Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,832,209 | 1 | 3,969,649 | null | 3 | 1,490 | I have done the authorisation step of [LinkedIn-iphone API](http://github.com/ResultsDirect/LinkedIn-iPhone), and the app comes to the screenshot:
---

But the 'close' button does not respond, and no where to use the authorised PIN.
Because it is not finally authorised, the methods like
```
- (void)linkedInEngine:(RDLinkedInEngine *)engine requestSucceeded:(RDLinkedInConnectionID *)identifier withResults:(id)results {
NSLog(@"++ LinkedIn engine reports success for connection %@\n%@", identifier, results);
}
- (void)linkedInAuthorizationControllerSucceeded:(RDLinkedInAuthorizationController *)controller {
NSLog(@"Authentication succeeded.");
NSLog(@"Fetching current user's profile on connection %@", [controller.engine profileForCurrentUser]);
[rdEngine updateStatus:@"when can you update me??"];
}
```
do not run.
So the LinkedIn API is stuck there.
Anyone find the problem and solution please?
| cannot confirm after passing the LinkedIn API authorisation on iPhone App | CC BY-SA 2.5 | 0 | 2010-09-30T15:36:27.223 | 2011-01-12T02:24:20.033 | null | null | 312,938 | [
"objective-c",
"api",
"oauth",
"linkedin"
] |
3,832,725 | 1 | null | null | 14 | 26,275 | How do I add a text description for my property?

My code :
```
private bool _SpaceKey;
public bool SpaceKey
{
get
{
return _SpaceKey;
}
set
{
_SpaceKey = value;
}
}
```
| Add a description for a property | CC BY-SA 2.5 | 0 | 2010-09-30T16:28:43.217 | 2018-10-18T05:00:28.157 | 2010-09-30T16:56:58.883 | 76,217 | 461,057 | [
"c#"
] |
3,832,773 | 1 | 3,832,879 | null | 2 | 251 | I have trouble in my linq application.
I have , and tables. In 1 query i want to load orders and dependent tables. I use Linq.
```
return from p in _db.dbOrders
select new Order
{
ID = p.ID,
OrderStatusChangelog = new List<OrderStatusChangelog>( GetOrderStatusChangelog().Where(x => x.OrderID == p.ID)),
Items = new List<OrderItem>(GetOrderItems(p.ID)), };
```
In this variant it takes too many ADO.NET requests (see image1)
[image1 full size](https://i.stack.imgur.com/iLUzf.jpg)

But. If i comment
```
Items = new List<OrderItem>(GetOrderItems(p.ID))
```
Perfect result ([image2 full size](https://i.stack.imgur.com/gnZBo.jpg))

Why one join work so?
P.S. My T-SQL (generated by LINQ):
```
{SELECT [t0].[ID], [t0].[UserID], [t0].[DateOrder] AS [DateCreated], [t0].[ControlGUID] AS [Guid], [t0].[StatusID], [t1].[ID] AS [ID2], [t1].[OrderID], [t1].[StatusID] AS [OrderStatusID], [t1].[Comment] AS [StatusMessage], [t1].[UserID] AS [UserID2], [t1].[Date], [t2].[FullName] AS [UserName], (
SELECT COUNT(*)
FROM [dbo].[dbOrderStatusChangelog] AS [t3]
INNER JOIN [dbo].[dbUsers] AS [t4] ON [t4].[ID] = [t3].[UserID]
WHERE [t3].[OrderID] = [t0].[ID]
) AS [value], [t0].[ShippingFLP], [t0].[ShippingAddress] AS [ShippingAddressContent], [t0].[ShippingRegionID], [t0].[ShippingCity], [t0].[ShippingZIPCode], [t0].[ShippingPhone], [t0].[ShippingMetroID], [t0].[PaymentFLP], [t0].[PaymentAddress] AS [PaymentAddressContent], [t0].[PaymentRegionID], [t0].[PaymentCity], [t0].[PaymentZIPCode], [t0].[PaymentPhone], [t0].[TrackingNumber], [t0].[DateShipped], [t0].[ShippingCost] AS [Rate], [t0].[ShippingName] AS [Name], [t0].[ShippingTypeID], [t0].[PaymentName] AS [Name2], [t0].[PaymentTypeID], [t0].[SourceID], [t0].[CustomerComment], [t0].[CustomerEmail], [t0].[CustomerFLP], [t0].[DiscountAmount] AS [discountAmount], [t0].[DiscountReason] AS [discountReason], [t0].[Amount]
FROM [dbo].[dbOrders] AS [t0]
LEFT OUTER JOIN ([dbo].[dbOrderStatusChangelog] AS [t1]
INNER JOIN [dbo].[dbUsers] AS [t2] ON [t2].[ID] = [t1].[UserID]) ON [t1].[OrderID] = [t0].[ID]
WHERE (CONVERT(Int,[t0].[StatusID])) IN (@p0, @p1, @p2)
ORDER BY [t0].[ID] DESC, [t1].[ID], [t2].[ID]}
```
Table diagram

```
private IQueryable<OrderItem> GetOrderItems(int orderID)
{
return from p in _db.dbOrderItems
where p.OrderID == orderID
select new OrderItem
{
ID = p.ID,
ItemPrice = p.Price,
OrderID = p.OrderID,
Quantity = p.Quantity,
Product = new Product
{
ID = p.ProductID,
Name = p.ProductName,
Brand = new Brand { Name = p.dbProduct.dbBrand.Name }
}
};
}
private IQueryable<OrderStatusChangelog> GetOrderStatusChangelog()
{
return from p in _db.dbOrderStatusChangelogs
select new OrderStatusChangelog
{
Date = p.Date,
ID = p.ID,
OrderID = p.OrderID,
OrderStatusID = p.StatusID,
StatusMessage = p.Comment,
UserID = p.UserID,
UserName = p.dbUser.FullName
};
}
```
| Linq query problem (too many ado.net request) | CC BY-SA 2.5 | 0 | 2010-09-30T16:33:15.020 | 2010-09-30T16:48:54.120 | 2010-09-30T16:44:16.053 | 29,407 | 322,706 | [
"c#",
"linq"
] |
3,832,809 | 1 | 3,833,007 | null | 23 | 53,386 | Is it possible to change only the color of a single bar in a graph made by matplotlib?

Let's say I've evaluation 1 to 10 and for each one I've a graph generate when the user choice the evaluation. For each evaluation one of this boys will win.
So for each graph, I would like to leave the winner bar in a different color, let's say Jim won evaluation1. Jim bar would be red, and the others blue.
I have a dictionary with the values, what I tried to do was something like this:
```
for value in dictionary.keys(): # keys are the names of the boys
if winner == value:
facecolor = 'red'
else:
facecolor = 'blue'
ax.bar(ind, num, width, facecolor=facecolor)
```
Anyone knows a way of doing this?
| How to change the color of a single bar if condition is True | CC BY-SA 4.0 | 0 | 2010-09-30T16:39:28.153 | 2022-09-08T17:38:05.167 | 2022-09-08T17:38:05.167 | 7,758,804 | 426,176 | [
"python",
"matplotlib"
] |
3,832,852 | 1 | 3,832,894 | null | 1 | 1,194 | My question centers on some Parallel.ForEach code that used to work without fail, and now that our database has grown to 5 times as large, it breaks almost regularly.
```
Parallel.ForEach<Stock_ListAllResult>( lbStockList.SelectedItems.Cast<Stock_ListAllResult>(), SelectedStock =>
{
ComputeTipDown( SelectedStock.Symbol );
} );
```
The ComputeTipDown() method gets all daily stock tic data for the symbol, and iterates through each day, gets yesterday's data and does a few calculations and then inserts them into the database for each day.
We use this rarely to recalculate static data values when a formula changes.
The exception is this:

The database we are hitting has 16 gigs of ram and is a dual quad-core and nobody was using the system while I was recalculating. The machine running the application to regenerate the code is a laptop with 12 gigs of ram with a hyper-threaded octal-core. So there was no obvious resource contention.
This is my foray into using .NET 4 and parallel processing, so I am wondering if there is something I am missing. Any thoughts would be welcomed.
| Parallel.ForEach throws exception when processing extremely large sets of data | CC BY-SA 2.5 | 0 | 2010-09-30T16:46:20.293 | 2010-09-30T16:50:25.150 | null | null | 339,518 | [
"sql-server",
"multithreading",
"parallel-processing",
"linq-to-objects",
"large-data-volumes"
] |
3,832,893 | 1 | null | null | 22 | 14,118 | I have the following hierarchy: `Activity` -> `PopupWindow` -> `CustomView`
My the `PopupWindow` itself is a square, but transparent, so you can see the Activity sitting in the background. The `CustomView` is a circle embedded inside the PopupWindow.

What I have achieved so far is
1. User clicks on green circle and I invoke "some stuff"
2. User clicks outside of the PopupWindow and the touch event gets dispatched to the Activity.
The missing part is now, to dispatch any touch event that happens inside the `PopupWindow` but outside the `CustomView` (circle) to the Activity.
I already know how to sense when the touch is outside of my circle. I just have problems delegating it to the Activity.
In my `CustomView` I have the following in `onTouch`
```
if (radiusTouch > maxRadius) {
return false;
}
```
In my `PopupWindow` I already setup the following, but it gets never called:
```
popup.setTouchInterceptor(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Log.i(TAG, "PopupWindow :: onTouch()");
return false;
}
});
```
Anything else I have to do to delegate the touch event all the way to the Activity?
| Android: delegate touch event to underlaying view | CC BY-SA 3.0 | 0 | 2010-09-30T16:50:23.203 | 2013-04-02T05:54:15.533 | 2013-04-02T05:54:15.533 | 421,372 | 184,367 | [
"android",
"events",
"touch"
] |
3,833,241 | 1 | 3,833,743 | null | 8 | 1,440 | I was hoping to release my software with a trial period and I was wondering how I could show a link in the right side of my title bar telling them how long their trial will last similar to this:
.
Anyone have any suggestions?
| Adding secondary text to window title bar in Cocoa? | CC BY-SA 3.0 | 0 | 2010-09-30T17:34:10.107 | 2012-09-08T16:49:12.363 | 2012-04-22T06:39:01.023 | 1,028,709 | 391,121 | [
"cocoa",
"titlebar"
] |
3,833,580 | 1 | null | null | 2 | 1,929 | I need to attach my database to SQL server 2008(I used it before without problem),but now when I want to attach db , sqlsrv sent me this error.
error:`failed retrieve data for this request.`

Why do I have this problem and how can I solve it?
| error:failed retrieve data for this request | CC BY-SA 3.0 | null | 2010-09-30T18:18:25.883 | 2012-02-24T11:13:52.610 | 2012-02-24T11:13:52.610 | 867,232 | 431,281 | [
"sql-server-2008"
] |
3,833,654 | 1 | 3,900,860 | null | 10 | 3,093 | I guess you have all tried "Google Places" in Maps.
This is a list of POI close to you.
I really would like to do the same feature in my application with a list of GPS coordinates, but that seem really complicated.
Making the listview with the distance and the little arrow is very easy, but I cannot understand how to update this list and the arrow everytime the user move his phone.
For now I have a static listview.

I would like to know if someone succeed to create such a listview.
Thank a lot for any information.
| Android: compass + distance in a listview | CC BY-SA 2.5 | 0 | 2010-09-30T18:27:31.027 | 2013-06-24T08:38:08.857 | 2010-10-16T15:52:50.270 | 327,402 | 327,402 | [
"java",
"android",
"listview",
"gps",
"distance"
] |
3,833,746 | 1 | 3,833,834 | null | 0 | 202 | I made a custom styled list in WPF:
```
<DataTemplate x:Key="SelectedTemplate">
<StackPanel Background="#FF4E4E4E" HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Path=Title}" Foreground="#FFD80000" />
</StackPanel>
</DataTemplate>
<Style TargetType="{x:Type ListBoxItem}" x:Key="ContainerStyle">
<Setter Property="ContentTemplate"
Value="{StaticResource ItemTemplate}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="ContentTemplate"
Value="{StaticResource SelectedTemplate}" />
</Trigger>
</Style.Triggers>
</Style>
```
...
```
<ListBox
Name="lbSongs"
DockPanel.Dock="Left"
ItemsSource="{Binding Path=SongDirectory}"
SelectedItem="{Binding Path=Song, Mode=TwoWay}"
Visibility="{Binding Path=ListVisibility}"
ItemContainerStyle="{StaticResource ContainerStyle}"
HorizontalContentAlignment="Stretch"
Width="180px" Background="#FF333333" />
```
I tried to make a custom style for the selected item. To make the selection bar stretch to the width of the ListBox, I set the ItemContainerStyle's HorizontalContentAlignment property to "Stretch". The problem is that it does not stretch fully, a tiny bar on the left still remains and the original (blue) selection bar is still visible there. See the screenshot:

How can I make it to stretch to full size? Or how can I style the original selection bar?
Thanks in advance.
| HorizontalContentAlignment of SelectedItem not stretching perfectly | CC BY-SA 2.5 | null | 2010-09-30T18:40:30.173 | 2010-09-30T18:51:24.617 | null | null | 140,367 | [
"wpf",
"styles"
] |
3,833,939 | 1 | 3,834,028 | null | 0 | 228 | 
Right-most textview is causing some alignment issues. I'm not sure how I can alleviate this?
| How can I improve the alignment of my TextView? | CC BY-SA 2.5 | null | 2010-09-30T19:04:00.767 | 2010-09-30T19:33:15.900 | null | null | 19,875 | [
"android",
"layout",
"alignment",
"textview"
] |
3,834,112 | 1 | 3,834,137 | null | 3 | 5,732 | I'm trying to find a function that would help me draw a line between 2 given GPS coordinates, and .
I've tried the traditional Cartesian formula y=mx+b where m=(y2-y1)/(x2-x1), but GPS coordinates don't seem to behave that way.
What would be a formula/algorithm that could help me achieve my goal.
PS: I'm using Google Maps API but let's keep this implementation agnostic if possible.
: My implementation was wrong and it seems the algorithm is actually working as stated by some of the answers. My bad :(

| Function for line between 2 GPS coordinates | CC BY-SA 2.5 | null | 2010-09-30T19:28:49.637 | 2010-10-11T14:29:37.243 | 2010-09-30T19:59:13.080 | 96,855 | 96,855 | [
"google-maps",
"dictionary",
"gps"
] |
3,834,209 | 1 | null | null | 0 | 591 | I'm trying to put an Annotation the lower left corner of currently visible map region, although the following code
```
CLLocationCoordinate2D origin = getOriginOfRegion(mapView.region);
[[[SimpleAnnotation alloc] initWithCoords:origin] autorelease];
...
extern CLLocationCoordinate2D getOriginOfRegion(MKCoordinateRegion region){
return CLLocationCoordinate2DMake(region.center.latitude-region.span.latitudeDelta/2,
region.center.longitude-region.span.longitudeDelta/2);
}
```
where `SimpleAnnotation` is as simple as it gets; puts the pin point a few degrees off the actual corner:

On the right side zoom level is higher, and as you can see the mistake is significantly smaller.
I've tried doing some math to counter it, considering that the error may be something related to projecting elliptical coordinates onto a plane, but didn't come up with anything useful.
Has anyone solved this problem? I've noticed that latitude values are not 'linear' on a mapView, I need some hints to understand how to transform them.
| Coordinates of bottom-left corner of a mapView off by a few pixels | CC BY-SA 2.5 | null | 2010-09-30T19:41:17.367 | 2010-09-30T20:00:17.023 | 2020-06-20T09:12:55.060 | -1 | 40,431 | [
"iphone",
"ios4",
"mapkit"
] |
3,834,227 | 1 | null | null | 6 | 3,783 | I want to create a speech balloon type shape, where there is a rectangle or ellipse with a triangular shape jutting out of it.
How I'm attempting to do this is to create a Path object that combines the triangle with the other shape (round rect).
I'm doing it as follows:
```
Path path = new Path();
// Create triangular segment
Point drawOffset = getAttributes().getDrawOffset();
int leaderGap = getAttributes().getLeaderGapWidth();
// Recall that we have a coordinate system where (0,0) is the
// bottom midpoint of the annotation rectangle.
// the point to left of gap
int x1 = -leaderGap/2;
int y1 = 0;
// the point to right of gap
int x2 = leaderGap/2;
int y2 = 0;
// The point where we're drawing to; the end of the pointy segment of triangle
int x3 = -drawOffset.x;
int y3 = drawOffset.y;
path.moveTo(x2, y2);
path.lineTo(x3, y3);
path.lineTo(x1, y1);
// path.close();
// Add the rectangular portion to the path
path.addRoundRect(backgroundShape, 5, 5, Path.Direction.CW);
```
The problem is that the roundRect is a closed path, so its edge shows through underneath the triangular section.
A picture's worth a thousand words, so here you go:

What I want is for the line segment between those two endpoints of the triangle to disappear, so that it looks like one seamless path.
If all I were doing were a straight rectangle, I could create the whole path myself from scratch. But I'd like to do the rounded corners, and it'd be a bit of a paint to do that with the Path (yes I know you can do quad to and arcTo but it's still not as clean a solution as I'd like).
So in general, is it possible to combine two paths and create a single union object that traces the perimeter of both?
| Android: how to combine the paths of two shapes and remove overlap? | CC BY-SA 2.5 | 0 | 2010-09-30T19:43:26.257 | 2016-09-08T09:19:14.617 | null | null | 155,392 | [
"android",
"graphics",
"path"
] |
3,834,485 | 1 | null | null | 2 | 5,206 | I'm running an application server which uses quite a bit of memory (there are quite a few users). It's running on an 18 GB EC2 instance.
I pass these GC parameters to the VM:
```
-server -XX:GCTimeRatio=19 -Xmx12g -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
```
The server works fine for awhile (as well as you'd expecte without concurrent GC) but after a few days, it suddenly grew the heap by a huge amount, and took us into swap which destroyed the server performance and required a restart:
```
217408.525: [Full GC [PSYoungGen: 12935K->0K(530944K)] [PSOldGen: 5668446K->4551217K(5431168K)] 5681382K->4551217K(5962112K) [PSPermGen: 50534K->50480K(50816K)], 11.8155060 secs] [Times: user=9.73 sys=2.08, real=11.81 secs]
217963.521: [Full GC [PSYoungGen: 13247K->0K(635776K)] [PSOldGen: 5422640K->4884067K(5741120K)] 5435887K->4884067K(6376896K) [PSPermGen: 50489K->50489K(50816K)], 8.4219030 secs] [Times: user=8.38 sys=0.05, real=8.43 secs]
218452.573: [Full GC [PSYoungGen: 20879K->0K(877504K)] [PSOldGen: 5720236K->4873397K(5788544K)] 5741115K->4873397K(6666048K) [PSPermGen: 50502K->50502K(50816K)], 10.9450630 secs] [Times: user=9.13 sys=1.84, real=10.95 secs]
219061.305: [Full GC [PSYoungGen: 73587K->0K(4073600K)] [PSOldGen: 5790501K->5022476K(6031040K)] 5864088K->5022476K(10104640K) [PSPermGen: 50518K->50518K(50816K)], 11.1695740 secs] [Times: user=8.80 sys=1.81, real=11.17 secs]
```
That last line seems very much out of step. Why would the PS young gen heap suddenly grow to 4 GB?
Running this VM on Ubuntu:
```
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
```
EDIT: Happened a second time tonight.
```
101017.205: [Full GC [PSYoungGen: 73185K->0K(4095616K)] [PSOldGen: 6373373K->5318013K(6638016K)] 6446559K->5318013K(10733632K) [PSPermGen: 46183K->46183K(46272K)], 221.1337460 secs] [Times: user=8.13 sys=1.26, real=221.08 secs]
```
EDIT: Here is a graph of the last 3 hours on our production server.

| Java GC: PSYoungGen grows by 4 GB after Full GC | CC BY-SA 2.5 | null | 2010-09-30T20:15:33.157 | 2012-04-28T03:12:54.520 | 2010-10-06T17:10:48.897 | 104,181 | 104,181 | [
"java",
"garbage-collection",
"jvm",
"java-6"
] |
3,834,519 | 1 | null | null | 1 | 296 | I committed a project to VSTF and then pulled it down locally on another machine. It works fine on my dev box, but on the other machine, the WCF RIA Service link appears to be gone and there is no option to re-add it in the project properties.
See image for clarification:

What's missing on the other machine?
| WCF RIA Services link dropdownlist not present in project properties (Visual Studio 2010) | CC BY-SA 3.0 | null | 2010-09-30T20:20:51.780 | 2011-12-03T23:56:34.163 | 2011-12-03T23:56:34.163 | 84,042 | 262,046 | [
"c#",
".net",
"visual-studio",
"silverlight",
"wcf"
] |
3,834,620 | 1 | 3,834,678 | null | 14 | 2,229 | I'm interested in how the Microsoft Visual C++ compiler treat/optimize static variables.
My code:
```
#include <cstdlib>
void no_static_initialization()
{
static int value = 3;
}
void static_initialization(int new_value)
{
static int value = new_value;
}
int main()
{
no_static_initialization();
static_initialization(1);
static_initialization(std::rand());
return 0;
}
```
Here's the assembly for the code (compiled with optimizations):

My main area of interest is the last case.
Here, the first statement got fully optimized and two calls of the second statement were inlined and they actually represent similiar chunks of code.
Each of them does `test something something` and then makes a short `jump` if the test wasn't successful (these jumps obviously point to the end of corresponding routine).
Does the compiler make an explicit check on every function call for if the function is called the first time?
Does the compiler actually have a `flag`, which indicates if this is the first time the function was called or not?
Where is it stored (I guess all that `test` stuff is about it, but I'm not exactly sure)?
| How does MSVC optimize static variable usage? | CC BY-SA 3.0 | 0 | 2010-09-30T20:34:24.247 | 2017-09-16T14:27:46.503 | 2017-09-16T14:27:46.503 | 2,176,813 | 346,332 | [
"c++",
"assembly",
"visual-c++",
"optimization",
"static"
] |
3,834,741 | 1 | 3,841,150 | null | 9 | 20,219 | I made an Android Hello world app and I'm trying to load it onto my HTC Incredible. I believe it has 2.2 (how do I confirm that?)
Anyway, Eclipse gives me this message and then brings up the window in the screenshot below.
> Automatic Target Mode: Unable to
detect device compatibility. Please
select a target device.
I'm on Ubuntu 64bit if that matters. I did turn on USB debugging on the phone. I told the phone to connect as a disk drive.
Any ideas how to get my app onto the phone?
Do I need to perform [these steps](http://developer.android.com/guide/developing/device.html) since I'm on Ubuntu? I doesn't mention what to do for Ubuntu 8.10 though.

| Android - How to load HelloWorld app onto my Phone? | CC BY-SA 2.5 | 0 | 2010-09-30T20:50:00.937 | 2013-09-16T01:47:05.873 | 2010-09-30T23:56:57.097 | 13,009 | 13,009 | [
"android",
"eclipse"
] |
3,835,090 | 1 | null | null | 5 | 170 | I was creating a new form and my IDE crashed, or it was having problems, and now every time I create a new form it has a black line across it. The black line is not something I was adding, it appears to be the black line from the top of the form getting painted in the wrong place. The interesting thing is that every time I reload the form the line moves up until after the 5th load it disappears. How do I stop this happening? I have tried build, rebuild, clean solution (restart visual studio) but it is still there, it isn't consistent either which also annoying, any ideas?

| interesting error: new form has black line across it, how do I get rid of it | CC BY-SA 2.5 | null | 2010-09-30T21:49:29.023 | 2010-10-03T19:53:52.777 | 2010-09-30T22:54:57.010 | 33,225 | 109,614 | [
"c#",
"winforms",
"visual-studio-2008"
] |
3,836,224 | 1 | 3,836,236 | null | 2 | 565 | As per an example URL shortened here:
[http://goo.gl/info/kW1c#week](http://goo.gl/info/kW1c#week)
What is the displayed 2D barcode for (copied here):

| What's the 2D barcode on Google's new goo.gl URL shortner? | CC BY-SA 2.5 | null | 2010-10-01T02:45:11.150 | 2010-10-12T15:20:31.540 | 2010-10-01T02:53:11.757 | 18,821 | 199,305 | [
"barcode"
] |
3,836,227 | 1 | 3,836,249 | null | 1 | 1,038 | I've got an expandable css menu that is acting a bit weird in ie, but works fine in firefox. Anyone who can help me is appreciated.
Heres the problem. When I click the li it expands to the sub li fine, however, if I keep the mouse directly over the li I just clicked on, the text in the sub li's don't show. See this picture...notice where the mouse is located, and notice there is no text next to the sub li's. The anchor tag is represented by the dotted line.

If I move the mouse to the right (or anywhere off of the text "Los Angeles") the sub li's show up.
Notice the mouse now and the li's showing up in this picture:

Heres the css and html:
```
<HTML lang="en_US" sizcache="7062" sizset="0">
<HEAD>
<STYLE>
ul.left_menu{
position:relative;
float:left;
width:100%;
}
ul.left_menu li>a:hover{
cursor: pointer;
}
ul.left_menu li {
list-style-type:none;
position:relative;
padding-top: 5px;
clear:both;
}
ul#nav{
text-indent:15px;
}
#nav li > ul{
display:none;
padding-left:15px;
text-indent:15px;
}
#nav li {
line-height:11px;
}
#nav > li{
clear: both;
padding-left:15px;
line-height:11px;
}
A {
TEXT-ALIGN: left;
TEXT-DECORATION: none;
outline: none
}
</STYLE>
</HEAD>
<BODY>
<UL id="nav" class="left_menu">
<LI>
<A >Los Angeles</A>
<UL>
<LI>
<A>Commercial Properties</A>
<UL>
<LI>
<A>Office</A>
</LI>
<LI>
<A>Industrial</A>
</LI>
<LI>
<A>Retail</A>
</LI>
</UL>
</LI>
</ul>
</li>
</ul>
</body>
</html>
```
Thanks for your help.
| css expandable menu working fine in firefox, but not ie...sub li's not showing up properly | CC BY-SA 2.5 | null | 2010-10-01T02:46:20.320 | 2010-10-01T02:54:59.807 | null | null | 249,034 | [
"css",
"html-lists"
] |
3,836,302 | 1 | 3,837,505 | null | 1 | 1,244 | I think that is what this is called:

I want to be able to add stuff like that to my program. Such as an open button and other buttons that would . This is in C#, by the way.
I DID look into the Windows 7 API Code Pack, but it.. doesn't work the way I want. It won't let me execute a method inside my app like I want. It just lets you open other apps.
Is something like this possible?
| Windows 7 Jump List | CC BY-SA 3.0 | 0 | 2010-10-01T03:11:01.927 | 2013-08-19T12:55:37.927 | 2013-08-19T12:26:07.757 | 203,458 | 385,853 | [
"c#",
".net",
"winforms",
"windows-7",
"jump-list"
] |
3,836,556 | 1 | null | null | 5 | 3,558 | here is the xml code i used
but no use even if try increasing the minheight....
please help

```
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Here you put the rest of your current view-->
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:text="ID:"
android:textSize="15dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/cid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="Name:"
android:textSize="15dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/con"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="Posted By:"
android:textSize="15dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/poby"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="Posted Time:"
android:textSize="15dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/poti"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="Annotation ID:"
android:textSize="15dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/aid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="Comment:"
android:textSize="15dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/comm"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="Image-path:"
android:textSize="15dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/imgpath"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<TextView
android:text="Solutions:"
android:textSize="15dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ListView
android:id="@+id/listviewid"
android:layout_marginBottom="10dp"
android:paddingBottom="10dp"
android:minHeight="1000dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
</ScrollView>
```
The java code related to it is:
```
if(s8.length()!=0){
String[] sidarray = s8.split("@");
String[] replyarray = s9.split("@");
String[] replybyarray = s10.split("@");
for(int p=0;p<sidarray.length;p++)
{
if(solutionsList!=null){
solutionsList.add("\nSolutionsID:" + sidarray[p] );
solutionsList.add("\nReply:" + replyarray[p]);
solutionsList.add("\nReply-by:" + replybyarray[p]);
}}
solutionlist=(ListView)findViewById(R.id.listviewid);
solutionadapter = new ArrayAdapter<String>(this, R.layout.solutiondisplay, solutionsList);
solutionlist.setAdapter(solutionadapter);
}
```
[Here is my source code.................](http://www.compliantbox.com/XmlParsingcompliant.zip)
| How do i increase the view size of my list view? | CC BY-SA 2.5 | 0 | 2010-10-01T04:33:12.113 | 2011-01-12T09:25:58.763 | 2011-01-12T09:25:58.763 | 438,864 | 438,864 | [
"android",
"listview"
] |
3,836,579 | 1 | 3,836,603 | null | 2 | 248 | Hi this question or problem i have its very hard i have search and ask in the university and i have no idea how to make this happen, or even if it is possible.
Here we go...
I am making a photo or image editor with the variation of letting the user to insert buttons in top of the edited image(this buttons when clicked plays an audio file) all of this works so far.
BUT at the end when the user finish his work i need him to save it, so it can be send and view by others.
Now I think I know how to save an edited image but that dose not contain the buttons (controls) .... its like when we save a file at power point and we send it to others they contain audio and the image. Hope fully you guys understand if so can any one point me in a direction to do this or show me how if possible.
( Some people told me to use meta-data others the manifest file but I am so confuse).
too bad i cant post pictures of the work until i get 10 points......
Thanks For the first four quick response and sorry mistake of not telling that I am working on C# 3.5 .Net and in Windows Form app.
It seems you all quite understand what i am trying to do here. I will post the picture thanks to the points i receive from TheVillageIdiot. and about the XML I have never ever used that before ill try my best to understand you guys but if any one can show me an example two or were to read ( dose xml works on Windows form app.?)  Here is ...( sorry if the picture its too big) an example of what the program it's doing so far that black transparent box its the MouseOverBackColor... when clicked it loads a player that plays x_x the sound. Its like tagging but with audio.
I really need help i reached my limit don't know were to look and the time is killing me.
---
HI I am back again this time with a simple sample of what i need to learn how to save the dinamic buttonarray
Today is 10/11/10 (i made a acount with !@#$%share to share the sample with you guys i hope this dosent bother any one here) here is the [Link](http://rapidshare.com/#!download|911|424453759|ManageControls.zip|76). i will explain again what i need to do and i have no idea or code on how to do it.Imagine a person that uses the program and create like 5 buttons any were in the form , it needs to be save so he can send it to others that have the same program, this way others can view the buttons the user created.
hopefully you guys can help me out with a simple example i really neeed some sample working code. Note: I am working on windows form app WFA C# 3.5 .net M.V.studio2010 (the file I gave above has a backup with a 2008 vercion) thanx in advance.
| How to Save Controls that are inside a form | CC BY-SA 2.5 | 0 | 2010-10-01T04:40:40.960 | 2010-10-11T18:26:05.040 | 2010-10-11T18:26:05.040 | 463,475 | 463,475 | [
"c#",
"custom-controls",
"image-manipulation"
] |
3,836,591 | 1 | 10,163,893 | null | 1 | 4,238 | I want a function which when i upload a photo it should crop the image irrespective of the ration of the image from the centre making sure the crop is well inside the image.

the above image is 2592 * 1944
i want to crop an image of 159 * 129

and this is what i get when using a plugin for cakephp (Miles Johnsons Upload Plugin)
can some one help me find a image crop function to do this or help me with the algorithm in doing the same.
| PHP image Resize and Crop Function | CC BY-SA 2.5 | null | 2010-10-01T04:44:34.603 | 2013-07-04T11:49:32.640 | 2013-07-04T11:49:32.640 | 569,101 | 155,196 | [
"php",
"cakephp",
"image-processing",
"crop"
] |
3,836,901 | 1 | 3,837,140 | null | 1 | 382 | How do i define a following layout in my xml file:

I hope you got it from image that i want to display TextView1 on 1st Row, and in 2nd Row, TextView2 on Left and TextView3 on Right side.
How do i define this layout?
i know the layout_gravity attribute but not getting success, so pls share your code
| Android XML Layout | CC BY-SA 2.5 | 0 | 2010-10-01T06:07:40.037 | 2010-10-15T10:08:02.063 | null | null | 379,693 | [
"android",
"android-layout",
"android-sdk-2.1"
] |
3,836,990 | 1 | 3,837,013 | null | 0 | 4,492 | I need to show a date in a certain format on screen, but I need to store the date as a string in another format. I think this means I have to convert it to a date and back to a string.
How do i do this ?
I have already figured out how to convert my string to a date, however build analyser gives me a warning.
I want to convert the string from dd MM yyyy to yyyy-MM-dd
He my code so far...
```
NSString *startDateString = btnStartDate.titleLabel.text;
NSDateFormatter *dateStartFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateStartFormatter setDateFormat:@"dd MM yyyy"];
NSDate *datStartDate = [[NSDate alloc] init];
datStartDate = [dateStartFormatter dateFromString:startDateString];
```

| iPhone, if I'm converting a date string from one format to another, to store it, do I have to convert it to a date, how? | CC BY-SA 2.5 | 0 | 2010-10-01T06:31:49.473 | 2010-10-01T06:42:29.043 | null | null | 450,456 | [
"iphone",
"xcode",
"iphone-sdk-3.0"
] |
3,836,997 | 1 | null | null | 1 | 1,116 | I want to know how to display value(in percent) on the bar series
Thanks..
| Display value on the bar chart | CC BY-SA 2.5 | 0 | 2010-10-01T06:34:29.843 | 2010-10-01T07:44:34.223 | null | null | 448,173 | [
"delphi"
] |
3,837,037 | 1 | null | null | 49 | 107,563 | I have a div with position:fixed that is my container div for some menus. I've set it to top:0px, bottom:0px to always fill the viewport. Inside that div I want to have 2 other divs, the lower one of which contains lots of lines and has overflow:auto. I would expect that it would be contained within the container div, but if there are too many lines it simply expands outside the fixed div. Below is my code and a screenshot to clarify:
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MyPlan</title>
<meta name="X-UA-COMPATIBLE" value="IE=8" />
<style type="text/css">
#outerfixed { position:fixed; width:200px; background-color:blue; padding:5px; top:0px; bottom:30px;}
#innerstatic1 { width:100%; background-color:yellow; height:100px;}
#innerstatic2 { overflow:auto; background-color:red; width:100%;}
</style>
</head>
<body>
<div id="outerfixed">
<h3>OUTERFIXED</h3>
<div id="innerstatic1">
<h3>INNERSTATIC1</h3>
</div>
<div id="innerstatic2">
<h3>INNERSTATIC2</h3>
line<br />
...lots of lines
line<br />
</div>
</div>
</body>
</html>
```

Is there any way for me to do this? Again, I want #innerstatic2 to be properly contained within #outerfixed and get scrollbars if it gets bigger than the space it has inside #outerfixed.
I know there are some possibilites to hack around this by also fixing #innerstatic2, but I would really like it to be within the flow inside #outerfixed if possible, so that if I move #outerfixed somewhere, the inner element would come with it.
EDIT: I know I can set overflow:auto on the #outerfixed and get a scrollbar on the whole thing, but I specifically want a scrollbar just on #innerstatic2, it is a grid and I want to scroll just the grid.
Anyone? Possible?
| Div with scrollbar inside div with position:fixed | CC BY-SA 2.5 | 0 | 2010-10-01T06:46:33.577 | 2021-11-02T16:53:01.800 | 2010-10-01T07:07:19.900 | 35,716 | 35,716 | [
"css",
"css-position"
] |
3,837,538 | 1 | 3,837,590 | null | 5 | 12,663 | I've enclosed a screen dump to make things easier to follow.
I've attached my outlets for datasource and delegate and I've created an outlet for my table view, but reloadData doesn't work?
Ideally I'd like to only call reloadData after the view has been loaded once?

| iPhone, why isn't UITableView reloadData working? | CC BY-SA 2.5 | 0 | 2010-10-01T08:22:38.177 | 2010-10-01T08:39:43.277 | 2010-10-01T08:32:21.703 | 173,191 | 450,456 | [
"uitableview",
"ios",
"reloaddata"
] |
3,837,584 | 1 | 3,844,323 | null | 0 | 977 | I am trying to make a desktop application in netbeans. The GUI form that i have made, is longer than the size of the desktop screen, so the contents in the lower parts are not visible. Please help me to get ride of this problem.Here I'm pasting the picture.

| netbeans desktop application | CC BY-SA 2.5 | null | 2010-10-01T08:30:44.320 | 2010-10-05T08:22:26.340 | null | null | 142,540 | [
"java",
"netbeans"
] |
3,837,710 | 1 | 3,837,827 | null | 3 | 4,149 | The layout I'm trying to achieve is shown in this image:

The HTML below is one of many attempts which haven't worked. The project this is for is targeting HTML5 in the latest browsers only, so there is no need for it to work in anything except the latest Chrome, Safari, Firefox and (with a following wind) IE9 beta.
```
<!DOCTYPE html>
<html>
<body>
<div style="border: solid 1px red; width:600px; height: 600px">
<span style="-webkit-transform:rotate(-
90deg);display:block;position:absolute;bottom:600px">My Vertical Text</span>
<img src="http://www.gizmodo.com/assets/resources/2007/01/Bill-gates-mugshot.jpg"
style="position:absolute;bottom:600px" />
</div>
</body>
</html>
```
| Trying to get vertical text to bottom align | CC BY-SA 2.5 | null | 2010-10-01T08:51:33.710 | 2010-10-01T09:16:11.847 | 2010-10-01T09:16:11.847 | 313,758 | 149,533 | [
"html",
"webkit",
"css"
] |
3,837,714 | 1 | 3,839,108 | null | 0 | 1,367 | I have a project where I am required to subtract an empty template image from an incoming user filled image. The document type is a normal Bank cheque.
The aim is to extract the handwritten fields from it by subtracting one image from the empty template image.
The issue what i am facing is in aligning these two images, as there is scaling, translation, rotation etc
Any ideas on how to align the template image with the incoming image?
I am posting an example image from the [wikipedia](http://en.wikipedia.org/wiki/Cheque) page but in the monochrome format as my image is in monochrome format.

| Template matching - Image subtraction | CC BY-SA 2.5 | 0 | 2010-10-01T08:52:06.220 | 2010-10-01T13:50:09.477 | 2010-10-01T13:50:09.477 | 119,535 | 119,535 | [
"algorithm",
"image-processing",
"opencv",
"image-manipulation",
"subtraction"
] |
3,837,849 | 1 | 3,838,087 | null | 0 | 101 | 
Here for part ‘CF061W’ finum is 25, I will select records whose fparinum value is 25 now I will get these parts FA061W, HRD20600 and SD1201. Now again I will select records whose fparinum value is finumber of above retrieved parts FA061W, HRD20600 and SD1201 and so on. This should continue till the highest level (flevel), for the above table it is up to level 4.
Now I want single sql query that will retrieve all the records for the parent part ‘CF061W’.
Thanks in advance
Pradeep
| SQl query required for the below Scenario | CC BY-SA 2.5 | null | 2010-10-01T09:16:25.130 | 2010-10-01T09:55:49.810 | null | null | 366,947 | [
"sql",
"sql-server",
"tsql"
] |
3,837,884 | 1 | 3,844,538 | null | 0 | 414 | I'm trying to use the google custom search in a wordpress website (but without any plugin).
I've used the code google provided (the search box code and the search results page code) and the results page it's returning empty...
However the auto-complete it's working:

This is the page that should show the results: [http://www.guiasdeviagens.com/pesquisa/](http://www.guiasdeviagens.com/pesquisa/)
Anyone could help me please? I've been trying for some days and can't fix the problem. :(
Thanks in advance.
| Google custom search results page don't show any results | CC BY-SA 2.5 | null | 2010-10-01T09:21:04.603 | 2010-10-02T05:44:05.490 | 2010-10-01T09:33:53.927 | 155,905 | 155,905 | [
"wordpress"
] |
3,838,117 | 1 | 3,838,134 | null | 0 | 1,387 | I'm managed to make my UITableView rows / cells black when data is loaded, to a fashion, I get a white line in between rows, which makes it look awful. How can i make them fully black with and without data ?
Heres the code I'm using at the moment
```
- (void)tableView:(UITableView *)tableView willDisplayCell:
(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = [UIColor blackColor];
```
}
Heres what I get (with white lines remaining) :(

| iPhone, how can I make my UITableView cells black with and without data in them? | CC BY-SA 2.5 | null | 2010-10-01T09:54:16.857 | 2010-10-01T10:46:53.473 | null | null | 450,456 | [
"iphone",
"uitableview",
"reloaddata"
] |
3,838,329 | 1 | 3,838,357 | null | 151 | 210,130 | How can I check if 2 segments intersect?
I've the following data:
```
Segment1 [ {x1,y1}, {x2,y2} ]
Segment2 [ {x1,y1}, {x2,y2} ]
```
I need to write a small algorithm in Python to detect if the 2 lines are intersecting.

| How can I check if two segments intersect? | CC BY-SA 4.0 | 0 | 2010-10-01T10:24:41.410 | 2022-11-01T22:21:29.560 | 2019-07-17T12:27:23.273 | 7,851,470 | 257,022 | [
"python",
"math",
"geometry"
] |
3,838,484 | 1 | 3,838,625 | null | 0 | 1,235 | I have a widget which looks like this:

Every cone is a "touchable element". Now I want to put a bitmap texture above each cone. However, bitmap images are all rectangular, so a bitmap texture above one cone would interfere with the bitmap texture above another cone.
I'm wondering what is the best solution to this approach. Should I just create an image which fits (as a rectangle) exactly above the cone and make the non used areas transparent?
A second question is, how do bitmap textures work with stretching? Because this whole circle draws itself to fit the whole screen size, while bitmap textures are pretty much one size.
| Android: adding a bitmap texture to a non rectangular item | CC BY-SA 2.5 | null | 2010-10-01T10:52:59.933 | 2010-10-01T11:43:11.260 | null | null | 184,367 | [
"android",
"bitmap",
"2d",
"textures"
] |
3,838,529 | 1 | null | null | 0 | 306 | I've created MVC2 based solution in VS2010 using standard template. Site.Master is cleaned a bit, here is how HomeController looks like:
```
namespace MvcApplication1.Controllers
{
[HandleError]
public class HomeController : Controller
{
public ActionResult Index()
{
return RedirectToAction("About");
}
public ActionResult About()
{
return View();
}
}
}
```
So it simply redirects to About action any time somebody hits Index action. And here I see strange behavior, when I open [http://localhost/](http://localhost/) (or [http://localhost/HomeIndex](http://localhost/HomeIndex)) first time here is what firebug shows - note that "About" page is duplicated. Can anybody explain why it's happening, it looks like a bug for me.
[Screenshot with firebug after redirect](https://imgur.com/2RCuK.png)

| C#/MVC and RedirectToAction behaviour | CC BY-SA 2.5 | null | 2010-10-01T11:00:00.700 | 2013-04-06T21:59:18.827 | 2013-04-06T21:59:18.827 | 727,208 | 159,367 | [
"c#",
"asp.net-mvc",
"asp.net-mvc-2"
] |
3,838,610 | 1 | null | null | 18 | 124,493 | C#
Every time I run my porgram I get this exception:

But when I run in debug mode, there is no exception and the program works fine, what can I do?
I do not use anywhere in the project
Okay, here is the code found in the details:
If someone know how to use protoBuff, and know this problem....
```
************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> ProtoBuf.ProtoException: Incorrect wire-type deserializing TimeSpan
at ProtoBuf.ProtoBcl.ProtoTimeSpan.DeserializeTicks(SerializationContext context) in c:\protobuf-net_fixed\trunk\protobuf-net\ProtoBcl\ProtoTimeSpan.cs:line 80
at ProtoBuf.ProtoBcl.ProtoTimeSpan.DeserializeDateTime(SerializationContext context) in c:\protobuf-net_fixed\trunk\protobuf-net\ProtoBcl\ProtoTimeSpan.cs:line 41
at ProtoBuf.Property.PropertyDateTimeString`1.DeserializeImpl(TSource source, SerializationContext context) in c:\protobuf-net_fixed\trunk\protobuf-net\Property\PropertyDateTimeString.cs:line 32
at ProtoBuf.Property.Property`2.Deserialize(TSource source, SerializationContext context) in c:\protobuf-net_fixed\trunk\protobuf-net\Property\Property.cs:line 150
at ProtoBuf.Serializer`1.Deserialize[TCreation](T& instance, SerializationContext context) in c:\protobuf-net_fixed\trunk\protobuf-net\SerializerT.cs:line 568
at ProtoBuf.Serializer`1.DeserializeChecked[TCreation](T& instance, SerializationContext source) in c:\protobuf-net_fixed\trunk\protobuf-net\SerializerT.cs:line 400
at ProtoBuf.SerializerItemProxy`2.Deserialize(TActualClass& instance, SerializationContext source) in c:\protobuf-net_fixed\trunk\protobuf-net\SerializerProxy.cs:line 86
at ProtoBuf.Serializer.Deserialize[T](SerializationContext source) in c:\protobuf-net_fixed\trunk\protobuf-net\Serializer.cs:line 302
at ProtoBuf.Serializer.Deserialize[T](Stream source) in c:\protobuf-net_fixed\trunk\protobuf-net\Serializer.cs:line 289
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at ProtoBuf.Serializer.NonGeneric.Deserialize(Type type, Stream source) in c:\protobuf-net_fixed\trunk\protobuf-net\NonGeneric.cs:line 154
at ProtoBuf.Serializer.NonGeneric.TryDeserializeWithLengthPrefix(Stream source, PrefixStyle style, Getter`2 typeReader, Object& item) in c:\protobuf-net_fixed\trunk\protobuf-net\NonGeneric.cs:line 128
at AccessPoint.MainForm.getEventsList() in C:\Users\user\Desktop\accesspoint\AccessPoint\AccessPoint\MainForm.cs:line 97
at AccessPoint.MainForm.Form1_Load(Object sender, EventArgs e) in C:\Users\user\Desktop\accesspoint\AccessPoint\AccessPoint\MainForm.cs:line 18
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
```
Row 97:
```
int startIndex = count - 10, index = 0;
object obj;
while (Serializer.NonGeneric.TryDeserializeWithLengthPrefix(file, PrefixStyle.Base128, tag =>
{
return index++ >= startIndex ? typeof(EventsWireFrame) : null;
}, out obj))
{
EventsWireFrame evt = (EventsWireFrame)obj;
AddEventToTable(evt.eventDate, evt.eventType, evt.eventKeyNumber, evt.eventKeyName, evt.eventDoor, true);
}
```
I can't get it, what's wrong? Do I need to add another part of code? Maybe the seraliztaion?
| How to solve: "exception was thrown by the target of invocation" C# | CC BY-SA 3.0 | 0 | 2010-10-01T11:11:03.750 | 2022-03-11T19:16:30.047 | 2011-06-16T12:17:17.523 | 7,862 | 389,222 | [
"c#",
".net",
"exception"
] |
3,839,002 | 1 | 3,904,106 | null | 6 | 7,047 | Our team trying to create a windows application(c#) to call a WCF service using internet proxy server
Showing exception "The server committed a protocol violation. Section=ResponseStatusLine" while calling WCF service
Please give suggestion to solve this problem/any other alternative solution
```
//Code for creating proxy
public static DevicesServiceClient CreateProxy()
{
var proxy = new DevicesServiceClient("BasicHttpBinding_IDevicesService");
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.None;
binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
binding.UseDefaultWebProxy = false;
binding.ProxyAddress = new Uri(string.Format("http://{0}:{1}", "192.168.0.20","808"));
proxy.Endpoint.Binding = binding;
proxy.ClientCredentials.UserName.UserName = "Username";
proxy.ClientCredentials.UserName.Password = "Password";
}
```
Server stack trace:
> at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway,
ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway,
ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage
methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at DevicesService.IDevicesService.CheckNetworkConnection(String ipAddress)
My client side code in app.config

My server side code in web.config

| Windows WCF client with internet proxy server showing error The server committed a protocol violation. Section=ResponseStatusLine | CC BY-SA 2.5 | 0 | 2010-10-01T12:12:15.500 | 2018-07-02T15:07:47.487 | 2010-10-11T05:07:50.067 | 171,985 | 171,985 | [
"c#",
".net",
"windows",
"wcf"
] |
3,839,099 | 1 | 3,839,157 | null | 2 | 748 | is there a way to create an image slideshow that is rotated by say 5° ? I'd prefer a non-flash solution. Thank you!

| How to create an inclined (not levelled) slideshow? | CC BY-SA 2.5 | 0 | 2010-10-01T12:25:04.070 | 2010-10-01T12:40:46.380 | 2010-10-01T12:33:26.640 | 132,873 | 132,873 | [
"javascript",
"css",
"html",
"slideshow"
] |
3,839,118 | 1 | 3,846,619 | null | 0 | 277 | I have a UITextView that is supposed to have one line of text.
The size font is controlled by a slider. As the user controls the slider, I calculate the new UITextView size using (this is the method called by the slider as it moves).
```
- (void) changeFontSize:(id)sender {
UISlider *slider = (UISlider *)sender;
CGFloat newSize = (CGFloat)[slider value];
myTextView.font = [UIFont boldSystemFontOfSize:newSize];
[self adjustBoxforSize:myTextView.text];
}
- (void) adjustBoxForSize:(NSString*)myText {
CGFloat fontSize = myTextView.font.pointSize;
CGSize newSize =
[myText sizeWithFont:[UIFont boldSystemFontOfSize:fontSize]];
newSize.width = newSize.width * 1.5; // make it 50% larger
newSize.height = newSize.height * 1.5; // make it 50% taller
CGRect myFrame = CGRectMake(0.0f, 0.0f, newSize.width, newSize.height);
myTextView.frame = myFrame;
}
```
If I reduce the font, this is the result

The question is: how can the text be out of the textview if I am scaling it to fit and indeed making it 50% larger??
am I missing something? It seems that sizeWithFont is not calculating the size correctly.
Thanks.
| iphone - a question about UITextView and its size | CC BY-SA 2.5 | null | 2010-10-01T12:27:17.077 | 2010-10-02T16:40:10.297 | 2010-10-01T18:43:10.577 | 316,469 | 316,469 | [
"iphone"
] |
3,839,142 | 1 | 3,857,111 | null | 0 | 1,824 | im using windows server 2008, while installing sql server 2008, in account provisioning, i added current user. but now after installation, i added new user in windows. now the problem is in not able to login into sql server 2008.
so how do i add the new user in account provisioning in sql server 2008.
check the screenshot for more details

please help.
| Account provisioning after installing sql server 2008 | CC BY-SA 2.5 | null | 2010-10-01T12:32:07.667 | 2010-10-04T16:20:24.177 | null | null | 336,009 | [
"provisioning",
"account"
] |
3,839,138 | 1 | 3,839,154 | null | 1 | 3,233 | I want to find position `in(` position within string, but I can not explicitly write:
```
int index = valueOf("in(");
```
because I get error of `non closed group ( java.util.regex.PatternSyntaxException Unclosed group).` If I escape parenthesis it will not find index of `in(`, but `in\(`
```
int index = value.indexOf("in\\(");
```
How can I achieve that?
I indeed made an mistake in forming the question. In my code i use indexOf but the real problem was an String.split. But when I got PatternSyntaxException I somehow went to line where indexOf was, thus I started to fixing the issue in wrong place. When I
escaped ( then indexOf did not find the "\(".
What I got confused and felt like loosing ground was what the eclipse did, then I post stackoverflow, what I do:
```
String value = "in(test";
String[] arr = value.split("in\\(");
```
so I have arr = {"","test"} as below:


Why in array elements string value is shown as original string? Is it bug or feature?
| How to find index of parenthesis indexOf - confusion, Eclipse bug or feature | CC BY-SA 2.5 | null | 2010-10-01T12:31:20.277 | 2010-10-01T18:47:40.637 | 2020-06-20T09:12:55.060 | -1 | 410,737 | [
"java",
"regex",
"eclipse"
] |
3,839,289 | 1 | 3,839,366 | null | 0 | 51 | i'm currently exceeding the maximum server queries per hour with my blog on my host, and when that happens they shut my account down, rendering it useless.
I keep exceeding the maximum amount of queries which is 75,000 but I don't think I should be considering the amount of visitors I have at the moment, plus I'm using Super Cache.
I've been trying to investigate what may be causing the problem, but I've had little luck so far.
I've tried:
- - - -
However, I did notice this warning:

Am I right in thinking this may be the problem? If not does anyone have any other ideas for me to explore?
Thanks.
| Can I drop one of these indexes in Wordpress? | CC BY-SA 2.5 | 0 | 2010-10-01T12:51:50.963 | 2010-10-01T13:00:18.743 | null | null | 372,752 | [
"sql",
"database",
"wordpress"
] |
3,839,407 | 1 | 3,840,030 | null | 1 | 627 | For example, Notepad++ has a toolbar that looks like this:

7-Zip has a toolbar that looks like this:
(stack overflow won't let me post more links because I'm new)
Whereas mine is boring and flat, like this:
(stack overflow won't let me post more links because I'm new)
How do I do make my toolbar 3d? Is there a setting I'm missing? Am I going to have to draw my own? Am I even using the right control? (Do I get this in a rebar?) Examples are really hard to come by on the web for some reason.
| What's the correct way to get a gradient in a toolbar in win32 API (no MFC)? | CC BY-SA 3.0 | null | 2010-10-01T13:05:00.603 | 2011-06-23T17:12:51.643 | 2011-06-23T17:12:51.643 | 192,077 | 463,876 | [
"c++",
"winapi",
"toolbar"
] |
3,839,579 | 1 | null | null | 0 | 233 | I got a problem of selecting triangles in a model with a particular way.
The problem is simple enough :
User have a model (made from triangles) , on that model define some margine line (cutting line if you wish), and after based on array of the verticies of the margin line I would like to select one part of the model or another part of the same model.
Here is the picture.

The cutting line makes a circle arround a model and I would like to select a model, let's say in area (1) based on verticies of the cutting line.
I have information about relationship always any object on the scene (vertex vs Triangle, triangle vs lines, vertex vs lines and so on)
P.S. If we assume that, for example Y axis is always in one direction, let's say to down,
and want to select only neighbour triangles for every vertex that have their vertex Y coordinate major, it will not work, as, if you look at the image, the triangle in the (2) selection it's a neigbour triangle of a vertex from cutting line, and it's vertex Y coordinate sutisfies condition, but this is not a riangle that I would like to select.
Any ideas on subject ?
| Splitting Selection algorithm | CC BY-SA 2.5 | null | 2010-10-01T13:26:02.130 | 2010-10-01T14:35:31.480 | 2010-10-01T13:28:12.030 | 103,385 | 156,695 | [
"algorithm",
"opengl",
"selection"
] |
3,839,725 | 1 | 4,175,624 | null | 0 | 102 | What exactly I have to do is I have 2 images one is mask and another is Photo.
Mask.png is just the layout of the person and Photo.png is the image of the person in the position as per the mask.png.
Now the main problem is I want the Photo.png to be resized and moved in such a way that it can be adjusted in that Mask.png.
below is the example of mask and Photo


Now I want that red color must come on the below two legs of the star for that I need to move the Flowers image as per my convininece and then save them whole as one Image. Im my case theres a outlay of person instead of star and the Photo of person instead of flowers image.
Kindly help... Any help would realy be appreciated.
Thanks in advance.
| set the second image by dragging on first image and then save it | CC BY-SA 2.5 | 0 | 2010-10-01T13:42:05.867 | 2010-11-14T01:10:14.263 | null | null | 363,363 | [
"iphone",
"uiimageview"
] |
3,840,657 | 1 | 3,841,529 | null | 23 | 18,543 | I could not find what formatting available to write help for your own MATLAB function. Very little information is available [in official documentation](http://www.mathworks.com/help/techdoc/matlab_prog/f7-41453.html#f7-38710).
Do you know about any other formatting that can be visible with Help Browser (not with help function)? As it is for built-in functions. How to format headings (like Syntax, Description, Examples)? Are bullets, tables possible?
I've tried text markup as used for PUBLISH and HTML, didn't work.
I found only one interesting thing. If your function contains mixed case, like `testHelpFunction`, its name will be highlighted:

No highlighting if it's just `testhelpfunction`.
Any other thoughts?
Here is extensive documentation I found on creating your own help files:
[Providing Your Own Help and Demos](https://web.archive.org/web/20101031000134/http://www.mathworks.com/help/techdoc/matlab_env/bruby4n-1.html)
(Dead link replaced with web archive link)
---
(Dead link removed)
---
- [Add Help for Your Program](http://www.mathworks.com/help/matlab/matlab_prog/add-help-for-your-program.html)- [Display Custom Documentation](http://www.mathworks.com/help/matlab/matlab_prog/display-custom-documentation.html)
| MATLAB m-file help formatting | CC BY-SA 3.0 | 0 | 2010-10-01T15:32:05.267 | 2018-01-16T07:56:37.743 | 2015-01-17T14:44:17.483 | 1,797,098 | 163,080 | [
"matlab",
"formatting"
] |
3,840,827 | 1 | null | null | 1 | 1,173 | Is there any way to access the internal images that the iPhone simulator uses?
For example, if I want to get the original image used for one of the default app icons (e.g. Contacts). This way I could get the highest possible resolution, and examine it for purposes of creating similar icons for my app.
Another example of an image I might want to access is the default icon for a contact:

I'm not asking for a programmatic solution (although that would work), I'm asking for a manual solution, possibly navigating the Simulator's file system using Finder.
| How to access iPhone Simulator's images | CC BY-SA 2.5 | null | 2010-10-01T15:49:40.367 | 2010-10-01T16:49:00.927 | 2010-10-01T16:49:00.927 | 35,690 | 35,690 | [
"ios-simulator",
"filesystems"
] |
3,840,835 | 1 | 3,894,983 | null | 4 | 11,452 | I'm trying to replicate the Gmail Notifier popup.
It both fades in (Opacity) and raises from the start bar.
I've managed to do the fade in\out using a timer and opacity but how do I:
A) make the form appear to 'pop up'? (I think its height grows via a timer from 0 to it's max?
B) Locate it's start point exactly above the task bar as pictured on all screen resolutions\Windows flavours?

| Create pop up 'toaster' effect message | CC BY-SA 2.5 | 0 | 2010-10-01T15:51:33.067 | 2010-10-08T23:33:18.030 | null | null | 2,278,201 | [
"vb.net"
] |
3,840,992 | 1 | 3,841,006 | null | 0 | 1,813 | I'm trying to make a Sudoku board online using an HTML Table and formatting it with CSS. Ideally the output would look like this image:

The problem is I'm having trouble setting the borders properly. Below is the code for a single 3 by 3 box, it unfortunately isn't outputting correctly. The cell with class 'end' seems to have a non collapsed border. Any suggestions?
HTML:
```
<table>
<tr>
<td><input type='text' size='2' /></td>
<td><input type='text' size='2' /></td>
<td><input type='text' size='2' class='end'/></td>
</tr>
</table>
```
CSS:
```
table, td{
border-color: black;
border-width: 1px;
border-style: solid;
}
table{
border-collapse:collapse;
}
td{
padding:0px;
margin: 0px;
}
td .end{
border-style:solid;
border-color:black;
border-width: 1px 3px 1px 1px;
}
input{
padding:0px;
margin:0px;
}
```
| HTML+CSS Table, trouble setting borders | CC BY-SA 3.0 | 0 | 2010-10-01T16:10:21.800 | 2017-06-11T11:08:28.350 | 2017-06-11T11:08:28.350 | 4,370,109 | 309,616 | [
"html",
"css",
"html-table",
"border"
] |
3,841,122 | 1 | 5,110,406 | null | 126 | 101,827 | I am using a Preview to display what the camera see's on the screen.
I can get everything working fine, surface created, surface set and the surface is displayed.
However it always displays the picture at an incorrect 90 degree angle in portrait mode.
Such as in the picture:

I am aware that using the following code will set the picture straight:
```
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
```
However I have the Preview within an Activity that has other elements in it and it does not make sense for my Activity to be displayed in landscape mode. (Its disabled by default)
So I was wondering is there anyway to just change the orientation of the Preview? And leave the rest of my Activity correctly displayed in Portrait mode?
Or anyway to rotate the preview so that it is displayed correctly?
| Android - Camera preview is sideways | CC BY-SA 2.5 | 0 | 2010-10-01T16:24:18.473 | 2020-02-19T16:55:00.087 | null | null | 243,999 | [
"android",
"camera",
"orientation",
"preview",
"portrait"
] |
3,841,231 | 1 | 3,890,800 | null | 7 | 5,942 | I am trying to do something similar to [this](https://stackoverflow.com/questions/3682021/uislider-with-certain-possible-values) but in Android.

In Android I can extend the `ProgressBar` but I am doubting of how to add the `TextViews` on top. In iphone it was easy because I can use absolute positions, but not here.
Any ideas?
EDIT:
I decided to use `SeekBar` instead of `ProgressBar` to add the thumb drawable. I commented below. Some points to notice:
- - - -
My progress so far:
```
public class SliderFrameLayout extends FrameLayout implements OnSeekBarChangeListener {
private SeekBar mSlider;
private Context mContext;
private int mSize = 3;
private TextView[] mTextViews;
private String[] mTexts = {"Nafta", "Gas", "Gasoil"};
public SliderFrameLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
setWillNotDraw(false);
mTextViews = new TextView[mSize];
addSlider();
addTextViews();
}
private void addTextViews() {
for ( int i=0 ; i < mSize ; i++ ) {
TextView tv;
tv = new TextView(mContext);
tv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
tv.setText(mTexts[i]);
mTextViews[i] = tv;
addView(tv);
}
}
private void addSlider() {
FrameLayout fl = new FrameLayout(mContext, null);
LayoutParams params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
fl.setLayoutParams(params);
fl.setPadding(30, 30, 30, 0);
mSlider = new SeekBar(mContext, null);
LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
//lp.setMargins(30, 30, 30, 0);
//mSlider.setPadding(30, 30, 30, 0);
mSlider.setLayoutParams(lp);
//mSlider.setMax(mSize-1);
mSlider.setThumbOffset(30);
//mSlider.setProgressDrawable(mContext.getResources().getDrawable(R.drawable.slider_track));
//mSlider.setThumb(mContext.getResources().getDrawable(R.drawable.slider_thumb));
mSlider.setOnSeekBarChangeListener(this);
//addView(mSlider);
fl.addView(mSlider);
addView(fl);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Rect rectf = new Rect();
mSlider.getLocalVisibleRect(rectf);
Log.d("WIDTH :",String.valueOf(rectf.width()));
Log.d("HEIGHT :",String.valueOf(rectf.height()));
Log.d("left :",String.valueOf(rectf.left));
Log.d("right :",String.valueOf(rectf.right));
Log.d("top :",String.valueOf(rectf.top));
Log.d("bottom :",String.valueOf(rectf.bottom));
int sliderWidth = mSlider.getWidth();
int padding = sliderWidth / (mSize-1);
for ( int i=0 ; i < mSize ; i++ ) {
TextView tv = mTextViews[i];
tv.setPadding(i* padding, 0, 0, 0);
}
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
// TODO Auto-generated method stub
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
Log.d("SEEK", "value: " + seekBar.getProgress());
seekBar.setProgress(50);
}
}
```
| Custom ProgressBar widget | CC BY-SA 2.5 | 0 | 2010-10-01T16:39:30.557 | 2010-10-08T14:00:16.077 | 2017-05-23T12:13:26.330 | -1 | 119,895 | [
"iphone",
"android",
"progress-bar"
] |
3,841,486 | 1 | 3,868,008 | null | 3 | 3,482 |
### Background
I'm using `SendKeys()` to send keyboard commands to the active window, but I'm not having any luck finding the child window when the application is running through RemoteApp. It all works as expected when I run the application locally.
[Microsoft RemoteApp](http://technet.microsoft.com/en-us/library/cc753844%28WS.10%29.aspx) allows users to connect to applications through the RDP protocol, but instead of showing the entire remote Virtual machine, it just shows the application window. To the end user, there is no difference between an application running under RemoteApp and it running on their desktop.
I've been using ManagedSpy to determine the class name of the .NET application window so that I can use the Win32 API function `FindWindowEx` to make one of the child windows active, and it works well. However, I'm having a problem when the application is running over RemoteApp.
I can still use the .NET `Process.GetProcessesByName()` to find the application, I just have to have it invoke `mstsc.exe`:
```
IntPtr hwndChild = IntPtr.Zero;
Process[] processess = Process.GetProcessesByName("mstsc");
IntPtr appHandle = IntPtr.Zero;
foreach (Process p in processess)
{
if ((p.MainWindowHandle != IntPtr.Zero))
{
appHandle = p.MainWindowHandle;
}
}
if (appHandle == IntPtr.Zero)
{
MessageBox.Show("Application is not Running.");
return;
}
```
However, I can't use `FindWindowEx` in the same way. This question revolves around that.
For the unmanaged code to tell me what windows `mstsc.exe` has active, I used Spy++, but for `mstsc.exe` it comes back with a different class name, called `RAIL_WINDOW`:

Here is the code I'm using to find the Child Window:
```
[DllImport("USER32.DLL")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle);
hwndChild = FindWindowEx(appHandle, IntPtr.Zero, "RAIL_WINDOW", "MyApplication (Remote)");
SetForegroundWindow(hwndChild);
```
### Questions
1. I can use Spy++ to highlight the active child window in the RemoteApp version of the application, and I get RAIL_WINDOW, but I cannot seem to access this window programmatically. Given the code above, what am I missing to be able to do so?
2. Are there other ways of sending keyboard strokes to an application running over Remote App?
| Finding the Child Window inside a Microsoft RemoteApp Programmatically | CC BY-SA 2.5 | null | 2010-10-01T17:10:11.107 | 2015-05-12T11:59:11.570 | 2010-10-04T12:21:53.593 | 16,587 | 16,587 | [
"c#",
".net",
"winforms",
"winapi",
"remoteapp"
] |
3,841,642 | 1 | 3,862,114 | null | 55 | 28,254 | For an application I am building I have drawn 2 circles. One a bit bigger than the other. I want to curve text between those lines, for a circular menu I am building.
I read most stuff about curving a text that you have to split up your text in characters and draw each character on it's own with the right angle in mind (by rotating the context you are drawing on).
I just can't wrap my head around on how to get the right angles and positions for my characters.
I included a screenshot on what the menu, at the moment, look like. Only the texts I added by are loaded from an image in an UIImageView.

I hope someone can get me some starting points on how I can draw the text in the white circle, at certain points.
EDIT:
Ok, I am currently at this point:

I accomplish by using the following code:
```
- (UIImage*) createMenuRingWithFrame:(CGRect)frame
{
CGRect imageSize = CGRectMake(0,0,300,300);
float perSectionDegrees = 360 / [sections count];
float totalRotation = 90;
char* fontName = (char*)[self.menuItemsFont.fontName cStringUsingEncoding:NSASCIIStringEncoding];
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL, imageSize.size.width, imageSize.size.height, 8, 4 * imageSize.size.width, colorSpace, kCGImageAlphaPremultipliedFirst);
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
CGContextSelectFont(context, fontName, 18, kCGEncodingMacRoman);
CGContextSetRGBFillColor(context, 0, 0, 0, 1);
CGPoint centerPoint = CGPointMake(imageSize.size.width / 2, imageSize.size.height / 2);
double radius = (frame.size.width / 2);
CGContextStrokeEllipseInRect(context, CGRectMake(centerPoint.x - (frame.size.width / 2), centerPoint.y - (frame.size.height / 2), frame.size.width, frame.size.height));
for (int index = 0; index < [sections count]; index++)
{
NSString* menuItemText = [sections objectAtIndex:index];
CGSize textSize = [menuItemText sizeWithFont:self.menuItemsFont];
char* menuItemTextChar = (char*)[menuItemText cStringUsingEncoding:NSASCIIStringEncoding];
float x = centerPoint.x + radius * cos(degreesToRadians(totalRotation));
float y = centerPoint.y + radius * sin(degreesToRadians(totalRotation));
CGContextSaveGState(context);
CGContextTranslateCTM(context, x, y);
CGContextRotateCTM(context, degreesToRadians(totalRotation - 90));
CGContextShowTextAtPoint(context, 0 - (textSize.width / 2), 0 - (textSize.height / 2), menuItemTextChar, strlen(menuItemTextChar));
CGContextRestoreGState(context);
totalRotation += perSectionDegrees;
}
CGImageRef contextImage = CGBitmapContextCreateImage(context);
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
return [UIImage imageWithCGImage:contextImage];
}
```
These are the variables I use in there:
```
NSArray* sections = [[NSArray alloc] initWithObjects:@"settings", @"test", @"stats", @"nog iets", @"woei", @"woei2", nil];
self.menuItemsFont = [UIFont fontWithName:@"VAGRounded-Bold" size:18];
```
The rotation of the words seem correct, the placement also. Now I need somehow figure out at which rotation the letters (and their coordinates) should be. I could use some help with that.
Fixed! Check out the following code!
```
- (void) drawStringAtContext:(CGContextRef) context string:(NSString*) text atAngle:(float) angle withRadius:(float) radius
{
CGSize textSize = [text sizeWithFont:self.menuItemsFont];
float perimeter = 2 * M_PI * radius;
float textAngle = textSize.width / perimeter * 2 * M_PI;
angle += textAngle / 2;
for (int index = 0; index < [text length]; index++)
{
NSRange range = {index, 1};
NSString* letter = [text substringWithRange:range];
char* c = (char*)[letter cStringUsingEncoding:NSASCIIStringEncoding];
CGSize charSize = [letter sizeWithFont:self.menuItemsFont];
NSLog(@"Char %@ with size: %f x %f", letter, charSize.width, charSize.height);
float x = radius * cos(angle);
float y = radius * sin(angle);
float letterAngle = (charSize.width / perimeter * -2 * M_PI);
CGContextSaveGState(context);
CGContextTranslateCTM(context, x, y);
CGContextRotateCTM(context, (angle - 0.5 * M_PI));
CGContextShowTextAtPoint(context, 0, 0, c, strlen(c));
CGContextRestoreGState(context);
angle += letterAngle;
}
}
- (UIImage*) createMenuRingWithFrame:(CGRect)frame
{
CGPoint centerPoint = CGPointMake(frame.size.width / 2, frame.size.height / 2);
char* fontName = (char*)[self.menuItemsFont.fontName cStringUsingEncoding:NSASCIIStringEncoding];
CGFloat* ringColorComponents = (float*)CGColorGetComponents(ringColor.CGColor);
CGFloat* textColorComponents = (float*)CGColorGetComponents(textColor.CGColor);
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL, frame.size.width, frame.size.height, 8, 4 * frame.size.width, colorSpace, kCGImageAlphaPremultipliedFirst);
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
CGContextSelectFont(context, fontName, 18, kCGEncodingMacRoman);
CGContextSetRGBStrokeColor(context, ringColorComponents[0], ringColorComponents[1], ringColorComponents[2], ringAlpha);
CGContextSetLineWidth(context, ringWidth);
CGContextStrokeEllipseInRect(context, CGRectMake(ringWidth, ringWidth, frame.size.width - (ringWidth * 2), frame.size.height - (ringWidth * 2)));
CGContextSetRGBFillColor(context, textColorComponents[0], textColorComponents[1], textColorComponents[2], textAlpha);
CGContextSaveGState(context);
CGContextTranslateCTM(context, centerPoint.x, centerPoint.y);
float angleStep = 2 * M_PI / [sections count];
float angle = degreesToRadians(90);
textRadius = textRadius - 12;
for (NSString* text in sections)
{
[self drawStringAtContext:context string:text atAngle:angle withRadius:textRadius];
angle -= angleStep;
}
CGContextRestoreGState(context);
CGImageRef contextImage = CGBitmapContextCreateImage(context);
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
[self saveImage:[UIImage imageWithCGImage:contextImage] withName:@"test.png"];
return [UIImage imageWithCGImage:contextImage];
}
```
| Curve text on existing circle | CC BY-SA 2.5 | 0 | 2010-10-01T17:32:23.057 | 2017-04-11T20:44:12.257 | 2010-10-06T10:49:25.963 | 69,313 | 69,313 | [
"iphone",
"cocoa-touch",
"math",
"quartz-graphics",
"quartz-2d"
] |
3,842,525 | 1 | 3,847,064 | null | 0 | 875 | I have a button that says "Sort" and when a user normal/short presses the button, I want a menu to appear with the various sort options. Looking around online there doesn't seem to be a straight forward answer to which route is considered best practice. I'm looking to have a menu that looks similar to this:

with icons and text.
For an example, click the Layers button in the Google Maps app. It opens a list of options on a single short click. It has a title at the top and icons for each option. (The icons aren't super crucial)
Should I use a Context Menu? If so, how do I do it without a long press. Should it be a Spinner? If so how do I change the appearance to use a button instead of the normal drop down box.
| What is the best practice for opening a context-menu-like menu from a short button click? | CC BY-SA 3.0 | null | 2010-10-01T19:45:01.130 | 2015-06-08T12:59:32.297 | 2017-02-08T14:30:30.470 | -1 | 445,348 | [
"android",
"button",
"spinner",
"android-contextmenu"
] |
3,843,103 | 1 | null | null | 1 | 148 | 
In the image above, most of the html is semantic, using css to manage the look of it all. Despite my best efforts, though, I had to resort to using a table to get the segment on the right to stay where it is and allow its inner elements to wrap fluidly when it gets too big for the screen, like this:

I know that it's preferable if tables are only used for "tabular data," but I have never found a good way to force elements to do this without using tables. Has anybody solved this problem?
| How can I convert this table-based layout to use semantic html with css-based layout? | CC BY-SA 2.5 | null | 2010-10-01T21:18:06.090 | 2010-10-01T21:25:29.853 | null | null | 120,955 | [
"css",
"semantic-markup"
] |
3,843,265 | 1 | 3,843,328 | null | 1 | 458 | It's difficult to explain, but I'll try.

As you see on query_plan picture attached (It is query plan for query described below), there are 3 almost the same "blocks" - my question is WHY? It seems to me that when I have "all in one" (see below) query the "Init" block (that is rather heavy) is run three times with different filters instead of being SPOOLED and reused later.
This Query exec time is about 45secs.
It query could be presented in a form:
```
-- Complex "All in One place" Query
WITH init as (
Init1 complex query here -- (10 sec to run) if executed alone
)
, step1 as ( select * from init .. joins... where ... etc ),
step2 as ( select *, row_number() over(__condition__) as rn from step1 where _filter1_)
, step3 as ( select * from step2 where __filter2_),
.... some more steps could be here ....
select *
into target_table
from step_N;
-- 45sec CPU time
```
The important thing here is that I use those Step1, Step2, ..., StepN tables within "WITH" clause sequentially - Step 1 uses INIT table, so Step2 uses Step1 table, Step3 uses Step2 Table etc. I need this because of different rankings I process after every step that is used later for filtering.
If change this complex CTE query to (I put the result of query into table, then process other Steps without change):
```
-- Complex query separated from the rest of the query
with Init as (
The same Init1 complex query here
)
select *
into test_init
from init;
-- 10sec CPU time
with step1 as ( select * from test_init .. joins... where ... etc ),
step2 as ( select *, row_number() over(__condition__) as rn from step1 where _filter1_) ,
step3 as ( select * from step2 where __filter2_),
.... some more steps could be here ....
select *
into target_table
from step_N;
-- 5sec CPU time
```
I got about 15secs of exec time, that seems OK to me. Because 10sec is the 1st complex query that is difficult to improve.
So as a result I cant get this MS Sql server 2005 behavior? Could somebody explain this to me? It's rather interesting, I suppose!
| CTE query plan for complex query - triple run of the same init query - why? | CC BY-SA 2.5 | null | 2010-10-01T21:50:55.303 | 2010-10-01T22:10:45.940 | null | null | 70,745 | [
"sql-server-2005",
"tsql",
"sql-execution-plan"
] |
3,843,367 | 1 | 3,843,407 | null | 2 | 523 | I'm trying to render an image to the window. Super simple (or so I thought). No matter what I do, I always get this purple square. Some tidbits of my code:
```
// load image from file, called one time on load:
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
glEnable(GL_DEPTH_TEST);
RgbImage theTexMap( filename );
glGenTextures(1, &textureID);
glBindTexture(GL_TEXTURE_2D, textureID);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, theTexMap.GetNumCols(), theTexMap.GetNumRows(), 0, GL_RGB, GL_UNSIGNED_BYTE, theTexMap.ImageData() );
// render quad and texture, called inside glutDisplayFunc callback
glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex3f(-50.0, -50.0, 0.0);
glTexCoord2f(0.0, 1.0); glVertex3f(-50.0, 50.0, 0.0);
glTexCoord2f(1.0, 1.0); glVertex3f(50.0, 50.0, 0.0);
glTexCoord2f(1.0, 0.0); glVertex3f(50.0, -50.0, 0.0);
glEnd();
glFlush();
glDisable(GL_TEXTURE_2D);
```
I'm cutting out a lot of code because I'm attempting to extend an example from third party library (ARToolkit). There's a lot more code in there than needs displaying here.
Any ideas for a mistake I might be making that would display the quad, but not render the texture/image?

| What am I doing wrong that I can't render an image/texture properly in OpenGL? | CC BY-SA 2.5 | null | 2010-10-01T22:12:12.210 | 2010-10-02T08:39:19.717 | null | null | 1,210,318 | [
"c++",
"opengl",
"augmented-reality",
"texture-mapping"
] |
3,843,547 | 1 | 3,843,599 | null | 2 | 7,215 | Make something like in html/css

| How can I render text under a textbox? | CC BY-SA 2.5 | null | 2010-10-01T23:01:32.707 | 2010-10-02T04:08:24.020 | null | null | 68,172 | [
"html",
"css"
] |
3,843,555 | 1 | null | null | 6 | 4,316 | Have a look at the following screenshot fragment from an iPad app I am working on:

The "chat bubble" icon on the left is from the famous [Glyphish icon set](http://glyphish.com/). Note how it has correct vertical positioning (in the middle), but is much darker than the greyscale used for the InfoDark button. The code to make this icon is as follows:
```
UIImage* image = [UIImage imageNamed:@"02-chat.png"];
CGRect frame = CGRectMake(0, 0, image.size.width, image.size.height);
UIButton* button = [[UIButton alloc] initWithFrame:frame];
[button setBackgroundImage:image forState:UIControlStateNormal];
[button addTarget:nil action:NULL forControlEvents:UIControlEventTouchUpInside];
[button setShowsTouchWhenHighlighted:YES];
UIBarButtonItem* chatBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
```
The "chat bubble" icon in the middle is created using the same image, using different code. Note how it has had correct colouring/transparency, but has incorrect vertical positioning (too high).:
```
UIImage* image = [UIImage imageNamed:@"02-chat.png"];
UIBarButtonItem* chatBarButtonItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:nil action:NULL];
```
How do I get a `UIBarButtonItem` button that has both correct colouring/transparency (so I don't have to do it manually), as well as correct vertical positioning?
Is one or the other a bug, either in my code, or with Apple's? Or both? Or neither (i.e. it's "as designed")?
Responses to answers
> It looks like the first version is
using the image as a mask, rather than
as a regular image.
It looks like it, but it's not the case. If I substitute the image with one that was hand-lightened by a friend with Photoshop, and use a `UIButton`, the positioning and colouring are correct. I am just trying to find away around that manual step.
> Keep in mind that putting UIResponder
objects (e.g. UIButton) inside a
UIBarButtonItem gives unpredictable
results, and I've found it's best to
avoid it.
Do you have a source? (Especially an Apple link?) Never heard that.
> Redesign the image to be your own.
That is the best and only way to
ensure proper sizing, gradients and
position of all your tool bar icons.
I don't necessarily disagree. However, this is a manual step I want to eliminate. It should be possible to get the behaviour I desire without requiring editing. (Especially since I get both halves of the desired behaviour using the existing frameworks. Just not at the same time)
> Best for a toolbar is 25x25 and
50x50@2x. Sometimes you may need to go
as low as 23.
Is this something official from Apple? Perhaps from the HIG? Can you provide a source?
> You could try setting imageInsets on
it to push it down.
This is also a needlessly manual process. The worst part is this needs to be hand-tuned for each image, and if an image changes in any way, it has to be double-checked. Way too much work. I want to just set it to an image and let the underlying framework work out how to centre the image.
| iPad toolbar icons: bar button images not centered? | CC BY-SA 2.5 | 0 | 2010-10-01T23:02:59.723 | 2010-10-02T01:03:52.033 | 2010-10-02T01:03:52.033 | 161,161 | 161,161 | [
"image",
"ipad",
"button",
"ios",
"toolbar"
] |
3,843,784 | 1 | 3,843,876 | null | 7 | 9,562 | I have encountered something very strange, simple WPF application
```
<Window x:Class="ListBoxSelection.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<ListBox ItemsSource="{Binding Path=Strings}" SelectionMode="Single"/>
</Grid>
</Window>
```
with code behind
```
public class ViewModel
{
public List<string> Strings { get; set; }
public ViewModel ()
{
Strings = new List<string> ();
Strings.Add ("A");
// add many items ...
Strings.Add ("A");
}
}
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow ()
{
InitializeComponent ();
DataContext = new ViewModel ();
}
}
```
and when I click on a single item,

if I continue clicking items, they just aggregate. Clicking an already selected item does nothing. Scratching my head, I have databound lists to ListBoxes before, and have never seen this before. Running Win7 (64), VS2010, behaviour presents with .Net 3.5, .Net 3.5 Client Profile, .Net 4, and .Net 4 Client Profile.
Arg, I should mention I am expecting normal, default, single-select behaviour.
| ListBox is selecting many items even in SelectionMode="Single" | CC BY-SA 2.5 | 0 | 2010-10-02T00:06:29.070 | 2011-02-10T05:08:07.097 | null | null | 189,183 | [
"wpf",
".net-4.0",
"listbox",
"binding"
] |
3,843,814 | 1 | 4,915,160 | null | 1 | 1,533 | when the orientation changes, the seekbar drawing is messed up. See voice call and alarm below:

| android seekbar drawing problem on orientation change | CC BY-SA 2.5 | null | 2010-10-02T00:19:05.977 | 2011-06-24T17:59:36.433 | null | null | 398,148 | [
"android",
"android-widget",
"seekbar"
] |
3,843,930 | 1 | null | null | 1 | 437 | How to implement custom diagram Project for VS2010?
Where can I find the exmaple?
---
It is no diagram designer project (Class Diagram Project/Sequence diagram project) example in the Visual Studio Integration Samples.
---

I hope can implement custom diagram elements in VS.NET Toolbok window,and custom diagram designer (like edmx diagram designer and sequence diagram designer).
| How to implement custom diagram Project for VS2010? | CC BY-SA 2.5 | null | 2010-10-02T01:01:12.480 | 2010-10-02T08:11:07.583 | 2010-10-02T08:11:07.583 | 364,126 | 364,126 | [
"c#",
"visual-studio"
] |
3,844,477 | 1 | 3,845,221 | null | 14 | 9,755 |
## Background
I am developing a social web app for poets and writers, allowing them to share their poetry, gather feedback, and communicate with other poets. I have very little formal training in database design, but I have been reading books, SO, and online DB design resources in an attempt to ensure performance and scalability without over-engineering.
The database is MySQL, and the application is written in PHP. I'm not sure yet whether we will be using an ORM library or writing SQL queries from scratch in the app. Other than the web application, Solr search server and maybe some messaging client will interact with the database.
## Current Needs
The schema I have thrown together below represents the primary components of the first version of the website. Initially, users can register for the site and do any of the following:
- - - - -
## Schema
Here is what I came up with on MySQL Workbench for the initial site. I'm still a little fuzzy on some relational databasey things, so go easy.

## Questions
1. In general, is there anything I'm doing wrong or can improve upon?
2. Is there any reason why I shouldn't combine the ExternalAccounts table into the UserProfiles table?
3. Is there any reason why I shouldn't combine the PostStats table into the Posts table?
4. Should I expand the design to include the features we are doing in the second version just to ensure that the initial schema can support it?
5. Is there anything I can do to optimize the DB design for Solr indexing/performance/whatever?
6. Should I be using more natural primary keys, like Username instead of UserID, or zip/area code instead of a surrogate LocationID in the Locations table?
Thanks for the help!
| Social web application database design: how can I improve this schema? | CC BY-SA 3.0 | 0 | 2010-10-02T05:11:40.463 | 2015-12-25T22:16:28.617 | 2015-12-25T22:16:28.617 | 2,171,044 | 461,276 | [
"mysql",
"database",
"database-design",
"schema",
"social-networking"
] |
3,844,695 | 1 | 3,845,506 | null | 2 | 195 | I need some performance improvement guidance, my query takes several seconds to run and this is causing problems on the server. This query runs on the most common page on my site. I think a radical rethink may be required.
~ EDIT ~
This query produces a list of records whose keywords match those of the program (record) being queried. My site is a software download directory. And this list is used on the program listing page to show other similar programs. PadID is the primary key of the program records in my database.
~ EDIT ~
Heres my query
```
select match_keywords.PadID, count(match_keywords.Word) as matching_words
from keywords current_program_keywords
inner join keywords match_keywords on
match_keywords.Word=current_program_keywords.Word
where match_keywords.Word IS NOT NULL
and current_program_keywords.PadID=44243
group by match_keywords.PadID
order by matching_words DESC
LIMIT 0,11;
```
Heres the query explained.

Heres some sample data, however I doubt you'd be able to see the effects of any performance tweaks without more data, which I can provide if you'd like.
```
CREATE TABLE IF NOT EXISTS `keywords` (
`Word` varchar(20) NOT NULL,
`PadID` bigint(20) NOT NULL,
`LetterIdx` varchar(1) NOT NULL,
KEY `Word` (`Word`),
KEY `LetterIdx` (`LetterIdx`),
KEY `PadID_2` (`PadID`,`Word`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `keywords` (`Word`, `PadID`, `LetterIdx`) VALUES
('tv', 44243, 'T'),
('satellite tv', 44243, 'S'),
('satellite tv to pc', 44243, 'S'),
('satellite', 44243, 'S'),
('your', 44243, 'X'),
('computer', 44243, 'C'),
('pc', 44243, 'P'),
('soccer on your pc', 44243, 'S'),
('sports on your pc', 44243, 'S'),
('television', 44243, 'T');
```
I've tried adding an index, but this doesn't make much difference.
```
ALTER TABLE `keywords` ADD INDEX ( `PadID` )
```
| MySQL, need some performance suggestions on my match query | CC BY-SA 2.5 | null | 2010-10-02T06:50:35.580 | 2010-10-04T09:08:46.633 | 2010-10-02T07:31:56.540 | 450,456 | 450,456 | [
"sql",
"database",
"mysql"
] |
3,844,784 | 1 | 3,844,975 | null | 2 | 1,319 | after i have add 6 or more tabbar on the InterfaceBuilder it will automatically generate More Tab. how to customize look and feel of it ? eg Navigation bar color.

| how to customize More Tabbar on iPhone? | CC BY-SA 2.5 | 0 | 2010-10-02T07:25:32.157 | 2015-06-17T16:15:56.103 | null | null | 203,372 | [
"iphone",
"uitabbarcontroller"
] |
3,845,014 | 1 | 3,853,153 | null | 57 | 61,484 | MySQL Workbench reports a value called "Key Efficiency" in association with server health. What does this mean and what are its implications?

From [MySQL.com](http://dev.mysql.com/doc/administrator/en/mysql-administrator-health-memory-health.html), "Key Efficiency" is:
> ...an indication of the number of `key_read_requests` that resulted in actual `key_reads`.
Ok, so what does that mean. What does it tell me about how I'm supposed to tune the server?
| What is MySQL "Key Efficiency" | CC BY-SA 2.5 | 0 | 2010-10-02T08:50:32.637 | 2013-04-07T00:01:07.980 | 2010-10-02T10:48:29.507 | 86,060 | 86,060 | [
"mysql",
"reporting",
"performance"
] |
3,845,085 | 1 | 3,847,889 | null | 14 | 13,651 | I would like to know to make an UIPopoverController without arrows
In fact I would like to simulate something like this:

See that
- There is no arrows- There is a title that is somehow inside of a expanded top border of the UIPopoverController and not inside of it like in the normal UIPopoverController.
I assume this is not really an UIPopoverController object but I would appreciate advices on how can I make the same effect (using CoreGraphics? -> specially the translucent degrade effect of the 3D outstanding border) and/or links to some sources if anyone has done this before.
Thanks in advance.
Ignacio
EDIT:
I am still looking for this stuff and realized that even in third party apps is being used
an example is: twitterrific for iPad as seen in this picture.
Anyone please? Putting the title inside the popovercontroller is just ugly.

| UIPopoverController without arrows? | CC BY-SA 2.5 | 0 | 2010-10-02T09:12:06.787 | 2014-07-04T06:46:06.217 | 2010-10-04T17:54:49.233 | 149,008 | 149,008 | [
"iphone",
"cocoa-touch",
"uikit",
"core-graphics",
"uipopovercontroller"
] |
3,845,265 | 1 | 3,846,342 | null | 0 | 1,503 | I'm trying to display transparent `UINavigationBar` on top of Scrollview.
This is actual result of code that I have written...

where as I'm expecting view to be displayed like below image, which happens after I slightly scroll the image.

Code :
```
- (void) loadView {
CGRect pagingScrollViewFrame = [self frameForPagingScrollView];
pagingScrollView = [[UIScrollView alloc] initWithFrame:pagingScrollViewFrame];
pagingScrollView.pagingEnabled = YES;
pagingScrollView.backgroundColor = [UIColor blackColor];
pagingScrollView.showsVerticalScrollIndicator = NO;
pagingScrollView.showsHorizontalScrollIndicator = NO;
pagingScrollView.contentSize = CGSizeMake(pagingScrollViewFrame.size.width * [self imageCount],
pagingScrollViewFrame.size.height);
pagingScrollView.delegate = self;
self.wantsFullScreenLayout = YES;
pagingScrollView.scrollsToTop = YES;
self.view = pagingScrollView;
}
```
question is how do I make view to load as I expected without user interacting to it?
any suggestion or help is appreciated..
| Transparent NavgationBar on iPhone | CC BY-SA 2.5 | null | 2010-10-02T10:24:56.607 | 2013-05-17T23:29:04.880 | 2010-10-08T03:51:36.677 | 240,633 | 85,606 | [
"iphone",
"objective-c",
"uiscrollview",
"ios4"
] |
3,845,411 | 1 | 3,846,921 | null | 0 | 223 | Given image is N*M (R,G,B) pixels like:

Algorithm should tall us how to find main image colors like: red and white here.
Aeries with relatively same colors means we search for (R,G,B) (222, 12, 10) giving for example such step (40, 20, 10 ) so that (199, 32, 5) will count like what we are searching for like:

Shapes should be defined by array of connected points (x, y) attached to pixels like:

Pseudo code will work for me as well as any readable code in OO language like Java or C++ (in this 2 I am especially interested)
What algorithm is fastest for getting relative to image shapes formed by aeries with relatively same colors on the given image?
| What is fastest algorithm for getting relative to image shapes formed by aeries with relatively same colors on the given image? | CC BY-SA 2.5 | null | 2010-10-02T11:17:17.383 | 2010-10-02T18:04:04.207 | null | null | 434,051 | [
"java",
"c++",
"algorithm",
"image",
"search"
] |
3,845,654 | 1 | 3,845,753 | null | 8 | 10,962 | I want to create an effect like that of `fieldset` and `label`.

When the headings change along the side, the width that the white background of the heading remains the same.
If I can make the `heading` or `div` element to take the width enough to fit its content, it will give the proper effect.
If there is any other solution please let me know.
| how can we make a div take width according to its content automatically | CC BY-SA 2.5 | 0 | 2010-10-02T12:20:20.393 | 2016-03-01T07:37:10.960 | 2010-10-02T12:46:19.223 | 82,548 | 155,196 | [
"html",
"width",
"fieldset"
] |
3,845,701 | 1 | 3,845,932 | null | 10 | 58,488 | I am trying to code the following layout. I have messed up the code and not sure what's the best way to do it.

```
<div class="search-wrapper">
<form action="search.php" method="get" name="search">
<div class="search-box"><img class="search-icon" src="images/search-icon.png" width="21" height="18" alt="search icon" />
<input name="seach" type="text" value="Search for dishes or restaurants" />
</div>
<input class="submit-button" name="Go" type="submit" />
</form>
</div>
#search {
height:125px;
overflow:hidden;
}
.search-wrapper {
width:465px;
height:45px;
background-color:#f0f0f0;
margin:43px auto 0;
border:1px solid #e9e9e9;
-moz-border-radius: 5px; /* FF1+ */
-webkit-border-radius: 5px; /* Saf3-4 */
border-radius: 5px; /* Opera 10.5, IE 9, Saf5, Chrome */
position:relative;
}
.search-box {
width:375px;
height:32px;
background-color:#fff;
margin:5px 7px;
border:1px solid #cfcfcf;
-moz-border-radius: 5px; /* FF1+ */
-webkit-border-radius: 5px; /* Saf3-4 */
border-radius: 5px; /* Opera 10.5, IE 9, Saf5, Chrome */
position:relative;
}
.search-box img.search-icon {
margin:8px 0 0 5px;
}
.search-box input {
border:none;
height:30px;
width:332px;
margin:0;
position:absolute;
font-size:16px;
padding-left:5px;
padding-right:5px;
}
input.submit-button {
background:url(../images/go-button.png) no-repeat;
text-indent:-9999px;
border:none;
height:32px;
width:68px;
position:absolute;
top:6px;
left:390px;
cursor:pointer;
//right:15px;
}
```
Here is the code @ paste bin:
[http://pastebin.com/KQR3mPiW](http://pastebin.com/KQR3mPiW)
Images:
[http://bayimg.com/IAPcpAACi](http://bayimg.com/IAPcpAACi)
[http://bayimg.com/JapcBaAci](http://bayimg.com/JapcBaAci)
| coding a search bar with icon inside it | CC BY-SA 3.0 | null | 2010-10-02T12:30:02.273 | 2014-07-23T10:06:58.193 | 2014-02-24T06:09:55.353 | 249,762 | 155,196 | [
"html",
"css"
] |
3,845,941 | 1 | 3,845,979 | null | 0 | 372 | 
This is the representation of prototype chain when I created two instances of Book constructor. The screen-shot is taken from "High Performance Javascript - N.C.Jakas".
My confusion is about the Book constructor given in the middle (the yellow box with the heading "Book"). As every function in javascript is an instance of Function prototype, shouldn't this box (Book) has a property linking it to prototype of .?
| prototype confusion | CC BY-SA 2.5 | 0 | 2010-10-02T13:32:56.617 | 2011-08-20T20:46:20.943 | null | null | 341,144 | [
"javascript"
] |
3,846,182 | 1 | 3,846,245 | null | 1 | 2,950 | 
I have above mysql table with available dates and prices. Second table includes room details. How can I join two tables to get available rooms between two dates and not get duplicate content.
| Select available rooms between two dates | CC BY-SA 2.5 | null | 2010-10-02T14:39:13.177 | 2013-09-06T20:26:45.367 | 2013-09-06T20:26:45.367 | null | 412,225 | [
"php",
"mysql"
] |
3,846,233 | 1 | null | null | 0 | 765 | I have a GridBagLayout, but one label (maxSizeLbl) goes crazy and an other one (maxDateLbl) isnt visible, anyone knows what I've done wrong?
Here is the Picture:

And here is the Code:
```
import java.awt.Component;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class SearchGUI {
public static void main(String args[]) {
JFrame frame = new JFrame("Search Files");
JPanel panel = new JPanel();
JTextField rootTF = new JTextField(20);
JTextField containsTF = new JTextField(20);
JTextField containsNotTF = new JTextField(20);
JTextField minSizeTF = new JTextField(10);
JTextField maxSizeTF = new JTextField(10);
JTextField suffixTF = new JTextField(10);
JTextField prefixTF= new JTextField(10);
JTextField minDateTF = new JTextField(10);
JTextField maxDateTF = new JTextField(10);
JCheckBox hiddenCB = new JCheckBox("search hidden");
JCheckBox recursiveCB = new JCheckBox("search subfolders");
JButton searchBtn = new JButton("search");
JLabel rootLbl = new JLabel("search in: ", JLabel.CENTER);
JLabel containsLbl = new JLabel("Filename contains: ", JLabel.CENTER);
JLabel containsNotLbl = new JLabel(" Filename contains not", JLabel.CENTER);
JLabel minSizeLbl = new JLabel("min. Size", JLabel.CENTER);
JLabel maxSizeLbl = new JLabel("max. Size", JLabel.CENTER);
JLabel suffixLbl = new JLabel("Filetypes", JLabel.CENTER);
JLabel prefixLbl = new JLabel("begins with", JLabel.CENTER);
JLabel minDateLbl = new JLabel("min. Date", JLabel.CENTER);
JLabel maxDateLbl = new JLabel("max Date", JLabel.CENTER);
frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
Container c = frame.getContentPane();
GridBagLayout gbl = new GridBagLayout();
c.setLayout(gbl);
// addComponent(c, gbl, );
// x y w h wx wy
addComponent(c, gbl, rootLbl, 0, 0, 2, 1, 1.0, 0.0);
addComponent(c, gbl, rootTF, 0, 1, 2, 1, 1.0, 0.0);
addComponent(c, gbl, containsLbl, 0, 2, 2, 1, 1.0, 0.0);
addComponent(c, gbl, containsTF, 0, 3, 2, 1, 1.0, 0.0);
addComponent(c, gbl, containsNotLbl, 0, 4, 2, 1, 1.0, 0.0);
addComponent(c, gbl, containsNotTF, 0, 5, 2, 1, 1.0, 0.0);
addComponent(c, gbl, minSizeLbl, 0, 6, 1, 1, 1.0, 0.0);
addComponent(c, gbl, maxSizeLbl, 1, 6, 1, 1, 1.0, 0.0);
addComponent(c, gbl, minSizeTF, 0, 7, 1, 1, 1.0, 0.0);
addComponent(c, gbl, maxSizeTF, 1, 7, 1, 1, 1.0, 0.0);
addComponent(c, gbl, suffixLbl, 0, 8, 2, 1, 1.0, 0.0);
addComponent(c, gbl, suffixTF, 0, 9, 2, 1, 1.0, 0.0);
addComponent(c, gbl, minDateLbl, 0, 10, 1, 1, 1.0, 0.0);
addComponent(c, gbl, maxSizeLbl, 1, 10, 1, 1, 1.0, 0.0);
addComponent(c, gbl, minDateTF, 0, 11, 1, 1, 1.0, 0.0);
addComponent(c, gbl, maxDateTF, 1, 11, 1, 1, 1.0, 0.0);
addComponent(c, gbl, searchBtn, 0, 12, 2, 1, 1.0, 0.0);
frame.setSize(gbl.preferredLayoutSize(c));
frame.setVisible(true);
}
static void addComponent( Container cont,
GridBagLayout gbl,
Component c,
int x, int y,
int width, int height,
double weightx, double weighty )
{
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.BOTH;
gbc.gridx = x; gbc.gridy = y;
gbc.gridwidth = width; gbc.gridheight = height;
gbc.weightx = weightx; gbc.weighty = weighty;
gbl.setConstraints( c, gbc );
cont.add( c );
}
}
```
Thanks in advance.
| GridBagLayout goes crazy | CC BY-SA 2.5 | null | 2010-10-02T14:54:01.960 | 2010-10-02T20:26:44.763 | 2010-10-02T19:23:27.353 | 157,882 | 453,882 | [
"java",
"swing",
"layout-manager",
"gridbaglayout"
] |
3,846,474 | 1 | null | null | 0 | 470 | I've got a Flex application that loads without issue when offline, but once I embed it in a webpage it hangs on “Loading…”:

I've tried fiddling with the `-use-network` compile flag to no avail.
I've also watched the network traffic with Charles, and I see two requests for the SWF (ie, `GET /foo.swf`), both of which complete successfully, then nothing else.
What am I missing?
: I've determined that it's not a problem with the SWF — when I run a server using `python -m SimpleHTTPServer`, everything loads and runs properly. It only appears to break when I'm using Django's static media server.
| Flex: application hangs on "Loading..." | CC BY-SA 2.5 | null | 2010-10-02T15:55:46.220 | 2010-10-02T18:08:34.103 | 2010-10-02T17:54:23.727 | 71,522 | 71,522 | [
"apache-flex",
"preloader"
] |
3,846,655 | 1 | 3,846,724 | null | 2 | 5,609 | 

I wrote a php app using php+smarty.
When I view the web source code in firebug, I find that tag and tag get under the tag. But it should be under the tag.
And there are some space below tag.
And there is on my top of my web page.
What is the problem?
| the blank space below the <body> tag & script tag and link tag goes under body tag from head tag | CC BY-SA 4.0 | 0 | 2010-10-02T16:52:37.930 | 2020-12-17T11:29:22.850 | 2020-12-17T11:29:22.850 | 1,783,163 | 298,553 | [
"php",
"html",
"utf-8",
"smarty",
"byte-order-mark"
] |
3,846,845 | 1 | 3,847,519 | null | 0 | 187 | I have never seen this issue before, its very strange. Just wondering if anyone else has come across this too.

I have added a sprite to my game, its supposed to be the top left corner of a box to put text on to. I want to make it scalable without loosing anything so i have it broken up into sections. In the image above the one on top is the image itself, and then the one on the bottom is the image when its being drawn in the iPhone simulator.
Any idea why the last column of pixels on the right are altered? I have not scaled the image at all.
| Cocos2D changes the colours in the last row of pixles in a sprite? | CC BY-SA 2.5 | null | 2010-10-02T17:43:27.337 | 2010-10-02T21:01:32.927 | null | null | 385,816 | [
"iphone",
"cocos2d-iphone",
"sprite"
] |
3,846,958 | 1 | 3,846,974 | null | 0 | 2,248 | I did this before but I can't remember how to do it again.
Image of what i'm trying to get:

and what I have so far

In between each link,, theres two borders. yes I know how to make the effect, put two borders together. But the problem is I can't do it!
At first I tried [Jefferey ways Technic](http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-multiple-borders-with-simple-css/).
```
nav ul li:before { border-left: 1px solid red; content: ''; margin: 0 -30px; position: absolute; height: 20px; }
nav ul li:after { border-right: 1px solid white; content: ''; margin: 0 39px; position: absolute; height: 20px; }
```
It worked, except the borders from the left and right end of the nav is sticking out. I tried `:first-of-type` and `:last-of-type` to try to remove the borders at the end, but they didn't go away.
Then, I tried just using both `:first-of-type` and `:last-of-type` to create the borders,but again. it didn't work. So I don't really know what to do to create the effect! I wish there was a way to remove the front and end borders with Jefferey Ways code but I can't. Can anybody help?
Heres the whole css of the nav.
```
nav { background: #282828 url(../images/nav-bg.png) repeat-x; border-radius: 6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; -o-border-radius: 6px; margin: 24px auto; padding: 11px 29px; width: 670px; }
nav ul {}
nav ul li { display: inline; padding: 32px; margin: 0 auto; }
nav ul li:before { border-right: 1px solid red; }
nav ul li:odd { border-right: 1px solid white; }
nav ul li a { color: #626262; height: 20px; }
```
| Double border effect with navigation? | CC BY-SA 2.5 | 0 | 2010-10-02T18:14:22.220 | 2010-10-02T18:18:34.623 | null | null | 363,551 | [
"css"
] |
3,847,188 | 1 | 3,848,494 | null | 1 | 354 | Does anyone know if there is a tool that will take an image (.png, .gif, etc) and output the gradient that the image contains?
I really want to recreate this image  in css. Looks like a mix of linear and radial gradients and is beyond my css skills
| WebKit gradient from an image | CC BY-SA 2.5 | null | 2010-10-02T19:25:29.900 | 2010-10-08T23:19:04.840 | 2010-10-03T02:56:37.430 | 69,634 | 413,606 | [
"css",
"webkit",
"gradient"
] |
3,847,336 | 1 | 3,847,558 | null | 2 | 2,445 | I am hitting a brick wall with something I'm trying to do.
I'm trying to perform a complex query and return the results to a vbscript (vbs) record set.
In order to speed up the query I create temporary tables and then use those tables in the main query (creates a speed boost of around 1200% on just using sub queries)
the problem is, the outlying code seems to ignore the main query, only 'seeing' the result of the very first command (i.e. it will return a 'records affected' figure)
For example, given a query like this..
```
delete from temp
select * into temp from sometable where somefield = somefilter
select sum(someotherfield) from yetanothertable where account in (select * from temp)
```
The outlying code only seems to 'see' the returned result of 'delete from temp' I can't access the data that the third command is returning.
(Obviously the sql query above is pseudo/fake. the real query is large and it's content not relevant to the question being asked. I need to solve this problem as without being able to use a temporary table the query goes from taking 3 seconds to 6 minutes!)
edit: I know I could get around this by making multiple calls to ADODB.Connection's execute (make the call to empty the temp tables, make the call to create them again, finally make the call to get the data) but I'd rather find an elegant solution/way to avoid this way of doing it.
edit 2: Below is the actual SQL code I've ended up with. Just adding it for the curiosity of people who have replied. It doesn't use the nocount as I'd already settled on a solution which works for me. It is also probably badly written. It evolved over time from something more basic. I could probably improve it myself but as it works and returns data extremely quickly I have stuck with it. (for now)
Here's the SQL.

Here's the Code where it's called. My chosen solution is to run the first query into a third temp table, then run a select * on that table from the code, then a delete from from the code...

I make no claims about being a 'good' sql scripter (self taught via necesity mostly), and the database is not very well designed (a mix of old and new tables. Old tables not relational and contain numerical values and date values stored as strings)
Here is the original (slow) query...
```
select
name,
program_name,
sum(handle) + sum(refund) as [Total Sales],
sum(refund) as Refunds,
sum(handle) as [Net Sales],
sum(credit - refund) as Payout,
cast(sum(comm) as money) as commission
from
(select accountnumber,program_name,
cast(credit_amount as money) as credit,cast(refund_amt as money) as refund,handle, handle * (
(select commission from amtotecommissions
where _date = a._date
and pool_type = (case when a.pool_type in ('WP','WS','PS','WPS') then 'WN' else a.pool_type end)
and program_name = a.program_name) / 100) as comm
from amtoteaccountactivity a where _date = '@yy/@mm/@dd' and transaction_type = 'Bet'
and accountnumber not in ('5067788','5096272') /*just to speed the query up a bit. I know these accounts aren't included*/
) a,
ews_db.dbo.amtotetrack t
where (a.accountnumber in (select accountno from ews_db.dbo.get_all_customers where country = 'US')
or a.accountnumber in ('5122483','5092147'))
and t.our_code = a.program_name collate database_default
and t.tracktype = 2
group by name,program_name
```
| How to perform multiple SQL tasks when using SQL within code (in this case vbscript) | CC BY-SA 2.5 | null | 2010-10-02T20:07:01.227 | 2016-03-02T23:44:25.433 | 2010-10-03T18:57:41.467 | 21,880 | 21,880 | [
"sql",
"vbscript"
] |
3,847,377 | 1 | null | null | 0 | 183 | i have to develop one image gallery in flex, 
this is how it looks, wht i have to do, is to make it run, like it keeps running, from left to right,(the items shown here should move from left to right)
i am using repeater in an hbox, can u help me by telling, how to make it movable?
Thanx in advance
| auto movable gallery in flex | CC BY-SA 2.5 | null | 2010-10-02T20:18:24.547 | 2010-10-03T12:10:27.040 | null | null | 340,116 | [
"apache-flex",
"actionscript-3",
"flex3",
"flash-cs4"
] |
3,847,899 | 1 | 3,847,912 | null | 0 | 221 | Right now my navigation looks like this:

There is huge spaces at the ends of it, and I don't really know how to take it out.
CSS:
```
nav { background: #282828 url(../images/nav-bg.png) repeat-x; border-radius: 6px; -webkit-border-radius: 6px; -moz-border-radius: 6px; -o-border-radius: 6px; margin: 24px auto; padding: 18px 29px; width: 670px; }
nav ul { margin: 0 auto; }
nav ul li { background: url(../images/nav-sep.jpg) left center no-repeat; display: inline; padding: 32px; margin: 0 auto; }
nav ul li:first-of-type { background: none; }
nav ul li a { color: #626262; font: 16px Arial, Helvetica, serif; }
```
| Space on Navigation right and left...how to remove it? | CC BY-SA 2.5 | null | 2010-10-02T23:20:31.463 | 2010-10-03T03:30:10.240 | 2010-10-03T03:28:25.283 | 361,608 | 363,551 | [
"css"
] |
3,847,972 | 1 | 3,848,049 | null | 1 | 73 | I want to write an xslt to transform one xml file to another. The source XML file is like the following
```
<orgs>
<organization revenue="10000">
<name>foo</name>
</organization>
<organization parent="foo">
<name>foo2</name>
</organization>
<organization parent="foo2">
<name>foo3</name>
</organization>
</orgs>
```
The output xml should be as follows
```
<orgo>
<organization revenue="10000">
<name>foo</name>
<organization>
<name>foo2</name>
<organization><name>foo3</name></organization>
</organization>
</organization>
</orgo>
```
So far i've tried writing the xsl as follows

| XSLT Transformation doubt | CC BY-SA 2.5 | null | 2010-10-02T23:50:16.277 | 2010-10-03T01:01:09.620 | 2010-10-02T23:57:18.987 | 42,346 | 379,524 | [
"xslt"
] |
3,847,983 | 1 | 3,848,667 | null | 0 | 239 | Is there a way to get Eclipse to do something like this:

It would be SOOOO helpful.
| Eclipse: showing an interactive map of your project | CC BY-SA 2.5 | 0 | 2010-10-02T23:56:21.827 | 2010-10-03T07:42:42.800 | 2010-10-03T07:42:42.800 | 6,309 | 356,849 | [
"eclipse",
"diagrams"
] |
3,848,108 | 1 | 3,848,201 | null | 23 | 2,539 | Based on this original idea, that many of you have probably seen before:
[http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/](http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona-lisa/)
I wanted to try taking a different approach:
You have a target image. Let's say you can add one triangle at a time. There exists some triangle (or triangles in case of a tie) that maximizes the image similarity (fitness function). If you could brute force through all possible shapes and colors, you would find it. But that is prohibitively expensive. Searching all triangles is a 10-dimensional space: `x1, y1, x2, y2, x3, y3, r, g, b, a`.
I used simulated annealing with pretty good results. But I'm wondering if I can further improve on this. One thought was to actually analyze the image difference between the target image and current image and look for "hot spots" that might be good places to put a new triangle.
Should the algorithm vary to handle coarse details and fine details differently? I haven't let it run long enough to start refining the finer image details. It seems to get "shy" about adding new shapes the longer it runs... it uses low alpha values (very transparent shapes).
  
I had a new idea. If shape coordinates and alpha value are given, the optimal RGB color for the shape can be computed by analyzing the pixels in the current image and the target image. So that eliminates 3 dimensions from the search space, and you know the color you're using is always optimal! I've implemented this, and tried another run using circles instead of triangles.
 
| Reproducing images with primitive shapes. (Graphics optimization problem) | CC BY-SA 2.5 | 0 | 2010-10-03T00:51:26.527 | 2010-10-05T03:10:39.970 | 2010-10-05T03:10:39.970 | 90,308 | 90,308 | [
"algorithm",
"language-agnostic",
"optimization",
"graphics",
"simulated-annealing"
] |
3,848,259 | 1 | null | null | 2 | 611 | How I detect what language the current system?

| How I detect what language the current system | CC BY-SA 2.5 | null | 2010-10-03T02:05:49.473 | 2010-10-03T02:32:12.713 | null | null | 461,057 | [
"c#"
] |
3,848,274 | 1 | 3,848,283 | null | 0 | 20 | please help me with the website heading here. Please look at my picture below:

I have no idea why it is like that. I just use simple css and it became like that and similar as the buttom. The same thing happens as the bottom part of the page. Please help!Not sure why it's like that.
| the page heading isn't connected | CC BY-SA 2.5 | null | 2010-10-03T02:09:52.137 | 2010-10-03T02:13:24.537 | null | null | 324,753 | [
"css"
] |
3,848,455 | 1 | 3,848,474 | null | 2 | 206 | I am writing C / C++ code to run a shell command and capture the output:
```
static const int BUFFER_SIZE=512;
// (...)
FILE* pipe;
char buffer[BUFFER_SIZE];
// (...)
if (!(pipe = popen(cmd.c_str(), "r"))) {
out("\nProblem executing command: " + cmd + "\n");
return 1;
}
while (!feof(pipe)) {
int read = fread(buffer, sizeof(char), sizeof buffer, pipe);
int pos = -1;
int i;
for (i = 0; i < strlen(buffer); i++) {
if (buffer[i] == '\n') {
pos = i;
}
}
// ... get a substring from buffer var from 0 to pos,
// and set a "reminder" var with pos+1 to end of string
}
```
It's working with a glitch: I see that the buffer contain some non-ascii chars at the end that are messing up every other operation I do with the string afterwards (the substring I mentioned on the comment).
Here's an example of what I am seeing:

Since I am a C / C++ beginner, I'd like to ask advice on how can I can capture the process output and stream it somewhere else, splitting it when necessary. The code can be in C or C++.
| Properly getting output from a pipe in C / C++ | CC BY-SA 2.5 | 0 | 2010-10-03T03:31:52.277 | 2010-10-03T03:36:46.070 | 2017-02-08T14:30:30.810 | -1 | 14,540 | [
"c++",
"c",
"pipe"
] |
3,848,550 | 1 | 3,848,635 | null | 4 | 7,760 | I designed a button
How do I inherit the rest of this button?

---
Does this method of inheritance is true?
mycode :
```
public class MyButton : Button
{
public MyButton()
: base()
{
// set whatever styling properties needed here
this.ForeColor = Color.Blue;
this.Click += new EventHandler(MyButton_Click);
this.BackColor = Color.Red;
}
void MyButton_Click(object sender, EventArgs e)
{
MessageBox.Show("yes");
}
}
```
Why not change the background color?

---
All properties are subject to change
Except the background color
Is this a normal thing
No solution?
| Inheritance of button | CC BY-SA 3.0 | null | 2010-10-03T04:07:36.480 | 2019-03-10T17:36:19.473 | 2011-09-12T15:21:19.660 | 1,288 | 461,057 | [
"c#",
"winforms",
"inheritance"
] |
3,848,558 | 1 | null | null | 10 | 2,436 | I am trying to figure out how to use DWM to render a copy of a Window into my own desired location. The only thing I can find to tell DWM to render somewhere is with the thumbnail APIs.
But MSDN's [DWM Thumbnail Overview](http://msdn.microsoft.com/en-us/library/aa969541(v=VS.85).aspx) they specifically warn me off:
> DWM thumbnails do not enable developers to create applications like
the Windows Vista Flip3D (WINKEY-TAB)
feature. Thumbnails are rendered
directly to the destination window in
2-D.
I am told that the thumbnailing api cannot be used to create applications like Flip3D, but they don't say which api be used to create applications like the Windows Flip3D.
So what API be used to create applications like the Windows Vista Flip3D?
---
# Background
With Windows Desktop Composition running, applications draw their window client-area's onto their own private buffer. (This contrasts with previous versions of Windows where every application drew directly on the screen). This client area image is then placed in a frame (the title bar, minimize, maximize, restore buttons, etc) and then drawn (i.e. composited) onto the desktop - along with all the other windows that are open:

Because this buffer is private, and because graphics cards in the last few years have become powerful at performing 3D tasks, Windows can then start to perform some neat tricks. One of them is to be able to manipulate the client window, performing scaling and perspective changes to it. This allows the live "thumbnail" api - where Windows will draw a thumbnail size copy of a window where you tell it to. Since this is all happening in the hardware, it is very fast.
The other ability is the Flip3D (Win+Tab). The compositor can perform 3d positioning of a window. Again, because this is all done in hardware it is very fast.
I have found the API to tell the Desktop Window Monitor to draw me a thumbnail of an application "here":
```
//Register a thumbnail we want
DwmRegisterThumbnail({in}hwndDestination, {in}hwndSource, out thumbnail);
// Start displaying the thumbnail
DwmUpdateThumbnailProperties({in}thumbnail, {in}thumbproperties);
```
But I cannot find the API to tell the DWM to draw me the full-size version of a window.
---
: [You can't blame Microsoft for copy protection in Windows](http://www.digital-cp.com/files/static_page_files/D6724AFD-9B02-A253-D8D2FE5B1A10F7F7/HDCP_License_Agreement_082207.pdf): [archive](https://web.archive.org/web/20081230102746/https://www.digital-cp.com/files/static_page_files/D6724AFD-9B02-A253-D8D2FE5B1A10F7F7/HDCP_License_Agreement_082207.pdf)
> - Licensed Products as shipped shall comply with the Compliance Rules and shall be designed and manufactured in a manner that is clearly
designed to effectively
attempts to modify such Licensed Products to defeat the content protection requirements of the HDCP Specification and the
Compliance Rules.- Licensed Products shall be designed and manufactured in a manner that is clearly intended to effectively attempts to
discover or reveal Device Keys or other Highly Confidential
Information- Licensed Products shall use at least the following techniques, in a manner that is clearly designed to effectively attempts
to defeat the content protection requirements of the HDCP
Specification and the Compliance Rules
You have to blame Sony.
| What is the API to "create applications like Flip3D" | CC BY-SA 4.0 | 0 | 2010-10-03T04:11:33.557 | 2021-05-16T20:56:27.037 | 2021-05-16T20:56:27.037 | 12,597 | 12,597 | [
"aero",
"flip",
"dwm"
] |
3,848,559 | 1 | 3,850,796 | null | 2 | 361 | I'm getting a SQL query from NH, and it's generating a column that does not exist (thus producing an ADOException from NH).
```
SELECT roles0_.CreatedBy_id as CreatedBy4_1_,
roles0_.Id as Id1_,
roles0_.Id as Id18_0_,
roles0_.RoleDescription as RoleDesc2_18_0_,
roles0_.User_id as User3_18_0_
FROM [Role] roles0_
WHERE roles0_.CreatedBy_id=?
```
My problem is that I can't figure out where the `CreatedBy` column is coming from. Here's my class structure.
```
public abstract class DomainEntity
{
public virtual int Id { get; set; }
}
public class User : DomainEntity
{
/* all the regular stuff you'd expect */
public virtual IList<Role> Roles { get; private set; }
}
public class Role : DomainEntity
{
public virtual User User { get; set; }
public virtual string RoleDescription { get; set; }
}
```
At app startup, I can inspect the configuration, and I can see the `ColumnIterator` for the Role class map. It has 4 items in the dictionary: id, user_id, roledescription, and createdby_id. So the query is legit based on the configuration, but I can't figure out the configuration based on the classes.
Yes, I have cleared my ASP.NET DLL cache, deleted the bin and obj directories, and anything else like that I could think of.
This is my Fluently.Configure statement
```
_configuration = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2008.ConnectionString(_connectionString))
.Mappings(m => m.AutoMappings.Add(GetPersistenceModel()))
.BuildConfiguration();
```
And this is my call for `GetPersistenceModel()`
```
private static AutoPersistenceModel GetPersistenceModel()
{
var configuration = new CustomAutomappingConfiguration();
return AutoMap.AssemblyOf<User>(configuration)
.IgnoreBase(typeof(DomainEntity))
.UseOverridesFromAssemblyOf<UserMapOverride>()
.Conventions.Setup(c =>
{
c.Add<CustomHasManyConvention>();
});
}
```
My Custom config says to only map public autoproperties. This is so I can add other calculated properties to my domain entities. The user map override makes sure that the table name is `[User]`, because I was getting SQL errors using just `User`. The Custom HasMany convention sets cascade all-delete-orphan for all has many relationships.
This gets even better. This is the column iterator after creating the configuration object, but before creating the session factory object.

See? No `createdby_id` column in the list of mapped columns. This is the column iterator after creating the session factory object.

And now there's a `createdby_id` column. I am really lost now.
OK, I think I'm onto something now.
I got a new requirement from my customer last week. That requirement was that they wanted to know who had created an assignment. So it has a new property as follows.
```
public class Assignment : DomainEntity {
/* etc. */
public virtual User CreatedBy { get; set; }
/* etc. */
}
```
In my Assignment table, it now has a column like this.
```
[CreatedBy_id] INT NULL
```
And there's a FK to the User table on this new column.
If I comment out this property, everything works again. The SQL goes back to querying by `user_id`, exactly the way I would it expect it to be. Is there some type of override I can use to keep this from happening like this?
| Fluent NHibernate + AutoMappings: Mystery Column in Generated SQL | CC BY-SA 2.5 | 0 | 2010-10-03T04:11:40.773 | 2010-10-03T17:31:43.373 | 2010-10-03T16:24:38.110 | 5,834 | 5,834 | [
"fluent-nhibernate",
"automapping"
] |
3,848,867 | 1 | null | null | 3 | 1,080 | Given this markup:
```
<ul class="grafiek">
<li class="first-child">item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li>item</li>
<li class="last-child">item</li>
</ul>
```
How do I make it appear, cross-browser, like so:

In other words: the last item (with the fake pseudo-class `last-child`) should always stretch to accomodate the cumulative total width of the previous, arbitrary amounts (within reason of course), of `<li>`'s
This is what I have so far:
```
ul.grafiek {
float: left;
}
ul.grafiek li {
float: left;
display: block;
margin-left: 6px;
width: 56px;
height: 66px;
padding: 12px 0;
color: #fff;
text-align: center;
font-size: 11px;
line-height: 1;
background-color: #c5015a;
}
ul.grafiek li.first-child {
margin-left: 0;
}
ul.grafiek li.last-child {
clear: both;
margin: 10px 0 0 0;
width: 100%;
height: 23px;
padding: 0;
line-height: 23px;
background-color: #0a2d7f;
}
```
IE6 stretches the last `<li>` to the total width of the `<ul>`'s parent. IE7 doesn't stretch it at all. How do I make it work in these two browsers also?
PS.: Firefox, Chrome and Opera work a expected.
| IE6, IE7: stretch last li to cumulative width of previous li's | CC BY-SA 2.5 | 0 | 2010-10-03T06:41:52.037 | 2014-01-14T07:32:02.663 | 2014-01-14T07:32:02.663 | 881,229 | 165,154 | [
"css",
"list",
"layout",
"internet-explorer-7",
"internet-explorer-6"
] |
3,849,025 | 1 | 3,849,144 | null | 1 | 5,302 | i've developed a simple application (`.dll`) in `LABVIEW` and i implorted that dll to a C# windows application(`Winforms`) . Like
```
[DllImport(@".\sample.dll")]
public static extern void MyFunc(char[] a, StringBuilder b ,Int32 c);
```
so when i call the function `MyFunc` a window will be popped up( the `Lab View` window( `Front panel` of my labview application

i need to get the window name (`ExpectedFuncName`) in my C# application. i.e i need to get the name of the external window which is opend by my C# application. Can we use `FileVersionInfo` or `assembly loader` to get the name?
Is there any idea to do this?
Thanks in advance.
| How to get the name of an External window in C# Application? | CC BY-SA 2.5 | 0 | 2010-10-03T07:54:48.417 | 2010-10-05T19:29:33.780 | 2010-10-03T08:25:35.440 | 336,940 | 336,940 | [
"c#",
"labview"
] |
3,849,307 | 1 | 3,909,338 | null | 4 | 8,200 | I want to do automatic installation by AutoIt.
I cant activate and choose elements menu on the "select features" step.
I can choose any element in the "tree". For it I use the function
```
ControlTreeView($windowId, "", $h_tree, "Select", "#2")
```
How to activate and choose the elements menu in ControlTreeView?

| AutoIt: Activate and choose elements context menu in ControlTreeView | CC BY-SA 4.0 | 0 | 2010-10-03T09:59:29.677 | 2018-11-18T10:15:11.800 | 2018-11-18T10:15:11.800 | 1,033,581 | 428,861 | [
"autoit"
] |
3,849,484 | 1 | null | null | 0 | 178 | The web site was built on asp.net platform. Ajax enabled. It works very well on
ie or chrome, but it does not work on mozilla...?
You see arrows work great but the numbers does not appear?
how can i fix..
[http://dexiab-2.hosting.parking.ru//Default.aspx#world](http://dexiab-2.hosting.parking.ru//Default.aspx#world) the link to see the detail..

| ajax or html error on mozilla? | CC BY-SA 2.5 | null | 2010-10-03T11:02:01.703 | 2011-03-10T17:12:01.020 | 2011-03-10T17:12:01.020 | 352,765 | 173,718 | [
"c#",
"asp.net",
"ajax",
"firefox",
"mozilla"
] |
3,849,530 | 1 | 3,855,767 | null | 4 | 2,841 | I have a custom DefaultMutableTreeNode class that is designed to support robust connections between many types of data attributes (for me those attributes could be strings, user-defined tags, or timestamps).
As I aggregate data, I'd like to give the user a live preview of the stored data we've seen so far. For efficiency reasons, I'd like to only keep one copy of a particular attribute, that may have many connections to other attributes.
Example: The user-defined tag "LOL" occurs at five different times (represented by TimeStamps). So my JTree (the class that is displaying this information) will have five parent nodes (one for each time that tag occured). Those parent nodes should ALL SHARE ONE INSTANCE of the DefaultMutableTreeNode defined for the "LOL" tag.
Unfortunately, using the add(MutableTreeNode newChild) REMOVES newChild from WHATEVER the current parent node is. That's really too bad, since I want ALL of the parent nodes to have THE SAME child node.
Here is a picture of DOING IT WRONG :

How can I accomplish this easily in Java?
I've been looking at the code for DefaultMutableTreeNode.add()... and I'm surprised it works the way it does (comments are mine):
```
public void add(MutableTreeNode child)
{
if (! allowsChildren)
throw new IllegalStateException();
if (child == null)
throw new IllegalArgumentException();
if (isNodeAncestor(child))
throw new IllegalArgumentException("Cannot add ancestor node.");
// one of these two lines contains the magic that prevents a single "pointer" from being
// a child within MANY DefaultMutableTreeNode Vector<MutableTreeNode> children arrays...
children.add(child); // just adds a pointer to the child to the Vector array?
child.setParent(this); // this just sets the parent for this particular instance
}
```
| Sharing children among parents in a JTree | CC BY-SA 2.5 | 0 | 2010-10-03T11:21:30.530 | 2012-05-10T08:37:35.403 | 2010-10-03T13:44:42.447 | 359,172 | 359,172 | [
"java",
"swing",
"jtree"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.