Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,547,807 | 1 | 6,548,063 | null | 0 | 127 |
I want to Align the tableviewcell content like the below screenshot

but my alignment is like below only..

please any one help me to do..



|
TableViewCell Alignment Issue
|
CC BY-SA 3.0
| 0 |
2011-07-01T12:14:09.880
|
2011-07-01T14:24:19.137
|
2011-07-01T14:24:19.137
| 756,857 | 756,857 |
[
"iphone",
"uitableview"
] |
6,547,886 | 1 | 6,547,947 | null | 2 | 927 |
I would like to divide my current view into 4 areas (not divide the screen into 4, but divide the view) like following:
I would like to have the following sized layout for the view:

That's divided into of the view for each.
vertically, the upper area has view height and lower two areas holds view height.
I do by:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/top_area"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<LinearLayout
android:id="@+id/top_left_area"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/content_blue_bg"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="TOP LEFT"/>
</LinearLayout>
<LinearLayout
android:id="@+id/top_right_area"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/content_blue_bg"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="TOP RIGHT"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/bottom_area"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:orientation="horizontal"
>
<LinearLayout
android:id="@+id/bottom_left_area"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="BOTTOM LEFT"/>
</LinearLayout>
<LinearLayout
android:id="@+id/bottom_right_area"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/content_blue_bg"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="BOTTOM RIGHT"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
```
But how can I have the 1/3 view height for the uper areas and 2/3 view height for the lower areas?
|
How to implement this layout?
|
CC BY-SA 3.0
| null |
2011-07-01T12:22:36.987
|
2011-07-03T19:41:34.097
|
2011-07-03T19:41:34.097
| 4,596 | 740,018 |
[
"android",
"android-layout"
] |
6,547,924 | 1 | null | null | 0 | 4,237 |
Is there a way to hide the checkbox icon for an ListItem and just display the value-text.
Like Below - Checkbox for items is hidden.
I could figure out that I could disable (grey-out) or completely hide (invisible) a list item but not just hide the checkbox icon (square)

|
Hide Checkbox Icon for a ListItem in checkboxlist
|
CC BY-SA 3.0
| null |
2011-07-01T12:26:17.610
|
2016-12-20T22:59:55.850
| null | null | 789,170 |
[
"asp.net",
"styling",
"checkboxlist",
"listitem"
] |
6,547,927 | 1 | 12,472,845 | null | 0 | 1,906 |
Whenever Skype is in , the `TConversationWindow`'s become children of the `tSkMainForm` Window.
I am having problems finding out which `TConversationWindow` is active - however it's not like an MDI interface - only `TConversationWindow` is visible, like if it was a .
When I do `GetForegroundWindow`, Skype's MainForm handle is returned (`tSkMainForm`). Is there any way that I can get the foreground `TConversationWindow` within Skype?
[This question](https://stackoverflow.com/questions/6541629/detecting-whether-skype-is-in-compact-view-or-default-view) of mine has screenshots of Skype's Default View, if you need it. :)
: Here is a screenshot of the Winspector Hierachy:

: I tried going thru the windows like this:
```
procedure TForm1.Button1Click(Sender: TObject);
function GetClassName(Handle: HWND): String;
var
Buffer: array[0..MAX_PATH] of Char;
begin
Windows.GetClassName(Handle, @Buffer, MAX_PATH);
Result := String(Buffer);
end;
Var
Wnd: HWND;
SkypeWnd: HWND;
begin
SkypeWnd := FindWindow('tSkMainForm',nil);
Wnd := GetTopWindow(SkypeWnd);
while (GetClassName(Wnd) <> 'TConversationForm') and (Wnd <> 0) and (not IsWindowVisible(Wnd)) do
begin
Wnd := GetNextWindow(Wnd,GW_HWNDNEXT);
end;
Label1.Caption := GetClassName(Wnd)+' - '+GetHandleText(wnd);
end;
```
The above is supposed to find the visible window, however when I debug it, it never enters the Begin End within the While loop, and Label1 displays "TChromeMenu - ChromeToolbar". When I remove the IsWindowVisible check, it atleast finds a TConversationForm. What am I doing wrong?
: By placing the IsWindowVisible and getClassName check inside the loop, and break when true, I managed to do it. :)
|
Get foreground CHILD window
|
CC BY-SA 3.0
| null |
2011-07-01T12:26:34.083
|
2012-09-18T08:09:40.810
|
2017-05-23T12:01:09.963
| -1 | 561,545 |
[
"delphi",
"skype",
"foreground",
"window-handles"
] |
6,548,249 | 1 | null | null | 0 | 5,942 |

I bind ProductsPhoto to children using bindModel method:
```
$this->Category->bindModel(array
('hasMany' => array(
'ProductsPhoto' => array...
```
How can I bind ProductsPhoto to every product item?
Or maybe any other solution suggestion?
|
Bindmodel to binded model? Cakephp
|
CC BY-SA 3.0
| null |
2011-07-01T12:57:27.027
|
2011-07-05T12:58:32.747
| null | null | 217,681 |
[
"cakephp",
"cakephp-1.3"
] |
6,548,207 | 1 | 6,548,311 | null | 3 | 8,132 |
I have got 9 condition for my if else statement , I was thinking is there any other alternative solution to make the code clean and short. All the 9 condition perform different calculations for asp.net mvc view . I have included the code and an image which shows the view of some conditions, hope it make sense , I was looking for any better and robust solution for this scenario.. thanks
```
//Condition 1
//when no selection is made for the 2 dropdownlist (garages & helmets)
if (formvalues["helmets"] == "" && formvalues["garages"] == "")
{
ViewBag.hideHelmet = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.hideGarages = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.SelectedHelmets = 1;//
ViewBag.SelectedGarages = 1;//
ViewBag.TotalHelmets = 1;
ViewBag.TotalGarages = 1;
ViewBag.TotalAmount = 1;
ViewBag.TotalAmount = trackEventCost.UnitCost;
}
//Condition 2
//When garages are selected from dropdown & helmets are not selected
else if ((formvalues["helmets"] == "") && (Convert.ToInt32(formvalues["garages"]) > 0))
{
ViewBag.hideHelmet = 0;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.hideGarages = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.SelectedHelmets = 1;
ViewBag.SelectedGarages = Convert.ToInt32(formvalues["garages"]);
ViewBag.TotalHelmets = 1;
ViewBag.TotalGarages = Convert.ToInt32(formvalues["garages"]) * getGarages.UnitCost;
ViewBag.TotalAmount = ViewBag.TotalGarages + trackEventCost.UnitCost;
}
//Condition 3
//When helmets are selected from dropdown & garages are not selected
else if ((formvalues["garages"] == "") && (Convert.ToInt32(formvalues["helmets"]) > 0))
{
ViewBag.hideHelmet = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.hideGarages = 0;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.SelectedGarages = 1;
ViewBag.SelectedHelmets = Convert.ToInt32(formvalues["helmets"]);
ViewBag.TotalGarages = 1;
ViewBag.TotalHelmets = Convert.ToInt32(formvalues["helmets"]) * getGarages.UnitCost;
ViewBag.TotalAmount = ViewBag.TotalHelmets + trackEventCost.UnitCost;
}
//Condition 4
//When garages are not selected from dropdown & helmets dropdownlist is hidden on the view due to unavailablity of helmets for that event
else if (formvalues["garages"] == "" && (formvalues["helmets"] == null))
{
ViewBag.hideHelmet = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.hideGarages = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.TotalAmount = trackEventCost.UnitCost;
}
//Condition 5
//When helmets are not selected from dropdown & garages dropdownlist is hidden on the view due to unavailablity of garages for that event
else if ((formvalues["garages"] == null) && (formvalues["helmets"] == ""))
{
ViewBag.hideHelmet = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.hideGarages = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.SelectedHelmets = 1;
ViewBag.TotalAmount = trackEventCost.UnitCost;
}
//Condition 6
//When both helmets and garages dropdown list is not displayed on the view as they are not present in the database
else if (formvalues["helmets"] == null && formvalues["garages"] == null)
{
ViewBag.SelectedHelmets = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.SelectedGarages = 1;//for jquery, This value is passed to jquery script which then decides which field to hide/show
ViewBag.TotalHelmets = 1;
ViewBag.TotalGarages = 1;
ViewBag.hideHelmet = 1;
ViewBag.hideGarages = 1;
ViewBag.TotalAmount = trackEventCost.UnitCost;
}
//Condition 7
//When garages are selected from dropdown & helmets dropdownlist is hidden on the view due to unavailablity of helmets for that event
else if (formvalues["helmets"] == null && Convert.ToInt32(formvalues["garages"]) > 0)
{
ViewBag.hideHelmet = 0; //for jquery , This value is passed to jquery script which then decides which field to hide/show
ViewBag.hideGarages = 1; //for jquery , This value is passed to jquery script which then decides which field to hide/show
ViewBag.SelectedGarages = Convert.ToInt32(formvalues["garages"]);
ViewBag.TotalGarages = Convert.ToInt32(formvalues["garages"]) * getGarages.UnitCost;
ViewBag.TotalAmount = ViewBag.TotalGarages + trackEventCost.UnitCost;
}
//Condition 8
//When helmets are selected from dropdown & garages dropdownlist is hidden on the view due to unavailablity of garages for that event
else if (Convert.ToInt32(formvalues["helmets"]) > 0 && formvalues["garages"] == null)
{
ViewBag.hideHelmet = 1; //for jquery , This value is passed to jquery script which then decides which field to hide/show
ViewBag.hideGarages = 0; //for jquery , This value is passed to jquery script which then decides which field to hide/show
ViewBag.TotalHelmets = Convert.ToInt32(formvalues["helmets"]) * getHelmets.UnitCost;
ViewBag.TotalAmount = ViewBag.TotalHelmets + trackEventCost.UnitCost;
}
//Condition 9
//When garages and helmet both dropdown are selected
else
{
ViewBag.hideHelmet = 0;//for jquery , This value is passed to jquery script which then decides which field to hide/show
ViewBag.hideGarages = 0;//for jquery , This value is passed to jquery script which then decides which field to hide/show
ViewBag.SelectedHelmets = Convert.ToInt32(formvalues["helmets"]);
ViewBag.SelectedGarages = Convert.ToInt32(formvalues["garages"]);
ViewBag.TotalHelmets = Convert.ToInt32(formvalues["helmets"]) * getHelmets.UnitCost;
ViewBag.TotalGarages = Convert.ToInt32(formvalues["garages"]) * getGarages.UnitCost;
ViewBag.TotalAmount = ViewBag.TotalHelmets + ViewBag.TotalGarages + trackEventCost.UnitCost;
}
```

|
Avoiding too many if else, else if statement for multiple(9) conditions
|
CC BY-SA 3.0
| 0 |
2011-07-01T12:53:10.967
|
2014-07-01T18:02:16.840
|
2011-07-01T13:02:38.497
| 264,697 | 638,007 |
[
"c#",
"asp.net-mvc-2",
"c#-4.0",
"if-statement"
] |
6,548,527 | 1 | null | null | 1 | 100 |
could some one suggest me how to implement the layout like following:

That's multiple lines of texts surrounding a button. Probably a linear layout?
|
layout with text surrounding a button
|
CC BY-SA 3.0
| 0 |
2011-07-01T13:24:01.623
|
2011-07-03T19:42:02.837
|
2011-07-03T19:42:02.837
| 4,596 | 740,018 |
[
"android",
"android-layout"
] |
6,548,536 | 1 | 6,548,842 | null | 0 | 4,225 |
There is a command property in wpf that I am trying to execute on an image click. I am basically changing the style of a scroller. I downloaded sample styles from [here](http://www.eggheadcafe.com/tutorials/aspnet/f51ddf8c-5227-4f1b-a5df-ec3d1b3439ca/styling-the-wpf-scrollviewer.aspx) and after changing my style I end up with something like:

ok so let me explain. on the top there is an arrow pointing upwards on top of an image. I plan to get rid of the top arrow but the reason why I need it is because in the xaml it has a command that when clicked it scrolls upward. the code for that up arrow is:
```
<RepeatButton
Style="{StaticResource ScrollBarButton}"
Margin="0,15,0,0"
VerticalAlignment="Top"
Background="#FFFFFFFF"
Grid.Row="0"
Command="{x:Static ScrollBar.LineUpCommand}" <!-- This is the line that enables to scroll upwards when clicked -->
theme:ScrollChrome.ScrollGlyph="UpArrow"
RenderTransformOrigin="0.5, 0.5">
<RepeatButton.RenderTransform>
<ScaleTransform ScaleX="4" ScaleY="2"/>
</RepeatButton.RenderTransform>
</RepeatButton>
```
In short I am interested in the following property:
```
Command="{x:Static ScrollBar.LineUpCommand}"
```
It would be nice if I could get rid of the top arrow and place that command in the image instead. The problem is that the image control does not have the property command. I know I can make the alpha of the top arrow equal to 0 and make it appear like there is only an image but I am curios of understanding how does this work and moreover I would like to add more functionality such as changing the image appearance on mouse enter etc..
|
Execute command on mouse click on image control wpf
|
CC BY-SA 3.0
| null |
2011-07-01T13:24:37.817
|
2011-07-01T15:59:51.290
| null | null | 637,142 |
[
"wpf",
"xaml",
"resources",
"triggers",
"styles"
] |
6,548,548 | 1 | 6,548,565 | null | 6 | 3,469 |
In the following program `abort` method is called even when I have got the applicable catch statement. What is the reason?
```
#include <iostream>
#include <string>
using namespace std;
int main() {
try {
cout << "inside try\n";
throw "Text";
}
catch (string x) {
cout << "in catch" << x << endl;
}
cout << "Done with try-catch\n";
}
```
When I run the program I only get the first statement `inside try` displayed and then I get this error:

Why does `abort` get called even when I am handling `string` exception?
|
why is abort method called?
|
CC BY-SA 3.0
| null |
2011-07-01T13:25:33.797
|
2011-07-04T13:41:18.863
|
2011-07-01T13:28:20.780
| 560,648 | 648,138 |
[
"c++",
"exception"
] |
6,548,611 | 1 | 6,856,889 | null | 2 | 1,577 |
I am programmatically generating Office Documents (in my case Word or Excel 2007) using automation in VBA (in this example MS Access 2007, but that should not change much) under Windows 7. This works fine.
Since the documents are automatically generated I don't want them to show up in the recent lists. For recent list in Word I can just add "AddToRecentFiles:=False" when saving the document (see example) or I could delete the entries afterwards through "Application.RecentFiles ..."
My code
```
Set objWord = CreateObject("Word.Application")
Set curDocument = objWord.Documents.Add
curDocument.SaveAs FileName:=Folder + "text.doc", FileFormat:=wdFormatDocument,
AddToRecentFiles:=False
curDocument.Close
```
I could not find a way to disable the (i.e. jump list with recent items in the taskbar for Word or last used folders in Explorer and recent list for Word in Start menu).

I am aware these lists are stored under %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations and I have found out that to manipulate Jumplist there is the "WindowsAPICodePack" (that I can use from VBA, right?).
To add an item the the recent list I can use the old API SHAddToRecentDocs from the "shell32.dll" library but deleting with this API function does not work anymore as it only seems to affect the entries in the old "/recent" folder (and even deletes everything what is not my intention). Presentations on the Windows 7 Taskbar API too only seem to mention how to items but not how to avoid doing so or to delete specific entries.
Am I missing something or is there no -- easy and ideally usable from within VBA -- way to manipulate (or temporerally disable) the recording Windows 7 does?
Kind regards
Andreas
|
Disable jumplist entries in Windows 7 for VBA-generated Office documents
|
CC BY-SA 3.0
| null |
2011-07-01T13:30:27.650
|
2011-09-05T06:17:56.490
|
2011-07-05T05:53:59.713
| 487,340 | 487,340 |
[
"vba",
"taskbar",
"jump-list",
"recent-file-list"
] |
6,548,760 | 1 | 6,549,171 | null | 0 | 386 |
I have an image resource created for png transaprency support with the following:
```
$image = imagecreatetruecolor($new_width, $new_height);
imagealphablending($image, false);
imagesavealpha($image, true);
$new_image_bg = imagecolorallocatealpha($image, 255, 255, 255, 127);
imagefill($image, 0, 0, $new_image_bg);
```
I'm then adding overlapping layers of text to this image resource with `imagettftext()`, however this overwrites the current area of the image. I'm trying to merge this into the existing image resource maintaining the transparency of the text string. Below is an example of what I'm trying to avoid:

|
overlapping text strings created with imagettftext
|
CC BY-SA 3.0
| null |
2011-07-01T13:43:19.043
|
2011-07-01T14:17:37.097
| null | null | 259,681 |
[
"php",
"imagettftext"
] |
6,548,824 | 1 | 6,549,242 | null | 1 | 840 |
I have just added the Google Tools for Mac OAuth classes to a project and get the following linker error
Any ideas what I need to do? It is an iPad app if that makes any difference.
Thanks for your help :-)
|
Mach-O Linker (Id) Error
|
CC BY-SA 3.0
| null |
2011-07-01T13:48:15.150
|
2011-07-01T18:04:11.167
|
2020-06-20T09:12:55.060
| -1 | 457,103 |
[
"iphone",
"objective-c",
"ios",
"ipad"
] |
6,549,030 | 1 | null | null | 4 | 753 |
I am working with chrome extension.
Here in button click i required to open a menu.
When toolbar loaded in memory it make a space for menu item I want to remove it in page load.


|
How to control frame height and width in chrome extension?
|
CC BY-SA 3.0
| null |
2011-07-01T14:05:58.047
|
2011-07-01T15:21:38.990
| null | null | 229,555 |
[
"jquery",
"google-chrome-extension",
"google-chrome-frame"
] |
6,549,157 | 1 | 6,549,271 | null | 0 | 192 |
I made a App in Google AppInventor.
Afterwards i clicked on "Package this App" and under that i clicked "Show the Barcode". A window showing a small scrappy image shows-up. After some googling, i learnt that this is a 2d code for my app URL.
But, What i dont understand is the meaning of line above the barcode image.:
.
Does this mean, no one else can use this barcode and install the app??
Here is the Image ::

|
AppInventor Barcode :: What does "this barcode will only work for pankajupadhyay05" means?
|
CC BY-SA 3.0
| null |
2011-07-01T14:16:27.970
|
2011-07-01T14:39:54.123
|
2011-07-01T14:39:54.123
| 570,928 | 570,928 |
[
"android",
"app-inventor"
] |
6,549,301 | 1 | 6,641,673 | null | 7 | 5,444 |
I'm trying to toggle a `SeekBar` between the the two modes to display the state of streaming media.
I've established that the correct graphics show when defining the `android:indeterminate` tag in XML:
```
<SeekBar
android:id="@+id/seekBar1"
android:indeterminate="false"
android:progressDrawable="@android:drawable/progress_horizontal"
android:indeterminateDrawable="@android:drawable/progress_indeterminate_horizontal"
android:indeterminateBehavior="cycle"
android:indeterminateOnly="false"
android:progress="33"
android:secondaryProgress="66"
android:layout_height="wrap_content"
android:layout_width="match_parent"></SeekBar>
```

The trouble is, when trying to switch by calling `setIndeterminate(true)`, the drawables don't appear to change properly. In the case of indeterminate->determinate, the animation stops, and from determinate->indeterminate, nothing happens.
What am I doing wrong?
|
Horizontal ProgressBar: Toggling between determinate and indeterminate
|
CC BY-SA 3.0
| null |
2011-07-01T14:29:44.543
|
2014-02-19T23:40:22.107
|
2011-07-04T15:09:29.870
| null | null |
[
"android",
"progress-bar",
"toggle",
"seekbar"
] |
6,549,375 | 1 | 6,549,509 | null | 0 | 74 |
Is there any way to make it happen that when is selected it also selects it's subs 2a and

|
Manipulate select multiple
|
CC BY-SA 3.0
| null |
2011-07-01T14:35:53.290
|
2011-07-01T14:48:25.360
|
2011-07-01T14:48:25.360
| 764,285 | 754,773 |
[
"php",
"html"
] |
6,549,497 | 1 | 6,557,839 | null | 0 | 81 |
Is there any way to get the details of the commit? At the moment when I go to changes I can see the following:

but I'd be great to be able to see the commit details (e.g redmine does it )
.
I use Mercurial.
|
Detailed changes view in Hudson CI
|
CC BY-SA 3.0
| null |
2011-07-01T14:45:48.390
|
2014-10-12T11:40:24.793
|
2014-10-12T11:40:24.793
| 321,731 | 195,108 |
[
"mercurial",
"hudson"
] |
6,549,538 | 1 | 6,557,137 | null | 3 | 8,275 |
I have a GUI (using GUIDE) in Matlab, this is how it looks:

I want to rotate the image using slider and to show the change in real time.
I use axes to display the image.
how can I do this?
I'm building OCR application. this is how the plate looks when I'm rotate it, the numbers are totally deformed.

thanks.
|
using slider to rotate image in Matlab
|
CC BY-SA 3.0
| null |
2011-07-01T14:48:22.727
|
2011-07-02T15:33:44.183
|
2011-07-02T15:01:02.927
| 556,011 | 556,011 |
[
"matlab",
"slider",
"image-rotation"
] |
6,549,622 | 1 | 6,550,683 | null | 15 | 5,510 |
The color schemes in emacs shell mode appear as primary colors (high saturation) and look primitive, and some colors, for example, purple, do not appear:

I want to adjust the colors so that they use more intermediate colors and look more soft as in gnome-terminal:

How can I change the color schemes in shell mode? I couldn't find shell-mode related font assignments in emacs, and that is probably because the color is given by the shell and is different from other font assignmets in emacs.
|
Adjusting shell mode color schemes
|
CC BY-SA 3.0
| 0 |
2011-07-01T14:56:24.300
|
2015-06-02T22:41:38.383
|
2015-06-02T22:41:38.383
| 823 | 314,166 |
[
"shell",
"emacs",
"colors",
"themes"
] |
6,549,821 | 1 | 6,549,901 | null | 95 | 78,286 |
I am writing the Javadoc for a class that contains its own enums. Is there a way to generate Javadoc for the individual enums? For example, right now I have something like this:
```
/**
* This documents "HairColor"
*/
private static enum HairColor { BLACK, BLONDE, BROWN, OTHER, RED };
```
However, this only documents all of the enums as a whole:

Is there any way to document each of the `HairColor` values individually? Without moving the enum into its own class or changing it from an enum?
|
How to Javadoc a Class's Individual Enums
|
CC BY-SA 4.0
| 0 |
2011-07-01T15:13:03.977
|
2022-07-25T11:40:13.380
|
2021-02-20T08:23:10.493
| 1,009,479 | 815,749 |
[
"java",
"enums",
"javadoc"
] |
6,550,046 | 1 | 6,743,941 | null | 24 | 10,411 |
I'm using the [mvc-mini-profiler](http://code.google.com/p/mvc-mini-profiler/) in my project built with ASP.Net MVC 3 and Entity Framework code-first.
Everything works great until I attempt to add database profiling by wrapping the connection in the `ProfiledDbConnection` as described in the documentation. Since I'm using a DbContext, the way I am attempting to provide the connection is through the constructor using a static factory method:
```
public class MyDbContext : DbContext
{
public MyDbContext() : base(GetProfilerConnection(), true)
{ }
private static DbConnection GetProfilerConnection()
{
// Code below errors
//return ProfiledDbConnection.Get(new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionName"].ConnectionString));
// Code below works fine...
return new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionName"].ConnectionString);
}
//...
}
```
When using the `ProfiledDbConnection`, I get the following error:
`ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.`
Stack Trace:
```
[ArgumentException: The connection is not of type 'System.Data.SqlClient.SqlConnection'.]
System.Data.SqlClient.SqlProviderUtilities.GetRequiredSqlConnection(DbConnection connection) +10486148
System.Data.SqlClient.SqlProviderServices.GetDbProviderManifestToken(DbConnection connection) +77
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +44
[ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +11092901
System.Data.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection) +11092745
System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) +221
System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) +61
System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) +1203482
System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +492
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +26
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +89
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +44
System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +135
```
I have stepped through and the type returned by `ProfiledDbConnection.Get` is of type `ProfiledDbConnection` (Even if the current MiniProfiler is null).
The `MiniProfiler.Start()` method is called within the Global `Application_BeginRequest()` method before the `DbContext` is instantiated. I am also calling the Start method for every request regardless but calling stop if the user is not in the correct role:
```
protected void Application_BeginRequest()
{
// We don't know who the user is at this stage so need to start for everyone
MiniProfiler.Start();
}
protected void Application_AuthorizeRequest(Object sender, EventArgs e)
{
// Now stop the profiler if the user is not a developer
if (!AuthorisationHelper.IsDeveloper())
{
MvcMiniProfiler.MiniProfiler.Stop(discardResults: true);
}
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}
```
I'm not sure if this affects things but I'm also using StructureMap as IoC for the `DbContext` using the following initialiser:
```
For<MyDbContext>().Singleton().HybridHttpOrThreadLocalScoped();
```
I understand that there is a similar question on here with a good explanation of what's happening for that user, however it doesn't seem to solve my problem.
For clarity. I am attempting to pass the connection as `ProfiledDbConnection` in order to profile the generated sql from Entity Framework Code First.

The Entity Framework is expecting a connection with type `SqlConnection` which of course this isn't.
Here is an example of my connection string (notice the providerName)
```
<add name="MyDbContext" connectionString="Server=.\SQLEXPRESS; Database=MyDatabase;Trusted_Connection=true;MultipleActiveResultSets=true" providerName="System.Data.SqlClient" />
```
I attempted to create my own version of the `ProfiledDbConnection` inheriting from `SqlConnection` but it is a sealed class.
If there is some way of telling Entity Framework about the custom connection type then perhaps this would work. I tried setting the `providerName` in the connection string to `MvcMiniProfiler.Data.ProfiledDbConnection` but that didn't work.
So. Perhaps an evolution of the question would be: How can you pass a custom connection type to Entity Framework Code First?
|
Using mvc-mini-profiler database profiling with Entity Framework Code First
|
CC BY-SA 3.0
| 0 |
2011-07-01T15:35:34.877
|
2013-07-10T04:14:08.063
|
2011-07-13T07:51:25.613
| 194,626 | 194,626 |
[
"ef-code-first",
"entity-framework-ctp5",
"mvc-mini-profiler"
] |
6,550,223 | 1 | 6,550,471 | null | 0 | 2,256 |
Hi I need some help with this. The design calls for a vertical line separator in between each menu item, but only when they are not active. I need to remove the left border from the a for the #current a (already done) as well as the next a. Thoughts?

```
#topmenu ul {margin: 0 0 7px 0; width: 100%;padding: 0;}
#topmenu li {list-style: none;display: inline;margin: 0 0px;padding:15px 10px 15px 0px;
line-height:15px;text-align:center;}
#topmenu a:link, #topmenu a {color: #ffffff;text-decoration: none;margin: 0px 0px 0px 0px;
font-weight:normal;padding: 0px 5px 0px 14px;
border-left-color:#fff; border-left-style:solid;border-left-width:1px;}
#topmenu ul li.item82 a, #topmenu #current {border:none;}
#topmenu #current:after {border:none;}
#topmenu a:hover{color: #EFEFEF;}
#topmenu a:active{color: #EFEFEF;}
#topmenu #current{color: #EFEFEF;background-color:#19bcb9;-moz-border-radius-topright:4px;
-moz-border-radius-topleft:4px;
border-top-left-radius: 4px;border-top-right-radius: 4px;
-webkit-border-top-right-radius:4px;-webkit-border-top-left-radius:4px;}
<ul class="menu">
<li class="item82"><a href="/about.html"><span>About Us</span></a></li>
<li class="item62"><a href="/our-philosophy.html"><span>Our Philosophy</span></a></li>
<li class="active item54" id="current"><a href="/services.html"><span>Services</span></a></li>
<li class="item74"><a href="/soutions.html"><span>Soutions</span></a></li>
<li class="item68"><a href="/workshops.html"><span>Workshops</span></a></li>
<li class="item75"><a href="/whats-new.html"><span>What's New</span></a></li>
</ul>
```
|
css menu :after selector?
|
CC BY-SA 3.0
| 0 |
2011-07-01T15:52:13.593
|
2011-07-02T01:07:57.900
|
2011-07-02T01:07:57.900
| 106,224 | 592,659 |
[
"css",
"css-selectors"
] |
6,550,373 | 1 | 6,551,549 | null | 3 | 1,401 |
Why does the cells left and right get filled with empty space?
The empty space is above the left and right table-cell.
[http://jsfiddle.net/Tim86/NU9sA/](http://jsfiddle.net/Tim86/NU9sA/)
It has something to do with the `#middlebuttons{display:block;}`.
EDIT: I am using Firefox 5.
EDIT2: Pictues
Wrong

Right

|
Why empty space in CSS table-cells?
|
CC BY-SA 3.0
| 0 |
2011-07-01T16:03:04.853
|
2011-07-01T17:58:50.460
|
2011-07-01T17:35:33.650
| 505,701 | 505,701 |
[
"css"
] |
6,550,839 | 1 | 6,550,895 | null | 1 | 575 |
I have this help page I want to add to my application, but I'm not sure of how to format it. At the moment it's just an image in a scrollview, but surely there's a better way?

|
how can I add this formatted text for a help page in my ios app
|
CC BY-SA 3.0
| null |
2011-07-01T16:46:16.643
|
2011-07-01T18:13:29.520
| null | null | 126,597 |
[
"ios",
"cocoa-touch",
"uikit"
] |
6,551,147 | 1 | 6,551,736 | null | 5 | 7,596 |
How can I add text to points rendered with geom_jittered to label them? geom_text will not work because I don't know the coordinates of the jittered dots. Could you capture the position of the jittered points so I can pass to geom_text?
My practical usage would be to plot a boxplot with the geom_jitter over it to show the data distribution and I would like to label the outliers dots or the ones that match certain condition (for example the lower 10% for the values used for color the plots).
One solution would be to capture the xy positions of the jittered plots and use it later in another layer, is that possible?
## [update]
From Joran answer, a solution would be to calculate the jittered values with the jitter function from the base package, add them to a data frame and use them with geom_point. For filtering he used ddply to have a filter column (a logic vector) and use it for subsetting the data in geom_text.
He asked for a minimal dataset. I just modified his example (a unique identifier in the label colum)
```
dat <- data.frame(x=rep(letters[1:3],times=100),y=runif(300),
lab=paste('id_',1:300,sep=''))
```
This is the result of joran example with my data and lowering the display of ids to the lowest 1%

And this is a modification of the code to have colors by another variable and displaying some values of this variable (the lowest 1% for each group):
```
library("ggplot2")
#Create some example data
dat <- data.frame(x=rep(letters[1:3],times=100),y=runif(300),
lab=paste('id_',1:300,sep=''),quality= rnorm(300))
#Create a copy of the data and a jittered version of the x variable
datJit <- dat
datJit$xj <- jitter(as.numeric(factor(dat$x)))
#Create an indicator variable that picks out those
# obs that are in lowest 1% by x
datJit <- ddply(datJit,.(x),.fun=function(g){
g$grp <- g$y <= quantile(g$y,0.01);
g$top_q <- g$qual <= quantile(g$qual,0.01);
g})
#Create a boxplot, overlay the jittered points and
# label the bottom 1% points
ggplot(dat,aes(x=x,y=y)) +
geom_boxplot() +
geom_point(data=datJit,aes(x=xj,colour=quality)) +
geom_text(data=subset(datJit,grp),aes(x=xj,label=lab)) +
geom_text(data=subset(datJit,top_q),aes(x=xj,label=sprintf("%0.2f",quality)))
```

|
adding text to ggplot geom_jitter points that match a condition
|
CC BY-SA 3.0
| 0 |
2011-07-01T17:16:52.120
|
2015-12-13T20:42:54.153
|
2011-07-04T21:51:55.920
| 317,773 | 427,129 |
[
"r",
"ggplot2",
"plyr"
] |
6,551,516 | 1 | 6,551,529 | null | 4 | 631 |

Well here we have two columns A and B. The thing is column A generally contains more content so its height is more (in this case 126px) and column B has less content so it remains shorter (here 94px). Now I want to make the height of B = A, considering that height of column A might change dynamically by AJAX but to keep pace with column A, height of column B must also change.
`<div id="A">filer text</div>` | `<div id="B">filler text2</div>`
Now may be by using jQuery or some js we can get the height of element with id #A and set it to #B but the problem lies when the content changes dynamically.
|
Dynamically change the height of an element to another
|
CC BY-SA 3.0
| 0 |
2011-07-01T17:55:39.527
|
2011-07-01T19:02:58.843
| null | null | 433,587 |
[
"javascript",
"jquery",
"html",
"css"
] |
6,551,713 | 1 | 6,552,761 | null | 3 | 719 |
While I was coding an algorithm of collision detection I have come up at this problem. It is something weird which is beyond my understanding.
that if in my algorithm, presented in function `tryMove()`, I add `potentialArea` to `moveLineArea` and I am doing detection of change in the `spaceTestArea` (which is created from the `moveLineArea`) after subtracting areas taken by all units, I have a collision with a unit that is not even close `x=280,y=120`, where moving unit is at `x=1880,y=120`, and it is moving to `x=1914,y=126`.
what might be the reason of this issue and what to do in order to avoid it in future.
I must say I have a temporary solution (`tryMove2()`) but please do not let it influence your thinking, i.e. I do not like this solution and I strongly believe that the first solution (`tryMove()`) should work and it must be me who forgot about something.
Please see below the code presenting the problem.
```
import java.awt.Point;
import java.awt.Polygon;
import java.awt.geom.Area;
import java.awt.geom.Ellipse2D;
import java.util.ArrayList;
import java.util.List;
/**
* Test showing some unexpected and weird behaviour of area subtraction.
* @author Konrad Borowiecki
*/
public class TestTryMove {
private static final List<Point> unitCenterPoints = new ArrayList<Point>();
static{
unitCenterPoints.add(new Point(1720, 120));
unitCenterPoints.add(new Point(1880, 120));
unitCenterPoints.add(new Point(1800, 200));
unitCenterPoints.add(new Point(1720, 280));
unitCenterPoints.add(new Point(1880, 280));
unitCenterPoints.add(new Point(120, 120));
unitCenterPoints.add(new Point(280, 120));
unitCenterPoints.add(new Point(200, 200));
unitCenterPoints.add(new Point(120, 280));
unitCenterPoints.add(new Point(280, 280));
unitCenterPoints.add(new Point(120, 1720));
unitCenterPoints.add(new Point(280, 1720));
unitCenterPoints.add(new Point(200, 1800));
unitCenterPoints.add(new Point(120, 1880));
unitCenterPoints.add(new Point(280, 1880));
}
public static void main(String[] args) {
int[] xpointsOK = new int[]{1876, 1884, 1918, 1910};//for Move OK
int[] ypointsOK = new int[]{139, 101, 108, 146};//for Move OK
Polygon lineOK = new Polygon(xpointsOK, ypointsOK, xpointsOK.length);
int[] xpointsFAIL = new int[]{1877, 1883, 1917, 1911};//for problem no move
int[] ypointsFAIL = new int[]{139, 101, 107, 145};//for problem no move
Polygon lineFAIL = new Polygon(xpointsFAIL, ypointsFAIL, xpointsFAIL.length);
Point endPointCPOK = new Point(1914, 127);//Move OK
Point endPointCPFAIL = new Point(1914, 126);//problem no move
//where in both cases it should be move OK
System.out.println("******TEST for method tryMove()******");
System.out.println("TEST 1: this will FAIL");
System.out.println("Result="+tryMove(endPointCPFAIL, lineFAIL));
System.out.println("\nTEST 2: this will be OK");
System.out.println("Result="+tryMove(endPointCPOK, lineOK));
System.out.println("******TEST for method tryMove2()******");
System.out.println("TEST 1: this will be OK");
System.out.println("Result="+tryMove2(endPointCPFAIL, lineFAIL));
System.out.println("\nTEST 2: this will be OK");
System.out.println("Result="+tryMove2(endPointCPOK, lineOK));
}
/**
* Tests if a unit represented by point of index 1 in the list of
* unitCenterPoints (i.e. [1880, 120]) can make a move to the given endPointCP.
* (Please notice we are ignoring this unit in the algorithm
* i.e. if(i != movingUnitIndexInTheArray)).
* @param endPointCP the point where the unit moves to.
* @param line the line of the move of the thickness equal to units width (mod=40),
* drawn between the current unit's center point and the endPointCP,
* represented as a polygon object.
* @return true if move possible; false otherwise.
*/
private static boolean tryMove(Point endPointCP, Polygon line){
Area potentialArea = getArea(endPointCP);
Area moveLineArea = new Area(line);
moveLineArea.add(potentialArea);
//this area is used for testing if nothing stays on the way of the move
Area spaceTestArea = new Area(moveLineArea);
//the index of the unit making the move in the unitCenterPoints list
int movingUnitIndexInTheArray = 1;
//we are subtracting from spaceTestArea all areas of units
for(int i = 0; i < unitCenterPoints.size(); i++)
if(i != movingUnitIndexInTheArray) {
Point p = unitCenterPoints.get(i);
Area uArea = getArea(p);
spaceTestArea.subtract(uArea);
//we have intersection then return false, we cannot make this move
if(spaceTestArea.isEmpty() || !spaceTestArea.equals(moveLineArea)) {
System.out.println("No move --- a unit is on the way. "
+ "Conflicting point is="+p +"; for i="+i);
return false;
}
}
System.out.println("Move OK.");
return true;
}
private static boolean tryMove2(Point endPointCP, Polygon line){
Area potentialArea = getArea(endPointCP);
Area moveLineArea = new Area(line);
//test if unit can move to the new position
Area potentialTestArea = new Area(potentialArea);
//this area is used for testing if nothing stays on the way of the move
Area spaceTestArea = new Area(moveLineArea);
//the index of the unit making the move in the unitCenterPoints list
int movingUnitIndexInTheArray = 1;
//we are subtracting from spaceTestArea all areas of units
for(int i = 0; i < unitCenterPoints.size(); i++)
if(i != movingUnitIndexInTheArray) {
Point p = unitCenterPoints.get(i);
Area uArea = getArea(p);
spaceTestArea.subtract(uArea);
potentialTestArea.subtract(uArea);
//we have intersection then return false, we cannot make this move
if(spaceTestArea.isEmpty() || !spaceTestArea.equals(moveLineArea)
|| potentialTestArea.isEmpty() || !potentialTestArea.equals(potentialArea)) {
System.out.println("No move --- a unit is on the way. "
+ "Conflicting point is="+p +"; for i="+i);
return false;
}
}
System.out.println("Move OK.");
return true;
}
/**
* Gets the area taken by a unit given the unit's center point.
* @param p the center point of a unit.
* @return circle area.
*/
private static Area getArea(Point p) {
int mod = 40;//this is width and height of a unit
Ellipse2D circle = new Ellipse2D.Double(p.x - mod / 2, p.y - mod / 2, mod, mod);
return new Area(circle);
}
}
```
And this is the output it is producing:
```
******TEST for method tryMove()******
TEST 1: this will FAIL
No move --- a unit is on the way. Conflicting point is=java.awt.Point[x=280,y=120]; for i=6; where moving unit point is=java.awt.Point[x=1880,y=120]; the unit is moving to=java.awt.Point[x=1914,y=126]
Result=false
TEST 2: this will be OK
Move OK.
Result=true
******TEST for method tryMove2()******
TEST 1: this will be OK
Move OK.
Result=true
TEST 2: this will be OK
Move OK.
Result=true
```
In order for you to see the problem better I have two images presenting it for two endPoints, first `1914, 126` when the method fails, and second `1914, 127` when it is OK.


If more description is needed I will answer ASAP. Thank you all in advance.
As suggested by @trashgod I did tried and implemented a solution which uses `intersect()` method. I do not like that for every test you must create a new object. Can you suggest some optimization for this algorithm.
```
private static boolean tryMove3(Point endPointCP, Polygon line){
Area potentialArea = getArea(endPointCP);
Area moveLineArea = new Area(line);
moveLineArea.add(potentialArea);
//this area is used for testing if nothing stays on the way of the move
//the index of the unit making the move in the unitCenterPoints list
int movingUnitIndexInTheArray = 1;
//we are subtracting from spaceTestArea all areas of units
for(int i = 0; i < unitCenterPoints.size(); i++)
if(i != movingUnitIndexInTheArray) {
Point p = unitCenterPoints.get(i);
Area uArea = getArea(p);
Area spaceTestArea = new Area(moveLineArea);
spaceTestArea.intersect(uArea);
//we have intersection then return false, we cannot make this move
if(!spaceTestArea.isEmpty()) {
System.out.println("No move --- a unit is on the way. "
+ "Conflicting point is="+p +"; for i="+i
+ "; where moving unit point is="
+unitCenterPoints.get(movingUnitIndexInTheArray)
+"; the unit is moving to="+endPointCP
+"; spaceTestArea.isEmpty()="+spaceTestArea.isEmpty());
return false;
}
}
System.out.println("Move OK.");
return true;
}
```
|
What is the reason of this weird area subtraction issue?
|
CC BY-SA 3.0
| null |
2011-07-01T18:16:07.247
|
2011-07-02T21:14:49.973
|
2011-07-02T20:45:16.077
| 613,495 | 613,495 |
[
"java",
"collision-detection",
"area"
] |
6,551,753 | 1 | 6,551,961 | null | 2 | 271 |
I'm still new to String Processing in PHP. Below is a diagram of what I am currently doing. Ultimately, I would like to get a generic methodology for handling strings in the below scenarios. Note that the text tends to be a lot of math symbols and code syntax in this scenario.
The strings and integer are input via a standard HTML-based form (I forgot to mention that in the diagram).
Step A currently uses: `mysql_real_escape_string(input);`
Step B currently uses:
- `htmlentities($string2)`- `$string1`-
Questions:
1. Regarding MySQL injection, is mysql_real_escape_string sufficient to guard against this?
2. I still need to finish processing the output for String1. Note how the text is actually used in two different places: HTML and Canvas. htmlentities at step B would make code syntax appear properly on the HTML5 Canvas but not in the HTML. Vice-versa for leaving it out (HTML syntax breaks the Page). Is there a JavaScript function that is identical to PHP's htmlentities?
3. int form should be validated to make sure it is an int.
4. String2 ouputs "null" to the HTML when I use this character ('–') which is not the standard minus-sign character ('-').
5. Magic Quotes is turned off. However, if I run the script on a server with it enabled, I need a short script that goes: IF(magic quotes is enabled){turn off magic quotes}.
6. What did I forget in regard to form validation?
If my approach is totally wrong, set me straight and help me get this straightened out once and for all. You can describe your solution in terms of A, B, C, D and E if you think that is helpful. Thanks in advance.

|
PHP and Ajax String Input/Output Handling Scenario
|
CC BY-SA 3.0
| 0 |
2011-07-01T18:20:02.463
|
2011-07-01T18:50:16.993
|
2011-07-01T18:22:03.340
| 596,781 | 647,405 |
[
"php",
"ajax",
"string",
"validation",
"html-entities"
] |
6,552,126 | 1 | 6,562,074 | null | 1 | 417 |
I've made a very simple customView, a gray rectangle with an arbitrary amount of red markings inside the rectangle marked by percentages.
```
public class DemoView extends View {
private ShapeDrawable mDrawable;
private ArrayList<ShapeDrawable> mMarks;
public DemoView(Context context, int[] marks) {
super(context);
int x = 0;
int y = 0;
int width = 100;
int height = 10;
// Timeline Initially empty
mDrawable = new ShapeDrawable(new RectShape());
mDrawable.getPaint().setColor(Color.GRAY);
mDrawable.setBounds(x, y, x + width, y + height);
// Add marks
if (marks != null && marks.length % 2 == 0) {
mMarks = new ArrayList<ShapeDrawable>(marks.length / 2);
ShapeDrawable mark;
for (int i = 1; i < marks.length; i = i + 2) {
mark = new ShapeDrawable(new RectShape());
mark.getPaint().setColor(Color.RED);
mark.setBounds(x + marks[i - 1], y, x + marks[i], y + height);
mMarks.add(mark);
}
}
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
mDrawable.draw(canvas);
if (mMarks != null)
for (ShapeDrawable mark : mMarks)
mark.draw(canvas);
}
```
}
However I can't figure out how to make use of the view. Each time I try to add more than one of the view in a linearlayout or relativelayout, I only see one of the views.
XML:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/llayout"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
</LinearLayout>
```
Layout code:
```
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout ll = (LinearLayout) findViewById(R.id.llayout);
demoview = new DemoView(this, new int[]{10,15,35,60});
demoview.setId(ID_NUM++);
ll.addView(demoview);
demoview2 = new DemoView(this, new int[]{0,1,3,6});
demoview2.setId(ID_NUM++);
ll.addView(demoview2);
demoview3 = new DemoView(this, new int[]{25,60});
demoview3.setId(ID_NUM++);
ll.addView(demoview3);
demoview4 = new DemoView(this, new int[]{15,60});
demoview4.setId(ID_NUM++);
ll.addView(demoview4);
}
```
Results in:

Is this the wrong route to take? Am I missing some obvious key to using this view multiple times? If this is not the correct route is there some other method to making a custom shape? Perhaps extending rectShape?
|
Custom Views only showing up once
|
CC BY-SA 3.0
| null |
2011-07-01T18:54:36.873
|
2011-07-03T09:22:21.397
| null | null | 697,151 |
[
"android",
"android-linearlayout",
"custom-view"
] |
6,552,196 | 1 | 6,552,250 | null | 2 | 6,686 |
I'm current a WebForms developer that is trying to move to MVC. I'm super excited about MVC and I'm really have fun but I'm running into a weird issue. So what I'm trying to do is create an advanced editor for a "widget". I've posted the code below.
Everything appears to work fine when you add the first 4-5 items but the problem occurs when you delete the 2nd item. Here is a visual example.
First add the 4 values.

But the problem occurs when we delete the 2nd value. We end up with this...

What I cannot seem to understand is why does this property act different between the two following lines of code.
```
@Model.Values[i]
@Html.TextBoxFor(m => m.Values[i])
```
My guess is that the @Model and (m =>m) do not reference the same object?
Here is my widget class.
```
public class Widget
{
#region Constructor
public Widget()
{
ID = 0;
Name = string.Empty;
Values = new List<string>();
}
#endregion
#region Properties
[Required]
[Display(Name = "ID")]
public int ID { get; set; }
[Required]
[Display(Name = "Name")]
public string Name { get; set; }
[Required]
[Display(Name = "Values")]
public List<string> Values { get; set; }
#endregion
}
```
My controller looks like this.
```
public ViewResult EditWidget(int id)
{
return View(_widgets.GetWidgetByID(id));
}
[HttpPost]
public ActionResult EditWidget(Widget widget)
{
if (!TryUpdateModel(widget))
{
ViewBag.Message = "Error...";
return View(widget);
}
if (Request.Form["AddWidgetValue"] != null)
{
widget.Values.Add(Request.Form["TextBoxWidgetValue"]);
return View("EditWidget", widget);
}
if (Request.Form["DeleteWidgetValue"] != null)
{
widget.Values.Remove(Request.Form["ListBoxWidgetValues"]);
return View("EditWidget", widget);
}
_widgets.UpdateWidget(widget);
_widgets.Save();
return RedirectToAction("Index");
}
```
And finally my view.
```
@model MvcTestApplication.Models.Widget
@{
ViewBag.Title = "EditWidget";
}
<h2>EditWidget</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Widget</legend>
@Html.HiddenFor(model => model.ID)
<div class="editor-label">
@Html.LabelFor(model => model.Name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name)
</div>
@for (var i = 0; i < Model.Values.Count; i++)
{
@Model.Values[i]
@Html.TextBoxFor(m => m.Values[i])
@Html.HiddenFor(m => m.Values[i])
<br />
}
@Html.ListBox("ListBoxWidgetValues", new SelectList(Model.Values), new { style = "width: 100%" })<br />
@Html.TextBox("TextBoxWidgetValue", string.Empty, new { style = "width: 100%" })
<input type="submit" value="Add" id="AddWidgetValue" name="AddWidgetValue" class="submitButton" />
<input type="submit" value="Delete" id="DeleteWidgetValue" name="DeleteWidgetValue" class="submitButton" />
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
```
|
Handling array's in post back data - MVC3
|
CC BY-SA 3.0
| 0 |
2011-07-01T19:02:14.653
|
2013-07-05T13:18:50.170
|
2013-07-05T13:18:50.170
| 727,208 | 43,976 |
[
"c#",
"asp.net-mvc",
"asp.net-mvc-3",
"razor"
] |
6,553,139 | 1 | null | null | 3 | 828 |
I have an Inheritance class as shown here:

As you can easily see users, buildings and hotels have addresses (more than one) and address table keeps the id of the owner in whose column.
1. Is my logic correct?
2. Let's say I want to get the address of user (or buildings or hotels) whose id is 2; must I run a DQL statement (and how?) or can I get it with find() function without DQL?
And I'll be happy if you give example since Doctrine documentation doesn't help much.
Thanks.
users, buildings and hotels are just symbolic names that is why they can have multiple addresses otherwise buildings and hotels would have only one address.
:I think I couldn't make myself clear, when I talk about the Class Table Inheritance I mean entity class has the Discriminator column as
```
/**
* ...
*
* @DiscriminatorColumn(name="classname", type="string")
* @DiscriminatorMap({"Entities\users" = "Entities\users",
* "Entities\buildings" = "Entities\buildings"}) ... etc
*/
```
Each and every subclass is related to parent (Entity) with the foreign key relation as "id". But of course doctrine creates this relation already for me.
|
Accessing relations of a table with inheritance
|
CC BY-SA 3.0
| 0 |
2011-07-01T20:54:57.493
|
2011-12-12T20:38:57.580
|
2011-12-12T20:38:57.580
| null | 522,235 |
[
"php",
"doctrine-orm"
] |
6,553,149 | 1 | 6,553,473 | null | 0 | 94 |
I would like some help with the following problem.
I have a system setup where a user clicks on an image (ThumbsUp or ThumbsDown) and the specified field in the Db in incremented by 1 and the new result is supposed to be sent back to the view. I am able to use jQuery to increment the value in the Db, but I cannot get the right value to update. It just shows up as `Array`, which I think I know why. But how do I fix this?

My view file
```
...
<div id="article_thumbsUp">
<?php echo $comment['Comment']['liked'];?>
</div>
<img class="voteup" width="20" src="/img/icons/thumb-up-icon.png">
...
```
My jQuery Code
```
<script>
$(".voteup").click(function() {
$('#article_thumbsUp').change(function() {
$(this).load('/comments/voteup/10');
function(result) {
$('#article_thumbsUp').html(result);
};
})
.change();
});
</script>
```
`/comments/voteup/10``$comments['Comment']['id']`
And my controller file
```
function voteUp($id = null){
$this->autoRender = false;
if($this->RequestHandler->isAjax()){
$this->Comment->id = $id;
if($this->Comment->saveField(
'liked',
$this->Comment->field('liked')+1)){
$newValue = $this->Comment->findById($id);
}
}
return $newValue;
}
```
I know `findById` creates an array of data. How do I only return the field `liked`.
Thanks a lot,
|
CakePHP - Stuck retrieving new result from Db using jQuery
|
CC BY-SA 3.0
| null |
2011-07-01T20:55:57.330
|
2011-07-01T21:38:37.010
| null | null | 597,237 |
[
"jquery",
"cakephp"
] |
6,553,404 | 1 | 8,266,670 | null | 1 | 2,136 |
I'm looking for techniques for displaying hierarchical data.
I find my experience is, unfortunately limited to how Windows presents hierarchies:
1) TreeView - vertical expansion (as in file explorer, and Windows 7 start menu)


2) Start menus - largely horizontal expansion (XP style)

I'm looking for new/fresh ways to visualize hierarchical data to the user however. Looking for studies, can be academic, still searching. I'm currently browsing through [Hierarchical Data Visualization In Desktop Virtual Reality](http://www.dgp.toronto.edu/people/modjeska/Pubs/modjeska_thesis.pdf), which is quite cool, looking for more input.
|
visualizing hierarchical data
|
CC BY-SA 3.0
| null |
2011-07-01T21:28:29.647
|
2011-11-25T08:57:22.970
| null | null | 111,307 |
[
"user-interface",
"hierarchy"
] |
6,553,582 | 1 | 6,553,604 | null | 2 | 31,414 |
I just got a Samsung Galaxy Tab 10.1 and want to test my app on it. I turned on USB debugging and the bumblebee in the corner confirms that it is on. When I run my app from Eclipse (Helios) on Windows 7, I don't see the Galaxy Tab in my list. All I see is my Samsung Nexus S, which is also attached via USB.

|
How to test Android app on Samsung Galaxy Tab from Eclipse?
|
CC BY-SA 3.0
| null |
2011-07-01T21:55:11.277
|
2012-01-23T19:33:42.343
| null | null | 459,987 |
[
"android",
"galaxy-tab"
] |
6,553,869 | 1 | null | null | 0 | 4,365 |
So, I am using Visual Studio 2010 and was trying to create a new database that I could use in my project. I have vague idea of having used the Server Explorer in the past, although I'm not that sure about it. My experience with MSSQL is almost non-existent, anyway.
I don't remember having to configure anything, but it seems I have a server called Xyz already set up, as can be seen in the next picture:

I've tried to to create a new database, but I am getting the following error:

What might be wrong? What tools should I make sure are correctly running? Isn't there something like Oracle's Sql Developer which allows me easily to inspect what's happening with my databases?
Also, what about the authentication? I can't recall having configured anything when installing Visual Studio. Maybe I still have to configure something?

I'm quite lost here, I'd appreciate some light shed up on me on this issue. Thanks!
|
Creating a database through Server Explorer in Visual Studio 2010
|
CC BY-SA 3.0
| 0 |
2011-07-01T22:36:53.033
|
2012-01-24T13:52:18.013
| null | null | 130,758 |
[
"sql-server",
"visual-studio",
"visual-studio-2010",
"server-explorer"
] |
6,554,036 | 1 | null | null | 0 | 898 |
I´m making a program using C# and It´s almost over and I was thinking that It will be interesting to include a welcome form to load by 5 seconds showing the name of the program and other stuff... like this in microsoft word...

but I'm not sure how to do this. I will like some advice please....
|
Welcome loading on c#
|
CC BY-SA 3.0
| null |
2011-07-01T23:09:35.287
|
2011-07-01T23:49:19.747
| null | null | 647,399 |
[
"c#",
"forms"
] |
6,554,225 | 1 | null | null | 8 | 6,288 |
I am seeing a huge memory leak when using `UIImagePickerController` in my iPhone app. I am using standard code from the apple documents to implement the control:
```
UIImagePickerController* imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
switch (buttonIndex) {
case 0:
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imagePickerController animated:YES];
break;
case 1:
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagePickerController animated:YES];
break;
default:
break;
}
}
```
And for the cancel:
```
-(void) imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[[picker parentViewController] dismissModalViewControllerAnimated: YES];
[picker release];
}
```
The didFinishPickingMediaWithInfo callback is just as stanard, although I do not even have to pick anything to cause the leak.
Here is what I see in instruments when all I do is open the `UIImagePickerController`, pick photo library, and press cancel, repeatedly. As you can see the memory keeps growing, and eventually this causes my iPhone app to slow down tremendously.

As you can see I opened the image picker 24 times, and each time it malloc'd 128kb which was never released. Basically 3mb out of my total 6mb is never released.
This memory stays leaked no matter what I do. Even after navigating away from the current controller, is remains the same. I have also implemented the picker control as a singleton with the same results.
Here is what I see when I drill down into those two lines:

Any help here would be greatly appreciated! Again, I do not even have to choose an image. All I do is present the controller, and press cancel.
# Update 1
I downloaded and ran apple's example of using the `UIIMagePickerController` and I see the same leak happening there when running instruments (both in simulator and on the phone).
[http://developer.apple.com/library/ios/#samplecode/PhotoPicker/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40010196](http://developer.apple.com/library/ios/#samplecode/PhotoPicker/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40010196)
All you have to do is hit the photo library button and hit cancel over and over, you'll see the memory keep growing.
Any ideas?
# Update 2
I only see this problem when viewing the photo library. I can choose take photo, and open and close that one over and over, without a leak.
|
UIImagePickerController Memory Leak
|
CC BY-SA 3.0
| 0 |
2011-07-01T23:52:23.720
|
2012-12-18T11:29:35.757
|
2020-06-20T09:12:55.060
| -1 | 825,625 |
[
"iphone",
"objective-c",
"ios",
"memory-leaks",
"uiimagepickercontroller"
] |
6,554,214 | 1 | 6,554,966 | null | 3 | 3,700 |
I'm teaching myself ExtJS by building a really simple 'scrum' development tracking application. I'm currently displaying the "Backlog" as a grid panel that displays the properties of the card(user story).
Card.js (Card model)
```
Ext.define('AM.model.Card', {
extend: 'Ext.data.Model',
fields: [
'id',
'name',
'priority_id',
...
]
});
```
Priority.js (Priority model)
```
Ext.define('AM.model.Priority', {
extend: 'Ext.data.Model',
fields: [
'id',
'name',
'short_name'
]
});
```
So the data for the card will look something like this:
backlogcards.json (data)
```
{
success: true,
backlogcards: [
{
id: 1,
name: 'ONEs',
priority_id: 2,
...
},
{
id: 2,
name: 'TWOs',
priority_id: 3,
...
}
]
}
```
And the priorities looks like this:
priorities.json (data)
```
{
success: true,
priorities: [
{
id : 1,
name : "High",
short_name : "H"
},
{
id : 2,
name : "Medium",
short_name : "M"
},
{
id : 3,
name : "Low",
short_name : "L"
}
]
}
```
So ideally what I would like to do is have the grid panel display the short_name for the corresponding priority_id. When the item is clicked on to be edited inline, a combo box will be displayed that shows the name property. I'm half way there already.
BacklogList.js (view)
```
Ext.define('AM.view.card.BacklogList', {
extend: 'Ext.grid.Panel',
alias: 'widget.backlogcardlist',
title: 'Backlog',
store: 'BacklogCards',
selType: 'cellmodel',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
columns: [
{ header: 'ID', dataIndex: 'id' },
{ header: 'Name', dataIndex: 'name', field: 'textfield' },
{
header: 'Priority',
dataIndex: 'priority_id',
width: 130,
field: {
xtype: 'combobox',
typeAhead: true,
store: 'Priorities',
displayField: 'name',
valueField: 'id',
listClass: 'x-combo-list-small'
}
}
]
});
```
So I know the 'dataIndex' property is what I need to modify in order to change the display, but I'm not sure how to tie those two stores together.

As you can see above, priority is being displayed as a number instead of the short_name.
Is this a situation where I would need to use associations? (I only know OF them) [Sencha Docs](http://docs.sencha.com/ext-js/4-0/#/guide/data)
Thank you!
EDIT1: Oh I realize I could 'hard code' a renderer property that does this change, but I would like to avoid that and instead use values from the priorities store.
```
renderer: function(value){
if (value==3)
{
return "L";
}
else if (value==2)
{
return "M";
}
else
{
return "H";
}
},
```
EDIT2 for Evan:
Priorities store
```
Ext.define('AM.store.Priorities', {
extend: 'Ext.data.Store',
model: 'AM.model.Priority',
autoLoad: true,
proxy: {
type: 'ajax',
api: {
read: 'app/data/priorities.json',
update: 'app/data/updateUsers.json'
},
reader: {
type: 'json',
root: 'priorities',
successProperty: 'success'
}
}
});
```
The store.each refers to this store, right? If so, how do I perform the each operation on it?
I tried changing the declaration line to:
```
var test = Ext.define('AM.store.Priorities', {
```
And then tried changing your code to test.each but was unsuccessful.
Thanks again!
|
Displaying values in an ext grid where the values correspond to strings in another table/model
|
CC BY-SA 3.0
| null |
2011-07-01T23:48:48.257
|
2013-07-03T10:57:30.060
|
2011-07-05T16:04:12.840
| 387,285 | 387,285 |
[
"javascript",
"extjs",
"extjs4"
] |
6,554,257 | 1 | null | null | 1 | 213 |
I had many objects using px. I changed everything in my app to dp and textsizes to sp. Now my app won't open. When I use the debugger and go step by step it does open and then displays this. I did not change any code from before when it was working, just the px. By the way, I am using tabHost and their should be 5 tabs on the bottom. It splits it into about 30. It is just very strange stuff going on. Do you know what is wrong and how to fix it?
Thank you.
This image is the error message:

This image is using the debugger.

|
In Android app,I changed all px to dp and sp. Now it is not opening. What is wrong?
|
CC BY-SA 3.0
| null |
2011-07-02T00:03:31.183
|
2012-05-06T03:32:28.130
|
2012-05-06T03:32:28.130
| 1,268,895 | 825,652 |
[
"java",
"android",
"android-tabhost"
] |
6,554,291 | 1 | 6,554,531 | null | 3 | 1,105 |
In a Flex Mobile project I have a simple itemRenderer where I'm trying to create an "bubble" texting effect, similar to ichat or iphone (just so you get what im going for). But if the text is longer than the screen it runs off, rather than just going down a line.
If I set Group thats holding the rectangle(to create the bubble effect) and the label to 100% it works and keeps it from exceeding the list containers bounds, BUT the group is always at 100% and looks bad, I'm trying to keep the "bubble" JUST AROUND the text.
Anyway so, at the top of my itemRenderer I tried specifying:
```
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%">
```
And here's my layout I figured since `msg_container` has a width of 100% I was hoping `bubble_lable_group` would just not exceed that but...it doesnt...it just runs off. I tried setting a max width but that does not allow you to input percents. And just to say it 1 more time. I know if i set `bubble_lable_group` width to 100% it works, and keeps it from going off the edge, but then the rectangle "bubble" stretches all the way across and just looks bad.
```
<s:VGroup id="main_container" horizontalAlign="left" paddingBottom="10" paddingTop="10"
verticalAlign="top" width="100%">
<s:VGroup id="name_container" width="100%">
<s:Label id="name_label" fontSize="20" fontWeight="bold" text="Name: " />
</s:VGroup>
<s:VGroup id="msg_container" width="100%" paddingLeft="20">
<s:Group id="bubble_lable_group">
<s:Rect id="the_bubble_shape" width="100%" height="100%" radiusX="15" radiusY="15" >
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="{grOne}"/>
<s:GradientEntry color="{grTwo}"/>
</s:LinearGradient>
</s:fill>
</s:Rect>
<s:Label id="msg_txt" width="100%" text="msg text here"
fontSize="18" color="#FFFFFF" paddingTop="15" paddingRight="15" paddingBottom="15" paddingLeft="15"/>
</s:Group>
</s:VGroup>
</s:VGroup>
```
Any Ideas or tricks I could pull to achieve the effect i'm going for and keep it all inside the parent List container? I'm stumped.
EDIT:
Here's some screenshots to help illustrate the issue:

|
How to prevent container in itemRenderer from exceeding width of list container?
|
CC BY-SA 3.0
| 0 |
2011-07-02T00:10:12.983
|
2013-12-22T02:32:37.900
|
2011-07-02T00:46:03.083
| 393,373 | 393,373 |
[
"apache-flex",
"actionscript-3",
"layout",
"mxml",
"itemrenderer"
] |
6,554,308 | 1 | 6,554,335 | null | 1 | 513 |
I have some problems adding my shader-glsl files from one xcode project to another. I'm completely confused at this moment, since I can't make a path to files I simply drag into xcode.
I have checked spelling, "show in finder" many times and still have the problem...
Here's my example of files I added to xCode, I didn't even put them into sub-directories to rule out any problems with those:

Now my code:
```
NSLog(@"Filepath of Tools-image: %@",[[NSBundle mainBundle] pathForResource:@"tools" ofType:@"png"]);
NSLog(@"Filepath of mo-tut is: %@",[[NSBundle mainBundle] pathForResource:@"mo" ofType:@"tut"]);
NSLog(@"Filepath of FragShader-fsh is: %@",[[NSBundle mainBundle] pathForResource:@"fragshader" ofType:@"fsh"]);
```
At run-time I get this output:
```
2011-07-02 02:03:33.516 windowconfig[16192:707] Filepath of Tools-image: /var/mobile/Applications/BC82AD2C-B8B9-4751-80A2-31EC5ACEC9C2/windowconfig.app/tools.png
2011-07-02 02:03:33.526 windowconfig[16192:707] Filepath of mo-tut is: /var/mobile/Applications/BC82AD2C-B8B9-4751-80A2-31EC5ACEC9C2/windowconfig.app/mo.tut
2011-07-02 02:03:33.531 windowconfig[16192:707] Filepath of FragShader-fsh is: (null)
```
Please, does anyone have an idea on this?
EDIT: "tools.png" currently is an icon I use on a tab-bar, its in a subfolder in resources and was just a test for comparison. In case you guys wonder why I didn't open the path to the other file in the screenshot.
EDIT2: I used "Clean" like crazy in the last two hours. "fragshader.fsh" appearently doesn't get copied to the "windowconfig.app" bundle even though I added it to the project in the same way I added "mo.tut" and this one is in the bundle package. How can I ensure it gets copied?
EDIT3: Target Membership is checked in the Inspector for both files, still teh shader isn't copied.
Under Target-Build Phases the file wasn't in the "copy files to bundle" list.
I manually added it, but still its strange it wasn't added automatically after I added the file to the project.
|
pathForResource yields erratic null
|
CC BY-SA 3.0
| null |
2011-07-02T00:15:53.533
|
2011-07-02T17:30:45.107
|
2011-07-02T17:30:45.107
| 459,744 | 459,744 |
[
"iphone",
"objective-c",
"cocoa-touch"
] |
6,554,437 | 1 | 6,695,897 | null | 12 | 9,314 |
I have groupboxes acting like expanders in my application. When I need to colapse a groupbox I set its height equal to 0. when I need to expand it I set it's height equal to auto (double.Nan) is it posible to do this with a storyboard. How could I know the auto height in advance. Expression blend does not enable me to animate to an auto.

|
Animate height of groupbox from 0 to auto
|
CC BY-SA 3.0
| 0 |
2011-07-02T00:46:44.753
|
2021-03-13T01:13:06.690
| null | null | 637,142 |
[
"c#",
"wpf",
"xaml",
"animation",
"storyboard"
] |
6,554,582 | 1 | 6,554,621 | null | 3 | 376 |
If you open settings of wifi and choose any network you will see Password textbox and BUTTONS (not icons) in ApplicationBar. How it is made? Is it some kind of ApplicationBar template? Or it is some Border control, but how to show a Border above the SIP(keyboard)?
Any ideas how to make the same thing?
|
Buttons on ApplicationBar (WP7)
|
CC BY-SA 3.0
| null |
2011-07-02T01:31:30.347
|
2011-07-02T02:09:02.340
|
2011-07-02T02:09:02.340
| 582,864 | 582,864 |
[
"windows-phone-7"
] |
6,554,628 | 1 | 6,554,647 | null | 1 | 35 |
I have created fiddle here: [http://jsfiddle.net/ozzy/WEGMh/](http://jsfiddle.net/ozzy/WEGMh/)
How it should look is here:

Issue is the left and right hand divs arent showing. I have tried z-index , but it must be something painfully obvious.
My code may be crap too..
The idea is the container height will be flexible. Container width fixed.
Header fixed width and height
left div will be fixed width and flexible height.
right div can just adopt left divs parameters.
footer div fixed width and height.
If that makes sense.
|
Quick CSS problem
|
CC BY-SA 3.0
| null |
2011-07-02T01:45:30.377
|
2011-07-02T01:51:36.550
| null | null | 501,173 |
[
"css"
] |
6,554,623 | 1 | null | null | 0 | 726 |

With Chrome on a desktop computer, I can get an image reflection with:
```
img {
-webkit-box-reflect: below 0 -webkit-gradient(
linear,
left top,
left bottom,
from(transparent),
color-stop(.7, transparent),
to(white)
);
}
```

When tested on Android's Chrome, the mask is not really a mask. It becomes a plain overlay gradient. How do I turn it into a true mask? On my real website, I have a patterned background, so a plain overlay gradient wouldn't be able to gradually reveal the background.
|
Webkit reflection mask in Android Chrome
|
CC BY-SA 3.0
| null |
2011-07-02T01:44:38.697
|
2012-06-03T21:10:00.697
| null | null | 459,987 |
[
"android",
"css",
"google-chrome"
] |
6,554,813 | 1 | null | null | 8 | 10,808 |
I had a problem on my own site with a `<div>` that is supposed to have 100% width. The code for it is shown below.
```
#myDiv {
width: 100%;
height: 160px;
background: #f48;
}
```
This works great except for the following issue:
When my browser window is smaller than the `<div>`'s content, and I scroll to the right then my `<div>` will move left with the rest of the page rather than occupying 100% of the width of the page's scrollable area.
This issue has been bugging me for a few hours and just recently I realized that many other sites have the same issue. Including Facebook.com and Stackoverflow.com just take a look at my snapshots below.


|
100% width div gets cut off when I scroll right if my browser window is smaller than div's content
|
CC BY-SA 3.0
| 0 |
2011-07-02T02:47:21.770
|
2014-12-21T18:56:15.027
| null | null | 552,067 |
[
"css",
"html",
"scroll",
"width"
] |
6,555,063 | 1 | null | null | 1 | 3,727 |
This is what I am trying to achieve. I have an image - the outline of the State of California.

I would like to change the color of this image dynamically and programatically based on a value.
Is it possible to achieve this using HTML5/CSS3/Javascript?
In the larger scheme of things I intend to have the entire map - just a blank outline of it. And fill each of these states with dynamic colors by treating each of these states as an object.
Coding hints and samples are greatly appreciated.
|
Is dynamic coloring of vector images possible with HTML5 & CSS3?
|
CC BY-SA 3.0
| null |
2011-07-02T04:09:07.663
|
2011-07-10T00:52:56.413
| null | null | 336,489 |
[
"javascript",
"html",
"canvas",
"css",
"color-coding"
] |
6,555,356 | 1 | 6,555,398 | null | 2 | 877 |
I accidentally added my project to a folder. How can I undo this? Here's the image describing what i have done:

Thanks.
UPDATE: I dragged it out, it asked me to save a new workspace (don't know what that means) and now it's fixed, but on top it looks like this:

Although it compiles/works fine, this isn't normal and bugging me. Please help.
|
XCode accidently added my project to folder
|
CC BY-SA 3.0
| null |
2011-07-02T05:54:02.437
|
2017-12-24T07:49:17.213
|
2011-07-02T06:01:44.977
| 770,337 | 770,337 |
[
"iphone",
"objective-c",
"ios",
"xcode",
"cocoa-touch"
] |
6,555,431 | 1 | null | null | 2 | 1,370 |
I am a S/W developer working on a Java web application.
I have very limited knowledge of Java and want to understand my application architecture from a very high level in simple terms. Being a developer, I do not completely understand the big picture.
Can anyone help me understand this?

|
Understand application architecture
|
CC BY-SA 3.0
| 0 |
2011-07-02T06:18:53.100
|
2011-07-04T16:33:46.330
|
2011-07-04T16:33:46.330
| 427,648 | 825,810 |
[
"java",
"web-applications",
"servlets",
"architecture"
] |
6,555,459 | 1 | 6,556,328 | null | 3 | 1,085 |
I'm a beginner in ASP.NET MVC3 and I would like to be sure the way I do is a good one. Let's say I have a page containing different things such as some header info at the top and some detail info (footer) at the bottom. I prefer to create partial pages to split all these things in small pages (easy to manage).
Below is an example page:

Here is the way I cut my page into small pages.

This way of doing is (for me at least) easy to understand and to manage.
Here is my Detail.cshtml page
```
@model DocumentManager.ViewModels.SuiteDetailViewModel
<div class="detail-header-toolbar"> @Html.Partial("DetailHeaderToolbar") </div>
<div class="detail-header-affaire"> @Html.Partial("DetailHeaderAffaire") </div>
<div class="detail-footer-suite"> @Html.Partial("DetailFooterTabs", Model.Suite) </div>
<div class="detail-script"> @Html.Partial("DetailScript", Model.Suite) </div>
```
I place all my scripts in one page for convenience (DetailScript.cshtml).
I would like your opinion. Thank you.
|
Good way for splitting a page into small pages
|
CC BY-SA 3.0
| null |
2011-07-02T06:27:32.623
|
2011-07-02T10:03:18.373
| null | null | 693,560 |
[
"asp.net",
"asp.net-mvc-3"
] |
6,555,536 | 1 | 6,557,834 | null | 1 | 173 |
Hi i am using goole map API for my application to get the path drawn for my app. But the issues is when i call the following API
[http://maps.googleapis.com/maps/api/directions/json?origin=Chicago&destination=158%20Waterston%20Avenue,%20Wolliston,%20MA,%2002170,%20&waypoints=optimize:true%7C134%20Wimbleton%20Drive,%20Longmeadow,%20MA,%2001106,%20%7C&sensor=false&mode=driving](http://maps.googleapis.com/maps/api/directions/json?origin=Chicago&destination=158%20Waterston%20Avenue,%20Wolliston,%20MA,%2002170,%20&waypoints=optimize:true%7C134%20Wimbleton%20Drive,%20Longmeadow,%20MA,%2001106,%20%7C&sensor=false&mode=driving)
The path drawn as per the value in "points" tag (here we get instruction to path to follow as well as latitude and langitude) from the above API call is as below
Here my current location i am passing is chicago as my current location.
I am drawing the path with mkpolyline function with the lat lon i get from "points" key .
I dont whats the issue there .
|
Issues with google map api
|
CC BY-SA 3.0
| null |
2011-07-02T06:47:36.687
|
2011-07-02T15:32:07.803
| null | null | 362,086 |
[
"iphone",
"xcode",
"mkmapview"
] |
6,555,600 | 1 | 6,556,655 | null | 34 | 9,786 |
I am working on an svg export utility for a drawing program on android. I am having a problem that the behind blur is cutoff past the shape boundaries - looks like i need to resize the viewBox or increase the margin or something. Does anyone know the best way?
The test file url is [here](http://www.robmunro.net/misc/test.svg) - it downloads as the mime type isn't setup correctly on the server and I cant restart it at the moment :(. There are embedded images and fonts in the file, Which is why it's big. But if you save it to disk you can open in chrome, ff, etc...
An enlarged example of this problem is given. Notice the square edges on the orange glow.

|
Gaussian blur cutoff at edges
|
CC BY-SA 3.0
| 0 |
2011-07-02T07:04:40.253
|
2013-11-08T17:08:47.947
|
2013-11-08T17:08:47.947
| 24,874 | 668,195 |
[
"svg",
"svg-filters"
] |
6,555,629 | 1 | 6,644,246 | null | 113 | 60,385 |
What is the best way to detect the corners of an invoice/receipt/sheet-of-paper in a photo? This is to be used for subsequent perspective correction, before OCR.
## My current approach has been:
RGB > Gray > Canny Edge Detection with thresholding > Dilate(1) > Remove small objects(6) > clear boarder objects > pick larges blog based on Convex Area. > [corner detection - Not implemented]
I can't help but think there must be a more robust 'intelligent'/statistical approach to handle this type of segmentation. I don't have a lot of training examples, but I could probably get 100 images together.
## Broader context:
I'm using matlab to prototype, and planning to implement the system in OpenCV and Tesserect-OCR. This is the first of a number of image processing problems I need to solve for this specific application. So I'm looking to roll my own solution and re-familiarize myself with image processing algorithms.
Here are some sample image that I'd like the algorithm to handle: If you'd like to take up the challenge the large images are at [http://madteckhead.com/tmp](http://madteckhead.com/tmp)
[](https://i.stack.imgur.com/z13MW.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0773_sml.jpg)
[](https://i.stack.imgur.com/6GOPm.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0774_sml.jpg)
[](https://i.stack.imgur.com/y6Nq8.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0775_sml.jpg)
[](https://i.stack.imgur.com/Mzaud.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0776_sml.jpg)
## In the best case this gives:
[](https://i.stack.imgur.com/817rw.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0773_canny.jpg)
[](https://i.stack.imgur.com/NFior.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0773_postcanny.jpg)
[](https://i.stack.imgur.com/suaqb.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0773_blob.jpg)
## However it fails easily on other cases:
[](https://i.stack.imgur.com/nKNwp.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0774_canny.jpg)
[](https://i.stack.imgur.com/ZqznM.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0774_postcanny.jpg)
[](https://i.stack.imgur.com/X8hba.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0774_blob.jpg)
## EDIT: Hough Transform Progress
Q: What algorithm would cluster the hough lines to find corners?
Following advice from answers I was able to use the Hough Transform, pick lines, and filter them. My current approach is rather crude. I've made the assumption the invoice will always be less than 15deg out of alignment with the image. I end up with reasonable results for lines if this is the case (see below). But am not entirely sure of a suitable algorithm to cluster the lines (or vote) to extrapolate for the corners. The Hough lines are not continuous. And in the noisy images, there can be parallel lines so some form or distance from line origin metrics are required. Any ideas?

[](https://i.stack.imgur.com/NYGGm.jpg)
[](https://i.stack.imgur.com/toesV.jpg)
[](https://i.stack.imgur.com/Cyq6f.jpg)
[madteckhead.com](http://madteckhead.com/tmp/IMG_0776_hough.jpg)
|
Algorithm to detect corners of paper sheet in photo
|
CC BY-SA 4.0
| 0 |
2011-07-02T07:12:23.907
|
2022-12-18T22:48:52.337
|
2022-12-18T22:48:52.337
| 11,107,541 | 647,549 |
[
"image-processing",
"opencv",
"edge-detection",
"hough-transform",
"image-segmentation"
] |
6,555,952 | 1 | 6,562,740 | null | 0 | 2,475 |
I followed [a tutorial on Video Player](http://www.dreamincode.net/forums/topic/111181-adding-video-to-an-application/).
It is nice but I am imagining a different situation.
I need to some videos in the Resources file and dynamically change the videos depending on the user input.
I have managed this running inside Visual Studio 2010. using the switch statements.
But I have to specify the path of that video in the resources file. for eg :
```
case 1 : video = new Video("..//..//Resources//The video name");
```
But when I publish this application using the click once wizard, the final application ends up in an exception :
```
System.NullReferenceException: Object reference not set to an instance of an object.
at VideoPlayer.Form1.button2_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e).............
```
It seems that the video file was not included in the application.
But when i saw the installer folder, a clear look showed that there is a file as named VideoPlayer.exe.deploy which is of 59MB normally these files without any resources are light weighted...
It surely contains the Video file. But I cannot access that file.
How Do I Access It?
Please help me out...
Thanks in advance :-)
As asked by some users, I am posting the entire code in C#.NET :
```
namespace PlayVideo
{
partial class Form1
{
// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.viewport = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// viewport
//
this.viewport.Location = new System.Drawing.Point(12, 39);
this.viewport.Name = "viewport";
this.viewport.Size = new System.Drawing.Size(391, 368);
this.viewport.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(55, 418);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(79, 27);
this.button1.TabIndex = 0;
this.button1.Text = "Play";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(167, 418);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(79, 27);
this.button2.TabIndex = 1;
this.button2.Text = "Pause";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(279, 418);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(79, 27);
this.button3.TabIndex = 2;
this.button3.Text = "Stop";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(108, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Load Video number : ";
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Items.AddRange(new object[] {
"Video number 1",
"Video number 2",
"Video number 3"});
this.comboBox1.Location = new System.Drawing.Point(132, 12);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 4;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(415, 457);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.viewport);
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Video Player";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Panel viewport;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox comboBox1;
}
}
```
```
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.DirectX.AudioVideoPlayback;
namespace PlayVideo
{
public partial class Form1 : Form
{
private Video video;
public Form1()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (comboBox1.SelectedIndex)
{
case 0: video = new Video("..//..//Resources//Video1.mp4");
break;
case 1: video = new Video("..//..//Resources//Video2.DAT");
break;
case 2: video = new Video("..//..//Resources//Video3.DAT");
break;
}
int width = viewport.Width;
int height = viewport.Height;
// set the panel as the video object’s owner
video.Owner = viewport;
// stop the video
video.Stop();
// resize the video to the size original size of the panel
viewport.Size = new Size(width, height);
}
private void button1_Click(object sender, EventArgs e)
{
if (video.State != StateFlags.Running)
{
video.Play();
}
}
private void button2_Click(object sender, EventArgs e)
{
if (video.State == StateFlags.Running)
{
video.Pause();
}
}
private void button3_Click(object sender, EventArgs e)
{
if (video.State != StateFlags.Stopped)
{
video.Stop();
}
}
}
}
```
And I thought a screenshot may be of some information :

It works fine in Debugging mode..... But once I install it using the click once installer, It crashes into an Exception. How do I manage the same using the Resources in the DEPLOY file?
|
Accessing the resources in the published application
|
CC BY-SA 3.0
| null |
2011-07-02T08:33:08.597
|
2011-07-03T14:18:43.553
|
2011-07-03T11:48:26.393
| 41,071 | 825,901 |
[
"c#",
"c#-4.0",
"resources"
] |
6,556,041 | 1 | 6,556,234 | null | 1 | 89 |


my question is, my point of view is correct or wrong?
i have try by but not get success.
|
HTML embeded in android
|
CC BY-SA 3.0
| null |
2011-07-02T08:56:36.100
|
2011-07-02T09:41:47.130
|
2011-07-02T09:07:32.517
| null | null |
[
"android",
"html"
] |
6,556,326 | 1 | null | null | 11 | 13,012 |
I want underline to be removed from a link. Also I want underline to appear when I hover it with my mouse pointer. How can this be done? Pls help.
No hover:

When I hover the `Login` link:

|
How to remove underline from a link and add underline on hover? (images attached)
|
CC BY-SA 3.0
| 0 |
2011-07-02T10:02:28.763
|
2011-07-02T10:13:56.823
| null | null | 722,531 |
[
"javascript",
"html",
"css",
"stylesheet"
] |
6,556,335 | 1 | null | null | 0 | 225 |
After changing the orientation and try to write in textField.
This problem occurs only when I launch the app in Landscape mode to start with and then change the interface orientation to portrait.
My screen view moves slightly to right side.
I am not setting any frame for this, but still it moves at one side.
What should I do ?

|
iPad : Problem with orientation
|
CC BY-SA 3.0
| 0 |
2011-07-02T10:04:58.983
|
2011-07-02T21:57:02.770
|
2011-07-02T10:10:10.110
| 463,857 | 664,067 |
[
"iphone",
"objective-c",
"ipad",
"ios4"
] |
6,556,396 | 1 | 6,556,455 | null | 3 | 562 |
there is few text boxes im generating dynamically with a counter so its looks like this
```
form.append('Street: <input type="text" id="street'+counter+'" /> city: <input type="text" id="city'+counter+'" /><br/>');
counter++;
```
then im doing this to make a array
```
var array = [];
for(i=1; i<counter; i++){
array.push({'a':$('#street' + i).val(),'b':$('#city' + i).val()});
}
console.log(array);
$.ajax({
type: "POST",
url: "dummy.php",
data: array,
success: function(response, textStatus, xhr) {
},
error: function(xhr, textStatus, errorThrown) {
}
});
```
but the problem is when im trying to send array to php script via ajax im getting
Parameters
undefined undefined
undefined undefined
in post section of firebug
what im doing wrong here?
firebug console looks like with console.log(array) 
Regards
|
how to create javascript array contain key and value?
|
CC BY-SA 3.0
| 0 |
2011-07-02T10:18:37.930
|
2011-07-02T11:30:50.800
|
2011-07-02T11:30:50.800
| 732,372 | 732,372 |
[
"php",
"javascript",
"jquery"
] |
6,556,402 | 1 | 6,690,856 | null | 1 | 3,813 |
I've set up some example layers like this. Every layer scales down its sublayers contents by `0.75`.
```
CGColorRef color = [UIColor colorWithRed:1 green:0 blue:0 alpha:1].CGColor;
CGRect frame = CGRectMake(0, 0, 128, 128);
m_layer0 = [CATextLayer new];
m_layer0.string = @"0";
m_layer0.frame = frame;
m_layer0.sublayerTransform = CATransform3DMakeScale(0.75, 0.75, 0.75);
m_layer0.masksToBounds = NO;
m_layer0.foregroundColor = color;
m_layer1 = [CATextLayer new];
m_layer1.string = @" 1";
m_layer1.frame = frame;
m_layer1.sublayerTransform = CATransform3DMakeScale(0.75, 0.75, 0.75);
m_layer1.masksToBounds = NO;
m_layer1.foregroundColor = color;
m_layer2 = [CATextLayer new];
m_layer2.string = @" 2";
m_layer2.frame = frame;
m_layer2.sublayerTransform = CATransform3DMakeScale(0.75, 0.75, 0.75);
m_layer2.masksToBounds = NO;
m_layer2.foregroundColor = color;
[m_layer0 addSublayer:m_layer1];
[m_layer1 addSublayer:m_layer2];
[m_hostView.layer addSublayer:m_layer0];
```
The `hostView` is a subview of an `UIScrollView` and on zoom, I set the appropriate `contentsScale` factor on its sublayers to get a crisp look.
```
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
[CATransaction begin];
[CATransaction setDisableActions:YES];
m_layer0.contentsScale = scale;
m_layer1.contentsScale = scale;
m_layer2.contentsScale = scale;
[CATransaction commit];
}
```
This produces following output image when zoomed in. 
Why is the first sublayer rendered correctly but the sublayer of that all blurry?
|
CALayer sublayerTransform and contentsScale do not play well together
|
CC BY-SA 3.0
| 0 |
2011-07-02T10:20:01.983
|
2011-07-14T09:06:25.910
|
2011-07-03T10:10:39.440
| null | null |
[
"objective-c",
"cocoa-touch",
"core-animation"
] |
6,556,758 | 1 | null | null | 0 | 1,243 |
HI in my iPHone App I facing problem for the device orientation

screen 1
now On click of next button, it is displaying screen2 that is fine

screen 2
now clicking on back when I can return to original screen it is not showing properly

what could be the problem?
how can I solve it?
|
iPhone:Device Orientation problem
|
CC BY-SA 3.0
| 0 |
2011-07-02T11:35:05.630
|
2011-07-02T21:44:13.027
| null | null | 531,783 |
[
"iphone",
"objective-c",
"cocoa-touch",
"ios4"
] |
6,556,903 | 1 | 6,556,919 | null | 2 | 2,607 |
i have an image that shows different fireworks. I want to make the colors configurable so there is a combobox that says:
1. USA (which should color the fireworks red, white and blue)
2. St Patricks Day (which should color the fireworks various shades of green . .
3. etc . .
and i want it to look like this:

or this:

the fireworks are all a single image right now and i would want to "intermingle" the selected color (so for #1 above, it shows red, white and blue all sitting side by side. (compared to the left side of the image is all blue, the right side is all red, etc. .)
so i have an image and i have two choices:
1. Create a seperate image for every example in the dropdown.
2. See if there is a way to dynamically change colors of parts of an image within an html page
3. other suggestions ??
i wanted to get feedback on if #2 was possible or i should stick with #1. obviously as the list gets longer, #1 becomes more annoying and #2 is more appealing (if its possible)
|
is it possible to change the colors on parts of an image using jquery, css, etc
|
CC BY-SA 3.0
| null |
2011-07-02T12:10:07.697
|
2011-07-02T12:32:13.550
|
2011-07-02T12:32:13.550
| 4,653 | 4,653 |
[
"jquery",
"html",
"css",
"image",
"colors"
] |
6,557,178 | 1 | 6,557,233 | null | 23 | 24,851 |
In my application I have multiple tableviews with custom cells. Some of the text in the cells are spread out on between 2-4 lines so the height of the label is large enough to contain the content.
However on iPad the screen is larger and I want the text to appear at the top left point of the label, not in the middle as it do when you use `numberOfLines` property. I know you can horizontally align the text, but it must be possible to align the text to the top left also? Or is it impossible.

|
Is it possible to vertically align text inside labels with a "large" frame
|
CC BY-SA 3.0
| 0 |
2011-07-02T13:06:14.813
|
2016-01-09T12:48:45.973
|
2011-08-30T09:15:11.810
| 491,980 | 454,049 |
[
"iphone",
"objective-c",
"ios",
"uitableview",
"uilabel"
] |
6,557,220 | 1 | 6,557,267 | null | 125 | 197,832 |
I want to define a percentage width (70%) for a LinearLayout that contains some buttons, so that I can center it and so that the child buttons can fill_parent. Here's a picture showing what I mean:

My current layout looks like this:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:id="@+id/layoutContainer" android:orientation="vertical">
<LinearLayout android:layout_width="fill_parent"
android:id="@+id/barContainer" android:orientation="horizontal"
android:layout_height="40dp" android:background="@drawable/titlebackground">
<ImageView android:id="@+id/barLogo" android:src="@drawable/titlelogo"
android:layout_gravity="center_vertical" android:adjustViewBounds="true"
android:layout_height="25dp" android:layout_width="wrap_content"
android:scaleType="fitXY" android:paddingLeft="5dp"></ImageView>
</LinearLayout>
<TextView android:layout_height="wrap_content"
android:layout_width="fill_parent" android:gravity="center_horizontal"
android:id="@+id/searchTip" android:text="@string/searchTip"
android:paddingTop="10dp" android:paddingBottom="10dp"></TextView>
<LinearLayout android:layout_height="wrap_content"
android:id="@+id/linearLayout1" android:orientation="vertical" android:layout_width="wrap_content">
<Button android:text="Button" android:id="@+id/button1"
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:layout_width="wrap_content" android:id="@+id/button2" android:layout_height="wrap_content" android:text="Button"></Button>
<Button android:layout_width="wrap_content" android:id="@+id/button3" android:layout_height="wrap_content" android:text="Button"></Button>
</LinearLayout>
</LinearLayout>
```
The LinearLayout im referring to has the id: linearLayout1. How do I do this?
|
Defining a percentage width for a LinearLayout?
|
CC BY-SA 3.0
| 0 |
2011-07-02T13:15:22.097
|
2016-10-26T13:36:55.463
|
2012-10-10T20:02:23.087
| 319,931 | 281,434 |
[
"android",
"android-layout"
] |
6,557,274 | 1 | 6,557,350 | null | 0 | 115 |
My site works with all the browsers ive tested with except for IE7 (im not supporting IE6):
[http://smartpeopletalkfast.co.uk/jquery2/new6.htm](http://smartpeopletalkfast.co.uk/jquery2/new6.htm)
With IE7 their is a weird > character appearing on the page:

Anyone have any ideas why this is happening? Its quite hard to debug as IE7 doesnt have the F12 feature of the newer browsers.
Thanks
|
IE7 shows weird > character
|
CC BY-SA 3.0
| null |
2011-07-02T13:25:05.013
|
2011-07-02T13:39:36.413
| null | null | 467,875 |
[
"internet-explorer-7",
"cross-browser"
] |
6,557,341 | 1 | 6,559,836 | null | 0 | 1,228 |
I am implementing camera application using then example comes with blackberry plugin for eclipse named "CameraDemo" the problem is that when the screen loses focus It does not display the camera view istead of it shows like this


has anybody faced such problem whats the solution?
|
blackberry camera Application
|
CC BY-SA 3.0
| null |
2011-07-02T13:37:37.707
|
2011-07-02T21:57:52.613
| null | null | 548,208 |
[
"blackberry",
"camera"
] |
6,557,385 | 1 | null | null | 1 | 1,190 |
I'm using the MySQL World Database, but it seems that the special chars like `á`, `é` are missing, they are changed with a `?` sign:

Is this my fault? Or is the database designed in this way, just because I looked in the `world.sql` file and I found that some chars are missing, or my textmate is wrong:

As you can see in this picture instead of `Győr` it is `Gyˆr` and others too.
I'm on a MAC OS X 10.6, and I have followed these instructions [http://dev.mysql.com/doc/world-setup/en/world-setup.html](http://dev.mysql.com/doc/world-setup/en/world-setup.html) . and I downloaded the [MyISAM version of the world database](http://dev.mysql.com/doc/index-other.html).
|
MySQL: World Database Special Chars are Missing?
|
CC BY-SA 3.0
| null |
2011-07-02T13:44:30.580
|
2012-05-21T11:04:41.127
|
2011-07-02T13:49:09.940
| 380,562 | 380,562 |
[
"mysql",
"database",
"special-characters"
] |
6,557,719 | 1 | 6,579,140 | null | 3 | 3,974 |

```
ImageView connect = (ImageView) findViewById(R.id.fconnect);
connect.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
facebook.authorize(SignIn.this, new String[] {"offline_access", "email", "read_friendlists","publish_stream" },new DialogListener() {
@Override
public void onComplete(Bundle values) {
String AccessToken = facebook.getAccessToken();
LoginDirect = "Loading Home....";
LoginProcessChkUserStatus();
}
@Override
public void onFacebookError(FacebookError error) {
}
@Override
public void onError(DialogError e) {
}
@Override
public void onCancel() {
}
});
}else{
progress = true;
LoginProcessChkUserStatus();
}
}
});
```
this the facebook api....that i use for loading in my application...this works fine...when i click login button...after authorizing it comes to oncomplete stage... now the problem comes when i installed separtely Facebook.apk in my phone taken from Facebook SDK....the view becomes this....also when i click login button it never excutes the above code....what shall i do...???

|
Issue with Facebook sdk login in android
|
CC BY-SA 3.0
| 0 |
2011-07-02T14:53:58.273
|
2013-03-20T10:47:37.207
|
2013-03-20T10:47:37.207
| 1,286,723 | 598,084 |
[
"java",
"android",
"xml",
"facebook-android-sdk"
] |
6,557,784 | 1 | 6,558,173 | null | 11 | 19,870 |
I'm having a problem with input elements:

Even though in that picture their css is
```
margin: 0;
padding: 0;
```
They still have that slight margin I can't get rid of. I had to use a negative margin of -4px to get the button to stay close to the text field.
Also, when doing further styling I end up with a problem between Firefox and Chrome:
submit buttons seem to not have the same height. Setting an height which makes the submit button fit together with the input bar on Chrome breaks it on Firefox and vice-versa. There seems to be no apparent solution.
[1px difference between buttons http://gabrielecirulli.com/p/20110702-170721.png](http://gabrielecirulli.com/p/20110702-170721.png)
In the image you can see that where in Chrome (right) the button and input field fit perfectly, in Firefox they'll have a height difference of 1px.
Is there a solution to these 2 problems (the persistent margin and the 1px difference)?
---
I've fixed the first problem, it was caused by the fact that the two elements were separated by a newline in the html code.
The second problem persists, though, as you can see here:
by highlighting the shape of the two elements, you can see that in Firefox (left) the button is 2px taller than in Chrome (right)

|
Persistent margin and 1px height difference around input elements
|
CC BY-SA 3.0
| 0 |
2011-07-02T15:10:21.603
|
2016-07-10T14:57:33.883
|
2012-07-18T16:17:47.330
| 812,149 | 151,377 |
[
"html",
"css",
"firefox",
"google-chrome"
] |
6,557,853 | 1 | null | null | 3 | 1,032 |
I have a strange issue- I use a title window to create a message to the user. The user has the ability to move the title window around the screen so that the main screen is visible.
However if the user were to move the title window way too much, it can actually go outside the browser accessible area- the user has no option but to close the browser and start again. How do we ensure that the title window movement is limited, such that the title bar is always available for control?
I might not have worded this right- pls check the attached image.
|
Flex 4: Title window goes out of accessible area
|
CC BY-SA 3.0
| 0 |
2011-07-02T15:25:10.100
|
2012-10-29T08:38:59.490
| null | null | 611,456 |
[
"apache-flex",
"user-interface",
"flex4",
"popup"
] |
6,557,883 | 1 | null | null | 2 | 410 |
I just found out that a `BarChart` may get cropped when using `Frame` rather than `Axes`.
Example:
```
data = {.2, .4, .6, 0., 0., 0.}
BarChart[data]
BarChart[data, Frame -> True, Axes -> False]
```
Is this a feature or a bug? If it is a feature, is there an easy way to prevent cropping?
Screenshot, per request:

|
Not cropping BarChart when using Frame instead of Axes
|
CC BY-SA 3.0
| null |
2011-07-02T15:30:06.893
|
2011-07-03T10:30:44.080
|
2011-07-02T16:26:39.350
| 695,132 | 695,132 |
[
"wolfram-mathematica",
"plot",
"mathematica-8"
] |
6,558,105 | 1 | null | null | 0 | 465 |
I've just spent all day going through broken examples, outdated code, poor documentation and frustration, so bear with me. I need to do a sanity check here. I have this:
- - -
What I want is to automatically post updates to the wall of the fan page. The updates should not be posted by me, rather by the page itself.
I have gotten this to work (for a bit):

The second entry is a manual entry. The first one is automated via this code in PHP making use of the Facebook PHP SDK:
```
require_once 'src/facebook.php';
$facebook = new Facebook("", "");
$facebook->setAccessToken("");
try{
$facebook->api('/132114073492501/feed', 'POST', array('message' => 'test message'));
}catch(Exception $o ){
print_r($o);
}
```
I have left the keys out of the example. The thing that bugs me is that the automated post is created "via JungleDragon", which is the app, not the page itself. This app has no use for end-users so my question is ""
Please don't send me to some general graph api page. I've been there and they suck.
|
Can a Facebook application impersonate a Facebook fan page?
|
CC BY-SA 3.0
| null |
2011-07-02T16:09:44.267
|
2011-07-03T07:53:38.173
| null | null | 80,969 |
[
"facebook",
"facebook-graph-api"
] |
6,558,130 | 1 | 6,558,150 | null | 5 | 498 |
I am hitting the memory leak warning message as seen in the screenshot below.

I need some advise on how I can resolve this memory leak. Can I just do a [self release] at the end of the method?
|
Objective C: Memory Leak issue in Class Method
|
CC BY-SA 3.0
| null |
2011-07-02T16:13:25.753
|
2011-07-02T17:46:19.933
| null | null | 683,898 |
[
"objective-c",
"ios",
"memory-management",
"memory-leaks"
] |
6,558,271 | 1 | 6,559,330 | null | 2 | 2,148 |
So I installed Entity Framework June CTP day before and all was fine until I went to add POCO's to the EF, that's when I got this error

So I thought to myself 'It must have been the CTP that's causing this, so I went and unloaded it. I restarted Visual Studio and was greeted with this message:

I hit No and Visual Studio finished loading my project. When I once again tried to add the POCO's I was greeted with this error:

So does anyone know what's going on and how I can resolve this issue? I know Entity Framework 4.2 has new items but for the time being I prefer the POCO way of doing things.
|
Issues with the new Entity Framework (June 2011 CTP causing unknown errors)
|
CC BY-SA 3.0
| null |
2011-07-02T16:36:12.673
|
2012-01-22T17:33:31.707
|
2020-06-20T09:12:55.060
| -1 | 88,230 |
[
"entity-framework"
] |
6,558,542 | 1 | 6,560,707 | null | 1 | 1,148 |
I am having a problem to trigger a repository clone of googlecode project.
I keep receiving the following error:
Started by user anonymous $ hg clone
--rev default "[https://[email protected]/hg/](https://[email protected]/hg/) " "F:\Hudson\jobs\project Demostration project\workspace" abort: demo.projectname.googlecode.com certificate error: certificate is for
*.googlecode.com, googlecode.com, *.codespot.com, *.googlesource.com, googlesource.com (use --insecure to connect insecurely) ERROR: Failed to clone.
--template {node}
Anyone know on how to tell jenkins it is safe to use that certificate?

|
How to clone a googlecode mercurial repository in jenkins
|
CC BY-SA 3.0
| null |
2011-07-02T17:33:13.993
|
2017-06-16T16:04:08.030
|
2011-12-05T14:37:32.537
| 75,500 | 520,265 |
[
"mercurial",
"hudson",
"jenkins",
"google-code"
] |
6,558,598 | 1 | 6,559,189 | null | 2 | 674 |
How to flip a [Bitmap](http://www.blackberry.com/developers/docs/7.0.0api/net/rim/device/api/system/Bitmap.html) upside down?
(I need this for loading an OpenGL texture in another program).
Here is my failed try:

stripe.png (courtesy of [Pitr@OpenClipart](http://www.openclipart.org/user-detail/pitr)):

Flip.java:
```
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
public class Flip extends UiApplication {
public static void main(String args[]) {
Flip app = new Flip();
app.enterEventDispatcher();
}
public Flip() {
pushScreen(new MyScreen());
}
}
class MyScreen extends MainScreen {
static final Bitmap STRIPE = flip(Bitmap.getBitmapResource("stripe.png"));
public MyScreen() {
setTitle("Flip the bitmap");
add(new BitmapField(STRIPE));
add(new ButtonField("Hello world"));
}
static Bitmap flip(Bitmap bitmap) {
int[] argb = new int[bitmap.getWidth() * bitmap.getHeight()];
bitmap.getARGB(argb, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
for (int i = 0; i < bitmap.getHeight(); i++) {
for (int j = 0; j < bitmap.getWidth(); j++) {
int swap = argb[i * bitmap.getWidth() + j];
argb[(bitmap.getHeight() - 1 - i) * bitmap.getWidth() + j] = swap;
}
}
bitmap.setARGB(argb, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
return bitmap;
}
}
```
|
Blackberry: how to flip a Bitmap upside down?
|
CC BY-SA 3.0
| null |
2011-07-02T17:46:11.227
|
2016-01-15T12:02:44.293
|
2016-01-15T12:02:44.293
| 165,071 | 165,071 |
[
"blackberry",
"bitmap",
"bitmapdata",
"flip"
] |
6,558,608 | 1 | 6,558,630 | null | 2 | 2,637 |
In my string i have an plus (+) char.
For example, string is
> __VIEWSTATE=/wEPDwULLTIwMTY5NDMyMDAPZBYCZg9kFgICAQ9kFgxmD2QWAmYPFgIeC18hSXRlbUNvdW50AgMWBgIBD2QWAmYPFQEiPG5vYnI+PHNwYW4+0JLRhdC+0LQ8L3NwYW4+PC9ub2JyPmQCAw9kFgJmDxUBTDxub2JyPjxhIGhyZWY9J3NpZ251cC5hc3B4JyB0YXJnZXQ9J19zZWxmJz7QoNC10LPQuNGB0YLRgNCw0YbQuNGPPC9hPjwvbm9icj5kAgUPZBYCZg8VAUk8bm9icj48YSBocmVmPSdhYm91dC5hc3B4JyB0YXJnZXQ9J19zZWxmJz7QmNC90YTQvtGA0LzQsNGG0LjRjzwvYT48L25vYnI+ZAICD2QWBAIBDxYCHwACBRYKZg9kFgJmDxUBHjxsaT48Yj7QmtC
Now i add line to memo1 and get this:

Delphi inserts new line at random places.
I`m try to remove all lines break:
```
viewstate:=StringReplace(viewstate, #10#13, ' ', [rfReplaceAll]);
viewstate:=StringReplace(viewstate, #13#10, ' ', [rfReplaceAll]);
viewstate:=StringReplace(viewstate, #10, ' ', [rfReplaceAll]);
viewstate:=StringReplace(viewstate, #13, ' ', [rfReplaceAll]);
```
But it`s no result. What is it?
P.S. I`m from Russia, so sorry for bad English.
|
Word wrap in TMemo at a plus (+) char
|
CC BY-SA 3.0
| null |
2011-07-02T17:47:40.143
|
2018-09-06T20:53:34.443
|
2013-11-24T01:44:59.043
| 508,666 | 667,687 |
[
"delphi",
"char",
"line-breaks"
] |
6,558,941 | 1 | 6,563,913 | null | 3 | 1,451 |
I'm working with gathering data from a biological monitoring system. They need to know the average value of the plateaus after changes to the system are made, as shown below.
This is data for about 4 minutes, as shown there is decent lag time between the event and the steady state response.

These values won't always be this level. They want me to find where the steady-state response starts and average the values during that time. My boss, who is a biologist, said there may be overshoot and random fluctuations... and that I might need to use a z-transform. Unfortunately he wasn't more specific than that.
I feel decently competent as a programmer, but wasn't sure what the most efficient way would be to go about finding these values.
Any algorithms, insights or approaches would be greatly appreciated. Thanks.
|
Finding average settling value after step response
|
CC BY-SA 3.0
| 0 |
2011-07-02T18:53:18.653
|
2011-07-03T17:11:18.403
| null | null | 308,962 |
[
"algorithm",
"numpy",
"signal-processing"
] |
6,558,945 | 1 | 6,559,117 | null | 4 | 537 |

What is an efficient way to change buttons (bands) in the CoolBar (the red rectangle) while switching among items in the TreeView (the purple rectangle). I want to use one set of buttons for every item in the list view.
Thanks for help and advices!
|
Delphi: switch bands of CoolBar
|
CC BY-SA 3.0
| 0 |
2011-07-02T18:54:21.727
|
2011-07-02T19:26:30.290
|
2011-07-02T18:57:49.413
| 282,848 | 791,316 |
[
"delphi",
"toolbar",
"switch-statement"
] |
6,558,956 | 1 | 6,558,997 | null | 2 | 3,077 |

How can I make the view like in the Yellow rectangle. Using TPanel + Color? If yes what about an indent of the text from the left?
Thanks for help and advices!
|
Delphi: TPanel and text indent
|
CC BY-SA 3.0
| 0 |
2011-07-02T18:57:00.590
|
2019-07-30T11:23:11.333
| null | null | 791,316 |
[
"delphi",
"text",
"colors",
"panel",
"indentation"
] |
6,558,969 | 1 | 6,595,632 | null | 8 | 3,451 |
I am adding zxing to my project.
- I first copied the iphone folder to
my project directory.- Then copied the cpp folder to my
project directory.- Dragged the ZXingWidget.xcodeproj
into XCode.- Added the dependency.- Linked the library.- Now for header search paths, I don't
know what to put. Here's what my
setup looks like:

For header search paths, I entered:
- -
But when I try to import QRCodeReader.h it's telling me it's not found. So I am guessing it has something to do with header search paths. Can someone firm that the paths I entered are correct? If not, what could be wrong?
Thanks.
|
Add zxing to XCode 4
|
CC BY-SA 3.0
| 0 |
2011-07-02T18:59:02.727
|
2012-09-07T09:29:39.373
| null | null | 770,337 |
[
"objective-c",
"ios",
"cocoa-touch",
"xcode4",
"zxing"
] |
6,559,015 | 1 | 7,587,515 | null | 0 | 196 |
Ext JS 3.2.2
In IE8, the tabs on my tab panel are not fully populating their images. It looks like the top and right sides. Any ideas on what causes this and how to fix?
See attached screenshot.

|
Images for tabs on TabPanel not fully loading on IE8 in EXT JS3
|
CC BY-SA 3.0
| null |
2011-07-02T19:07:31.900
|
2011-09-28T18:05:53.670
| null | null | 687,739 |
[
"tabpanel",
"extjs3"
] |
6,559,083 | 1 | 6,559,240 | null | 13 | 19,494 |
Currently my drawable just scales to it's normal size, I want it to fit inside my button. Here's a picture of how it looks now:

Here is the xml for the button:
```
<LinearLayout android:layout_width="wrap_content"
android:id="@+id/linearLayout2" android:layout_height="40dp"
android:layout_weight="0.4" android:gravity="right|center_vertical"
android:paddingRight="5dp">
<Button android:id="@+id/button1" android:background="@drawable/refresh"
android:layout_height="25dp" android:layout_width="150dp"
android:text="@string/buttonSearchAgain" android:drawableRight="@drawable/refresh_48"></Button>
</LinearLayout>
```
So I want it to look like this:

Is there any way I can shrink my drawable?
|
Scaling a drawable inside a button?
|
CC BY-SA 3.0
| 0 |
2011-07-02T19:20:38.927
|
2016-04-28T08:50:41.263
|
2014-03-28T21:12:19.217
| 209,866 | 281,434 |
[
"android",
"xml",
"layout"
] |
6,559,082 | 1 | 6,559,383 | null | 1 | 1,685 |
I would Like to sort the keywords by its sort property.
I have a one-many relationship between page -> keyword.
Question: If I perform a comprehension query as:
```
IEnumerable<page> query = from p in contxt.pages where p.ID == myId select p;
IEnumerable<page> pge = query.First();
```
Could I expect a single page record set with all the page’s properties and one keyword collection?
My understanding is since there exist a one-many relationship, I don’t have to perform a join. The Linq to Entity framework should have knowledge of this relationship, and return a collection.
So this is my understanding, so when I try to sort on keyword.sort, the keyword is out of scope:
```
IEnumerable<page> query = from p in contxt.pages where p.ID == myId
orderby p.keywords. select p;
```
Utilizing the above understanding I thought the query is incorrect because keywords is returned as a collection, so I must perform a sort as follows:
```
PageKeywords pageKeywords = new PageKeywords();
Keywords keywords;
IEnumerable<page> query = from p in contxt.pages
where p.ID == vals.pageId select p;
page pge = query.First();
pageKeywords.keywords = new List<Keywords>();
pageKeywords.id = pge.ID;
pageKeywords.description = pge.descp;
pageKeywords.title = pge.title;
pageKeywords.showTitle = pge.showTitle;
pageKeywords.keywords = pge.keywords.OrderBy(k => k.sort);
foreach (var item in pageKeywords.keywords)
{
keywords = new Keywords();
keywords.id = item.id;
keywords.name = item.name;
keywords.sort = item.sort;
pageKeywords.keywords.Add(keywords);
}
```
However this did not work. The keywords were not sorted by sort? The code above does work, however I need the keywords to be sorted by sort property. The keywords collection isn't being sorted.
I also tried:
```
pageKeywords.keywords.Sort((x, y) => int.Compare(x.sort, y.sort));
```
Which did not work.
I have tried to understand, but I am missing something? Any suggestions would be appreciable.

|
Linq-to-Entities working with One-to-Many Relationship and Sorting
|
CC BY-SA 3.0
| 0 |
2011-07-02T19:20:10.680
|
2011-07-02T20:15:53.690
|
2011-07-02T20:08:48.163
| 584,954 | 584,954 |
[
"linq",
"linq-to-entities"
] |
6,559,295 | 1 | null | null | 0 | 149 |
I have a page with two forms that is generated with PHP.
The first part contains text boxes, a submit button and a clear button.
The second form is just a button called "Add more text boxes" so the user can add more to his form if he needs to.
The problem is when I click the "Add more rows" which loads another page which changes a value.
This value then affects the original page when it reloads causing more text boxes to get created.
The problem is that I lose all the data that was entered.
Is there any way to preserve the data when the user clicks "Add more rows"?.
Here's a screenshot of my page.

Thanks
|
Preserving data in one form when submitting a second form
|
CC BY-SA 3.0
| null |
2011-07-02T19:57:01.723
|
2011-11-19T21:33:48.067
|
2011-11-19T21:33:48.067
| 214,668 | 823,430 |
[
"php",
"forms"
] |
6,559,488 | 1 | 6,561,210 | null | 11 | 4,383 |
I am trying to build an interactive web App. using Jquery UI, but I am stuck here - I can't seem to find a way to "Nest" my "boxes" (See fiddle for demo). For example assume there are four boxes - , , , . If A is the parent with high values for width and height, I drag and drop b into - This works fine. I try dragging and dropping another "box" into , which also works fine. But when I try to drop (or even , this doesn't matter) into (Nesting), it doesnt seem to work (See fiddle).
Notice that the fiddle doesn't contain separate "Boxes" but instead just one box thats replicated multiple times. Also note that I haven't implemented the sorting feature (in the fiddle) yet since I haven't been able to fix the nesting issue.
JS Fiddle: [http://jsfiddle.net/JQwsf/](http://jsfiddle.net/JQwsf/)
Just to make sure I'm not trying to confuse anyone here, I've attached an image.

Any help is really much appreciated. Thank you.
|
Jquery UI - Nested Droppables/Sortables
|
CC BY-SA 3.0
| 0 |
2011-07-02T20:39:01.353
|
2011-07-03T05:13:59.140
| null | null | 381,150 |
[
"jquery",
"jquery-ui",
"drag-and-drop",
"draggable"
] |
6,559,526 | 1 | 6,559,542 | null | 3 | 7,053 |
I'm being asked to determine whether this dig answer is authoritative or not.
I'd say yes, but I am not too keen on that.
The rationale behind believing it is indeed authoritative is that the `AUTHORITATIVE SECTION` contains two addresses, that from what one can see from the `ADDITIONAL SECTION` map to `194.117.22.138` and `10.101.85.6`.
We know that this answer was replied from `194.117.22.138`, so it must be the case that the server is authoritative.
Is my reasoning correct or am I taking the wrong approach here?

|
Determining if some dig answer is authoritative or not
|
CC BY-SA 3.0
| 0 |
2011-07-02T20:48:47.297
|
2011-07-02T20:51:18.497
| null | null | 130,758 |
[
"networking",
"computer-science",
"dig"
] |
6,559,551 | 1 | null | null | 0 | 217 |
I'm trying to add the total number of comments made on an article on my site to an RSS feed using FeedBurner.
In the control panel of FeedBurner there is "FeedFlare" which will allow me to add an option "Comments Count"
> Lists the number of comments posted to an item. This Flare only works with self-hosted WordPress sites or other systems that use the element in the feed.
I've tried add the following in my RSS/XML but it doesn't seem to work
`<wfw:comments xmlns:wfw="http://wellformedweb.org/CommentAPI/"><?= $comment_count ?></<wfw:comments>`
AndroidPolice have managed to do it, but I can't figure out anything as I cannot find any way of accessing their raw RSS location.

|
Adding comment count to FeedBurner
|
CC BY-SA 3.0
| null |
2011-07-02T20:53:03.217
|
2011-07-28T19:54:25.157
| null | null | 63,523 |
[
"xml",
"rss",
"feedburner"
] |
6,559,924 | 1 | 6,560,704 | null | 5 | 4,526 |
I use a Toolbar as a MainMenu!
I embed a MainMenu into a ToolBar. But the text of the MainMenu (button's captions) is not in the center of ToolButtons.
I have:

I need:

I create a ToolBar, 4 ToolButtons and assign each menu for each button. Or I assign a MainMenu in "Menu" of a ToolBar. When I create a ToolBotton then it's caption is already at the bottom. Does nobody have the same?
After all these I will embed the ToolBar as the MainMenu into a CoolBar. Finally, I will have the same as in Windows Firewall.
Are there alternatives to have the same effect like the CoolBar of Windows Firewall (with the MainMenu + a break-line + ToolButtons of the ToolBar)?
I use Delphi 2010.
How to do this?
How to use properly a MainMenu in a ToolBar?
Thanks!
P.S. Another example and it is not from Windows:

and how to copy the last example...
|
Delphi: MainMenu and ToolBar. Alternative of CoolBar
|
CC BY-SA 3.0
| 0 |
2011-07-02T22:24:05.480
|
2011-11-30T22:49:13.470
|
2011-07-08T00:07:49.287
| 791,316 | 791,316 |
[
"delphi",
"menu",
"toolbar",
"caption"
] |
6,560,353 | 1 | 6,560,825 | null | 0 | 1,694 |
So the goal I am trying to achieve is that when I click on a button, I would like to change the text of a label. Following some tutorials online, and trying a myriad of alternative memory alloc/release, I still can't get past this error: *** -[HomeViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0x4b4aa10
Here's my code:
In my app delegate:
```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
self.homeViewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:[NSBundle mainBundle]];
self.window.rootViewController = self.homeViewController;
//[window addSubview:self.homeViewController.homeView];
[self.window makeKeyAndVisible];
return YES;
}
- (void)dealloc {
[homeViewController release];
[window release];
[super dealloc];
}
```
Then in my HomeViewController.m:
```
@synthesize btnNewProject;
@synthesize btnOpenProject;
@synthesize label;
- (IBAction)newProject:(id)sender {
NSString *text = @"We did it!";
label.text = text;
//[text release];
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
//self.homeView = nil;
}
- (void)dealloc {
[label release];
[btnOpenProject release];
[btnNewProject release];
//[homeView release];
[super dealloc];
}
```
So the event fires and newProject is called, but I can't get past this crash. I've tried autoreleasing the controller, and some other things. Are there any glaring mistakes?
Thank you!
So I am using IB. I have setup the connections properly, I think, from the HomeViewController (whose class I have set under Custom Class), to the buttons and label, and also the actions to the buttons.
One important detail is that I have a view on top of the view controller (and it's connected to the File's Owner), and the buttons and label are on top of the view in IB, but all the connections are through the HomeViewController - not sure if that should matter. I don't actually set the view anywhere in code (ie. in the App delegate where the controller is set up), but it is a variable within the HomeViewController, declared (without alloc) like the other variables (buttons and label):
```
@interface HomeViewController : UIViewController {
HomeView *homeView;
UIButton *btnNewProject;
UIButton *btnOpenProject;
UILabel *label;
}
@property (nonatomic, retain) HomeView *homeView;
@property (nonatomic, retain) IBOutlet UIButton *btnNewProject;
@property (nonatomic, retain) IBOutlet UIButton *btnOpenProject;
@property (nonatomic, retain) IBOutlet UILabel *label;
- (IBAction)openProject:(id)sender;
- (IBAction)newProject:(id)sender;
@end
```
Here is a screenshot of my connections:

Hmm... going to pick at the allocations a little more...
I have uploaded the project here:
[http://devmu.com/transfer/NoteMap.zip](http://devmu.com/transfer/NoteMap.zip)
|
iOS error: 'message sent to dealllocated instance', when trying to change label
|
CC BY-SA 3.0
| null |
2011-07-03T00:26:47.770
|
2011-07-03T05:59:45.417
|
2011-07-03T02:22:36.530
| 366,716 | 366,716 |
[
"iphone",
"ios",
"memory",
"allocation"
] |
6,560,467 | 1 | 6,560,716 | null | 0 | 100 |
My question is about by which I mean non-code files on which some of my automated tests depend (*.xml, *.xls, *.jpg etc). So I'll use not to be confused with test files meaning code files containing tests.
Most of my automated tests are issolated unit tests but I also have some integration tests in a single project (MyApp.Tests.Integration) that verify the behaviour of classes that interact with external dependencies.
My collection of sample test files are contained in another project in my solution called MyApp.Tests.TestFiles. Each file has a build action of 'Content' and Copy If Newer' set in it's properties.

When I run my tests the solution is built and the files are copied to my output directory "bin\Debug" and my integration tests refer to them there.
The problem that triggered the question was that I'd been committing my sample test files to my svn repository, which is hosted online with a limited amount of storage, alongside my code. The files were occupying an excessive amount of space in the repository. I've since reconstructed the repository and reduced all sample test files to a minimum size.
In most cases the sample test files are unlikely to change so while I want them available to check out from my repository with a Working Copy, there's no real reason to have them under version control as long as I can reconstruct the MyApp.Tests.TestFiles\TestFiles directory structure to run the tests against.
That's the scenario, I'm hoping for answers to the following points:
- - - -
|
Organising 'Sample Test Files' in Visual Studio and SVN
|
CC BY-SA 3.0
| null |
2011-07-03T00:59:37.050
|
2011-07-07T18:59:53.833
|
2011-07-07T18:59:53.833
| 207,687 | 207,687 |
[
"visual-studio",
"svn",
"integration-testing"
] |
6,560,527 | 1 | 6,560,560 | null | 1 | 692 |
I'm trying to make my character move around a tile map with collisions. Everything works fine except for one thing. I show you a picture with the problem:

That is, when I reach a tile above then I can not move anywhere. If you come from the left, I can not move either up or down. If you reach the bottom, I can move to the left but not right. And when you reach the right I can move in any direction.
Honestly I have no idea what may be failing. I think it has to do with if (...), because if I change the order, the addresses where I can move change :/
Here I leave some code:
```
boolean collision = false;
if(Keyboard.isKeyDown(Keyboard.KEY_UP)) {
for(int i = 0; i < map.GetNumLayers(); i++) {
if(UpTile(map, i) > 128) {
collision = true;
}
}
if(!collision) AddPos(0.0f, -vel);
}
if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {
for(int i = 0; i < map.GetNumLayers(); i++) {
if(LeftTile(map, i) > 128) {
collision = true;
}
}
if(!collision) AddPos(-vel, 0.0f);
}
if(Keyboard.isKeyDown(Keyboard.KEY_DOWN)) {
for(int i = 0; i < map.GetNumLayers(); i++) {
if(DownTile(map, i) > 128) {
collision = true;
}
}
if(!collision) AddPos(0.0f, vel);
}
if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) {
for(int i = 0; i < map.GetNumLayers(); i++) {
if(RightTile(map, i) > 128) {
collision = true;
}
}
if(!collision) AddPos(vel, 0.0f);
}
```
|
Tile based map and collision; getting stuck
|
CC BY-SA 3.0
| null |
2011-07-03T01:20:06.923
|
2011-07-03T02:58:22.687
|
2011-07-03T02:58:22.687
| 44,729 | 368,299 |
[
"java",
"collision-detection",
"tile"
] |
6,560,614 | 1 | 6,560,677 | null | 0 | 2,461 |
Did anybody ever installed wkhtmltopdf on Fedora 14?
On [http://code.google.com/p/wkhtmltopdf/wiki/compilation](http://code.google.com/p/wkhtmltopdf/wiki/compilation) there is a step by step for Debian. In the comments, there is also something similar to CentOS.
Till now I have installed:
- Development Tools- openssl-devel libXrender-devel libXext-devel libXft-devel- QT (qt.x86_64 qt-devel.x86_64 qt-webkit.x86_64)- git
And I have also downloaded wkhtmltopdf from git:
```
git clone git://github.com/antialize/wkhtmltopdf.git wkhtmltopdf
```
However, the last steps are driving me crazy. Here's where So I need some help:
- Compiling and installing wkhtmltopdf Now all you need to do is compile and install wkhtmltopdfmake && make install
Here's the wkhtmltopdf folder:

NEW UPDATE:
After running `cd wkhtmltopdf && qmake-qt4 && make` as user, here's what I got:

Then, I searched again for some qt packages I should have and ended with this group:
`qt-webkit-devel.x86_64 php-qt-devel.x86_64 qt-x11.x86_64 qtnx.x86_64`
Then, again, I ran `qmake-qt4 && make` and this time it passed with no errors.
Finally, I ran `sudo make install` and it also passed with no errors.
However, when I ran `wkhtmltopdf -h` it returns:
`wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory`
So, I decided to go all way compiling QT, following exactly the instructions. At the end, I got the same error:
```
$ wkhtmltopdf -h
wkhtmltopdf: error while loading shared libraries: libwkhtmltox.so.0: cannot open shared object file: No such file or directory
```
Any help would be great.
Thanks!
|
wkhtmltopdf on Fedora 14
|
CC BY-SA 3.0
| null |
2011-07-03T01:45:55.430
|
2015-11-16T14:03:42.860
|
2011-07-03T04:10:33.850
| 559,742 | 559,742 |
[
"compilation",
"fedora",
"wkhtmltopdf"
] |
6,560,629 | 1 | 6,560,768 | null | 11 | 6,060 |
I've run into a problem with Webkit browsers (Chrome/Safari), CSS3 Media Queries, `display` and `float` on my [site](http://oo.apphb.com). The default styling on my webpage is to float the element `nav` to the right and `display:inline-block`. When the window is resized to mobile size, Media Queries restyles it to: `float:none; display:block`. The problem arises when the browser is sized back up to normal: the navigation element appears dropped down about the amount of its height. Here's some pictures and markup:
Window Normal and Site Displayed Correctly:

Window Mobile Sized, Site Displayed Correctly:

Window Sized Back To Normal, Site Displayed Incorrectly:

Here's the normal styling for `nav` (and I'm going to move the IE7 stuff into a separate stylesheet...)
```
nav {
text-align:center;
float:right;
display:inline-block;
*display:inline;
zoom:1;
margin-top:30px;
*margin-top:-70px;
}
```
Here's the media query that restyles `nav`:
```
@media screen and (max-width:480px)
{
header nav
{
margin:0;
float:none;
display:block;
}
}
```
So, is this a Webkit bug, or expected behavior? Am I doing something wrong, or is Webkit? If it a bug, anybody know any good workarounds? The live site is [here](http://oo.apphb.com), let me know if I need to provide anymore info. Thanks.
|
Webkit float and display
|
CC BY-SA 3.0
| 0 |
2011-07-03T01:49:00.960
|
2011-07-03T02:34:07.537
| null | null | 719,312 |
[
"css",
"webkit",
"css-float",
"media-queries"
] |
6,560,711 | 1 | 6,561,154 | null | 1 | 60 |
Hi i am having difficulties to group these data as it has no aggregate function. I have the following data in 2 tables and i would like to Join both by PaymentId and `display only 1 row of record`.

How do i display the final result in only groupby CoursePaidForMonthYear.
I would like to get all data from `Payment.*, TutorCourseCommissions.* and CoursePaidForMonthYear column in same row displaying (September, October, November)`
```
referenceId| TutorId| CoursePaidForMonthYear |
1 | 1019 | September, October, November OR 9,10,11|
```
My work:
```
var result = from u in db.Users
join p in db.Payments on u.Id equals p.UserId
join tt in db.TutorCourseCommissions on p.Id equals tt.PaymentId into gtt
from tt in gtt.DefaultIfEmpty()
where u.Id == user.Id
GroupBy tt.CoursePaidForMonthYear ??
select new { u, p, tt };
foreach (var r in result)
{
Payment payment = new Payment();
payment.MonthToPay = (r.tt == null) ? null : common.GetMonthName(r.tt.CoursePaidForMonthYear.Month, true);
payment.Amount = r.p.Amount;
output.Add(payment);
}
return output;
```
|
Grouping troubles
|
CC BY-SA 3.0
| null |
2011-07-03T02:16:15.660
|
2011-07-03T04:49:00.180
|
2011-07-03T02:23:14.137
| 273,200 | 606,543 |
[
"c#",
"linq",
"group-by"
] |
6,560,778 | 1 | 6,560,917 | null | 2 | 1,319 |
I am building an user interface. My program will consist of 4 main parts:
1) Top Menu - TMainMenu. A top of a window
2) Main Menu - TTreeView. A left of a window. Each item of TreeView=corresponded TabSheet of TPageCotrol.
3) Work space - TPageControl. No tabs. An left space.
Each TabSheet has it's own ToolBar and other controls. It will be 5 menus (5 items in TreeView) = 5 TabSheets -> 5 ToolBars and other controls on each TabSheet.
It almost exactly looks like here (it could be: TreeView as Main Menu; MainMenu as Top Menu; Work Area - ToolBar and other controls):

I would like to use an user interface like here:

Where the CoolBar are represented with the Top Menu and the ToolBar (it suits my purpose to use 5 ToolBars instead of 1 ToolBar on each TabSheet). But after a discussion here it seems impossible to copy this CoolBar with the MainMenu and the ToolBar.
My question: how to build an efficient user interface using as examples the UI of uTorrent and the UI of Windows Firewall?
Are there good alternatives, ideas of a building of the UI? How would you make your interface if you need those 4 parts as me?
Now I have something like this:

Thanks!
|
Delphi: suggests, ideas in a building of User Interface
|
CC BY-SA 3.0
| 0 |
2011-07-03T02:38:25.953
|
2011-07-03T07:56:02.527
|
2011-07-03T06:06:26.037
| 791,316 | 791,316 |
[
"delphi",
"user-interface"
] |
6,560,804 | 1 | 6,572,752 | null | 2 | 1,192 |

When i use Eclipse in ubuntu Natty i am not able to read these tips. Please help me to solve these issues. I searched the web and got suggestions to install and use "Eclipse Color Themes" from [http://www.eclipsecolorthemes.org/](http://www.eclipsecolorthemes.org/) still the problem exists. I have only tried java in Eclipse i hope that this problem exists for other languages Eclipse support
|
Eclipse theme problem in Ubuntu Natty (11.04)
|
CC BY-SA 3.0
| 0 |
2011-07-03T02:47:16.567
|
2011-07-04T14:25:47.927
| null | null | 452,202 |
[
"java",
"eclipse",
"ubuntu-11.04"
] |
6,560,950 | 1 | 6,560,967 | null | 1 | 215 |
I am getting another memory leak in a non-void instance method that returns a object of class NSMutableArray.

Can someone advise me on how I can fix this leak? I tried to release 'userFollowings' at the end of the method but it's still reporting a leak.
|
Objective C: Memory Leak in non-void instance method
|
CC BY-SA 3.0
| null |
2011-07-03T03:30:46.883
|
2011-07-03T03:44:28.937
| null | null | 683,898 |
[
"objective-c",
"ios",
"memory-leaks"
] |
6,561,046 | 1 | 6,736,783 | null | -2 | 402 |
I have an issue when i show the VirtualKeyboard then appears on my screen a blank space over the MainScreen.
Some ideas to avoid this blank space?
Probably is the same weird attitude of the Blackberry OS with this guy...
[Weird behavior in Blackberry when toggling virtual keyboard between two textboxes](https://stackoverflow.com/questions/6332022/weird-behavior-in-blackberry-when-toggling-virtual-keyboard-between-two-textboxes)

|
Blackberry Issue showing VirtualKeyboard and getting a blank screen
|
CC BY-SA 3.0
| null |
2011-07-03T04:10:36.267
|
2017-07-13T15:01:27.083
|
2017-07-13T15:01:27.083
| 1,000,551 | 250,260 |
[
"blackberry",
"virtual-keyboard"
] |
6,561,061 | 1 | 6,655,441 | null | 4 | 1,195 |
I'm using [Vpim](http://vpim.rubyforge.org/) to generate .vcf files that users can then import into their address books. The problem that I'm having is that the information that their downloading is for a Company and not a person so I need to mark the card as being such. Is there a way to do this using Vpim or is there another gem that I could use to accomplish this?
```
def to_vcf
card = Vpim::Vcard::Maker.make2 do |maker|
...
end
end
```
```
BEGIN:VCARD
VERSION:3.0
N:;;;;
FN:The Flow Skatepark
ORG:The Flow Skatepark;
item1.TEL;type=pref:(614) 864-1610
item1.X-ABLabel:Work #
item2.ADR;type=WORK;type=pref:;;4252 Groves Rd;Columbus;OH;43232;USA
item2.X-ABADR:us
BDAY;value=date:2001-07-06
X-ABShowAs:COMPANY
X-ABUID:5F7349CB-369F-4EAC-AB65-49ED902BEF9F\:ABPerson
END:VCARD
```
```
BEGIN:VCARD
VERSION:3.0
N:;The Flow Skatepark;;;
FN:The Flow Skatepark
item1.TEL;type=pref:(614) 864-1610
item1.X-ABLabel:Work #
item2.ADR;type=WORK;type=pref:;;4252 Groves Rd;Columbus;OH;43232;USA
item2.X-ABADR:us
BDAY;value=date:2001-07-06
X-ABUID:5F7349CB-369F-4EAC-AB65-49ED902BEF9F\:ABPerson
END:VCARD
```
Obviously there are two main differences in these code samples:
- -
I don't know how this translates into Vpim however.

|
Create Company Card w/ Vpim Gem
|
CC BY-SA 3.0
| 0 |
2011-07-03T04:16:14.827
|
2011-07-11T19:45:37.660
|
2011-07-09T22:51:57.080
| 435,471 | 435,471 |
[
"ruby-on-rails",
"ruby",
"ruby-on-rails-3",
"rubygems",
"vpim"
] |
6,561,100 | 1 | 6,561,718 | null | 2 | 259 |
I am hitting the below memory leak warning after analyzing my code.

However, the warning is not showing up within my code to tell me exactly where this leak is happening. Can anyone advise me on what usually cause this leak and how can I search my code to identify it?
|
Objective C: Memory Leak due to 'Incorrect decrement of reference count'
|
CC BY-SA 3.0
| null |
2011-07-03T04:31:16.710
|
2011-07-03T07:46:18.123
| null | null | 683,898 |
[
"objective-c",
"ios",
"memory-leaks"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.