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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,897,227 | 1 | 6,198,202 | null | 0 | 1,038 |
I have a popup using div and javascript in a jsp page which also has some richface controls.
```
<a class="pr-toolbar-link pr-icon-help" href="#"
onclick="popupWindow('aboutPopup',true);"
onblur="popupWindow('aboutPopup',false);">About</a>
<div id="aboutPopup" class="popup">
<div class="popupbody">
<p>Some Message</p>
</div>
</div>
```
When I click "About" the popup is displayed properly in firefox i.e. on the top of all other things, but in IE it is overlapped by other controls. Following is the CSS
```
.popup { border: solid 1px #333; font-family: Tahoma; font-size: 12px; display: none; position: absolute; width:300px; z-index:1; }
.popuptitle { background: #784574; color: white; font-weight: bold; height: 15px; padding: 5px; }
.popupbody { background: #dee5ec; padding: 5px; text-align: center; }
#aboutPopup { top: 27px; left: 110px; }
```
I tried setting z-index value to higher then all other controls but still nothing different happens.
Edit:
Firefox popup

IE7 Popup

IE7 Popup
|
Popup using javascript & div doesnot behave same in Firefox & IE
|
CC BY-SA 3.0
| null |
2011-05-05T11:54:24.507
|
2011-06-01T08:19:54.887
|
2020-06-20T09:12:55.060
| -1 | 555,929 |
[
"javascript",
"html",
"popup",
"richfaces"
] |
5,897,447 | 1 | 5,902,363 | null | 0 | 532 |
I've been having a strange problem with CoreData for a while now. This will be a lenghty question, so bear with me...
I have two Entites, call them A and B. B might be both creator and updater of several A's. A must have a B as creator, and may or may not have a B as updater. (Required and optional relationships.)
B might have both created and updated zero or more A's.

The above is the data model I built. (I don't really the inverse relationship from B to A, but CoreData gives me compile time warnings otherwise.)
Here are the relevant parts of the ManagedObject subclasses:
A.h
```
@property (nonatomic, retain) B * creator;
@property (nonatomic, retain) B * updater;
```
A.m
```
@dynamic creator;
@dynamic updater;
```
B.h
```
@property (nonatomic, retain) NSSet * created;
@property (nonatomic, retain) NSSet * updated;
```
B.m
```
@dynamic updated;
@dynamic created;
- (void)addUpdatedObject:(A *)value { NSSet *changedObjects = [[NSSet
alloc] initWithObjects:&value count:1]; [self
willChangeValueForKey:@"updated"
withSetMutation:NSKeyValueUnionSetMutation
usingObjects:changedObjects]; [[self
primitiveValueForKey:@"updated"] addObject:value]; [self
didChangeValueForKey:@"updated"
withSetMutation:NSKeyValueUnionSetMutation
usingObjects:changedObjects]; [changedObjects release]; }
- (void)removeUpdatedObject:(A *)value { NSSet *changedObjects =
[[NSSet alloc] initWithObjects:&value count:1]; [self
willChangeValueForKey:@"updated"
withSetMutation:NSKeyValueMinusSetMutation
usingObjects:changedObjects]; [[self
primitiveValueForKey:@"updated"] removeObject:value]; [self
didChangeValueForKey:@"updated"
withSetMutation:NSKeyValueMinusSetMutation
usingObjects:changedObjects]; [changedObjects release]; }
- (void)addUpdated:(NSSet *)value { [self
willChangeValueForKey:@"updated"
withSetMutation:NSKeyValueUnionSetMutation usingObjects:value];
[[self primitiveValueForKey:@"updated"] unionSet:value]; [self
didChangeValueForKey:@"updated"
withSetMutation:NSKeyValueUnionSetMutation usingObjects:value]; }
- (void)removeUpdated:(NSSet *)value { [self
willChangeValueForKey:@"updated"
withSetMutation:NSKeyValueMinusSetMutation usingObjects:value];
[[self primitiveValueForKey:@"updated"] minusSet:value]; [self
didChangeValueForKey:@"updated"
withSetMutation:NSKeyValueMinusSetMutation usingObjects:value]; }
- (void)addCreatedObject:(A *)value { NSSet *changedObjects = [[NSSet
alloc] initWithObjects:&value count:1]; [self
willChangeValueForKey:@"created"
withSetMutation:NSKeyValueUnionSetMutation
usingObjects:changedObjects]; [[self
primitiveValueForKey:@"created"] addObject:value]; [self
didChangeValueForKey:@"created"
withSetMutation:NSKeyValueUnionSetMutation
usingObjects:changedObjects]; [changedObjects release]; }
- (void)removeCreatedObject:(A *)value { NSSet *changedObjects =
[[NSSet alloc] initWithObjects:&value count:1]; [self
willChangeValueForKey:@"created"
withSetMutation:NSKeyValueMinusSetMutation
usingObjects:changedObjects]; [[self
primitiveValueForKey:@"created"] removeObject:value]; [self
didChangeValueForKey:@"created"
withSetMutation:NSKeyValueMinusSetMutation
usingObjects:changedObjects]; [changedObjects release]; }
- (void)addCreated:(NSSet *)value { [self
willChangeValueForKey:@"created"
withSetMutation:NSKeyValueUnionSetMutation usingObjects:value];
[[self primitiveValueForKey:@"created"] unionSet:value]; [self
didChangeValueForKey:@"created"
withSetMutation:NSKeyValueUnionSetMutation usingObjects:value]; }
- (void)removeCreated:(NSSet *)value { [self
willChangeValueForKey:@"created"
withSetMutation:NSKeyValueMinusSetMutation usingObjects:value];
[[self primitiveValueForKey:@"created"] minusSet:value]; [self
didChangeValueForKey:@"created"
withSetMutation:NSKeyValueMinusSetMutation usingObjects:value]; }
```
When I create a new A with a B as creator, everything is fine (when using inverse relationships). However, when I update that same A later, using the same B as creator, i get the following crash:
```
2011-05-05 13:17:40.885 myapp[27033:207] -[NSCFNumber count]:
unrecognized selector sent to instance 0x5d14eb0
2011-05-05 13:17:40.887 myapp[27033:207] *** Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFNumber
count]: unrecognized selector sent to instance
0x5d14eb0'
*** Call stack at first throw: (
0 CoreFoundation 0x014065a9
__exceptionPreprocess + 185
1 libobjc.A.dylib 0x0155a313 objc_exception_throw + 44
2 CoreFoundation 0x014080bb -[NSObject(NSObject)
doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x01377966 ___forwarding___ + 966
4 CoreFoundation 0x01377522 _CF_forwarding_prep_0 + 50
5 CoreFoundation 0x013b7c3b -[NSSet intersectsSet:] + 59
6 Foundation 0x00c3f4fb NSKeyValueWillChangeBySetMutation +
422
7 Foundation 0x00c0416d NSKeyValueWillChange + 400
8 Foundation 0x00c3f34d
-[NSObject(NSKeyValueObserverNotification)
willChangeValueForKey:withSetMutation:usingObjects:] + 315
9 CoreData 0x01172bd0 -[NSManagedObject
willChangeValueForKey:withSetMutation:usingObjects:] + 112
10 myapp 0x0004fd48 -[B addUpdatedObject:] + 168
11 CoreData 0x011729f2 -[NSManagedObject(_NSInternalMethods)
_includeObject:intoPropertyWithKey:andIndex:] + 98
12 CoreData 0x01169301 -[NSManagedObject(_NSInternalMethods)
_didChangeValue:forRelationship:named:withInverse:] + 497
13 Foundation 0x00c051e4 NSKeyValueNotifyObserver + 361
14 Foundation 0x00c04ca6 NSKeyValueDidChange + 384
15 Foundation 0x00beb3e2
-[NSObject(NSKeyValueObserverNotification)
didChangeValueForKey:] + 123
16 CoreData 0x01166adb
_PF_ManagedObject_DidChangeValueForKeyIndex + 171
17 CoreData 0x01165de9 _sharedIMPL_setvfk_core + 313
18 CoreData 0x01173997 _svfk_11 + 39
```
(Yes, has the method `addUpdatedObject`defined.)
For further background, the list of A:s are shown in a `UITableView` backed by a `NSFetchedResultsController`.
The strangest thing is, IMHO, that it's perfectly possible to add a new A (with B as creator) with the inverse relationship without it leading to a crash, while adding the same B as updater to that same A leads to a crash.
However, when I remove the inverse relationships, everything works as expected.

I can add the same B as A:s creator and updater without any problems, and the app works as it should, except for the build-time warnings from CoreData:
```
A.creator should have an inverse
A.updater should have an inverse
```
So, is there any CoreData guru out there that can explain why the first case breaks?
|
Does CoreData allow object graph loops? (Strange error)
|
CC BY-SA 3.0
| null |
2011-05-05T12:12:54.477
|
2011-05-05T18:18:46.533
|
2011-05-05T16:26:30.593
| 494,626 | 494,626 |
[
"objective-c",
"ios",
"core-data",
"nsmanagedobject"
] |
5,897,548 | 1 | null | null | 2 | 4,478 |
I can input boolean data into a C s-function by defining it as an int32 (see code below). How do I input boolean data with SS_BOOLEAN or SS_UINT8 type? I specified the signal data type explicitly in my Simulink model and s-function but when I defined the data as boolean or uint8, I got strange numbers instead of 1 or 0.
```
static void mdlInitializeSizes( SimStruct *S )
{
...
ssSetInputPortRequiredContiguous(S, 0, true);
ssSetInputPortDataType(S, 0, SS_INT32);
...
}
static void mdlOutputs( SimStruct *S, int_T tid )
{
const int *myBoolean = (const int*) ssGetInputPortSignal( S, 0 );
...
}
```
I tried the [solution proposed by MikeT](https://stackoverflow.com/questions/5897548/how-to-input-a-boolean-to-a-simulink-c-s-function/5905886#5905886) to no avail. As output I was expecting [10 20 30] but got [1 2 3]. Below is the Simulink model, the ouput on command window and s-function code:

```
static void mdlOutputs( SimStruct *S, int_T tid )
{
InputBooleanPtrsType useData1 = (InputBooleanPtrsType) ssGetInputPortSignalPtrs( S, 0 );
InputBooleanPtrsType useData2 = (InputBooleanPtrsType) ssGetInputPortSignalPtrs( S, 1 );
const double *data1 = (const double*) ssGetInputPortSignal( S, 2 );
const double *data2 = (const double*) ssGetInputPortSignal( S, 3 );
double *outputs = (double *) ssGetOutputPortRealSignal( S, 0 );
double *data;
int i;
if (*useData1){data = data1;}
else if (*useData2){data = data2;}
//assign outputs:
for (i=0; i<3; i++){outputs[i] = data[i];}
printf("useData1 = %d\n", *useData1);
printf("useData2 = %d\n", *useData2);
}
static void mdlInitializeSizes( SimStruct *S )
{
int iPort;
if ( !ssSetNumInputPorts( S, 4 ) )
{
return;
}
ssSetInputPortDataType(S, 0, SS_BOOLEAN);
ssSetInputPortDataType(S, 1, SS_BOOLEAN);
ssSetInputPortDataType(S, 2, SS_DOUBLE);
ssSetInputPortDataType(S, 3, SS_DOUBLE);
ssSetInputPortWidth( S, 0, 1 );
ssSetInputPortWidth( S, 1, 1 );
ssSetInputPortWidth( S, 2, 3 );
ssSetInputPortWidth( S, 3, 3 );
for (iPort = 0; iPort < 4 ; iPort++)
{
ssSetInputPortRequiredContiguous(S, iPort, true); /*direct input signal access*/
ssSetInputPortDirectFeedThrough( S, iPort, 1 );
}
if ( !ssSetNumOutputPorts( S, 1 ) )
{
return;
}
ssSetOutputPortDataType(S, 0, SS_DOUBLE);
ssSetOutputPortWidth( S, 0, 3 );
ssSetNumSampleTimes( S, 1 );
ssSetOptions( S, SS_OPTION_EXCEPTION_FREE_CODE );
}
```
|
How to input a boolean to a Simulink C s-function
|
CC BY-SA 3.0
| null |
2011-05-05T12:21:36.923
|
2011-05-20T09:45:37.650
|
2017-05-23T12:01:33.300
| -1 | 51,358 |
[
"boolean",
"simulink"
] |
5,897,747 | 1 | null | null | 12 | 1,758 |
I'm building an app that get its layout based on external data. The layout is split into different blocks depending on the indata. These blocks are displayed with the help of a viewflipper. In each block there is, for the time being, one or more "textview" and "edittext". On the first page of the flipper all data is showing as it should in the textviews and edittexts. But on the other pages in the viewflipper the value in the edittexts is not showing until the edittext get focused. I have no idea why. So to be clear. The values for all edittexts is actually there, but doesn't show until the edittext get focused. The problem is the same on all devices I have runned the app on (emulator, HTC Desire, HTC Wildfire). Does anyone know how to fix this problem?
Here is the class that generate the layout:
```
public class ModuleLayout extends LinearLayout {
public ModuleLayout(Context context, ArrayList<BaseModuleItem> itemList) {
super(context);
TableLayout tempTable = new TableLayout(context);
for (int i = 0; i < itemList.size(); i++)
{
TableRow tempRow = new TableRow(context);
TextView tempTextView = new TextView(context);
tempTextView.setText(itemList.get(i).getName());
EditText tempEditText = new EditText(context);
tempEditText.setText(itemList.get(i).getItemValue());
tempRow.addView(tempTextView);
tempRow.addView(tempEditText);
tempTable.addView(tempRow);
}
tempTable.setColumnStretchable(1, true);
this.addView(tempTable);
}
}
```
Here is a picture of the problem in action.

The left picture displays all its values fine. The right picture is on the second position in the viewflipper and does not display the values in the edittexts, with the exception for the first that have focus. I should also mention that after an edittext has gotten focus it continues to display the value even if I fling to other views in the viewflipper and then back.
|
Value in edittext don't show until it get focus. Android
|
CC BY-SA 3.0
| 0 |
2011-05-05T12:36:30.400
|
2017-12-06T10:27:13.540
|
2017-12-06T10:27:13.540
| 2,235,972 | 739,845 |
[
"java",
"android",
"android-edittext",
"viewflipper"
] |
5,897,917 | 1 | 5,902,659 | null | 1 | 1,607 |
I'm a new grad, so please be kind. I'm working on validating input in a Flex DataGrid cell that the user can edit. The rows in the DataGrid are backed by an `mx.collections.ArrayCollection` that includes a `[Bindable]Model` that I wrote. I want to validate against a [custom client-side Validator](http://livedocs.adobe.com/flex/3/html/help.html?content=createvalidators_1.html), if-and-only-if that passes I want to validate the input on the server. If client-side validation fails, I want to display the normal validation error (see image below). If server-side validation fails, I want to use the same sort of UI components to notify the user. The solution should not include any external framework ([Cairngorm](http://sourceforge.net/adobe/cairngorm/home/) or [PureMVC](http://puremvc.org/)).

My DataGrid implementation is:
```
<mx:DataGrid id="myPageGrid" dataProvider="{myModelList}" editable="true"
itemEditEnd="verifyInputIsValid(event)">
<mx:columns>
<mx:DataGridColumn dataField="name" headerText="Name"
editable="false" />
<mx:DataGridColumn dataField="fieldNeedingValidation" editable="true"
id="fnv" headerText="Field Needing Validation" />
</mx:columns>
</mx:DataGrid>
```
When a user edit's a cell, this function is called:
```
private function verifyInputIsValid(event:DataGridEvent):void
{
// Check the reason for the event.
if (event.reason == DataGridEventReason.CANCELLED)
{
return; // Do not update cell.
}
// For the fieldNeedingValidation only
if(event.dataField == "fieldNeedingValidation") {
// Get the new data value from the editor.
var newValue:String = TextInput(event.currentTarget.itemEditorInstance).text;
var validatorResult:ValidationResultEvent = myValidator.validate(newValue);
if(validatorResult.type==ValidationResultEvent.INVALID){
// Prevent the user from removing focus, and leave the cell editor open.
// Also, the edit will not continue and store the blank value
event.preventDefault();
// Write a message to the errorString property.
// This message appears when the user mouses over the editor.
TextInput(myPageGrid.itemEditorInstance).errorString = validatorResult.message;
return;
}
else if(validatorResult.type==ValidationResultEvent.VALID){
// Assuming the data is valid on the Server, this is fine
TextInput(myPageGrid.itemEditorInstance).errorString = "";
TextInput(myPageGrid.itemEditorInstance).text = newValue;
return;
// I'd rather do this
remoteObjectValidationService.validate(newValue);
// Get a String result back from the call to the RemoteObject
// Mark this "edit" (of the cell) as invalid, just as the client-side validator would
}
}
}
```
Of course, for this to work, the `resultHandler` of the `remoteObjectValidationService` would need to be invoked (and run) before we exit the `verifyInputIsValid` function. In a "synchronous" fashion. I know [“All IO in Flex is asynchronous”](https://stackoverflow.com/questions/708338/synchronous-calls-using-remoteobject#answer-710126) , but there must be a standard way to do something like this right? I've already implemented my custom Validator and that works just fine.
I realize it seems silly to search out this "synchronous" design and I hope someone has an answer to solve my problem with best practices. In my defense, the reason I want to validate on the server immediately following client-side validation is so that I'm using Flex's validation framework. If I get an invalid response from the server, I want to leverage the built-in UI components that Flex has to tell the user something is incorrect about his/her input.
Any ideas?
|
Handle client and server validation with Flex 3?
|
CC BY-SA 3.0
| null |
2011-05-05T12:48:22.097
|
2011-05-12T14:27:11.660
|
2017-05-23T11:55:35.580
| -1 | 320,399 |
[
"flash",
"apache-flex",
"actionscript-3",
"design-patterns",
"flex3"
] |
5,898,610 | 1 | 5,898,689 | null | 0 | 157 |
Am trying to hide this publish 'tick-box' from non-admin users. I used the CanCan plug-in and set up the correct permissions but am struggling with the code syntax. I have used in the views/articles/_form.html.erb partial but it doesn't work?
```
<div class="field">
<%= f.label :tag_names, "Tags" %> <br />
<%= f.text_field :tag_names %>
</div>
<div class="field">
<%= check_box("article", "published" ) %>
**<%= if can? :publish, @article %>**
<%= "Publish article" %>
</div>
<div class="actions">
<%= f.submit %>
</div>
```

|
Hide 'Publish' Button From non Admins?
|
CC BY-SA 3.0
| null |
2011-05-05T13:37:11.930
|
2011-05-05T20:30:34.317
|
2011-05-05T20:17:35.040
| 372,237 | 372,237 |
[
"ruby-on-rails-3",
"permissions",
"cancan"
] |
5,898,709 | 1 | 5,899,104 | null | 0 | 4,518 |
I am trying to build an application that generates a custom list item which will be displayed on the screen dynamicly(like contact list update), and have the following code which works pretty well on both IE and Firefox.
```
<html>
<head>
<style type="text/css">
.divCss table{
width:100%;
height:130px;
}
.divCss {
width:100%;
height:100%;
border:solid 1px #c0c0c0;
background-color:#999000;
font-size:11px;
font-family:verdana;
color:#000;
}
.divCss table:hover{
background-color :#FF9900;
}
</style>
<script type="text/javascript" language="javascript">
var elementCounts = 0;
function myItemClicked(item)
{
alert("item clicked:"+item.id);
}
function createItem()
{
var pTag = document.createElement("p");
var tableTag = document.createElement("table");
tableTag.id = "" + (elementCounts++);
tableTag.setAttribute("border","1");
tableTag.setAttribute("cellpadding","5");
tableTag.setAttribute("width","100%");
tableTag.setAttribute("height","130px");
tableTag.onclick = function() {myItemClicked(this);};
var tBody = document.createElement("tbody");
var tr1Tag = document.createElement("tr");
var tdImageTag = document.createElement("td");
tdImageTag .setAttribute("width","100px");
tdImageTag .setAttribute("rowspan","2");
var imgTag = document.createElement("img");
imgTag.setAttribute("width","100px");
imgTag.setAttribute("height","100px");
imgTag.id = "avatar";
tdImageTag .appendChild(imgTag);
var tdTextTag= document.createElement("td");
tdTextTag.setAttribute("height","30%");
tdTextTag.setAttribute("nowrap","1");
tdTextTag.setAttribute("style","font-weight: bold; font-size: 20px;");
tdTextTag.id = "text";
tdTextTag.innerHTML = "text";
tr1Tag.appendChild(tdImageTag);
tr1Tag.appendChild(tdTextTag);
var tr2Tag = document.createElement("tr");
var tdAnotherTextTag = document.createElement("td");
tdAnotherTextTag.setAttribute("valign","top");
tdAnotherTextTag.id = "anotherText";
tdAnotherTextTag.innerHTML = "Another Text";
tr2Tag.appendChild(tdAnotherTextTag );
tBody.appendChild(tr1Tag);
tBody.appendChild(tr2Tag);
tableTag.appendChild(tBody);
tableTag.className ="divCss";
pTag.appendChild(tableTag);
document.getElementById("list").appendChild(pTag);
}
function clearList()
{
document.getElementById("list").innerHTML = "";
elementCounts = 0;
}
</script>
</head>
<body>
<input id="btn1" type="button" value="create item" onclick="createItem();" />
<input id="btn2" type="button" value="clear list" onclick="clearList();" />
<div id="list" class="divCss" style="overflow: scroll;"></div>
</body>
</html>
```
This code generates a new table element on click of "create item" button and adds it inside a div element on the main page.
The table element is supposed to be like the following
```
+---------------+--------------------+
| | Text |
| Image with | |
| rowspan of +--------------------|
| 2 | Another Text |
| | |
+---------------+--------------------+
```
The above code does showup properly on firefox, however on IE, the rowspan is kinda ignored and the output looks like
```
+---------------+--------------------+
| Image with | Text |
|rowspan ignored| |
|---------------+--------------------|
| Another Text | |
| | |
+---------------+--------------------+
```
Can anyone help me why this must be happening? I also checked writing direct tags ( instead of using createElement and appendChild), and that works, but the dynamic generation seems to be problamatic. Am I doing anything worng here?
Also, after adding the generated table elements in the div element ( "list" ), there seems to be some gap between consecutive table elements and am not able to remove it even if i specify margin and padding as 0 in div tag.
Any help would be much appreciated.
Thanks.
Here is the output as expected: ( This works in jsfiddle as suggessted by Shadow Wizard ).
```
+------------------------------------+
| List Element 1 |
+---------------+--------------------+
| | Text |
| Image with | |
| rowspan of +--------------------|
| 2 | Another Text |
| | |
+---------------+--------------------+
| List Element 2 |
+---------------+--------------------+
| | Text |
| Image with | |
| rowspan of +--------------------|
| 2 | Another Text |
| | |
+---------------+--------------------+
| List Element 3 |
+---------------+--------------------+
| | Text |
| Image with | |
| rowspan of +--------------------|
| 2 | Another Text |
| | |
+---------------+--------------------+
```
Here is the output that i get on chrome, ie, firefox..
```
+------------------------------------+
| List Element 1 |
+---------------+--------------------+
| | Text |
| Image with | |
| rowspan of +--------------------|
| 2 | Another Text |
| | |
+---------------+--------------------+
Gap
+------------------------------------+
| List Element 2 |
+---------------+--------------------+
| | Text |
| Image with | |
| rowspan of +--------------------|
| 2 | Another Text |
| | |
+---------------+--------------------+
Gap
+------------------------------------+
| List Element 3 |
+---------------+--------------------+
| | Text |
| Image with | |
| rowspan of +--------------------|
| 2 | Another Text |
| | |
+---------------+--------------------+
```
Sorry for explaining things like this. I was not able to upload my snapshots. However, you can see the difference between jsfiddle and other browser effects by opening the page as html file in any browser.
EDIT (Shadow_Wizard) - here is the screenshot: 
|
table setAttribute not working properly in IE
|
CC BY-SA 3.0
| null |
2011-05-05T13:43:35.130
|
2011-05-08T06:54:30.523
|
2011-05-08T06:50:13.773
| 447,356 | 473,184 |
[
"javascript",
"html",
"internet-explorer",
"quirks-mode"
] |
5,899,013 | 1 | 6,084,086 | null | 0 | 921 |
this is kind of tricky: I have an C# web application running always on [http://localhost](http://localhost) (it is configured like this in csproj properties).
The site runs fine on VS 2008, but Firefox plugin called Firebug is showing this messages:

The files exist on the folders, but IIS has some trouble when trying to show them.
What can I do to solve this issue?
My environment: IIS 7, Windows 7, Visual Studio 2008, Firefox 3.6. Classic Application pool.
|
Why some files return Network Error: 410 Gone on Firebug for C# web application under IIS?
|
CC BY-SA 3.0
| null |
2011-05-05T14:05:35.617
|
2011-05-21T19:54:41.660
| null | null | 66,708 |
[
"networking",
"iis-7",
"firebug",
"c#-2.0"
] |
5,899,185 | 1 | 5,899,350 | null | 82 | 31,200 |
I am working with models of neurons. One class I am designing is a cell class which is a topological description of a neuron (several compartments connected together). It has many parameters but they are all relevant, for example:
number of axon segments, apical bifibrications, somatic length, somatic diameter, apical length, branching randomness, branching length and so on and so on... there are about 15 parameters in total!
I can set all these to some default value but my class looks crazy with several lines for parameters. This kind of thing must happen occasionally to other people too, is there some obvious better way to design this or am I doing the right thing?
As some of you have asked I have attached my code for the class, as you can see this class has a huge number of parameters (>15) but they are all used and are necessary to define the topology of a cell. The problem essentially is that the physical object they create is very complex. I have attached an image representation of objects produced by this class. How would experienced programmers do this differently to avoid so many parameters in the definition?

```
class LayerV(__Cell):
def __init__(self,somatic_dendrites=10,oblique_dendrites=10,
somatic_bifibs=3,apical_bifibs=10,oblique_bifibs=3,
L_sigma=0.0,apical_branch_prob=1.0,
somatic_branch_prob=1.0,oblique_branch_prob=1.0,
soma_L=30,soma_d=25,axon_segs=5,myelin_L=100,
apical_sec1_L=200,oblique_sec1_L=40,somadend_sec1_L=60,
ldecf=0.98):
import random
import math
#make main the regions:
axon=Axon(n_axon_seg=axon_segs)
soma=Soma(diam=soma_d,length=soma_L)
main_apical_dendrite=DendriticTree(bifibs=
apical_bifibs,first_sec_L=apical_sec1_L,
L_sigma=L_sigma,L_decrease_factor=ldecf,
first_sec_d=9,branch_prob=apical_branch_prob)
#make the somatic denrites
somatic_dends=self.dendrite_list(num_dends=somatic_dendrites,
bifibs=somatic_bifibs,first_sec_L=somadend_sec1_L,
first_sec_d=1.5,L_sigma=L_sigma,
branch_prob=somatic_branch_prob,L_decrease_factor=ldecf)
#make oblique dendrites:
oblique_dends=self.dendrite_list(num_dends=oblique_dendrites,
bifibs=oblique_bifibs,first_sec_L=oblique_sec1_L,
first_sec_d=1.5,L_sigma=L_sigma,
branch_prob=oblique_branch_prob,L_decrease_factor=ldecf)
#connect axon to soma:
axon_section=axon.get_connecting_section()
self.soma_body=soma.body
soma.connect(axon_section,region_end=1)
#connect apical dendrite to soma:
apical_dendrite_firstsec=main_apical_dendrite.get_connecting_section()
soma.connect(apical_dendrite_firstsec,region_end=0)
#connect oblique dendrites to apical first section:
for dendrite in oblique_dends:
apical_location=math.exp(-5*random.random()) #for now connecting randomly but need to do this on some linspace
apsec=dendrite.get_connecting_section()
apsec.connect(apical_dendrite_firstsec,apical_location,0)
#connect dendrites to soma:
for dend in somatic_dends:
dendsec=dend.get_connecting_section()
soma.connect(dendsec,region_end=random.random()) #for now connecting randomly but need to do this on some linspace
#assign public sections
self.axon_iseg=axon.iseg
self.axon_hill=axon.hill
self.axon_nodes=axon.nodes
self.axon_myelin=axon.myelin
self.axon_sections=[axon.hill]+[axon.iseg]+axon.nodes+axon.myelin
self.soma_sections=[soma.body]
self.apical_dendrites=main_apical_dendrite.all_sections+self.seclist(oblique_dends)
self.somatic_dendrites=self.seclist(somatic_dends)
self.dendrites=self.apical_dendrites+self.somatic_dendrites
self.all_sections=self.axon_sections+[self.soma_sections]+self.dendrites
```
|
Class with too many parameters: better design strategy?
|
CC BY-SA 3.0
| 0 |
2011-05-05T14:16:30.333
|
2021-04-12T07:46:07.813
|
2015-06-25T09:43:05.210
| 3,489,230 | 592,235 |
[
"python",
"oop",
"neuroscience"
] |
5,899,568 | 1 | 5,899,720 | null | 0 | 346 |
This image describes it all:

As you can see, there is a border under each image, but not to the left or right.
Also you can see, I marked the link-tag in the inspector and it shows a frame from approximately the middle of the image till under the picture including the unwanted border.
I already removed the text-decoration from the link, but this didn't changed a thing.
As most didn't get the root of the problem, here a larger version of the screenshot:
[http://imageshack.us/f/10/screenshotfgi.png/](http://imageshack.us/f/10/screenshotfgi.png/)
Follow the link and click again on the picture you get.
Look at the blue box in the lower right. It is marked by Chrome as I selected the hyperlink-tag in the inspector. Here you can see, the hyperlink causes the border/space. How to get rid of this space by changing the hyperlink-tag's style?
|
How to get rid of link borders when working with linked images?
|
CC BY-SA 3.0
| null |
2011-05-05T14:39:12.363
|
2011-05-06T22:05:06.423
|
2011-05-05T14:53:05.713
| 179,602 | 179,602 |
[
"html",
"css",
"border"
] |
5,899,582 | 1 | 6,008,589 | null | 1 | 4,317 |
i am trying to build a network simulation with OMNet++. Problem is i dont know how to configure EtherSwitch and EtherHost devices and give them IP. What is the necessary routing code to rout traffic between switches and routers. IP addresses of the routers's ports must be like table below;
Router Leg IP
1 ------ 1 --- 192.168.1.0/24
1 ------ 4 --- 192.168.4.1
1 ------ 5 --- 192.168.5.1
2 ------ 2 --- 192.168.2.0/24
2 ------ 5 --- 192.168.5.2
2 ------ 6 --- 192.168.6.2
3 ------ 3 --- 192.168.3.0/24
3 ------ 4 --- 192.168.4.3
3 ------ 6 --- 192.168.6.3
Here image of the required network:

My NED file:
```
import inet.nodes.inet.Router;
import inet.nodes.inet.StandardHost;
import ned.DatarateChannel;
import inet.nodes.ethernet.EtherSwitch;
import inet.nodes.ethernet.EtherHost;
import inet.networklayer.autorouting.FlatNetworkConfigurator;
network gyte
{
@display("bgb=457,318");
types:
channel geth extends DatarateChannel
{
datarate = 1Gbps;
}
channel hgeth extends DatarateChannel
{
datarate = 512Mbps;
}
submodules:
// Routers
routers[3]: Router {
parameters:
@display("p=208,272,row=id;i=abstract/router");
gates:
pppg[3];
}
// Switches
switches[3]: EtherSwitch {
parameters:
@display("p=179,162,row");
gates:
ethg[3];
}
// Hosts
ehosts[4]: EtherHost {
parameters:
@display("p=384,56,row");
gates:
ethg;
}
// Servers
eservers[2]: EtherHost {
parameters:
@display("i=device/server;p=117,71,row");
gates:
ethg;
}
configurator: FlatNetworkConfigurator {
@display("p=22,25");
}
connections:
ehosts[0].ethg <--> switchs[0].ethg[0];
eservers[0].ethg <--> switchs[0].ethg[1];
ehosts[1].ethg <--> switchs[1].ethg[0];
eservers[1].ethg <--> switchs[1].ethg[1];
switchs[0].ethg[2] <--> routers[0].pppg[0];
switchs[1].ethg[2] <--> routers[1].pppg[0];
routers[0].pppg[1] <--> routers[1].pppg[1];
routers[0].pppg[2] <--> routers[2].pppg[0];
routers[1].pppg[2] <--> routers[2].pppg[1];
routers[2].pppg[2] <--> switchs[2].ethg[0];
switchs[2].ethg[1] <--> ehosts[2].ethg;
switchs[2].ethg[2] <--> ehosts[3].ethg;
```
}
|
OMNet++: EtherSwitch and EtherHost device configurations and routing. How to?
|
CC BY-SA 3.0
| 0 |
2011-05-05T14:40:05.923
|
2019-02-03T15:58:55.393
| null | null | 614,065 |
[
"routes",
"omnet++"
] |
5,899,898 | 1 | null | null | 0 | 200 |
I'm trying to get started with some MonoTouch development. Using iMockups on my iPad, I quickly created 3 Views/Screens/Wireframe Screenshots of sample app I'm trying to do to learn.
Given these screenies, I'm not sure what files I should be creating with what controllers and/or views.
### First Screen
A standard welcome page - has company logo, etc. Only thing you can do is sign into facebook ... which the button then goes to another view.

### Second Screen
This screen is a `UIWebView` which embeds Facebook's application login webpage. Nothing fancy. Take note of the BACK button though.

### Third Screen - User's home page
Once a user has authenticated via Facebook, they go here which gives them links to other views (ie. the 4 icon-buttons on the bottom `UIToolBar`).

So I thought i'd need a few more files ...
- `HomePageUINavigationController`- `HomePageViewController``UIViewController``FacebookViewController`- `FacebookViewController``UIViewController``UIWebView``HomePageViewController`- `UserUITabBarController``TabBar`
|
Given these 3 wireframe screenshots, what type of files in a MonoTouch solution would I need to make?
|
CC BY-SA 4.0
| null |
2011-05-05T15:00:50.337
|
2021-08-28T12:41:34.650
|
2021-08-28T12:41:34.650
| 472,495 | 30,674 |
[
"iphone",
"xamarin.ios"
] |
5,899,970 | 1 | 5,900,048 | null | 0 | 406 |
just wondering if anyone knows of any pre built content switchers powered by jquery like the one depicted below (only have a screenshot, otherwise I wouldn't be asking :P):

|
good jquery content separators
|
CC BY-SA 3.0
| null |
2011-05-05T15:03:57.253
|
2011-05-05T15:09:55.460
| null | null | 612,371 |
[
"javascript",
"jquery"
] |
5,900,235 | 1 | 7,321,229 | null | 36 | 3,581 |
+ on Eclipse is a life saver. Unfortunately, it only works when the currently selected file tab is of a `.java` file. It doesn't work when the currently selected file tab is of an `.xml` file.
I searched this great SO resource and found something [very similar](https://stackoverflow.com/questions/2213075/eclipse-how-can-i-make-ctrlf11-work-no-matter-which-file-is-being-edited) to what I am looking for but unfortunately the [solution offered](https://stackoverflow.com/questions/2213075/eclipse-how-can-i-make-ctrlf11-work-no-matter-which-file-is-being-edited/2213082#2213082) simply doesn't work for XML in an Android project.
Is there a way to make + launch Android project even when on XML file?
This is my current preferences dialog windows:

This mysteriously started working. I have no idea how this happened (I didn't change anything in the Eclipse, except for existing Eclipse and restarting it).
|
Make Ctrl+F11 launch Android project even when on XML file
|
CC BY-SA 3.0
| 0 |
2011-05-05T15:22:07.813
|
2014-04-15T08:15:58.020
|
2017-05-23T12:15:16.853
| -1 | 722,603 |
[
"android",
"eclipse",
"eclipse-plugin"
] |
5,900,238 | 1 | 5,901,146 | null | 0 | 637 |
I'm using to php to make a simple search engine that is base on the boolean retrieval
I have predefined documents
for example:
- doc0: my name is caesar
- doc1: caesar is character...
-doc2.....
I've constructed the term-document matrix as follows : 
so for example "my" exists in the first documents , but not in the second and "caesar" is in the both documents
when I do a search for a single term i get the boolean values of the term thus if I type "name" in the search engine i'll get 1 0 .
I want to make a boolean and between their boolean values thus the result of the search will be 0 1 as 1 1 & 0 1 = 01
$query = $_REQUEST['keyword'];
$stoplists = array("i",".","a"," ");
$words=array();
$wordsdoc=array();
$matrix=array();
$docs = array ("my name is caesar","caesar is a character");
$k=0;
```
//looping the docs array
for ($i=0;$i<sizeof($docs);$i++)
{
//splitting doc[i] on " " (space)
$words_temp=explode(" ",$docs[$i]);
//looping the splitted words
for ($j=0;$j<sizeof($words_temp);$j++)
{
//checking if the word is not in stop dictionnary and does not already added in words array
if (!in_array($words_temp[$j],$stoplists) && !in_array($words_temp[$j],$words))
{
//adding word to words array
$words[$k]=$words_temp[$j];
//incrementing counter
$k++;
}
}
//print_r($words[1]);
}
echo "<b>Words:</b> ";
for ($j=0;$j<sizeof($words);$j++)
{
echo $words[$j]." ";
}
echo "<br><br>";
//looping the docs array
for($i=0;$i<sizeof($docs);$i++)
{
//splitting doc[i] on " " (space)
$words_temp=explode(" ",$docs[$i]);
//initialize counter
$l=0;
//looping the splitted words
for ($j=0;$j<sizeof($words_temp);$j++)
{
//checking if the word is not in stop dictionnary
if (!in_array($words_temp[$j],$stoplists) )
{
//adding word to 2d array
$wordsdoc[$i][$l]=$words_temp[$j];
//incrementing counter
$l++;
}
}
}
echo "<b><u>Docs:</u></b><br>";
for($i=0;$i<sizeof($wordsdoc);$i++)
{
echo "doc".$i.": ";
for($j=0;$j<sizeof($wordsdoc[$i]);$j++)
{
echo $wordsdoc[$i][$j]." ";
}
echo "<br>";
}
echo "<br>";
echo "<b>Res Matrix First Col:</b><br>";
for($i=0;$i<sizeof($words);$i++)
{
$matrix[$i][0]=$words[$i];
echo $matrix[$i][0]."<br>";
}
$i1=0;
$i2=0;
foreach($wordsdoc as $items)
{
for($i=0;$i<sizeof($words);$i++)
{
if(in_array($matrix[$i][0],$items))
$matrix[$i][$i1+1] = 1;
else
$matrix[$i][$i1+1] =0;
}
$i1++;
}
echo "<table border=1><br>";
echo "<tr><td></td>";
for($i=0;$i<sizeof($docs);$i++)
{
echo "<td>doc".($i+1)."</td>";
}
echo "</tr><br>";
foreach($matrix as $items)
{
echo "<tr>";
foreach($items as $item)
{
echo "<td>".$item."</td>";
}
echo "</tr><br>";
}
echo "</table><br>";
```
*I'm sorry for posting such a long question, but I really need help :S *
thank You guys in advance :)
|
boolean retrieval php
|
CC BY-SA 3.0
| null |
2011-05-05T15:22:16.870
|
2011-05-05T16:42:00.087
|
2011-05-05T16:23:37.053
| 632,886 | 632,886 |
[
"php",
"matrix",
"search-engine",
"boolean",
"information-retrieval"
] |
5,900,346 | 1 | 5,900,594 | null | 2 | 1,374 |
Hello:
I have a SSL Website with port: 99. In my web.config what and where changes I have to make in order to get through this SSL Port?
This is my Web.Config File:
```
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Test.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
</connectionStrings>
<system.web>
<compilation debug="false" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="Default.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<security>
<access sslFlags="Ssl"/>
</security>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
```
The site is showing me this err:
> > The page cannot be displayed You have attempted to execute a CGI,
ISAPI, or other executable program
from a directory that does not allow
## programs to be executed.
Please try the following: •Contact
the Web site administrator if you
believe this directory should allow
execute access. HTTP Error 403.1 -
Forbidden: Execute access is denied.
## Internet Information Services (IIS)
This is how my IIS 6.0 settings looks like:

Dont know what should be done here? Does anyone have any idea about this? Thanks!
|
Changing Web.Config for SSL Website
|
CC BY-SA 3.0
| null |
2011-05-05T15:30:10.127
|
2011-05-05T16:00:47.940
|
2011-05-05T15:53:22.237
| 529,995 | 529,995 |
[
"c#",
"asp.net",
"web-config",
"web-deployment"
] |
5,900,595 | 1 | 5,902,645 | null | -1 | 439 |
It is joomla schema actually but this really drives me banana as I cannot understand it. Please guys help me interpret the whole thing. I can only understand the jos_users and little part of session. I cannot get what other tables do.
Here is image!
|
Anyone to explain this ACL schema for me
|
CC BY-SA 3.0
| null |
2011-05-05T15:46:26.790
|
2011-05-05T18:45:33.730
| null | null | 709,683 |
[
"schema",
"joomla1.5",
"acl"
] |
5,900,616 | 1 | 10,402,668 | null | 35 | 53,862 |
I am getting this errror in my newly created website in Windows 7 and IIS 7.5. I created an SSL certificate and done binding new website.
> HTTP Error 401.3 - Unauthorized
You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource on the Web server.
Earlier when I created the website, I selected 'application user(pass through authentication)' in 'Add Website' dialogue. and when I click "Test Settings ..." button, I get this error message:
> The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path. Then test these settings again.

Please suggest solution to this.
Thanks.
|
HTTP Error 401.3 - Unauthorized
|
CC BY-SA 3.0
| 0 |
2011-05-05T15:47:56.257
|
2021-12-16T14:21:37.527
|
2011-05-05T15:53:43.080
| 243,245 | 634,710 |
[
"asp.net",
"iis-7"
] |
5,900,754 | 1 | 5,900,798 | null | 1 | 106 |
I am getting this display in IE 7

I am getting this display in Firefox:

for the following code

Could anybody point me, What I should do to make the IE Display simalar to Firefox and also, How Do I make the Size should be same for all the headings?
|
browser compatibility issues-css
|
CC BY-SA 3.0
| null |
2011-05-05T15:56:57.953
|
2017-12-21T05:06:09.310
|
2017-12-21T05:06:09.310
| 1,033,581 | 424,611 |
[
"css"
] |
5,901,099 | 1 | 5,901,831 | null | 1 | 127 |
In my view controller, I have:
```
- (void)viewDidAppear:(BOOL)animated
{
LoginViewController* lvc = [[LoginViewController alloc] init];
lvc.delegate = self;
[self presentModalViewController:lvc animated:NO];
[lvc release];
}
```
However, this doesn't show up. What might be the possibilities? I tried to do a NSLog inside and it prints out.
Here's how I wire it up:

This is a UISplitView application where I put this code inside a RootViewController
|
presentModalView not showing up
|
CC BY-SA 3.0
| null |
2011-05-05T16:28:05.920
|
2012-12-28T07:16:07.393
|
2011-05-05T16:40:17.113
| 721,937 | 721,937 |
[
"iphone",
"objective-c",
"ipad"
] |
5,901,135 | 1 | 5,901,960 | null | 5 | 1,505 |
Just curious if this is possible. Right now here is what a sample [MAAttachedWindow](http://mattgemmell.com/2007/10/03/maattachedwindow-nswindow-subclass) looks like:

However, I want to know if I can blur the background the window, like this:

Is this possible without using private APIs?
---
Request for code. Well, here's how MAAttachedWindow works. You just feed it a custom NSView, and it does the rest. So, here's how I was trying to make the blur:
```
CALayer *backgroundLayer = [CALayer layer];
[view setLayer:backgroundLayer];
[view setWantsLayer:YES];
CIFilter *blurFilter = [CIFilter filterWithName:@"CIGaussianBlur"];
[blurFilter setDefaults];
[view layer].backgroundFilters = [NSArray arrayWithObject:blurFilter];
```
|
Blur background behind MAAttachedWindow?
|
CC BY-SA 3.0
| 0 |
2011-05-05T16:30:39.983
|
2011-05-05T22:58:40.037
|
2011-05-05T20:09:16.787
| 456,851 | 456,851 |
[
"objective-c",
"cocoa",
"macos"
] |
5,901,202 | 1 | 5,925,171 | null | 5 | 164 |
We have a site with a credit card entry form.
The user will enter their information and click submit. This then goes to a thank you page.
On a ThinkPad laptop running IE 8: If the user clicks the back button (from the thank you page) then it takes them back to the credit card entry. However, the fields for Name on card, card number and the first line of the address are not there. (ignore for a moment that the page shouldn't be cached..) I have other machines running IE 8 and 9 that do not exhibit this behavior.
I don't mean that they are empty. I mean the input fields are flat not there. The expiration date, city, state and zip input boxes are there. Just not those listed above.
Any ideas on what could possibly do this? The fields themselves are always visible and there is absolutely zero code to hide them.
My client says that it happens on other forms in their site as well. The main site is a joomla application that uses an iFrame to show the forms from my app.
I have no idea on where to even start with this one.

|
Weird site problem with back button
|
CC BY-SA 3.0
| null |
2011-05-05T16:35:35.920
|
2011-05-08T01:58:38.817
| null | null | 2,424 |
[
"html"
] |
5,901,275 | 1 | 5,901,625 | null | 0 | 358 |
I have noticed this weird behavior in firefox, it seems like font have some colorful noise. The example is shown in the image.

Does anyone know how this can be solved? With some CSS media type (which now is screen)?
I'm using firefox 4.0.1.
Any help is appreciated.
|
HTML font weird behavior in Firefox
|
CC BY-SA 3.0
| null |
2011-05-05T16:42:38.853
|
2011-05-05T17:12:25.860
| null | null | 326,036 |
[
"firefox",
"webfonts"
] |
5,901,454 | 1 | 5,901,643 | null | 2 | 10,780 |
What is the easiest way to hide the "Page" link?

Thank You.
|
Hide the "Page" button on SharePoint
|
CC BY-SA 3.0
| 0 |
2011-05-05T16:57:07.320
|
2012-11-12T19:11:35.263
| null | null | 352,334 |
[
"sharepoint",
"sharepoint-2010"
] |
5,901,608 | 1 | 5,901,950 | null | 0 | 472 |
The following code produces error:
```
ImageIcon i=new ImageIcon("logo.png");
Image scaleImage=i.getImage().getScaledInstance(10,10,Image.SCALE_DEFAULT);
mainPanel.add(scaleImage);
```
The error is `cannot find method add(Image)`.
Why it is giving this error?

|
error adding image object
|
CC BY-SA 3.0
| 0 |
2011-05-05T17:11:07.830
|
2011-05-05T17:54:49.497
|
2011-05-05T17:46:12.203
| 648,138 | 648,138 |
[
"java",
"swing",
"user-interface",
"image"
] |
5,901,652 | 1 | 5,901,966 | null | 1 | 664 |
Is it possible for an app to access Springboard icons? I want to build a small animation where a ball is jumping over the icons over other apps.
Here's an example what I want to achieve.
Possible?

|
iPhone access to Springboard icons
|
CC BY-SA 3.0
| null |
2011-05-05T17:14:45.603
|
2011-05-05T18:32:56.127
| null | null | 512,411 |
[
"iphone",
"ios"
] |
5,901,678 | 1 | null | null | 2 | 778 |
I don't know if you already tested the Google IO application, but there is a cool feature displaying all the tweets including Google IO hashtags.
I really would like to offer the same feature to my users.
I can do something similar using the API, but I would have to create a custom listview, parsing XML/JSON feeds and that's quite overcomplicated! .
In the application, I have just seen that when I turn off wifi, This is indeed a webview with this url:
[http://www.google.com/search?%20tbs=mbl%3A1&hl=en&source=hp&biw=1170&bih=668&q=%23io2011&btnG=Search](http://www.google.com/search?%20tbs=mbl%3A1&hl=en&source=hp&biw=1170&bih=668&q=%23io2011&btnG=Search)
Here is a screenshot of the app and the same url in the browser
High resolution picture: [http://cl.ly/3q1r0c2J3H163E3G2p2X](http://cl.ly/3q1r0c2J3H163E3G2p2X)

But using this url in a webview display only a google search, and does not offer same feature.
I know this app will certainly be opensources, but i am so negative about "within next days" that google promise.
We are still waiting for the Twitter app source code!
|
How to make a live Twitterfeed like Google IO 2011 application?
|
CC BY-SA 3.0
| 0 |
2011-05-05T17:17:06.400
|
2011-05-15T18:54:22.497
|
2011-05-05T18:24:51.640
| 327,402 | 327,402 |
[
"android",
"twitter",
"feed",
"tweets"
] |
5,901,692 | 1 | null | null | 0 | 2,072 |
I am trying to save export setting of Quicktime movie to a file using AppleScript. This is my code:
```
set file2save to (choose file name default location (path to desktop) default name "setting.qtes")
tell application "QuickTime Player 7"
tell document "video.mov"
save export settings for QuickTime movie to file2save
end tell
end tell
```
But I get error `"QuickTime Player 7 got an error: An error of type -2107 has occurred." number -2107`
This error occurs on the "save export settings" line...
What am I doing wrong?
Thanks.
Here's the screenshot:

|
Applescript QuickTime pro save export settings
|
CC BY-SA 3.0
| null |
2011-05-05T17:18:18.020
|
2011-05-06T04:22:01.070
|
2011-05-06T00:54:22.900
| 635,064 | 635,064 |
[
"macos",
"export",
"applescript",
"quicktime"
] |
5,901,864 | 1 | 5,902,135 | null | 2 | 4,930 |
I've got a background image that I want to extend the length of my page along the left margin.
Here is my css...
```
body, html{
height:100%;
}
#content{
background:url(../images/leftBorder.png);
background-repeat:repeat-y;
height:100%;
}
```
that has a great result:

Until the content in my page reaches past the page fold line, at this point if I scroll down I get this:

All the content is inside a div with the id of "content".
Thoughts?
|
CSS background repeat problem
|
CC BY-SA 3.0
| 0 |
2011-05-05T17:33:57.727
|
2013-08-06T14:57:33.427
|
2011-05-05T18:04:31.033
| 117,658 | 183,806 |
[
"css"
] |
5,902,035 | 1 | 5,902,840 | null | 3 | 1,356 |
I want to show the search bar of tableview like that in iBooks. How can i reduce the width of searchbar and how it can be shown without any background color.
Also how can i hide the search box initially when the page is displayed.

|
How to iBooks like search UI on table
|
CC BY-SA 3.0
| 0 |
2011-05-05T17:49:03.100
|
2011-08-24T10:08:31.593
| null | null | 139,352 |
[
"iphone",
"search",
"uisearchbar"
] |
5,902,667 | 1 | 5,923,551 | null | 8 | 5,574 |
Using CoreGraphics (inside my drawRect method), I'm trying to apply a blend mode to an image (transparent png), and then adjust the alpha of the result. I'm assuming that this needs to be done in two steps, but I could be wrong. Here's what I have so far (which works fine):
```
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
//SET COLOR - EDIT... added a more practical color example
CGContextSetRGBFillColor(context, 0.0, 1.0, 0.0, 1);
//flips drawing context (apparently this is necessary)
CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
CGContextScaleCTM(context, 1.0, -1.0);//flip context
//DRAW PIN IMAGE
UIImage *pin = [UIImage imageNamed:@"pin"];
CGRect pinrect = CGRectMake(12, 17, 25, 25);
CGContextDrawImage(context, pinrect, pin.CGImage);//draws image in context
//Apply blend mode
CGContextSetBlendMode(context, kCGBlendModeColor);
CGContextClipToMask(context, pinrect, pin.CGImage); // restricts drawing to within alpha channel
//fills context with mask, applying blend mode
CGContextFillRect(context, pinrect);
CGContextRestoreGState(context);
// -- Do something here to make result 50% transparent ?? --
```
I'm assuming that I need to draw all this into some kind of separate context somewhere, call `CGContextSetAlpha(...)`, and then re-draw it back to my original context, but I'm not sure how. Setting the alpha before my final CGContextFillRect will just change the amount that the blend mode was applied, not the alpha of the entire image.
EDIT: screenshot posted

Thanks in advance.
|
iOS: 2 Step Image Processing with CoreGraphics
|
CC BY-SA 3.0
| 0 |
2011-05-05T18:47:34.470
|
2011-05-07T20:39:57.270
|
2011-05-07T19:43:09.370
| 500,308 | 500,308 |
[
"iphone",
"objective-c",
"ios",
"core-graphics",
"cgcontext"
] |
5,902,841 | 1 | 5,903,013 | null | 2 | 268 |
I need to draw a bitmap on top of a completely rendered GLSurfaceView. By completely rendered I mean that the entire thing is filled with colorized triangles. Obviously the bitmap will hide the triangles underneath it, but I would like to minimize how much is hidden.

The bitmap is 64x64 pixels and has many empty areas that are translucent in the PNG file. When I draw the bitmap by making a square with two triangles, the translucent areas become black (the green areas in the picture above), perhaps because the app background is black. Is there an easy way to get the translucent areas to not affect the image (the second image above)? Do I need to create a complex set of triangles that exactly outlines the non-translucent parts when I render the bitmap?
I am developing on a Motorola Xoom, Android 3.0. Thanks for your time.
|
Drawing bitmaps with empty areas
|
CC BY-SA 3.0
| null |
2011-05-05T19:05:49.047
|
2011-05-05T19:22:28.417
| null | null | 724,157 |
[
"android",
"opengl-es",
"bitmap",
"png"
] |
5,902,992 | 1 | 5,903,202 | null | 0 | 373 |
I have an application in C# that I am converting to Java, specifically the C# version consists of a Windows Form (Main Form) that spawns a new form (Secondary Form) via the ShowDialog() method.
The event handler for a button (OK) on the Secondary form sets it's DialogResult to OK when clicked, therefore in the Main Form I can check what DialogResult was set and retrieve data from the Secondary Form instance through properties.
I'm using SwingUI with NetBeans and I was wondering how I would go about implementing the same functionality in the Java application.
An example:



As you can see it doesn't really take a lot of effort to achieve this in C#, how big of a task would it be to do it in Java?
Thanks for your time.
|
Display one form and return text to another - Java
|
CC BY-SA 3.0
| null |
2011-05-05T19:20:33.807
|
2011-05-05T20:35:54.897
|
2011-05-05T20:35:54.897
| 218,159 | 218,159 |
[
"c#",
"java",
"events",
"swing",
"netbeans"
] |
5,903,326 | 1 | 6,084,829 | null | 3 | 6,495 |
I'm trying to install the PHPExcel library on an Ubuntu server.
I executed the following commands in the command line:
```
pear channel-discover pear.pearplex.net
pear install pearplex/PHPExcel
```
The channel was install but the instakll generates an error:
```
pearplex/PHPExcel requires PHP extension "zip" (version >= 1.8.0), installed version is 1.4.0
No valid packages found
install failed
```
Then I did a safe-upgrade:
```
aptitude safe-upgrade
```
and when I check PHP, I see this (Zip version 2.0.0):

Any ideas?
|
Can't install PHPExcel
|
CC BY-SA 3.0
| null |
2011-05-05T19:51:28.700
|
2011-05-21T22:24:55.377
| null | null | 440,243 |
[
"php",
"pear",
"phpexcel"
] |
5,903,492 | 1 | 5,903,616 | null | 0 | 234 |
I am trying to call a Sample API from my JSP using jQuery Ajax, but I am not getting success. I dont know where am I wrong but even simple html page is not getting loaded.
Here is my code.
```
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Hello
<div id="temp">
<a href="#" onclick="callGetApplicationDetails();" >Click Here</a>
</div>
<script type="text/javascript">
function callGetApplicationDetails()
{
$.ajax({
url:"serverFile.jsp",
type: "GET",
dataType:'html',
async: true,
data:data,
success: function(responseData) {
if (responseData != null && callback != null) {
alert('success');
$('#temp').html(responseData);
}
},
error: function(){
alert('error');
if (errorCallback !=null) errorCallback();
}
});
}
</script>
</body>
</html>
```
Even the alert is not popping up of success and failure.
Pls help.
thanks
Hemish
|
Not able to make Ajax call using jquery
|
CC BY-SA 3.0
| null |
2011-05-05T20:09:03.547
|
2011-05-05T20:22:11.897
|
2011-05-05T20:19:08.930
| 107,625 | 515,990 |
[
"ajax",
"jquery"
] |
5,904,120 | 1 | 5,904,267 | null | 0 | 1,711 |
The URL is: [http://site1.ewart.library.ubc.ca/](http://site1.ewart.library.ubc.ca/)
IF using FF or other none IE browsers, the carousel panel looks like this: (3px border, in double style)

But when using IE 7 or 8, I get this: (border is gone and there is a gray area below the left side large thumbnail).

CSS for the carousel panel is:
```
#webcastingslideshow {
margin: 25px 30px 20px 35px;
z-index:1;
background:#3c3c3c;
border:double 3px #fff;
}
```
CSS for the left side large thumbnail is:
```
#webcastingslideshow .largethumbnail {
display:block;
height:240px;
width:320px;
background:#000;
float:left;
}
```
Could you please help?
Thanks,
|
Annoying CSS issues on IE
|
CC BY-SA 3.0
| null |
2011-05-05T21:09:41.000
|
2011-05-05T21:38:34.970
| null | null | 451,326 |
[
"css",
"border"
] |
5,904,801 | 1 | null | null | 20 | 1,039 |
## Or The Traveling Salesman plays Magic!
[TCGPlayer.com](http://TCGPlayer.com/) sells collectible cards for a variety of games, including . Instead of just selling cards from their inventory they are actually a (50+). Each vendor has a of cards and a . Each vendor also charges a (usually). Given all of that, how would one find the best price for a deck of cards (say 40 - 100 cards)?
Just finding the best price for each card doesn't work because if you order 10 cards from 10 different vendors then you , but if you order all 10 from one vendor you only .
The other night I wrote a simple HTML Scraper (using [HTML Agility Pack](http://html-agility-pack.net/?z=codeplex)) that grabs all the different prices for each card, and then finds all the vendors that carry all the cards in the deck, totals the price of the cards from each vendor and sorts by price. That was really easy. The total prices ended up being near the total median price for all the cards.
I did notice that some of the individual cards ended up being much higher than the median price. That raises the question of splitting an order over multiple vendors, but only if enough savings could be made by splitting the order up to cover the additional shipping (each added vendor adds another shipping charge).
Logically it seems that the best price will probably only involve a few different vendors, but if [and some are](http://magic.tcgplayer.com/db/magic_single_card.asp?cn=Jace,%20the%20Mind%20Sculptor) then in theory ordering each card from a different vendor could still result in enough savings to justify all the extra shipping.
If you were going to tackle this how would you do it? Pure figuring every possible combination of card / vendor combinations? A process that is more likely to be done in my lifetime would seem to involve a over a fixed number of iterations. I have a couple ideas, but am curious what others might suggest.
I am looking more for the algorithm than actual code. I am currently using .NET though, if that makes any difference.

|
How to find Best Price for a Deck of Collectible Cards?
|
CC BY-SA 3.0
| 0 |
2011-05-05T22:24:35.030
|
2017-11-23T06:24:56.553
|
2020-06-20T09:12:55.060
| -1 | 255 |
[
"algorithm",
"combinatorics"
] |
5,904,823 | 1 | 5,905,002 | null | 1 | 353 |
I am new to the core data and am loving it so far, I just have a question on to-many relations and their inverses. I'm trying to create something where each unit can convert to many other units so each unit can point to many converters that point to just one other unit. The image below works perfectly, but I know that core data wants them to be inverse and lets me know. When I try to select this it eliminates the functionality I desire.
I have tried creating a new relationship on each entity to act like an inverse but it fails, I can get a set of null objects.
Basically I am trying to create a graph-like structure in core data.
Is it possible to get this functionality while making core data happy with supplying inverses?

|
To-Many relations Core Data
|
CC BY-SA 3.0
| null |
2011-05-05T22:28:28.733
|
2011-05-05T22:54:54.423
| null | null | 526,901 |
[
"iphone",
"objective-c",
"xcode",
"core-data"
] |
5,904,921 | 1 | 5,904,939 | null | 2 | 751 |
I would like to mimic Facebook's functionality where when you attach a link, it will read the meta data and image automatically:


Anyone know how to accomplish this interface functionality with jQuery?
|
Clone Facebook wall posting via jQuery?
|
CC BY-SA 3.0
| 0 |
2011-05-05T22:42:40.020
|
2011-09-05T02:06:23.443
| null | null | 235,334 |
[
"javascript",
"ajax",
"jquery"
] |
5,905,003 | 1 | 5,905,062 | null | 4 | 3,188 |
Is there a way to distort an image using 4 points where the 4 points will correspond to the corners of an image?
Something like this:

Ignore the mid points and the center point. Here even though the image looks like it's deformed in 3d, it's not in my case. It's just like modifying a 2d rectangle polygon on screen where the image that fills the rectangle conforms to the modified shape/polygon, since both has 4 vertices and 4 edges.
Any ideas on how to do this?
|
How to distort an image using 4 points in screen space in WPF?
|
CC BY-SA 3.0
| 0 |
2011-05-05T22:55:02.790
|
2011-05-05T23:02:39.423
| null | null | 51,816 |
[
"c#",
".net",
"wpf",
"graphics",
"transformation"
] |
5,904,962 | 1 | 5,905,314 | null | 3 | 1,198 |
EDIT:
OH!!!!!
it works!!!
It seems that at one point it was fixed However the wrong HTML file was opening up so the wrong code was running. I feel stupid, that should have been obvious.
But THANKYOU!!!
Its so awesome to actually get some help with this stuff. whenever i ask for some help anywhere else or even ask my teacher im usually ignored or get useless advice.
(end of edit)
Im making a game for my final project in a java class. I just got mouse aiming to work using AffineTransform, however When ever the player object rotates to 90 degrees(or a multiple of it), it does this weird stutter thing.
Heres the code im specifically concerned with.
```
g2.drawImage(img, x_pos,y_pos,this);
AffineTransform oldTransform = g2.getTransform();
g2.setTransform(AffineTransform.getRotateInstance(radAngle,x_pos + (img.getWidth() / 2),y_pos+(img.getHeight() / 2)));
```
Could someone please help me figure out how to fix this? my project is due tomorrow so im slim on time.
Here are the images i use



Heres the code.
```
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.lang.Math.*;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import javax.imageio.ImageIO;
import java.io.*;
import java.net.URL;
public class Game extends Applet implements Runnable, KeyListener, MouseMotionListener
{
int x_pos = 250;
int y_pos = 250;
float x_speed = 0;
float y_speed = 0;
int radius = 20;
int appletsize_x = 800;
int appletsize_y = 600;
int x = 0;
int y = 0;
int up = 0;
int down= 0;
int left = 0;
int right= 0;
int mouse_x;
int mouse_y;
int tracking_angle;
private BufferedImage dbImage;
private Graphics dbg;
private Image curser;
BufferedImage img = null;
BufferedImage round = null;
AffineTransform at = new AffineTransform();
double radAngle;
public void init()
{
try {
URL url = new URL(getCodeBase(), "Player.png");
img = ImageIO.read(url);
} catch (IOException e) {System.out.println("Cant find player image");
}
try {
URL url = new URL(getCodeBase(), "round.png");
round = ImageIO.read(url);}
catch (IOException e) {}
setBackground (Color.blue);
setFocusable(true);
addKeyListener( this );
curser = getImage(getDocumentBase(), "mouse.png");
addMouseMotionListener(this);
try
{
Toolkit tk = Toolkit.getDefaultToolkit();
Cursor c = tk.createCustomCursor( curser,new Point( 5, 5 ), "Inodrop" );
setCursor( c );
}
catch( IndexOutOfBoundsException x )
{}
}
public class Shot {
int x_loc = -50;
int y_loc = -50;
public Shot(){
if(x_loc < 0){
x_loc = x_pos;}
if(y_loc < 0){
y_loc = y_pos;}
paint(dbg);}
public void paint(Graphics g){
System.out.println("hi");
Graphics2D g2d = (Graphics2D)g;
Graphics g2D = round.getGraphics();
g2d.drawImage(round, x_loc,y_loc,null);}}
public void start ()
{
Thread th = new Thread (this);
th.start ();
}
public void stop()
{
}
public void destroy()
{
}
public void mouseMoved(MouseEvent e){
//get position of mouse
mouse_x = e.getX();
mouse_y = e.getY();
double x_dist = mouse_x - x_pos;
double y_dist = mouse_y - y_pos;
if (x_dist == 0) {
radAngle = 90;
} else if ((x_dist == 0) && (y_dist == 0)) {
radAngle = 0;
} else {
radAngle = Math.atan(y_dist / x_dist);
}
tracking_angle = (int)(Math.sin(radAngle) * 100);
//System.out.println(Math.toRadians(tracking_angle));
}
public void mouseDragged(MouseEvent e){}
public void keyReleased(KeyEvent r)
{
//Left
if (r.getKeyCode() == 39 ){
x = 0;
left = 0;
Shot shoot = new Shot();
}
//Right
if (r.getKeyCode() == 37){
x = 0;
right = 0;
}
//Down
if (r.getKeyCode() == 38 ) {
//y_speed = 0;
down = 0;}
//Up
if (r.getKeyCode() == 40 ) {
//y_speed = 0;
up = 0;}
//move();
}
public void keyTyped(KeyEvent t){}
public void keyPressed(KeyEvent r){
//Left
if (r.getKeyCode() == 39 ){
left = 1;}
//Right
if (r.getKeyCode() == 37){
right = 1;}
//Down
if (r.getKeyCode() == 38 ) {
down = 1;}
//Up
if (r.getKeyCode() == 40 ) {
up = 1;}
//move();
}
public void run ()
{
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
while (true)
{
if (left == 1 && x_speed < 11){
x = 0;
x_speed += 1;
}
//Right
if (right == 1 && x_speed > -11){
x = 0;
x_speed -= 1;
}
//Down
if (down == 1 && y_speed > -11) {
y_speed -= 1;}
//Up
if (up == 1 && y_speed < 11) {
y_speed += 1;}
if( x == 0 && x_speed > 0){
x_speed -=.2;}
if( x == 0 && x_speed < 0){
x_speed +=.2;}
if( y == 0 && y_speed > 0){
y_speed -=.2;}
if( y == 0 && y_speed < 0){
y_speed +=.2;}
if (x_pos > appletsize_x - radius && x_speed > 0)
{
x_pos = radius;
}
else if (x_pos < radius && x_speed < 0)
{
x_pos = appletsize_x + radius ;
}
//System.out.println(y_pos);
if (y_pos > appletsize_y - radius && y_speed > 0){
y_speed = 0;}
else if ( y_pos < radius && y_speed < 0 ){
y_speed = 0;}
x_pos += (int)x_speed;
y_pos += (int)y_speed;
repaint();
try
{
Thread.sleep (15);
}
catch (InterruptedException ex)
{
}
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
}
}
public void update (Graphics g)
{
if (dbImage == null)
{
dbImage = new BufferedImage(this.getSize().width, this.getSize().height, BufferedImage.TYPE_INT_RGB);
dbg = dbImage.getGraphics ();
}
dbg.setColor (getBackground ());
dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
dbg.setColor (getForeground());
paint (dbg);
g.drawImage (dbImage, 0, 0, this);
}
public void paint (Graphics g)
{
//g = img.getGraphics();
Graphics2D g2 = (Graphics2D)g;
g2.drawImage(img, x_pos,y_pos,this);
AffineTransform oldTransform = g2.getTransform();
g2.setTransform(AffineTransform.getRotateInstance(radAngle,x_pos + (img.getWidth() / 2),y_pos+(img.getHeight() / 2)));
System.out.println(img.getWidth());
}
}
```
|
AffineTransform mouse aiming rotation stutter on 90 degrees
|
CC BY-SA 3.0
| null |
2011-05-05T22:50:25.500
|
2011-05-06T01:23:01.617
|
2011-05-06T01:23:01.617
| 34,065 | 740,830 |
[
"java",
"rotation",
"bufferedimage",
"affinetransform"
] |
5,905,158 | 1 | null | null | 2 | 185 |
I have a table within a div that can have arbitrary rows. Sometimes the rows expand to accommodate more than one line of text. The div has a fixed height and overflow:hidden.
My question is, is it possible to truncate the table such that the overflow occurs on a row boundary?
For example, is there a way to make this:

Look like this:

The main catch is that this use Javascript. Is this possible in HTML/CSS? I could do something in the code-behind (ASP.NET Webforms) if necessary, although I'd like to avoid it.
It has to work in IE7 and IE8. The number of rows displayed is not fixed - it depends on how many rows overflow with extra text.
|
How can I truncate table overflow at a row boundary?
|
CC BY-SA 3.0
| null |
2011-05-05T23:20:27.423
|
2011-05-05T23:36:09.503
|
2011-05-05T23:36:09.503
| 13,877 | 13,877 |
[
"asp.net",
"html",
"css"
] |
5,905,306 | 1 | 5,910,170 | null | 10 | 90,920 |
I have built several web sites and now i am having newbie problem that is driving me nuts...
```
<body>
<div id="page">
<div id="page_wrapper">
<div id="header">
<h1>Heading 1</h1>
<div class="clear_both" /> </div>
</div><!-- end #header -->
<div id="main_menu">
<p>Here goes the main menu</p>
<div class="clear_both" /> </div>
</div><!-- end #main_menu -->
<div id="left">
</div><!-- end #left -->
```
First i have a CSS Reset template from here:
[http://yui.yahooapis.com/3.3.0/build/cssreset/reset-min.css](http://yui.yahooapis.com/3.3.0/build/cssreset/reset-min.css)
and then on another file:
```
body, html {
font: 10pt Verdana,Arial,sans-serif;
background: #fff;
margin: 0;
padding: 0;
text-align: left;
color: #333;
}
div {
line-height: 1.4em;
}
#page {
}
#page_wrapper {
}
#main_menu {
}
#left {
}
div.clear_both {
margin: 0;
padding: 0;
font-size: 0;
height: 0;
line-height: 0;
clear: both;
}
```
And on the link below there is an image screenshot on which you can see the output... (i am working on a local server)
There is an unexplainable space between the div tags I CANT REMOVE IT and it is driving me nuts... please can someone tell me how to remove it?
I have tryed adding a negative top margin but from my previous experience it is not a solution... usualy seting the margin and the padding to 0 was enough... somehow now it is diferent :S

[Unexplainable DIV space](http://makedonskarabota.com/gallery/div_space.png)
|
How to remove an invisible space between div tags
|
CC BY-SA 3.0
| 0 |
2011-05-05T23:42:18.637
|
2013-11-21T15:45:10.723
|
2011-05-05T23:43:53.213
| 451,969 | 711,310 |
[
"html",
"css"
] |
5,905,316 | 1 | 5,905,412 | null | 1 | 220 |
I have an Array nested withing an Object that's inside an Object which is also in an Object.
My original data structure was malformed, so here is a screen cap of console.log(data):

This is being returned from an AJAX request and I'm having issue with getting to the array. The trick is that it will not always return 3 arrays per parent object, the amount of arrays is dependent on "length", or rather, "length" is a reflection of how many arrays to expect in each object that contains arrays. "OID" is the name of each array for both the "th" and "uh" objects.
There also happen to be several main objects, which are iterated with `for(var i in data)`
I've tried something like:
```
for(var i in data) {
for(var x in data[i].clicks) {
//And now I'm lost here
//I've tried getting the name of the Array from "OID"
//and going from there, that failed miserably.
}
}
```
How can I get at the contents of each of those arrays, it would be best if this can be done without knowing the name, quantity or length of said arrays.
Thanks in advance.
|
JSON data retrieval
|
CC BY-SA 3.0
| null |
2011-05-05T23:43:20.213
|
2011-05-06T00:04:15.440
|
2011-05-06T00:01:54.750
| 575,253 | 575,253 |
[
"javascript",
"arrays",
"json"
] |
5,905,451 | 1 | 11,723,840 | null | 0 | 1,938 |
I have been messing around with androids UI in eclipse and have been having trouble figuring out why my graphical layout does not reflect my actual program when launched to the device.The actual program seems to have a much larger scale.
My target device is WVGA (800x480) with a 240dpi screen(eg. most new high end smartphones). I have tried editing my Graphical Layouts view by changing the screen to be the 3.7 WVGA (Nexus One) which matches the display specs of my target device. I have also tried creating a custom screen configuration still with no luck. Heres 2 screen shots of it


Here's my layout
```
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="@drawable/androidcomp360" >
</ImageView>
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="0px"
android:layout_marginTop="10px" >
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:paddingLeft="20px"
android:text="Offset : " >
</TextView>
<TextView
android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView4"
android:layout_alignTop="@+id/textView4"
android:layout_toRightOf="@+id/textView4"
android:paddingLeft="10px"
android:text="0" >
</TextView>
<TextView
android:id="@+id/TextView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/TextView02"
android:layout_alignTop="@+id/TextView02"
android:layout_toRightOf="@+id/TextView02"
android:paddingLeft="20px"
android:text="Offset Min : " >
</TextView>
<TextView
android:id="@+id/TextView04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/TextView03"
android:layout_alignTop="@+id/TextView03"
android:layout_toRightOf="@+id/TextView03"
android:paddingLeft="10px"
android:text="0" >
</TextView>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView1"
android:layout_alignTop="@+id/textView1"
android:layout_toRightOf="@+id/textView1"
android:paddingLeft="10px"
android:text="0" >
</TextView>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView2"
android:layout_alignTop="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:paddingLeft="20px"
android:text="GPS Heading : " >
</TextView>
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView3"
android:layout_alignTop="@+id/textView3"
android:layout_toRightOf="@+id/textView3"
android:paddingLeft="10px"
android:text="0" >
</TextView>
<TextView
android:id="@+id/TextView06"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/TextView04"
android:layout_alignTop="@+id/TextView04"
android:layout_toRightOf="@+id/TextView04"
android:paddingLeft="20px"
android:text="Offset Max : " >
</TextView>
<TextView
android:id="@+id/TextView05"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/TextView06"
android:layout_alignTop="@+id/TextView06"
android:layout_toRightOf="@+id/TextView06"
android:paddingLeft="10dp"
android:text="0" >
</TextView>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:paddingBottom="10px"
android:paddingLeft="20px"
android:text="Compass Heading : " >
</TextView>
</RelativeLayout>
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:maxHeight="50px"
android:minHeight="30px"
android:text="Log Data"
android:typeface="normal"
android:visibility="visible" >
</Button>
<ImageView
android:id="@+id/ImageView01"
android:layout_width="match_parent"
android:layout_height="200px"
android:scaleType="fitCenter"
android:src="@drawable/androidcomp360" >
</ImageView>
</LinearLayout>
```
|
Android Eclipse Graphical Layout
|
CC BY-SA 3.0
| null |
2011-05-06T00:04:22.007
|
2012-07-30T14:45:23.457
|
2012-07-30T14:07:21.327
| 403,455 | 699,512 |
[
"android",
"user-interface",
"wysiwyg",
"screen-size"
] |
5,905,565 | 1 | null | null | 4 | 27,465 |
I am trying to use a DLL in a Visual Studio 2010 C++ project . I followed the directions here but [http://msdn.microsoft.com/en-us/library/ms235636(v=vs.80).aspx](http://msdn.microsoft.com/en-us/library/ms235636(v=vs.80).aspx) I cannot seem to add references to my project.
When I open add reference there is no way for me to add any references, as shown below.

What am I doing wrong here?
|
Using DLL's in Visual Studio 2010 C++ project
|
CC BY-SA 3.0
| 0 |
2011-05-06T00:24:08.897
|
2012-12-03T23:27:29.080
|
2012-08-29T15:33:13.057
| 250,835 | 250,835 |
[
"visual-studio-2010",
"dll"
] |
5,905,608 | 1 | 13,327,632 | null | 94 | 43,192 |
I know about [UITableview: How to Disable Selection for Some Rows but Not Others](https://stackoverflow.com/questions/2267993/uitableview-how-to-disable-selection-for-some-rows-but-not-others) and `cell.selectionStyle = UITableViewCellSelectionStyleNone`, but how do I make a cell (or any `UIView` for that matter) appear disabled (grayed-out) like below?

|
How do I make a UITableViewCell appear disabled?
|
CC BY-SA 3.0
| 0 |
2011-05-06T00:31:43.453
|
2021-07-06T15:19:45.337
|
2017-05-23T12:26:36.550
| -1 | 242,933 |
[
"uitableview",
"appearance"
] |
5,905,753 | 1 | 5,905,965 | null | 2 | 57 |
I have three tables `Professor`, `Course`, `Comment` I'm trying to get the comments and course names for a given professor.
I have the following SQL:
```
SELECT prefix, code, info, date
FROM Course C, Comment Co, Professor P
WHERE P.pID = 273
AND C.cID = Co.cID AND P.pID = Co.pID;
```
Tables:


This returns an empty set, when it should return 2 or 3 results. I doubled check the records in Comment..
Even if I try running:
```
SELECT *
FROM Course C, Comment Co, Professor P
WHERE P.pID = Co.pID AND P.pID = 273;
```
It gives me ALL the courses??
|
mySQL Query Not Returning properly?
|
CC BY-SA 3.0
| null |
2011-05-06T00:57:26.297
|
2011-05-06T01:38:15.087
|
2011-05-06T01:09:30.220
| 700,070 | 700,070 |
[
"mysql"
] |
5,905,831 | 1 | 5,906,059 | null | 4 | 716 |
When I am debugging a collection visually in Visual Studio 2010 I have to drill down quite a few levels before I get to the actual items in the collection. The image attached below is of an `ObservableCollection<Fundsource>` and you can see the hoops I need to go through to look at the items. It didn't used to be like this and I'm wondering if I have changed some setting to see all the intermediates. (Or maybe the implementation has changed between VS2005 and now and I'm just remembering the good ol' days).

|
Visual Studio 2010: Visual Debugger Drill down into collection pain
|
CC BY-SA 3.0
| 0 |
2011-05-06T01:12:25.900
|
2011-05-06T02:09:23.657
| null | null | 100,652 |
[
"visual-studio-2010",
"debugging",
"collections",
"drilldown"
] |
5,905,884 | 1 | 5,906,219 | null | 0 | 884 |
In my db I have three tables (I have more but for case is equal, users can be companies or single people).
- `Users``id_user`- `Company``id_company``users_id_user`- `job_offers``id_job_offers``company_id_company``company_users_id_user`
My questions are:
1. Does a primary key make sense in job_offers? I don't think that there is a reason for it.
2. job_offers has two foreign keys, one related to company and other to users. Is there a problem with this? Does there exist another way to accomplish the same task?

|
Usage of Primary and Foreign keys in an EER diagram
|
CC BY-SA 3.0
| null |
2011-05-06T01:21:22.060
|
2015-02-20T16:51:38.013
|
2015-02-20T16:51:38.013
| 488,195 | 564,979 |
[
"mysql",
"database",
"database-design",
"eer-model"
] |
5,905,937 | 1 | 5,907,600 | null | 3 | 608 |
I think I might be doing something wrong. Users that try and register with Internet Explorer say that the facebook plugin goes blank when trying to submit it. Any Ideas?
This is some of the code:
```
<fb:registration redirect-uri="http://friendsconnect.org/----.php"
fields='[{"name":"name"},{"name":"first_name"},{"name":"last_name"},{"name":"email"},{"name":"username","description":"Username","type":"text"},{"name":"password"},{"name":"gender"},{"name":"birthday"},{"name":"captcha"},]'
onvalidate="validate"></fb:registration>
<script>
function validate(form) {
errors = {};
if (form.name == "") {
errors.name = "Please enter your name.";
}
if (form.username == "") {
errors.username = "Please enter your username.";
}
if (form.email == "") {
errors.email = "Please enter your email address.";
}
if (form.password == "") {
errors.password = "Please enter your password.";
}
if (form.gender == "") {
errors.gender = "Please enter your sex.";
}
if (form.birthday == "") {
errors.birthday = "Please enter your birthday.";
}
if (form.captcha == "") {
errors.captcha = "Try and enter the text in the box below.";
}
return errors;
}
</script>
```

|
Why does the XFBML registration plugin go blank when used in IE?
|
CC BY-SA 3.0
| 0 |
2011-05-06T01:33:19.003
|
2011-05-25T17:16:50.463
|
2011-05-06T08:15:52.687
| 337,227 | 648,865 |
[
"php",
"javascript",
"facebook",
"xfbml"
] |
5,906,023 | 1 | 5,906,123 | null | 0 | 1,563 |
I'm quite new to Cocoa Bindings, but I've seen enough that I'd love to change all my old clunky methods over to it. For example, I have a `NSColorWell` that changes the text color of some `NSTextField`s in my view. Seems easy in practice, but it's not working.
Here's how my bindings look for my `NSColorWell`:

And here's my bindings for my `NSTextField`:

But instead of displaying a color it just displays `NSCalibratedRGBColor...`. Obviously it's not setting the value of the color to the field, it's just displaying the raw data.
So, after poking around I tried to make my own `NSValueTransformer` by doing this:
```
@interface DataToColor: NSValueTransformer {}
@end
#import "QWDataToColor.h"
@implementation DataToColor
+(Class)transformedValueClass { return [NSColor class]; }
+(BOOL)allowsReverseTransformation { return NO; }
-(id)transformedValue:(id)item {
NSColor *theColor=nil;
NSData *theData=[NSData dataWithData:item];
if (theData != nil)
theColor=(NSColor *)[NSUnarchiver unarchiveObjectWithData:theData];
return theColor;
}
@end
```
Then I set that value transformer to my "Value Transformer" area in my bindings in IB.
However, it still gave the same results. Any ideas?
|
Bind NSTextField's text color to NSColorWell?
|
CC BY-SA 3.0
| null |
2011-05-06T01:47:51.103
|
2011-05-06T02:55:31.080
| null | null | 456,851 |
[
"objective-c",
"cocoa",
"macos",
"cocoa-bindings"
] |
5,906,214 | 1 | 5,906,353 | null | 1 | 2,752 |
I am trying to build a binary tree from a string input piped to System.in with Java. Whenever a letter from a-z is encountered in the string I am making an internal node (with 2 children). Whenever a 0 is encountered in the string I am making an external node (a leaf). The string is in preorder, so just as an example, if I had an input such as:
> abcd000e000
I am supposed to make the following binary tree
> ```
a
/ \
b 0
/ \
c e
/ \ / \
d 00 0
/ \
0 0
```
At least that is what I think I am supposed to make according to the assignment details (in a link below). We were also given sample input and output for the entire program:
Input
> a0
0
a00
ab000
Output
> Tree 1:
Invalid!
Tree 2:
height: -1
path length: 0
complete: yes
postorder:
Tree 3:
height: 0
path length: 0
complete: yes
postorder: a
Tree 4:
height: 1
path length: 1
complete: yes
postorder: ba
I am trying to implement a program that will do this for me with Java, but I don't think I am making the binary tree correctly. I have provided the code I have come up with so far and detailed in the comments above each method what trouble I have run into so far while debugging. If more context is needed the following link details the entire assignment and what the ultimate goal is supposed to be (building the binary tree is only the first step, but I'm stuck on it):
[Link to Assignment](https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B1DkmkmuB-leNDVmMDU0MDgtYmQzNC00OTdkLTgxMDEtZTkxZWQyYjM4OTI1&hl=en)
```
import java.io.*;
// Node
class TreeNode {
char value;
TreeNode left;
TreeNode right;
}
// Main class
public class btsmall {
// Global variables
char[] preorder = new char[1000];
int i = 0;
// Main method runs gatherOutput
public static void main(String[] args) throws IOException {
new btsmall().gatherOutput();
}
// This takes tree as input from the gatherOutput method
// and whenever a 0 is encountered in the preorder character array
// (from a string from System.in) a new external node is created with
// a value of 0. Whenever a letter is encountered in the character
// array, a new internal node is created with that letter as the value.
//
// When I debug through this method, the tree "appears" to be made
// as expected as the tree.value is the correct value, though I
// can't check the tree.left or tree.right values while debugging
// as the tree variable seems to get replaced each time the condition
// checks restart.
public void createTree(TreeNode tree) throws IOException {
// Check that index is not out of bounds first
if (i >= preorder.length) {
i++;
} else if (preorder[i] == '0') {
tree = new TreeNode();
tree.value = '0';
tree.left = tree.right = null;
i++;
} else {
tree = new TreeNode();
tree.value = preorder[i];
i++;
createTree(tree.left);
createTree(tree.right);
}
}
// Supposed to print out contents of the created binary trees.
// Intended only to test that the binary tree from createTree()
// method is actually being created properly.
public void preorderTraversal(TreeNode tree) {
if (tree != null) {
System.out.println(tree.value + " ");
preorderTraversal(tree.left);
preorderTraversal(tree.right);
}
}
// Reads System.in for the Strings used in making the binary tree
// and is supposed to make a different binary tree for every line of input
//
// While debugging after the createTree method runs, the resulting tree variable
// has values of tree.left = null, tree.right = null, and tree.value has no value
// (it's just a blank space).
//
// This results in preorderTraversal printing out a single square (or maybe the square
// is some character that my computer can't display) to System.out instead of all
// the tree values like it's supposed to...
public void gatherOutput() throws IOException {
InputStreamReader input = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(input);
String line = null;
TreeNode tree = new TreeNode();
while ((line = reader.readLine()) != null) {
preorder = line.toCharArray();
createTree(tree);
preorderTraversal(tree);
i = 0;
}
}
}
```
Can anyone help me with building the binary tree properly and point out what I am doing wrong that would result in the output I'm currently getting? Am I at least on the right track? Any hints?
Thanks.
EDIT:
Here's a picture of the "square" output (this is in Eclipse).
|
Unable to create a binary tree properly?
|
CC BY-SA 3.0
| null |
2011-05-06T02:34:54.593
|
2011-05-06T03:15:04.737
|
2017-02-08T14:32:07.920
| -1 | 738,046 |
[
"java",
"binary-tree",
"bitstring"
] |
5,906,253 | 1 | 5,906,281 | null | 0 | 308 |
I am trying to rotate and image left and right by 90 degrees.
For some reason though, the output of this process results in corruption.
Here is my code:
(its groovy but it doesnt take much imagination to pretend its java)
```
void rotate(File file){
def image = ImageIO.read(file);
double theta = Math.PI / 2;
def w = image.width / 2;
def h = image.height / 2;
def transform = new AffineTransform();
transform.rotate(theta, h, w);
def op = new AffineTransformOp(transform, AffineTransformOp.TYPE_BILINEAR);
image = op.filter(image, null);
def name = file.getName();
def type = name.substring(name.lastIndexOf(".") + 1, name.length());
ImageIO.write(image,type,file);
}
```
original:

rotated:
|
Rotating an image results in corruption
|
CC BY-SA 3.0
| null |
2011-05-06T02:44:26.223
|
2011-05-06T06:04:00.127
| null | null | 26,188 |
[
"java",
"groovy",
"affinetransform"
] |
5,906,292 | 1 | 5,906,698 | null | 0 | 13,783 |
I have a `favicon.ico` on my site.
In the HTML, I link to its location...
```
<link rel="icon" href="/assets/images/layout/favicon.ico" type="image/x-icon" />
```
I also have this in my `.htaccess`.
```
# Redirect /favicon.ico requests
RewriteCond %{REQUEST_URI} !^assets/images/layout/favicon\.ico [NC]
RewriteCond %{REQUEST_URI} ^favicon\.(gif|ico|png|jpe?g)$ [NC]
RewriteRule ^(.*)$ assets/images/layout/favicon.ico [R=301,L]
```
...to redirect the `/favicon.ico` requests to a different location.
For some reason, every time I request [favicon.ico](http://toberua.com/favicon.ico) in my browser, I get `304 Not Modified` response with matching Etags and a blank image, even though `/assets/images/layout/favicon.ico` exist.

I get the same issue when trying to access it wil the full path.
What is going on here? What is causing this `304`?
|
Why is my `favicon.ico` request not working?
|
CC BY-SA 3.0
| 0 |
2011-05-06T02:54:04.153
|
2017-12-20T17:28:02.303
|
2013-05-17T06:35:50.093
| 31,671 | 31,671 |
[
".htaccess",
"favicon"
] |
5,906,426 | 1 | null | null | 0 | 259 |
I have a lot going on in my header so I am hoping it is makes some sense. My Header does not render at all. The only part that shows up is the loginfrom2.inc.php I was wondering if anyone can let me know what is wrong
```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel=stylesheet type="text/css" href="style.css">
<style type="text/css">
.headerfont {
color: #FFF;
}
</style>
<?php
/*Login Logout*/
if(isset($_SESSION['currentMember'])) {
$currentMember=unserialize($_SESSION['currentMember']);
?>
</head>
<body>
<table width="764" height="97" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td width="248"></td>
<td width="100%" background="img/faddedbanner3.png"> <img src="../img/star3.png" width="94" height="104" alt="Star"> <span class="headerfont" align="center"><strong>The Unofficial Bank of Mike</strong></span></td><td background="../assign4/img/faddedbanner3.png"></td>
<td>
</td>
</tr>
<div id="logout">
<span id="user_session">VALUED CUSTOMER: <strong>
<?=$currentMember->firstname?>
<?=$currentMember->lastname?>
</strong></span>
<a id="logout" href="<?=URL_ROOT?>logout.php" title="logout">LOGOUT</a>
<?php
}else{
require_once('loginform2.inc.php');
}
?>
</table>
</body>
</html>
```
//////////////////////////////////////////
This is my Loginform2.inc.php You can see the include statement above
```
<div id="login_form">
<form id="login" method="post" action="processlogin.php">
<p>
<label for="emailaddress">E-Mail Address:</label>
<input type="text" name="emailaddress" id="emailaddress" size="15">
</p>
<p>
<label for="password">Password: </label>
<input type="password" name="password" id="email" size="15">
</p>
<p>
<input type="submit" name="submit" id="login_submit" value="Login"></p>
</form>
</div>
```
///////////////////////processlogin.php
```
/*start session*/
session_start();
$_SESSION['currentMember'] = serialize($currentMember);
```
note the screen shots of my my web page

|
PHP Header / Login / I have header issues and I am hoping someone can assist
|
CC BY-SA 3.0
| null |
2011-05-06T03:20:23.660
|
2011-05-06T22:25:51.843
|
2011-05-06T22:25:51.843
| 604,359 | 604,359 |
[
"php"
] |
5,906,656 | 1 | 5,917,398 | null | 36 | 5,067 |
I accidentally added my project to a group, and now I can't remove it from it in xcode 4, any ideas? If I drag it out, it asks me to create a workspace...

|
Undo "New group from selection" project xcode 4
|
CC BY-SA 3.0
| 0 |
2011-05-06T04:06:08.910
|
2016-07-21T04:48:25.800
|
2011-05-06T21:48:31.623
| 277,370 | 277,370 |
[
"objective-c",
"xcode",
"xcode4"
] |
5,907,193 | 1 | 5,907,351 | null | 2 | 4,910 |

hello .
im new to django and
i want to create a form that looks like the image above in html.
the form should save the data when the user chose a radio button.
how to implement such a form in django ( please note that user cannot chose more than one answer)
|
how to create a dynamically-created radio buttons form in django
|
CC BY-SA 3.0
| null |
2011-05-06T05:34:54.013
|
2011-06-22T00:11:03.923
| null | null | 222,829 |
[
"python",
"django"
] |
5,907,142 | 1 | 5,908,027 | null | 1 | 1,213 |
I have a task where I need to traverse a tree (checking/un-checking individual items). I've written the code and it works correctly but slow at times. Please help me improve it.
Here is how it is suppose to work:
1. Un-checking the parent unchecks all children of that parent
2. Un-checking the (one or more) child nodes un-checks the parent
3. Checking the parent automatically checks all it's children
4. When all children are checked the parent gets checked as well automatically this should also work with any depth tree..so if there are 3 level deep nodes unchecking the most inner child will uncheck the First parent of each node.
Few other considerations:
Css classes:
- -
So:
- - -
I hope this illustration will help:

And part of HTML source code:
```
<ul class='treeList2b'><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:30px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Aparatura elektryczna, elektroenergetyka </span></div>
<ul class='treeList2b'><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:60px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Silniki, napędy, automatyka napędów </span></div>
<ul class='treeList2b'><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:90px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Silniki i napędy przemysłowe </span></div>
<ul class='treeList2b'><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Prądu stałego </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Prądu przemiennego </span></div>
<ul class='treeList2b'><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:150px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>synchroniczne </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:150px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>asynchroniczne </span></div>
</li></ul></li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Silniki krokowe </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Siłowniki elektryczne </span></div>
<ul class='treeList2b'><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:150px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Liniowe </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:150px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Obrotowe </span></div>
</li></ul></li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Serwosilniki, serwonapędy </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Inne </span></div>
</li></ul></li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:90px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Układy zabezpieczeń silników </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:90px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Elektroniczne układy sterowania napędów </span></div>
<ul class='treeList2b'><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Przemienniki prądu stałego </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Przemienniki częstotliwości (falowniki) </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Układy łagodnego rozruchu (softstarty) </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Sterowniki silników DC </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:120px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Sterowniki silników krokowych </span></div>
<ul class='treeList2b'><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:150px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Jednoosiowe </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:150px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Wieloosiowe </span></div>
</li><li class='open'> <div class="tlWrap clearfix marked checked" style="padding-left:150px;"><input type="checkbox" checked="checked" class="checkbox" name="SelectedBranch" id="SelectedBranch"><span>Wieloosiowe z interpolacją </span></div>
</li></ul></li>
```
...
And my script:
```
<script type="text/javascript">
/*<![CDATA[*/
$(function(){
$('ul.treeList2b .checkbox').click(function(e){
e.stopPropagation();
var obj = $(this).closest('li').find(':checkbox');
obj.attr('checked', this.checked);
var childCnt=obj.size(); // get childrent count - when parent was clicked
var checkedCnt=obj.filter(':checked').length; // out of those get those that are checked
if (childCnt==checkedCnt){
obj.parents('li').each(function (index, element) {
var objSub = $(element).find('li');
childCnt = objSub.size();
checkedCnt = objSub.find(':checkbox:checked').length;
if (childCnt==checkedCnt) {
$(element).find(':checkbox:first').attr("checked", true);
$(element).children('div.tlWrap').addClass('checked');
}
$(element).children('div.tlWrap').addClass('marked');
});
}else{
var objParent = obj.parents('li').find(':checkbox:first');
objParent.attr("checked", false);
objParent.parent('div.tlWrap').removeClass('checked');
}
refleshCheckbox(this);
});
});
function refleshCheckbox(obj){
if(!$(obj).attr('checked')){
$(obj).closest('li').find('div.tlWrap').removeClass('marked');
}
if ($(obj).closest('ul').find(':checkbox:checked').length==0){
$(obj).closest('ul').parent().find('div.tlWrap').removeClass('marked');
}
}
/*]]>*/
</script>
```
|
jquery tree traversal
|
CC BY-SA 3.0
| null |
2011-05-06T05:28:59.147
|
2011-05-06T07:30:54.683
| null | null | 455,042 |
[
"javascript",
"jquery",
"jquery-selectors"
] |
5,907,209 | 1 | 5,914,882 | null | 1 | 738 |
I wanted to make an app which is when started it shows a menu. It is just like when you open a Messaging app in S60. Here is a screenshot.

How do I make it? I have tried to make the centralWidget of the QMainWindow as QMenu, and adding QAction to the QMenu. But when I'm running it, the app don't show anything. And I have tried to make the QMenu using QMenuBar. And it is show okay. But I can't use the up/down key to select menu in the device. And when I press the options key (Qt::PositiveSoftKey), the menubar shows up too. And I didn't even add that to menuBar() which is owned by QMainWindow.
Here is my first code:
```
QAction* act1= new QAction(tr("act1"),this);
QObject::connect(tes,SIGNAL(triggered()),this,SLOT(close()));
QAction* act2= new QAction(tr("act2"),this);
QObject::connect(tes,SIGNAL(triggered()),this,SLOT(close()));
QMenu* menu = new QMenu(this);
menu->addAction(act1);
menu->addAction(act2);
setCentralWidget(menu);
```
And it shows nothing at the apps.
And here is my second try:
```
Qt Code: Switch view
QAction* act1= new QAction(tr("act1"),this);
QObject::connect(tes,SIGNAL(triggered()),this,SLOT(close()));
QAction* act2= new QAction(tr("act2"),this);
QObject::connect(tes,SIGNAL(triggered()),this,SLOT(close()));
QMenuBar* menubar = new QMenuBar(this);
QMenu* menu = menubar->addMenu(tr("menu"));
menu->addAction(act1);
menu->addAction(act2);
setCentralWidget(menu);
```
It shows the menu. But when I deploy to the device, I can't use the keypad to select the menu. And at the simulator, if I click other place than the QAction item, the menu lost.
I am using another approach by using QPushButton with Vertical Layout. Here is the code:
```
QWidget* centralWidget = new QWidget(this);
QScrollArea* scrollArea = new QScrollArea(this);
scrollArea->setWidget(centralWidget);
scrollArea->setWidgetResizable(true);
setCentralWidget(scrollArea);
QVBoxLayout* centralLayout = new QVBoxLayout(centralWidget);
QPushButton* button1 = new QPushButton(tr("button 1"));
QPushButton* button2 = new QPushButton(tr("button 2"));
centralLayout->addWidget(button1);
centralLayout->addWidget(button2);
centralLayout->setContentsMargins(0,0,0,0);
button1->setFocus();
```
Here it's look:

Okay, and that's look good enough. But if that's have 8 button. If it is only have 2 button, it looks like this:

looks kind of weird, huh? Any way to prevent this?
|
Creating a Symbian's like application menu at S60
|
CC BY-SA 3.0
| null |
2011-05-06T05:36:57.010
|
2015-12-14T06:57:36.447
|
2011-05-06T10:20:23.010
| 696,686 | 696,686 |
[
"qt",
"layout",
"menu",
"symbian",
"nokia"
] |
5,907,626 | 1 | 6,082,972 | null | 14 | 31,919 |
I would like the spinner dropdown to open right below the spinner itself.
E.g.:

How can i set the position of spinner dropdown?
|
How to change the position of opened spinner?
|
CC BY-SA 3.0
| 0 |
2011-05-06T06:30:42.943
|
2019-07-24T10:21:43.847
|
2019-07-24T10:21:43.847
| 1,000,551 | 324,417 |
[
"android",
"drop-down-menu",
"spinner",
"android-spinner"
] |
5,907,868 | 1 | 5,907,947 | null | 0 | 658 |
I recently installed `VS Team System 2008`, while having `VS 2010` installed on `Windows 7x64`
On First-run i get the following type of error

However i receive multiple of them:
- - - -
How do i fix this, and how do i this from happening in the future?
|
Package Load Failure
|
CC BY-SA 3.0
| null |
2011-05-06T06:57:35.660
|
2011-05-06T07:08:19.933
| null | null | 310,741 |
[
"visual-studio-2008",
"package"
] |
5,908,494 | 1 | 5,933,852 | null | 46 | 12,522 |
I have a standard select box which I'm populating using jquery by appending options, but for some reason IE9 only shows the first character of the selected option. Needless to say it works perfectly in FireFox and Chrome, but I have to support IE9. I tried the IE9 compatibility modes, but it made no difference, nor does styling the select or option.
Has anyone seen this issue before. What caused it? How did you fix it?

Simplified code sample:
```
<select id="selectCCY" ValueColumn="ccyID" DisplayColumn="ccySymbol" ></select>
$.each(res.result, function (key, value) {
$('#selectCCY').append('<option value="' + value[$('#selectCCY').attr('ValueColumn')]+ '">' + value[$('#selectCCY').attr('DisplayColumn')] + '</option>');
});
```
res.result is a simple json array like this:
```
[{"ccyID":1,"ccySymbol":"GBP"},{"ccyID":2,"ccySymbol":"AUD"},{"ccyID":3,"ccySymbol":"USD"}]
```
OH BUGGER!!! it works fine in my simplified example, so the problem is somewhere else. Sorry. The original code is to long and complex to paste here, but will let you know when I find the answer.
some time later....
OK, I got the problem down to an ajax call inside a $(selector).each() loop. The loop goes through all select boxes and asyncronously populates the options. If I make it a syncronous call, the select boxes have the correct width and show correctly, but if its an async call the select boxes only show the first char as in the image. still working on this, will get back to you again.
I still want to know what would cause a select box to display incorrectly. I can do workarounds and get it to show correctly, but that doesn't answer the question. It's just a select with options in it, it should always just work, right?
after a weekend of ignoring the issue ....
Right I found a workaround. Before doing the ajax call to populate the select box I first set the css display property to 'none' on it, then populate it and finally when the ajax call and population is complete I just remove the css display 'none' property.
So I still don't know why IE doesn't like me, but we have a solution at least.
|
<select> only shows first char of selected option
|
CC BY-SA 3.0
| 0 |
2011-05-06T08:02:35.547
|
2022-03-28T12:44:24.407
|
2014-11-04T21:32:55.533
| 402,884 | 141,443 |
[
"jquery",
"html",
"internet-explorer",
"internet-explorer-9"
] |
5,908,633 | 1 | null | null | 0 | 662 |
I want to track a rectangular ABCD using Kalman filter. I saw many people use position and velocity as state vector. Can I use position of point A, the length and width of the rectangular as state vector? Therefore, the process and update equation are:

Is this correct?
Thank you very much.
|
Kalman tracking: process and update equation
|
CC BY-SA 3.0
| 0 |
2011-05-06T08:15:24.673
|
2014-03-31T16:10:47.180
| null | null | 496,837 |
[
"kalman-filter"
] |
5,908,676 | 1 | 5,913,300 | null | 87 | 94,108 |
Past few days I have been trying to integrate an iframe into a site. This is a short term solution while the other side develops and API(could take months...)
And because this is as short term solution we done want to use easyXDM- I have access to the other domain but its difficult enough asking them to add p3p header as it is.....
The closest solution I found was the 3 iframes- but it goes mental of chrome and safari so I cannot use that.
open in chrome
[http://css-tricks.com/examples/iFrameResize/crossdomain.php#frameId=frame-one&height=1179](http://css-tricks.com/examples/iFrameResize/crossdomain.php#frameId=frame-one&height=1179)
I found a another post on how to use the scrollheight to try and resize the form.. in theory it works well but I could not apply it properly using the iframes scroll height..
```
document.body.scrollHeight
```
That obvoisly uses the bodies height (cannot access these properties 100% is based on the clients display canvaz and not the x-domains document height)
I tried using jQuery to get the iframes height
```
$('#frameId').Height()
$('#frameId').clientHeight
$('#frameId').scrollHeight
```
return values different in chrome and ie - or just don't make sense at all.
The problem is that everything inside the frame is denied- even the scrollbar...
But if I inspect and element in chrome of the iframe it badly shows me the documents dimensions inside the iframe (using jQuery x-domain to get iframe.heigh - access denied)
There is nothing in the computed CSS 
Now how does chrome calculate that? (edit- browser re-renders the page using its build in rendering engine to calculate all these settings - but are not attached anywhere to prevent cross-domain fraud.. so..)
I read specification of HTML4.x and it says there that there should be read-only values exposed via document.element but it's access denied via jQuery
I went down the route of proxying the site back and calculating which is OK.. until a user logs in through the iframe and the proxy gets a login page instead of the actual content. Also to some calling the page twice is not acceptable
[http://www.codeproject.com/KB/aspnet/asproxy.aspx](http://www.codeproject.com/KB/aspnet/asproxy.aspx)
[http://www.johnchapman.name/aspnet-proxy-page-cross-domain-requests-from-ajax-and-javascript/](http://www.johnchapman.name/aspnet-proxy-page-cross-domain-requests-from-ajax-and-javascript/)
I did not go this far but there are jscript engines out there that will look at the source and re-render the page based on the source file. but it would require hacking those jscripts.. and that's not an ideal situation for commercial entities...
and some invoke pure Java applets or server side rendering
[http://en.wikipedia.org/wiki/Server-side_JavaScript](http://en.wikipedia.org/wiki/Server-side_JavaScript)
[http://htmlunit.sourceforge.net/](http://htmlunit.sourceforge.net/) <-java not jscript
[http://maxq.tigris.org/](http://maxq.tigris.org/)
---
All this can do done with HTML5 sockets. But easyXDM is great fallback for non HTML5 complaint pages.
Very Great Solution!
Using easyXDM
On your server you set up a page in the form of
```
<html>
<head>
<script src="scripts/easyXDM.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
var transport = new easyXDM.Socket(/** The configuration */{
remote: "http://www.OTHERDOMAIN.example/resize_intermediate.html?url=testpages/resized_iframe_1.html",
//ID of the element to attach the inline frame to
container: "embedded",
onMessage: function (message, origin) {
var settings = message.split(",");
//Use jquery on a masterpage.
//$('iframe').height(settings[0]);
//$('iframe').width(settings[1]);
//The normal solution without jquery if not using any complex pages (default)
this.container.getElementsByTagName("iframe")[0].style.height = settings[0];
this.container.getElementsByTagName("iframe")[0].style.width = settings[1];
}
});
</script>
</head>
<body>
<div id="embedded"></div>
</body>
```
and on the callers domain they just need to add the intermediate_frame HTML and `easyXDM.js` in the same place. Like a parent folder - then you can access relative directories or a contained folder just for you.
|
cross-domain iframe resize
|
CC BY-SA 4.0
| 0 |
2011-05-06T08:18:49.843
|
2022-06-22T10:45:40.580
|
2022-06-22T10:45:40.580
| 1,145,388 | 706,363 |
[
"javascript",
"html",
"css",
"iframe",
"cross-domain"
] |
5,908,955 | 1 | 5,909,134 | null | 7 | 399 |

Hi all,
The images above are taken from the "Nike Boom" App. I am wondering how to do a magnified effect on the number list as shown in the images. I also want to point out that it is very very smooth animation, so screen capturing certain part of a screen and projected it back on UIView may not work (I tried that)
Thankz in advance,
Pondd
Update:
Hey,
Just so for anyone who might comes across this topic, I've made a simple sample based on Nielsbot's suggestion and posted up on github [here](https://github.com/ountzza/iPhone-Magnified-Effect)
Please feel free to fork it, improve it and pass it on :)
Best,
Pondd
|
iPhone how to get Magnified effect on certain part of the screen?
|
CC BY-SA 3.0
| 0 |
2011-05-06T08:47:05.313
|
2011-05-10T07:28:09.783
|
2011-05-10T07:28:09.783
| 408,721 | 408,721 |
[
"iphone",
"uiview",
"zooming"
] |
5,909,042 | 1 | 5,909,325 | null | 1 | 648 |
I have a Silverlight class library project which is referenced (project reference) in Windows Console project.
In visual studio 2010, I see warning icon next to the referenced project. I am using SL4 and .net 4.0.
When I build and run the console project, it works perfectly fine. I understand that silverlight library project can be referenced in Windows Console project or WPF project.
Will the warning cause any side effects? Do I have to take any corrective actions? Thanks. Screen capture attached.

Warning message

|
Visual studio 2010 adding SL project reference in non-SL project results in warning icon
|
CC BY-SA 3.0
| null |
2011-05-06T08:55:13.583
|
2011-05-06T09:20:55.050
|
2011-05-06T09:14:56.390
| 458,548 | 458,548 |
[
"c#",
".net",
"silverlight",
"visual-studio-2010",
"silverlight-4.0"
] |
5,909,030 | 1 | 5,909,226 | null | 1 | 2,528 |
this is probably going to seem like a daft question but please bear with me as I am very new to WPF, UI is sadly not my main area of skills and so I'm struggling to get my head around the concepts of WPF.
I have a user control which contains a dock panel which then contains a tree view, the tree view is being bound using a Hierarchical Data Template which is working great, all the items and sub controls are being bound and I'm pleased with the rough layout result. However I wanted to add a button under the last bound tree view item.
Basically this is what I am trying to acheive : 
At the moment I have a Grid inside the dock panel which has two rows, one for the tree view and one for the button but obviously the button is not part of the tree view, I want it to be within the scrolling area of the tree view so it appears as part of it and only appearing after the final item.
Here is my current XAML:
```
<DockPanel>
<Grid Width="Auto" Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="23"/>
</Grid.RowDefinitions>
<TreeView ItemsSource="{Binding Path=Steps}" FontFamily="Calibri" FontSize="14" DataContext="{Binding}" Grid.Row="0">
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Margin" Value="20,20,0,0"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="FontWeight" Value="Bold"/>
</Trigger>
</Style.Triggers>
</Style>
</TreeView.ItemContainerStyle>
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:StepViewModel}" ItemsSource="{Binding Segments}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" />
</StackPanel>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type local:SegmentViewModel}">
<DockPanel HorizontalAlignment="Stretch" >
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<myUserControl:SegmentLayout HorizontalAlignment="Stretch"/>
<TextBlock Text="{Binding Value}"/>
</StackPanel>
</DockPanel>
</DataTemplate>
</TreeView.Resources>
</TreeView>
<Button HorizontalAlignment="Left" Content="Add Step" Name="addStepButton" Height="23" Width="103" Grid.Row="1"/>
</Grid>
```
Oh and before you ask, yes I am basically ripping the SharePoint Workflow designer, this is for an internal tool and for some reason I'm required to write a lightweight workflow engine which is done and a designer for it in WPF that looks very similar to the SP one. I don't make business decisions, just a code monkey ;) .
Many Thanks
Paul
|
WPF Add Button To Bottom Of Treeview
|
CC BY-SA 3.0
| 0 |
2011-05-06T08:54:08.590
|
2011-05-06T09:20:23.723
| null | null | 431,142 |
[
"wpf",
"treeview",
"dockpanel"
] |
5,909,133 | 1 | 5,934,541 | null | 3 | 176 |
We're thinking about an architecture to support multiple views and editors on the same object. A requirement is the possibility to commit or cancel the changes done on a whole object.
Our requirements are
- lot's of objects edited at the same time (up to 10.000 in multiselect mode)
- multiple views and editors at the same time
- changes in on editor on the object should only reflect in the other views after a succesful commit
- the objects in an editor should be committable/cancellable as a whole
We've had a look at several concepts, including the dynamic-wrapper approach ([http://www.codeproject.com/KB/cs/dynamicobjectproxy.aspx#EditableProxy%28implementingIEditableObject%299](http://www.codeproject.com/KB/cs/dynamicobjectproxy.aspx#EditableProxy%28implementingIEditableObject%299)), which we've discarded because of
- no Intellisense on dynamics
- no compile time checks on dynamics
- access on the properties when iterating over them (e.g. for property grids) is very expensive
We've implemented a prototype of architectur in the figure
each editor gets its own clone of the original object. it can then work on it, validate it and commit it into the imodelrepository. when doing that, the original object gets updated and a backendchanged event gets sent out for each clone. The viewmodels of the other editors registered for the backendchanged events and now get new clones to reflect the changes
the positive aspects are:
- the imodelrepository only outputs clones, a direct editing of the original is prohibited
- each editor can work on it's own clone
- there is a way to notify the other clones and update there content if one editor commits a change
but the negative aspects are:
- each editor/Viewer viewmodel has to look for a backendchanged object that gets sent if the original objects gets changed. it then needs to get a new clone and discard the old one
- additionally each editor/viewer has to look for a object deleted event, if another editor deleted the object. it then needs to discard its clone
- a lot of clones is needed, which slows down the system, especially for a large number on edited objects at the same time
we're thinking about handing the original to viewmodels registered as viewers only, and using the clones for the real editors. That would cut down the number of clones needed. But there is no way to ensure a readonly original for the viewers (dynamic readonly wrapper causes the same problems as the editableproxy mentioned above)
i would be thankful for any input or ideas as how to simplify the approach, or about a different architecture
thx

|
Synchronizing Multiple Views, Editors & Commit/Cancel
|
CC BY-SA 3.0
| 0 |
2011-05-06T09:03:29.740
|
2011-05-09T08:43:26.527
|
2011-05-09T07:00:54.330
| 435,608 | 435,608 |
[
"c#",
"architecture",
"mvvm",
"synchronization",
"editor"
] |
5,909,345 | 1 | 5,913,089 | null | 19 | 2,142 |
During development of an application which prefaults an entire large file (>400MB) into the buffer cache for speeding up the actual run later, I tested whether reading 4MB at a time still had any noticeable benefits over reading only 1MB chunks at a time. Surprisingly, the smaller requests actually turned out to be faster. This seemed counter-intuitive, so I ran a more extensive test.
The buffer cache was purged before running the tests (just for laughs, I did one run with the file in the buffers, too. The buffer cache delivers upwards of 2GB/s regardless of request size, though with a surprising +/- 30% random variance).
All reads used overlapped ReadFile with the same target buffer (the handle was opened with `FILE_FLAG_OVERLAPPED` and `FILE_FLAG_NO_BUFFERING`). The harddisk used is somewhat elderly but fully functional, NTFS has a cluster size of 8kB. The disk was defragmented after an initial run (6 fragments vs. unfragmented, zero difference). For better figures, I used a larger file too, below numbers are for reading 1GB.
The results were really surprising:
```
4MB x 256 : 5ms per request, completion 25.8s @ ~40 MB/s
1MB x 1024 : 11.7ms per request, completion 23.3s @ ~43 MB/s
32kB x 32768 : 12.6ms per request, completion 15.5s @ ~66 MB/s
16kB x 65536 : 12.8ms per request, completion 13.5s @ ~75 MB/s
```
So, this suggests that submitting is actually better than submitting a few hundred large, contiguous reads. The submit time (time before ReadFile returns) does go up substantially as the number of requests goes up, but asynchronous completion time nearly halves.
Kernel CPU time is around 5-6% in every case (on a quadcore, so one should really say 20-30%) while the asynchronous reads are completing, which is a surprising amount of CPU -- apparently the OS does some non-neglegible amount of busy waiting, too. 30% CPU for 25 seconds at 2.6 GHz, that's quite a few cycles for doing "nothing".
Any idea how this can be explained? Maybe someone here has a deeper insight of the inner workings of Windows overlapped IO? Or, is there something substantially wrong with the idea that you can use ReadFile for reading a megabyte of data?
I can see how an IO scheduler would be able to optimize multiple requests by minimizing seeks, especially when requests are random access (which they aren't!). I can also see how a harddisk would be able to perform a similar optimization given a few requests in the NCQ.
However, we're talking about ridiculous numbers of ridiculously small requests -- which nevertheless outperform what appears to be sensible by a factor of 2.
The clear winner is memory mapping. I'm almost inclined to add "unsurprisingly" because I am a big fan of memory mapping, but in this case, it actually me, as the "requests" are even smaller and the OS should be even less able to predict and schedule the IO. I didn't test memory mapping at first because it seemed counter-intuitive that it might be able to compete even remotely. So much for your intuition, heh.
Mapping/unmapping a view repeatedly at different offsets takes practically zero time. Using a 16MB view and faulting every page with a simple for() loop reading a single byte per page completes in 9.2 secs @ ~111 MB/s. CPU usage is under 3% (one core) at all times. Same computer, same disk, same everything.
It also appears that Windows loads 8 pages into the buffer cache at a time, although only one page is actually created. Faulting every 8th page runs at the same speed and loads the same amount of data from disk, but shows lower "physical memory" and "system cache" metrics and only 1/8 of the page faults. Subsequent reads prove that the pages are nevertheless definitively in the buffer cache (no delay, no disk activity).
(Possibly very, very distantly related to [Memory-Mapped File is Faster on Huge Sequential Read?](https://stackoverflow.com/questions/5257019/memory-mapped-file-is-faster-on-huge-sequential-read-why))
To make it a bit more illustrative:

Using `FILE_FLAG_SEQUENTIAL_SCAN` seems to somewhat "balance" reads of 128k, improving performance by 100%. On the other hand, it impacts reads of 512k and 256k (you have to wonder why?) and has no real effect on anything else. The MB/s graph of the smaller blocks sizes arguably seems a little more "even", but there is no difference in runtime.

I may have found an explanation for smaller block sizes performing better, too. As you know, asynchronous requests may run synchronously if the OS can serve the request immediately, i.e. from the buffers (and for a variety of version-specific technical limitations).
When accounting for asynchronous vs. "immediate" asyncronous reads, one notices that upwards of 256k, Windows runs every asynchronous request asynchronously. The smaller the blocksize, the more requests are being served "immediately", (i.e. ReadFile simply runs synchronously). I cannot make out a clear pattern (such as "the first 100 requests" or "more than 1000 requests"), but there seems to be an inverse correlation between request size and synchronicity. At a blocksize of 8k, every asynchronous request is served synchronously.
Buffered synchronous transfers are, for some reason, twice as fast as asynchronous transfers (no idea why), hence the smaller the request sizes, the faster the overall transfer, because more transfers are done synchronously.
For memory mapped prefaulting, FILE_FLAG_SEQUENTIAL_SCAN causes a slightly different shape of the performance graph (there is a "notch" which is moved a bit backwards), but the total time taken is exactly identical (again, this is surprising, but I can't help it).
Unbuffered IO makes the performance graphs for the 1M, 4M, and 512k request testcases somewhat higher and more "spiky" with maximums in the 90s of GB/s, but with harsh minumums too, the overall runtime for 1GB is within +/- 0.5s of the buffered run (the requests with smaller buffer sizes complete significantly faster, however, that is because with more than 2558 in-flight requests, ERROR_WORKING_SET_QUOTA is returned). Measured CPU usage is zero in all unbuffered cases, which is unsurprising, since any IO that happens runs via DMA.
Another very interesting observation with `FILE_FLAG_NO_BUFFERING` is that it significantly changes API behaviour. `CancelIO` does not work any more, at least not in a sense of . With unbuffered in-flight requests, `CancelIO` will simply block until all requests have finished. A lawyer would probably argue that the function cannot be held liable for neglecting its duty, because there are no more in-flight requests left when it returns, so in some way it has done what was asked -- but my understanding of "cancel" is somewhat different.
With , overlapped IO, `CancelIO` will simply cut the rope, all in-flight operations terminate immediately, as one would expect.
Yet another funny thing is that the process is until all requests have finished or failed. This kind of makes sense if the OS is doing DMA into that address space, but it's a stunning "feature" nevertheless.
|
Explanation for tiny reads (overlapped, buffered) outperforming large contiguous reads?
|
CC BY-SA 3.0
| 0 |
2011-05-06T09:21:59.053
|
2011-05-09T10:14:09.100
|
2017-05-23T10:27:04.670
| -1 | 572,743 |
[
"windows",
"winapi",
"overlapped-io",
"buffered"
] |
5,909,587 | 1 | 5,911,035 | null | 1 | 4,083 |
I'm using following code for printing at the moment. Note that i have the requirement of HTML printing.
```
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = @"Sample";
pic.printInfo = printInfo;
NSString *htmlString = [self prepareHTMLEmailMessage];
UIMarkupTextPrintFormatter *htmlFormatter = [[UIMarkupTextPrintFormatter alloc] initWithMarkupText:htmlString];
htmlFormatter.startPage = 0;
htmlFormatter.contentInsets = UIEdgeInsetsMake(72.0, 72.0, 72.0, 72.0); // 1-inch margins on all sides
htmlFormatter.maximumContentWidth = 6 * 72.0; // printed content should be 6-inches wide within those margins
pic.printFormatter = htmlFormatter;
[htmlFormatter release];
pic.showsPageRange = YES;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
if (!completed && error) {
NSLog(@"Printing could not complete because of error: %@", error);
}
};
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[pic presentFromBarButtonItem:self.myPrintBarButton animated:YES completionHandler:completionHandler];
} else {
[pic presentAnimated:YES completionHandler:completionHandler];
}
```
The result produced doesn't give me consistent margins on all pages. Part of the problem is the `contentInsets` property. As per Apple's documentation: The top inset applies only to the first page of printed content.

I want the output to have consistent margins, just like the output produced by Safari.
Suggestions?
|
Printing HTML in iOS
|
CC BY-SA 3.0
| null |
2011-05-06T09:44:27.890
|
2011-05-13T07:02:33.013
| null | null | 49,739 |
[
"ios",
"printing",
"margin"
] |
5,909,703 | 1 | 5,909,793 | null | 0 | 187 |
Can anyon tell me why Windows forms text resizes itself on different resolutions? This happens often to me and it is frustrating. The font is arial, the form has its default font set to 14.25pt and the labels are 24pt. Why does the form text go over the screen on a smaller resolution, and how can I prevent this?


|
Why does windows forms text resize itself on different resolutions?
|
CC BY-SA 3.0
| null |
2011-05-06T09:55:06.103
|
2011-05-06T10:02:09.567
| null | null | 126,597 |
[
".net",
"winforms",
"fonts"
] |
5,909,738 | 1 | 5,909,779 | null | 0 | 115 |

I do a JQuery trigger on a login button to auto login.
It works fine in IE but in Firefox i get this login window.
My question is:
Can I trigger the click on OK with jQuery?
```
jQuery(document).ready(function(){
jQuery('.centerButton').trigger('click');
});
```
|
trigger login window
|
CC BY-SA 3.0
| null |
2011-05-06T09:57:50.710
|
2011-05-06T10:07:08.410
| null | null | 472,285 |
[
"javascript",
"jquery"
] |
5,909,941 | 1 | 6,249,410 | null | 1 | 1,778 |
A colleague of mine has been working on a project in Codewarrior and I have come on board to assist.
When trying to open the .mcp project file that she has created (and is working fine on her codewarrior) I get the following error.

Similarly - when I try to open her workspace file, I get the following error.

Important to note, we are using the exact same versions of codewarrior and I am able to open and work with other codewarrior projects.
Anyone had this problem before?
|
Codewarrior won't open .mcp project file
|
CC BY-SA 3.0
| null |
2011-05-06T10:15:10.377
|
2011-06-06T08:29:25.567
| null | null | 305,799 |
[
"codewarrior"
] |
5,910,004 | 1 | 5,910,911 | null | 45 | 76,635 |
Can anybody please help me with a script.. or a way to get the value of
```
height : 1196px;
width: 284px;
```
from the computed style sheet (webkit). I know IE is different- as usual. I cannot access the iframe (cross domain)—I just need the height/width.
Screenshot of what I need (circled in red). How do I access those properties?

Source
```
<iframe id="frameId" src="anotherdomain\brsstart.htm">
<html id="brshtml" xmlns="http://www.w3.org/1999/xhtml">
\--I WANT THIS ELEMENTS COMPUTED BROWSER CSS HEIGHT/WIDTH
<head>
<title>Untitled Page</title>
</head>
<body>
BLA BLA BLA STUFF
</body>
</html>
\--- $('#frameId').context.lastChild.currentStyle
*This gets the actual original style set on the other domain which is "auto"
*Now how to getComputed Style?
</iframe>
```
The closest I got is this
```
$('#frameId').context.lastChild.currentStyle
```
That gives me the actual style on the HTML element which is "auto" and that is true as thats what's its set on the iframed document.
How do I get the computed style that all the browsers use to calculate the scroll bars, and inspect elements values?
Using Tomalaks answer I conjured up this lovely piece of script for webkit
```
window.getComputedStyle(document.getElementById("frameId"), null).getPropertyValue("height")
```
or
```
window.getComputedStyle(document.getElementById("frameId"), null).getPropertyCSSValue("height").cssText
```
Result 150px
Identical to
```
$('#frameId').height();
```
So I got them to add a id of 'brshtml' to the head- maybe it will help me select the element easier. Webkit inspection shows me now html#brshtml but I cant select it using `getelementbyid`
|
How do I get a computed style?
|
CC BY-SA 3.0
| 0 |
2011-05-06T10:21:25.973
|
2018-11-04T01:26:48.507
|
2016-08-23T18:42:45.547
| 4,561,047 | 706,363 |
[
"javascript",
"html",
"css",
"cross-domain",
"computed-style"
] |
5,910,227 | 1 | 5,910,995 | null | 0 | 933 |
Ok so I've got a header and a footer with absolute positioning and heights of 144px. The content div in the middle area needs to be the full height of the area in between.
Simplified:
```
<style>
.marginals{
position: absolute;
height: 144px;
width: 100%;
left: 0;
}
#header{ top: 0px; }
#footer{ bottom: 0px; }
</style>
<div id="header" class="marginals"></div>
<div id="content"> Content </div>
<div id="footer" class="marginals"></div>
```
So basically I want a div that is 100% - 288px. At first I thought I could just make a 100% x 100% div with 144 padding on top and bottom and then stuff the content div in there at 100% but my thinking has gone stray somewhere.

> Here's an example I made using 20% height for 'bread layers'. (Which I can't do on this project) Used 60% height for the scrolling 'meaty layer' and put it at top: 20%;
|
Make content div and top/bottom running marginals equal 100% total height?
|
CC BY-SA 3.0
| null |
2011-05-06T06:51:50.793
|
2011-05-16T06:03:14.157
|
2011-05-16T06:03:14.157
| 578,023 | 578,023 |
[
"html",
"css",
"cross-browser"
] |
5,910,239 | 1 | 5,910,772 | null | 2 | 8,940 |
I'm trying to create custom `AlertDialog` with an image text and buttons. When I display it I get a white border which looks horrible.

How can I get rid of that white border?
Here my custom Dialog:
```
public LinearLayout customeLL;
public void alertD()
{
AlertDialog ad;
AlertDialog.Builder builder;
Context mContext = getApplicationContext();
TextView a = new TextView(getApplicationContext());
a.setText("Test dialog");
ImageView img = new ImageView(getApplicationContext());
img.setBackgroundResource(R.drawable.bottombar_bg);
LinearLayout customeLL = new LinearLayout(getApplicationContext());
customeLL.setOrientation(LinearLayout.VERTICAL);
customeLL.addView(img,curWidth,37);
customeLL.addView(a,curWidth,37);
builder = new AlertDialog.Builder(myClass.this);
builder.setView(customeLL);
ad=builder.create();
ad.show();
}
```
As you can see the topborder and image have a space in 2-3 px.
|
How to remove border in custom AlertDialog?
|
CC BY-SA 3.0
| null |
2011-05-06T10:45:15.473
|
2012-08-02T13:46:22.453
|
2011-05-06T13:06:18.637
| 418,183 | 562,592 |
[
"android",
"android-alertdialog"
] |
5,910,278 | 1 | 5,912,155 | null | 8 | 5,283 |
I need a built-in on screen numeric keypad in my Application. For various reasons I cannot use the [TMS Software](http://www.tmssoftware.com/site/atkbd.asp) or other commercial component offerings. I'm very happy with a button-based solution shown below but I cannot yet see how to solve the focus switch issue where clicking the button activates the keypad form and I lose the focused control into which I wanted the characters. My solution works if I keep the keypad buttons within the target form but I would like a form-independent solution. Is there a way of disabling the button activation or knowing where the focus came from so that I can use something like Scree.ActiveControl :=?? to put it back?

|
How to use window focus messages for a Delphi on-screen keyboard form
|
CC BY-SA 3.0
| 0 |
2011-05-06T10:49:09.173
|
2014-09-05T21:22:39.240
|
2014-09-05T21:22:39.240
| 321,731 | 47,012 |
[
"forms",
"delphi",
"keyboard",
"focus"
] |
5,910,654 | 1 | 9,995,400 | null | 1 | 264 |
I have a Silverlight navigation application, that for some reason when showing a data grid it consumes the entire processor...
For instance: [Image Link](https://i.stack.imgur.com/uvh2A.png)

I do not know why it is doing this, it shouldnt be refreshing the grid, if I put a breakpoint on PropertyChanged, there are no properties changing...
I have tracked this down to showing a control that is showing a scroll bar (TreeView, DataGrid) when this is shown, the processor tries to reach the maximum framerate allowed (60) and clogs the CPU... I can turn this down, but the point is that it should not constantly be trying to reach this rate, it normally only refreshes the UI when something changes, but now it doing it when a scroll bar is presented!! What is going on here?
Has anyone got any ideas on how to go about debugging this?
|
How to debug silverlight performance problems, data grid
|
CC BY-SA 3.0
| null |
2011-05-06T11:19:42.120
|
2012-04-03T14:31:00.700
|
2011-05-08T13:48:11.483
| 282,090 | 282,090 |
[
"silverlight",
"silverlight-toolkit"
] |
5,910,716 | 1 | 5,910,757 | null | 1 | 1,319 |
Anybody know a workaround for this problem described under:
"When you add the folder as a reference ("blue folder") it adds that folder to your bundle and not just the files in that folder. This means that when you want to reference a file in that folder, you have to reference it by doing foldername/myfile.png (because you have to dive into that folder, instead of just files in the root of the bundle).
I haven't found a way around this, so if you need to reference a file in a folder like that - be it in IB or a method like imageNamed: you need to do foldername/filename otherwise it won't be found."
It works when I create groups instead of folder references though.
Oh and I was wondering, if I add a folder with pictures in it with "Create groups for any added folders" selected, is all the structure going to be lost and everything will be on the root in my app bundle on the phone? Because if I go with the finder in my dev project, I can see that xcode copied my folder with all the pictures in it. But if it's true and no structure is kept, it means that I can't have two images with the same name in different folders in my dev project, correct? and even if all my images are in a folder "images" in my dev project, I still access them directly (foo.png not images/foo.png) in xcode, right?
OK after adding the User paths (thanks to @Matthew Frederick) I can now see the filename of my images in the dropdown of IB and they show up on the interface! Problem is, it does not add the folder in the dropdown (I only see filename.png not images/filename.png), so when I compile, it looks for filename.png instead of "images/filename.png", so it does not work. I have to put images/filename.png manually in the IB dropdown, but then the image does not show in IB...


|
is this problem resolved? image view with folder reference
|
CC BY-SA 3.0
| null |
2011-05-06T11:24:43.970
|
2011-05-07T17:27:49.893
|
2011-05-07T14:53:22.533
| 277,370 | 277,370 |
[
"objective-c",
"xcode",
"xcode4"
] |
5,910,726 | 1 | null | null | 1 | 7,950 |
I have created login page which contains the user name and password. I created one custom cell and it has one label and one text field. And i have created one grouped table view and used the custom cell. Actually i have created successfully but the problem is, how can i get the text field values for user name and pass word. Bcoz i have used only one textfield for both fields. I couldn't get the textfield values properly. I always get the last value for both fields. How can i get the user name and pass word text values properly?
Here my sample code,
In custom Cell,
```
@interface CustomCell : UITableViewCell {
UILabel *userLbl;
UITextField *userTxt;
}
@property (nonatomic, retain) IBOutlet UILabel *userLbl;
@property (nonatomic, retain) IBOutlet UITextField *userTxt;
@end
```
In Root View Controller,
```
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:nil options:nil];
for(id currentObjects in nibObjects)
{
if([currentObjects isKindOfClass:[CustomCell class]])
{
cell = (CustomCell *) currentObjects;
}
}
}
if (indexPath.section == 0) {
if(indexPath.row == 0)
{
[[cell userLbl] setText:@"User Name:"];
cell.userTxt.tag = 0;
//self.userName = [[cell userTxt] text];
}
if (indexPath.row == 1) {
[[cell userLbl] setText:@"Pass Word:"];
cell.userTxt.secureTextEntry = YES;
//self.passWord = [[cell userTxt] text];
cell.userTxt.tag = 1;
}
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// Configure the cell.
return cell;
}
-(IBAction) submitAction : (id) sender
{
self.userName = [[cell userTxt] text];
self.passWord = [[cell userTxt] text];
[cell.userTxt resignFirstResponder];
NSLog(@"The user Name is %@", self.userName);
NSLog(@"The password is %@", self.passWord);
//Doesn't work
/* UITextField *txtField = (UITextField*)[cell viewWithTag:0];
self.userName = [txtField text];
UITextField *txtField1 = (UITextField*)[cell viewWithTag:1];
self.passWord = [txtField1 text];
NSLog(@"The user Name is %@", self.userName);
NSLog(@"The password is %@", self.passWord);*/
}
```
Here my screen shot of the image is,

PLease Help me out.
Thanks.
|
How to get the text field values in the Table view in iPhone?
|
CC BY-SA 3.0
| 0 |
2011-05-06T11:25:14.897
|
2012-07-04T15:44:38.197
|
2011-05-09T12:34:17.903
| 249,916 | 249,916 |
[
"iphone",
"uitableview"
] |
5,911,004 | 1 | 5,911,770 | null | 1 | 1,019 |
How do you detect a long click on a ListField component?
Do you override its and fumble with its argument (how?) or is there some builtin method for detecting long clicks?
And more importantly - how do you display the menu (the one in the middle of the screen) once you detected such a click?
The background is that on short clicks I'd like to let the user edit the selected item. And on long clicks I'd like to display a menu in the middle of the screen to offer secondary tasks: delete item, change item display order, etc.
Below is my current test code - :

```
package mypackage;
import java.util.*;
import net.rim.device.api.collection.*;
import net.rim.device.api.collection.util.*;
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.*;
import net.rim.device.api.ui.decor.*;
import net.rim.device.api.util.*;
public class MyList extends UiApplication {
public static void main(String args[]) {
MyList app = new MyList();
app.enterEventDispatcher();
}
public MyList() {
pushScreen(new MyScreen());
}
}
class MyScreen extends MainScreen {
ObjectListField myList = new ObjectListField() {
protected boolean navigationClick(int status, int time) {
System.err.println("XXX status=" + status + ", index=" + getSelectedIndex());
return true;
}
};
public MyScreen() {
setTitle("How to detect long click?");
myList.set(new String[] { "Item 1", "Item 2", "Item 3", "Item 4", });
add(myList);
}
}
```
Thank you
Alex
|
Blackberry: detect long click on a ListField and display menu
|
CC BY-SA 3.0
| 0 |
2011-05-06T11:52:08.977
|
2012-08-24T11:47:59.880
|
2012-08-24T11:47:59.880
| 165,071 | 165,071 |
[
"blackberry",
"menu",
"contextmenu",
"listfield",
"long-click"
] |
5,911,020 | 1 | 5,911,083 | null | 0 | 298 |
The following code:
```
<div style="width: 50px; border: 1px solid green;">
<div style="position: absolute;">
whatever text you want
</div>
</div>
```
Renders like this:

in any modern browser(ie7+, chrome, firefox), and like this:

in IE6.
What i would like is for it to render in IE6 just like it renders in the others browsers.
Any ideas ?
|
Overflowing content outside parent div in ie6
|
CC BY-SA 3.0
| null |
2011-05-06T11:53:54.390
|
2011-05-06T12:07:30.313
| null | null | 17,515 |
[
"html",
"css",
"internet-explorer-6"
] |
5,911,064 | 1 | 5,912,033 | null | 1 | 135 |
When I add an 3party Library (Gibraltar.Agent) to a VB.NET project I get namespaces which interfere with my current code.
For example the namespace Gibraltar.Agent.IS makes the following code invalid:
```
Assert.That("bla", [Is].EqualTo("bla"))
```
as a solution i have to fully qualify [Is]
```
Assert.That("bla", Nunity.Frameworks.Is.EqualTo("bla"))
```
Also annoying is the "I" namespace, which makes the following invalid:
```
For i = 0 to 10 'valid without referencing Gibraltar.Agent
For i as Integer = 0 to 10 'needed change after adding Gibraltar.Agent
```
How can i hide the unwanted 3Party namespaces?

- - The following does not help either: ```
Imports [Is] = NUnit.Framework.Is
```
|
Hide 3party empty namespaces
|
CC BY-SA 3.0
| null |
2011-05-06T11:57:28.843
|
2011-05-06T13:20:06.930
|
2011-05-06T12:20:09.250
| 130,754 | 130,754 |
[
"vb.net"
] |
5,911,162 | 1 | 5,911,182 | null | 0 | 922 |
I use a List to populate a WPF `GridView` as its `ItemsSource`. This is the xaml markup I use:
```
<ListView.View>
<GridView>
<GridViewColumn Header="Subject" DisplayMemberBinding="{Binding Path=Subject}" />
<GridViewColumn Header="Start" DisplayMemberBinding="{Binding Path=StartingDate}" />
<GridViewColumn Header="End" DisplayMemberBinding="{Binding Path=EndingDate}" />
<GridViewColumn Header="Commissioner" DisplayMemberBinding="{Binding Path=Commissioner}" />
<GridViewColumn Header="Description" DisplayMemberBinding="{Binding Path=QuickNotes}" />
</GridView>
</ListView.View>
```
Surprisingly (at least for me), I get an additional (empty) column as shown below. What important point am I missing?

|
Additional column in GridView
|
CC BY-SA 3.0
| null |
2011-05-06T12:06:35.680
|
2011-05-06T14:46:31.883
| null | null | 491,195 |
[
"wpf",
"xaml",
"listview",
"datagrid"
] |
5,911,194 | 1 | null | null | 0 | 437 |
I Need Search line where i can search from three dissfrenc text boxes and displaying three columns link in this image. i am using php, jquery JavaScript and ajax mysql to make this 
bt i is working with only one text (1st box) box simultenously.
plz help me to do this.
|
auto search suggest with three text fields and displaying three columns paralal in the display panel
|
CC BY-SA 3.0
| null |
2011-05-06T12:09:51.047
|
2011-06-12T00:37:20.997
| null | null | 741,157 |
[
"php",
"mysql",
"ajax",
"jquery"
] |
5,911,330 | 1 | 5,911,397 | null | 3 | 1,101 |
Could you please tell me what does the underline symbols in the picture mean (they are not there in insert mode, when I write something to that place it will get underlined) and how to get rid of them?

thank you
|
Strange underline symbols in vim
|
CC BY-SA 3.0
| null |
2011-05-06T12:21:43.630
|
2011-05-06T12:27:00.597
| null | null | 653,379 |
[
"vim",
"symbols",
"underline"
] |
5,911,425 | 1 | 5,914,914 | null | 3 | 4,794 |
I'm trying to migrate [an old FBML app](https://stackoverflow.com/questions/5894992/facebook-iframe-app-how-to-fetch-preload-fql-result) to iFrame using the new PHP SDK and GRAPH API, but cannot figure out - how to find the visitor's city.
For example in my own Facebook profile I list both and :

But when I try the following iFrame app, the and are not printed, while other data including my employers and education is printed:
```
<?php
include_once 'facebook.php';
$facebook = new Facebook(array(
'appId' => "182820975103876",
'secret' => "XXXXXXX",
'cookie' => true,
));
$session = $facebook->getSession();
if (!$session) {
$url = $facebook->getLoginUrl();
print("<script type='text/javascript'>top.location.href = '$url';</script>");
} else {
try {
$me = $facebook->api('/me');
print('<pre>');
print_r($me);
print('</pre>');
} catch (FacebookApiException $e) {
print("Error:" . $e);
}
}
?>
```
Here is part of the data I see for myself, the current location isn't there:
```
Array
(
[first_name] => Alexander
[education] => Array
(
[0] => Array
(
[school] => Array
(
[id] => 106509962720287
[name] => Riga Nr. 40
)
[type] => High School
)
[1] => Array
(
[school] => Array
(
[id] => 103130426393616
[name] => RWTH Aachen University
)
[year] => Array
(
[id] => 143018465715205
[name] => 2000
)
[type] => College
)
)
[gender] => male
...........
)
```
Regards
Alex
|
Facebook iFrame app - how to find user's current city?
|
CC BY-SA 3.0
| null |
2011-05-06T12:29:19.783
|
2012-09-28T16:37:07.420
|
2017-05-23T10:24:27.860
| -1 | 165,071 |
[
"facebook",
"iframe",
"facebook-graph-api",
"location",
"facebook-iframe"
] |
5,911,686 | 1 | 5,912,060 | null | 0 | 128 |
Can anyone say what is the button in the image refers to and how to design this in a xml file

in a checked textview layout how to get the check box at the right corner normally it is showing in the left end
is it an image, please tell me.....
|
how to get this button in layout of an android file
|
CC BY-SA 3.0
| null |
2011-05-06T12:49:21.793
|
2011-05-06T13:22:42.230
|
2011-05-06T12:58:44.263
| 596,364 | 596,364 |
[
"android",
"uiview"
] |
5,912,013 | 1 | 5,927,178 | null | 0 | 123 |
I am writing a backend surveys database. The database is the backend for multiple applications that are used for gathering survey type data. I have a schema that includes a table that designates the application and what questions belong to that application.
now I need to setup users and userroles...
each user may have access to 1 or more applications
each application has 1 or more users
each user may have 1 role in the application they have access to
each role may exist in 1 or more applications
each user may have different roles in each application.
app1 has 15 users 1 user is admin
app1 has 2 roles defined for user access
app2 has 30 users admin user from app1 has access but is regular user
2 admin users in app2 exist in app1 as normal users
app2 has 4 roles defined for user access.
so I have
Application ->ApplicationUsers<-Users
maybe I only need one joining table then like this?

Would that be correct? Would it work in EF 4.0?
What would be the correct way to make this work?
|
complex user_roles many to many setup
|
CC BY-SA 3.0
| null |
2011-05-06T13:18:27.487
|
2011-05-08T11:35:41.087
|
2011-05-06T13:32:46.697
| 183,408 | 183,408 |
[
"sql",
"entity-framework",
"database-design"
] |
5,912,603 | 1 | 5,912,709 | null | 2 | 1,168 |
I am new in ASP 2.0 and i need help to create a createUserWizard. It is not for a real application, it is just for homework. Could someone give me some guidelines on what should i do?
This is what i did so far:
1-I created the database with a user table

2-I create a page for registration and i added the userWizardComponent on it:

What should i do now to be able to:
-Add users to the database
-Make the password validation less restrictive(I cannot enter it correctly i would like to make it easier or dissable it).
Ill appreciate your help
|
ASP.NET first time using createuserwizard component
|
CC BY-SA 3.0
| null |
2011-05-06T14:07:36.087
|
2011-05-06T14:28:53.110
|
2011-05-06T14:16:52.123
| 101,371 | 614,141 |
[
"c#",
"asp.net",
"visual-studio",
"visual-studio-2005"
] |
5,912,653 | 1 | 5,946,663 | null | -1 | 212 |
I am having the following problem while adding a subview to navigation controller. I even have tried to modify the Y location of frame before and after adding the subview but not effective.
Also tried to put a status bar on the child view but nothing is working.

Many Thanks.
|
adding subview problem
|
CC BY-SA 3.0
| null |
2011-05-06T14:11:54.467
|
2011-05-10T07:32:47.587
| null | null | 419,894 |
[
"iphone",
"uinavigationcontroller",
"addsubview"
] |
5,912,652 | 1 | null | null | 3 | 1,744 |
The relation of `PRIMARY` is equal to `fk_student_single_user1.` So i must remove one of them.
The problem is, i can't remove or rename `PRIMARY` in workbench, the program does not allow, and if i delete `fk_student_single_user1`, i also delete the `foreign key`. The only way is delete `PRIMARY` in the phpmyadmin.
But i think that exists any problem in my eer model, it is supposed an export without bugs.
I deleted my previous column id, because two foreign keys can be the primary key of the table.
How i can solve that?

|
problem with index -mysql workbench
|
CC BY-SA 3.0
| null |
2011-05-06T14:11:48.217
|
2011-05-08T17:25:13.537
|
2011-05-08T15:01:37.173
| 537,173 | 537,173 |
[
"mysql",
"database",
"database-design",
"phpmyadmin"
] |
5,912,714 | 1 | null | null | 0 | 117 |
I am using Railo CFVideoPlayer tag with colorbox effect in my project. It is working fine in all browsers except IE (Version 7 & 8).IE 9 is fine. I am getting below JS error line# 11 in /railo-context/swfobject.js.cfm & I am getting only loading symbol.
Message: 'null' is null or not an object
Line: 11
Char: 3894
Code: 0
URI: [http://Mysite/railo-context/swfobject.js.cfm](http://Mysite/railo-context/swfobject.js.cfm)

|
cfvideoplayer javascript error in IE 7 & 8
|
CC BY-SA 3.0
| null |
2011-05-06T14:16:08.660
|
2011-05-06T14:46:59.997
| null | null | 639,432 |
[
"coldfusion",
"colorbox",
"railo"
] |
5,912,887 | 1 | 5,913,214 | null | 1 | 416 |
I would like to create JScrollBar with increase and decrease buttons at the bottom in case of vertical scrollbar as shown in the image attached. (Mac OS Style)
I need something like
------------O-----------<>
instead of
<----------O-------------->
Could you please help me with this?

|
Customise JScrollBar arrow
|
CC BY-SA 3.0
| null |
2011-05-06T14:30:48.977
|
2011-05-06T14:57:49.287
|
2011-05-06T14:50:07.733
| 608,447 | 608,447 |
[
"java",
"swing",
"jscrollpane"
] |
5,912,980 | 1 | 5,913,327 | null | 47 | 8,672 |
I downloaded [Glimpse](http://www.getglimpse.com/) this morning to try it out and noticed this when I click on the views tab:

It checks all of the loaded view engines. I found where the `RazorViewEngine` is specified in web.config, but I couldn't find where the `WebFormViewEngine` was. Since I know my project will never have an web form view in it,
1. Is it ok/safe to turn off WebFormViewEngine?
2. How can I turn off WebFormViewEngine?
|
Turning off the WebFormViewEngine when using razor?
|
CC BY-SA 3.0
| 0 |
2011-05-06T14:38:34.033
|
2018-08-29T12:51:18.067
|
2011-05-06T14:56:46.783
| 178,082 | 178,082 |
[
"asp.net-mvc",
"configuration",
"webforms",
"razor"
] |
5,913,006 | 1 | 5,914,325 | null | 2 | 544 |
I have a plot that I would like to recreate within R. Here is the plot:

From: Boring, E. G. (1941). Statistical frequencies as dynamic equilibria. Psychological Review, 48(4), 279.
This is a little above my paygrade (abilities) hence asking here. Boring states:
> On the first occasion A can occur only 'never' (0) or 'always' (1). On
the second occasion the frequencies
are 0,1/2, or 1; on the third 0, 1/3,
2/3, or 1 etc, etc.
Obviously, you don't have to worry about labels etc. Just a hint to generate the data and how to plot would be great. ;) I have no clue how to even start...
|
Reproduce frequency matrix plot
|
CC BY-SA 3.0
| 0 |
2011-05-06T14:40:57.000
|
2011-06-01T08:53:29.263
|
2011-06-01T08:53:29.263
| 180,239 | 471,431 |
[
"r",
"matrix",
"plot",
"frequency"
] |
5,913,228 | 1 | 5,916,031 | null | 0 | 289 |
I am desperately trying to get rid of the margins around my table below:

I don't want the light gray area directly to the left and above "Brea" in the pic - I want the white table cells to extend left and up to completely cover the light grey area (to meet up with left-most white area)
Any help would be greatly appreciated!!!
|
What determines how high and wide the margin of a UITableView is? (see pic)
|
CC BY-SA 3.0
| null |
2011-05-06T14:58:33.793
|
2012-02-13T18:40:06.630
|
2011-05-07T10:43:21.547
| 596,219 | 718,530 |
[
"objective-c",
"ios",
"uitableview",
"interface-builder"
] |
5,913,345 | 1 | 5,914,548 | null | 0 | 277 |
From the image below you can see that I have a "Quick Tips" div. For examples sake lets say that the outermost div is called: id = "TipsDiv" You can see that it is below the accordion. I want it to stay below the accordion. However when the user scrolls down the div should never go above (0,0). And when the user scrolls back up it should be like it is in the picture.

If i didn't make my self clear please let me know and i'll try to explain better.
Thanks!
|
float div on page below an accordian
|
CC BY-SA 3.0
| null |
2011-05-06T15:09:33.607
|
2011-05-06T16:50:08.087
| null | null | 351,980 |
[
"jquery",
"html",
"css",
"internet-explorer-8"
] |
5,913,750 | 1 | 5,915,820 | null | 2 | 1,759 |
I've been trying to align some objects in my java project in a certain way but with no success. I am using MigLayout for the layout and this is how I would like it to look:

1. The sidebar should have a static width (220px) and be docked left.
2. The right column should have a fluid width and expand according to window size.
3. The footer should be docked to the bottom and have a static height, fluid width.
This is the code that I have got now:
```
this.setLayout(new MigLayout("fill, wrap 2", "[30%][70%]", "grow"));
this.add(sourceList, "w 30%");
this.add(listView, "w 70%");
this.add(bottomBar.getComponent(), "growx, push, span");
```
I've been trying to understand the usage instructions but they are hard to understand. I was hoping someone here had knowledge about working with MigLayout and could help me.
|
Help with problematic layout using MigLayout
|
CC BY-SA 3.0
| 0 |
2011-05-06T15:41:18.067
|
2011-05-06T18:55:39.927
|
2011-05-06T18:54:05.667
| 50,476 | 739,557 |
[
"java",
"layout",
"grid",
"alignment",
"miglayout"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.