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,992,625 | 1 | 6,013,313 | null | 0 | 809 |
I have problem with Joomla layouts in my component..There must be something bad with file/class name convention..
I was trying to ask on Joomla developer forum, but noone answered..
So I am getting this error.. 500 - View not found [name, type, prefix]: PostToBank,,postToBankView
The view is in views/postTobank/view.php and name is postToBankViewPostToBank
In my controllers/controller.php file I have class named PaymentController which contains this part of code.
```
$view = $this->getView('PostToBank','','postToBankView');
$this->getModel("Payment")->savePaymentData($data);
foreach ($data as $key => $value) {
$view->assignRef($key, $value);
}
$view->setLayout('postTobank');
$view->display();
```
my view.php file looks like this
```
class postToBankViewPostToBank extends JView{
function display($tpl=null){
//display set template
parent::display($tpl);
}
```
}
on attached image is full folder structure of my component..
Please whats wrong with this?Thanks

|
Joomla problem with MVC component
|
CC BY-SA 3.0
| null |
2011-05-13T13:30:17.913
|
2011-05-16T04:53:52.180
| null | null | 419,449 |
[
"model-view-controller",
"joomla1.5",
"joomla-extensions"
] |
5,993,014 | 1 | 5,993,074 | null | 2 | 92 |
I want to show 2 tables in html first at center and second at right like this pic.

[Link to the layout image](http://mehdi9torki.persiangig.com/image/Untitled.jpg)
But I don't know how. Please help me.
|
problem with showing tables in html
|
CC BY-SA 3.0
| null |
2011-05-13T13:58:55.770
|
2011-06-07T09:33:36.027
|
2011-06-07T09:33:36.027
| 468,793 | 578,462 |
[
"html",
"css",
"layout"
] |
5,993,062 | 1 | null | null | 0 | 183 |
So we try to solve simple ODE. We use text [book (warning - russian)](http://www.google.ru/url?sa=t&source=web&cd=2&ved=0CB4QFjAB&url=http://www.mmcs.sfedu.ru/docmanupload/doc_download/386-&ei=wRLNTdXUEM6dOteb9f4M&usg=AFQjCNGQGhVmfzbpzHy4_L2eF2hKaWjOXg&sig2=32T2SROcFptATj4gL2g7Yw). This is code presented as sample in book (page 18):
```
> with(DEtools); with(plots);
> eq1 := diff(x(t), t) = y(t); eq2 := diff(y(t), t) = -sin(x(t));
> init := [[x(0) = 1, y(0) = 0], [x(0) = 0, y(0) = 2]];
> DEplot([eq1, eq2], [x, y], t = 0 .. 110, x = -2*Pi .. 2*Pi, init, scene = [x, y], stepsize = 0.5e-1, obsrange = true, color = black, linecolour = black, arrows = 'MEDIUM')
```
This code shall draw:
But maple outputs this for me:
1) Why it solves function only for one quarter?
2) How to make it solve to make it look like in the book?
|
Maple ODE solving, Graphic is not complete. Why?
|
CC BY-SA 3.0
| null |
2011-05-13T14:02:06.217
|
2011-07-01T14:46:58.437
|
2011-07-01T14:46:58.437
| 201,078 | 434,051 |
[
"plot",
"maple",
"ode"
] |
5,993,055 | 1 | 5,993,181 | null | 7 | 19,168 |
I have a screen that I'm trying to layout...
Basically, I'm trying to evenly distribute 4 ImageButton objects vertically on a screen... I used this [here](http://andmobidev.blogspot.com/2010/01/setting-width-of-view-using-percentage.html) to evenly distribute the items, but now am having a terrible time getting the images to scale but maintain aspect ratio... if I use `scaleType="centerInside"` they don't scale, if I use "fitXY" they don't maintain aspect ratio... here is what the layout looks like:

and here is the code:
```
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_margin="0dp"
android:padding="0dp"
android:orientation="vertical"
android:weightSum="5"
>
<ImageButton android:id="@+id/share_song"
android:layout_width="fill_parent" android:text=""
android:layout_marginLeft="0dp"
android:layout_marginTop="15dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="5dp"
android:gravity="left"
android:src="@drawable/share_song_button_sel"
android:adjustViewBounds="true"
android:background="#0000"
android:scaleType="fitXY"
android:layout_height="0dp"
android:layout_weight="1"
/>
<Button
android:layout_width="wrap_content"
android:text="" android:id="@+id/tag_a_song"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="5dp"
android:gravity="right"
android:layout_gravity="right"
android:background="@drawable/song_check_in_button_sel"
android:layout_height="0dp"
android:layout_weight="1"
/>
<Button android:id="@+id/match_button"
android:layout_width="wrap_content" android:text=""
android:layout_marginLeft="0dp"
android:layout_marginTop="10dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="5dp"
android:gravity="left"
android:background="@drawable/music_match_button_sel"
android:layout_height="0dp"
android:layout_weight="1"
/>
<Button android:id="@+id/friends_button"
android:layout_width="wrap_content" android:text=""
android:layout_marginLeft="0dp"
android:layout_marginTop="10dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="5dp"
android:gravity="right"
android:layout_gravity="right"
android:background="@drawable/my_friends_music_button_sel"
android:layout_height="0dp"
android:layout_weight="1"
/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:layout_marginRight="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:padding="0dp"
>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="65dp"
android:orientation="horizontal"
android:layout_marginRight="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:padding="0dp"
android:layout_gravity="bottom"
>
<ImageView android:src="@drawable/trending_bar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginRight="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="10dp"
android:scaleType="fitXY"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
```
Hopefully someone can help.
|
android ImageButton scale and maintain aspect ratio
|
CC BY-SA 3.0
| 0 |
2011-05-13T14:01:39.173
|
2015-07-05T08:01:54.477
|
2015-07-05T08:01:54.477
| 4,626,831 | 453,432 |
[
"android",
"layout",
"scale",
"imagebutton",
"aspect-ratio"
] |
5,993,148 | 1 | null | null | 0 | 2,584 |
```
$image = "http://www.example.com/image.jpg";
if(!empty($image)){echo "<img src='".$image."' align='left' />";}
```
the above syntax wont successful in returning image empty or not...if image is empty in IE this shows a blank space with link like image is missing

|
Checking image empty or not
|
CC BY-SA 3.0
| null |
2011-05-13T14:09:08.477
|
2012-12-20T20:18:08.023
|
2012-12-20T20:18:08.023
| 367,456 | 732,892 |
[
"php",
"image"
] |
5,993,255 | 1 | 5,993,561 | null | 15 | 17,605 |
When I try to display the map I get this exception :
> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid Region <center:+inf, +0.00000000 span:+1.00000000, +0.50000000>'
My relevant code is this :
```
-(void)viewWillAppear:(BOOL)animated
{
[mapView removeAnnotations:mapView.annotations];
// locationManager update as location
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = kCLDistanceFilterNone;
[locationManager startUpdatingLocation];
CLLocation *location = [locationManager location];
//Configure the new event with information from the location
CLLocationCoordinate2D coordinate = [location coordinate];
latitudeOfUserLocation=coordinate.latitude;
longitudeOfUserLocation=coordinate.longitude;
location2D = (CLLocationCoordinate2D){ .latitude = latitudeOfUserLocation, .longitude = longitudeOfUserLocation };
MyLocation *annotation=[[[MyLocation alloc]initWithName:@"You are here" distanceVersLaStation:@"" coordinate:location2D]autorelease];
annotation.pinColor = MKPinAnnotationColorRed;
[mapView addAnnotation:annotation];
MKCoordinateSpan span={latitudeDelta:1,longitudeDelta:0.5};
MKCoordinateRegion region={location2D,span};
[mapView setRegion:region];
}
```
### Edit
I tried to do as you said in the comments. The exception is solved, however, when I try to display the longitude/latitude of the user in the console I get nothing. This is my code which is mostly correct:
```
-(void)viewWillAppear:(BOOL)animated
{
[mapView removeAnnotations:mapView.annotations];
// locationManager update as location
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = kCLDistanceFilterNone;
[locationManager startUpdatingLocation];
NSURL *url=[NSURL URLWithString:@"http://ipho.franceteam.org/ad_V1/stations/"];
ASIFormDataRequest * request=[ASIFormDataRequest requestWithURL:url];
[request setPostValue:[NSNumber numberWithFloat:longitudeOfUserLocation] forKey:@"longitude"];
[request setDelegate:self];
[request startAsynchronous];
MBProgressHUD *hud=[MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.labelText=@"Recherche en cours..";// this never stop loading
}
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
CLLocation *location = [locationManager location];
//Configure the new event with information from the location
CLLocationCoordinate2D coordinate = [location coordinate];
latitudeOfUserLocation=coordinate.latitude;
longitudeOfUserLocation=coordinate.longitude;
NSLog(@"your latitude :%f",latitudeOfUserLocation);//here nothing is shown
NSLog(@"your longitude :%f",longitudeOfUserLocation);// and here too
location2D = (CLLocationCoordinate2D){ .latitude = latitudeOfUserLocation, .longitude = longitudeOfUserLocation };
MyLocation *annotation=[[[MyLocation alloc]initWithName:@"Vous êtes ici" distanceVersLaStation:@"" coordinate:location2D]autorelease];
annotation.pinColor = MKPinAnnotationColorRed; //or red or whatever
[mapView addAnnotation:annotation];
//
MKCoordinateSpan span={latitudeDelta:1,longitudeDelta:0.5};
MKCoordinateRegion region={location2D,span};
[mapView setRegion:region];
}//End function
```
Even I work on the simulator, I should get something on the console right?
### Edit
Hi again, i had the opportunity to test my code on iPhone (device) and i have noticed that when i try to search, the application has succeeded to track my position and to find me the stations that meet my search (purple annotation), however, the map isn't displayed and the searching progress is still loading and never stop.
```
hud.labelText=@"Recherche en cours..";// this never stop loading
```
Here is a screenshot that could explain better:

|
Exception : 'Invalid Region <center:+inf, +0.00000000 span:+1.00000000, +0.50000000>' when trying to display the map
|
CC BY-SA 4.0
| 0 |
2011-05-13T14:16:44.920
|
2020-08-31T17:17:18.880
|
2020-08-31T17:17:18.880
| 5,740,428 | 734,308 |
[
"ios",
"mapkit"
] |
5,993,427 | 1 | null | null | 1 | 386 |
I've had a few complaints about my app, InstanTunes, when people are adding the same song twice to the queue, which is queued in the iPod app.
[[MPMusicPlayerController iPodMusicPlayer] setQueueWithItemCollection:collection];
Basically, the problem is that when the user leaves my app and continues to listen to their queue via the iPod app, InstanTunes loses all control and understanding of what is going on. On return to InstanTunes, I'm faced with the problem of the now playing song, given by [musicPlayer nowPlayingItem]; is in my NSMutableArray of MPMediaItems twice but I have no idea what instance of it is the now playing song.
Here's a simple diagram to illustrate:

Is song A at index 0 playing? Or song A at index 2 playing?
Can anyone think of a way for me to be able to tell which instance of 'Song A' is playing when the user returns to my app? As far as I know, I can't tag the MPMediaItems to be played in the iPod app.
This is really annoying, since I don't want to remove the ability to add the same song twice, but it is causing countless problems.
Any help, insight or suggestions would be greatly appreciated.
|
Big problems when adding the same MPMediaItem into an iPod queue - how can I track which one is playing?
|
CC BY-SA 3.0
| null |
2011-05-13T14:30:26.290
|
2015-08-05T02:12:35.123
| null | null | 453,226 |
[
"iphone",
"ios",
"ipod",
"mpmediaitem",
"mpmediaitemcollection"
] |
5,993,506 | 1 | 5,993,624 | null | 6 | 3,350 |
first a picture for visualizing the problem

As you can see, there is a huge gap to the parents container on the right and left side of the panel with the arrows, which should not be there. I do not have a clue how to remove the gap. I'm struggling with this for hours, I tried almost everything in the documentation and read all relevant topics on SO and MiG Support Forum. Here is the relevant code:
```
public class ArrowPanel extends JPanel
{
public ArrowPanel()
{
setLayout( new MigLayout( "fill,debug" ) );
add( new JLabel( Icons.roundArrowRight() ), "grow,wrap" );
add( new JLabel( Icons.roundArrowLeft() ), "grow" );
}
}
```
I think this should be easy, but somehow I do not get it...
|
Remove gap to Parent Containers Border in Miglayout
|
CC BY-SA 3.0
| 0 |
2011-05-13T14:36:38.783
|
2013-01-19T18:05:21.877
| null | null | 441,467 |
[
"java",
"swing",
"layout-manager",
"miglayout"
] |
5,993,518 | 1 | 5,993,870 | null | 2 | 22,865 |
I am setting an image for the background of a linearlayout that I am using. The problem I am getting is the white border just below the title bar. If I set the background to a color the white border does not appear. Does anybody know what might be causing this.

I am loading some content in dynamically but here is the xml
```
<?xml version="1.0" encoding="utf-8"?>
<android.gesture.GestureOverlayView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gestures"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gestureStrokeType="single"
android:eventsInterceptionEnabled="true"
android:orientation="vertical"
android:uncertainGestureColor="#00000000"
android:gestureColor="#00000000">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="20dip"
android:background="@drawable/background">
<!-- android:background="@drawable/background"> -->
<TextView
android:id="@+id/item_text"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_gravity="center"
android:text="@string/item_text"
android:textColor="#fffafa"
android:layout_width="wrap_content"
android:textStyle="bold"
android:paddingBottom="10dip"/>
<LinearLayout
android:id="@+id/photoLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="20dip"/>
<LinearLayout android:id="@+id/LinearLayoutDynamic"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:orientation="vertical"
android:background="@drawable/my_border">
</LinearLayout>
<TextView
android:id="@+id/item_text1"
android:layout_height="wrap_content"
android:paddingTop="20dip"
android:paddingBottom="10dip"
android:textSize="16sp"
android:layout_gravity="center"
android:text="Besonderheiten"
android:textColor="#fffafa"
android:layout_width="wrap_content"
android:textStyle="bold"/>
<LinearLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/my_border">
<RelativeLayout
android:id="@+id/LinearLayout"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="horizontal">
<TextView
style="@style/CodeFont"
android:id="@+id/item_wasteDisposal"
android:text="@string/item_wasteDisposal"
android:textSize="14sp"
android:singleLine="true"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/wasteDisposalImage"
android:layout_toRightOf="@id/item_wasteDisposal"
android:padding="5dp"/>
<View
android:layout_height="1dip"
android:background="#FF909090"
android:layout_below="@id/wasteDisposalImage"
android:layout_width="fill_parent"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/internetImage"
android:layout_below="@id/wasteDisposalImage"
android:layout_alignLeft="@id/wasteDisposalImage"
android:padding="5dp"/>
<TextView
style="@style/CodeFont"
android:id="@+id/item_internet"
android:text="@string/item_internet"
android:textSize="14sp"
android:layout_toLeftOf="@id/internetImage"
android:layout_below="@id/wasteDisposalImage"/>
<View
android:layout_height="1dip"
android:background="#FF909090"
android:layout_below="@id/internetImage"
android:layout_width="fill_parent"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/overnightStayImage"
android:layout_below="@id/internetImage"
android:layout_alignLeft="@id/internetImage"
android:padding="5dp"/>
<TextView
style="@style/CodeFont"
android:id="@+id/item_overnightStay"
android:text="@string/item_overnightStay"
android:textSize="14sp"
android:layout_toLeftOf="@id/overnightStayImage"
android:layout_below="@id/internetImage"/>
<View
android:layout_height="1dip"
android:background="#FF909090"
android:layout_below="@id/overnightStayImage"
android:layout_width="fill_parent"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/toiletImage"
android:layout_below="@id/overnightStayImage"
android:layout_alignLeft="@id/overnightStayImage"
android:padding="5dp"/>
<TextView
style="@style/CodeFont"
android:id="@+id/item_toilet"
android:text="@string/item_toilet"
android:textSize="14sp"
android:layout_toLeftOf="@id/toiletImage"
android:layout_below="@id/overnightStayImage"/>
<View
android:layout_height="1dip"
android:background="#FF909090"
android:layout_below="@id/toiletImage"
android:layout_width="fill_parent"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/electricityImage"
android:layout_below="@id/toiletImage"
android:layout_alignLeft="@id/toiletImage"
android:padding="5dp"/>
<TextView
style="@style/CodeFont"
android:id="@+id/item_electricity"
android:text="@string/item_electricity"
android:textSize="14sp"
android:layout_toLeftOf="@id/electricityImage"
android:layout_below="@id/toiletImage"/>
<View
android:layout_height="1dip"
android:background="#FF909090"
android:layout_below="@id/electricityImage"
android:layout_width="fill_parent"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/cranImage"
android:layout_below="@id/electricityImage"
android:layout_alignLeft="@id/electricityImage"
android:padding="5dp"/>
<TextView
style="@style/CodeFont"
android:id="@+id/item_cran"
android:text="@string/item_cran"
android:textSize="14sp"
android:layout_toLeftOf="@id/cranImage"
android:layout_below="@id/electricityImage"/>
<View
android:layout_height="1dip"
android:background="#FF909090"
android:layout_below="@id/cranImage"
android:layout_width="fill_parent"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/slipwayImage"
android:layout_below="@id/cranImage"
android:layout_alignLeft="@id/cranImage"
android:padding="5dp"/>
<TextView
style="@style/CodeFont"
android:id="@+id/item_slipway"
android:text="@string/item_slipway"
android:textSize="14sp"
android:layout_toLeftOf="@id/slipwayImage"
android:layout_below="@id/cranImage"/>
<View
android:layout_height="1dip"
android:background="#FF909090"
android:layout_below="@id/slipwayImage"
android:layout_width="fill_parent"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/campingImage"
android:layout_below="@id/slipwayImage"
android:layout_alignLeft="@id/slipwayImage"
android:padding="5dp"/>
<TextView
style="@style/CodeFont"
android:id="@+id/item_camping"
android:text="@string/item_camping"
android:textSize="14sp"
android:layout_toLeftOf="@id/campingImage"
android:layout_below="@id/slipwayImage"/>
<View
android:layout_height="1dip"
android:background="#FF909090"
android:layout_below="@id/campingImage"
android:layout_width="fill_parent"/>
<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:id="@+id/freshWaterImage"
android:layout_below="@id/campingImage"
android:layout_alignLeft="@id/campingImage"
android:padding="5dp"/>
<TextView
style="@style/CodeFont"
android:id="@+id/item_freshWater"
android:text="@string/item_freshWater"
android:textSize="14sp"
android:layout_toLeftOf="@id/freshWaterImage"
android:layout_below="@id/campingImage"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
```
|
Background Image in Linearlayout
|
CC BY-SA 3.0
| 0 |
2011-05-13T14:38:09.007
|
2011-05-13T15:08:15.683
| null | null | 690,681 |
[
"android",
"view",
"android-linearlayout"
] |
5,993,620 | 1 | 5,995,548 | null | 0 | 2,700 |
This my index.jsp file but the jQuery mobile CSS and JS do not do their work.

My .css and .js files are at the same dir level as index.jsp. Should they be in a different directory? Here is my directory structure

Here is my index.jsp:
```
<html>
<head>
<link rel="stylesheet" type="text/css" href="jquery.mobile-1.0a4.1.css" />
<script type="text/javascript" src="jquery.mobile-1.0a4.1.js"></script>
</head>
<body>
<div data-role="fieldcontain">
<label for="slider">Input slider:</label>
<input type="range" name="slider" id="slider" value="0" min="0" max="100" />
</div>
</body>
</html>
```
Firebug says that both resources are loaded

|
jQuery mobile rules are not being applied
|
CC BY-SA 3.0
| null |
2011-05-13T14:45:37.313
|
2012-03-23T08:02:15.073
|
2011-05-13T15:33:01.847
| 157,882 | 470,184 |
[
"jquery",
"jsp",
"jquery-mobile"
] |
5,993,711 | 1 | 5,994,768 | null | 8 | 11,989 |
I'm changing my tableviews contentInset, so that when a user scrolls beyond the top bounds of the table, the tableview is inset to display a UISearchBar hidden above the tableView.
Everything works fine apart from the section header views. when scrolling down, the top bound of the sectionHeaderView is inset the same distance from the top of the screen as my tableview inset, here is it in starting position:

In the above image the sectionheader view is set to its correct positon, and the tableview inset has been set to display the search field.

You can see in this second screenshot where the top bound of the headerview is set lower because of the 43 pixel tableview inset, where as it should stick to the top of the screen hiding the "related" cell and bouncing back when released.
I guess i need to Offset the Inset somehow, i'm just not sure how..
|
Setting UITableView contentInset also insets section header view
|
CC BY-SA 3.0
| 0 |
2011-05-13T14:51:54.410
|
2014-03-03T23:47:53.760
|
2011-05-13T14:57:18.980
| 448,294 | 448,294 |
[
"iphone",
"objective-c",
"uitableview"
] |
5,993,843 | 1 | 5,994,048 | null | 2 | 569 |
we have a DITA XML application that produces on the fly xhtml and when viewed in the browser it looks fine.
An example url is: [http://livecontent.jordanpublishing.co.uk/content/en/FAMILY-201103311115/Family_FLJONLINE_FLJ_2009_07_4](http://livecontent.jordanpublishing.co.uk/content/en/FAMILY-201103311115/Family_FLJONLINE_FLJ_2009_07_4)

If I try to load the url using curl I get the following error:
```
Error checking function parameter 3 in call transform:transform($fDoc, LiveContent-UI:get_xsl("ui/ui_skin.xsl", ""), LiveContent-UI:get_xsl_params(untyped-value-check[xs:string, $skin], $extra_params)): The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: LiveContent-Util:browser_from_user_agent($a as xs:string) xs:string. Expected cardinality: exactly one, got 0.
XQuery Stack TraceLiveContent-Util:browser_from_user_agent(xs:string) 161:55
LiveContent-UI:get_xsl_params(xs:string, node()) 145:25
LiveContent-UI:get_html(xs:string, xs:string, node(), node()) 313:25
LiveContent-Pub:home(xs:string, xs:string, xs:string) 65:17
Java Stack Trace:Class Name Method Name File Name Line
org.exist.xquery.DynamicCardinalityCheck eval DynamicCardinalityCheck.java 80
org.exist.xquery.Atomize eval Atomize.java 66
org.exist.xquery.UntypedValueCheck eval UntypedValueCheck.java 75
org.exist.xquery.DynamicTypeCheck eval DynamicTypeCheck.java 61
org.exist.xquery.FunctionCall eval FunctionCall.java 185
org.exist.xquery.AbstractExpression eval AbstractExpression.java 61
org.exist.xquery.PathExpr eval PathExpr.java 241
org.exist.xquery.AttributeConstructor eval AttributeConstructor.java 95
org.exist.xquery.ElementConstructor eval ElementConstructor.java 212
org.exist.xquery.AbstractExpression eval AbstractExpression.java 61
org.exist.xquery.PathExpr eval PathExpr.java 241
org.exist.xquery.ElementConstructor eval ElementConstructor.java 271
org.exist.xquery.AbstractExpression eval AbstractExpression.java 61
org.exist.xquery.PathExpr eval PathExpr.java 241
org.exist.xquery.DebuggableExpression eval DebuggableExpression.java 56
org.exist.xquery.DebuggableExpression eval DebuggableExpression.java 63
org.exist.xquery.LetExpr eval LetExpr.java 208
org.exist.xquery.BindingExpression eval BindingExpression.java 158
org.exist.xquery.AbstractExpression eval AbstractExpression.java 61
org.exist.xquery.PathExpr eval PathExpr.java 241
```
and I am completely at a loss as to what is going wrong.
The PHP Curl code is as follows:
```
$ch = curl_init();
/**
* Set the URL of the page or file to download.
*/
curl_setopt($ch, CURLOPT_URL, 'http://onlineservices.letterpart.com/sitemap.xml;jsessionid=1j1agloz5ke7l?id=1j1agloz5ke7l');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec ($ch);
curl_close ($ch);
$xml = new SimpleXMLElement($data);
foreach ($xml->url as $url_list) {
$url = $url_list->loc;
echo $url ."<br>";
//file_get_contents($url);
echo $url ."<br>";
$ch = curl_init($url); //load the urls
echo $url ."<br>";
curl_setopt($ch, CURLOPT_TIMEOUT_m2, 20); //No need to wait for it to load. Execute it and go.
curl_exec($ch); //Execute
curl_close($ch); //Close it off
```
Can anyone help? I'm at a bit of a loss as this is way outside of my skill set.
Thanks,
It was suggested that I added a User Agent so I added the following:
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
I now get the following error in my logs:
```
[13-May-2011 16:30:14] PHP Notice: Use of undefined constant CURLOPT_TIMEOUT_m2 - assumed 'CURLOPT_TIMEOUT_m2' in /home/digital1/public_html/dev/sitemap.php on line 43
[13-May-2011 16:30:14] PHP Warning: curl_setopt() [<a href='function.curl-setopt'>function.curl-setopt</a>]: Invalid curl configuration option in /home/digital1/public_html/dev/sitemap.php on line 43
```
The two line in question here (43) is:
```
curl_setopt($ch, CURLOPT_TIMEOUT_m2, 20); //No need to wait for it to load. Execute it and go.
```
I do seem to be having better luck using the Googlebot agent:
```
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
```
as in I am actually getting content written to the screen but my logs are still showing these errors.
|
Using curl to load an xsl page returns an actual cardinality error
|
CC BY-SA 3.0
| null |
2011-05-13T15:01:05.693
|
2011-05-13T15:59:40.063
|
2011-05-13T15:59:40.063
| 523,938 | 523,938 |
[
"php",
"xpath",
"curl",
"xquery"
] |
5,994,161 | 1 | null | null | 1 | 140 |
I am trying to build the following,

Basically what should happen is the dark green bar underneath the white text should grow and shrink dependent on which link is active, so for example at the moment, THE JOBWALL link is active so the green bar spans the width of that link. How can I achive this affect, is it possible to animate the backgroud-image that would create the green bar so that when the page loads the bar animates from left-right until it rest under the active page?
Any help would be great.
|
jquery animation help
|
CC BY-SA 3.0
| null |
2011-05-13T15:25:07.027
|
2011-05-13T17:10:30.233
| null | null | 725,444 |
[
"jquery",
"css",
"jquery-animate",
"dom-manipulation"
] |
5,994,478 | 1 | 5,994,915 | null | 3 | 24,584 |
I have a database with the following schema:

The following SQL creates the relevant tables:
```
-- -----------------------------------------------------
-- Table `ninikske_bioldb`.`CodingRegion`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `ninikske_bioldb`.`CodingRegion` (
`CodRegID` VARCHAR(45) NOT NULL ,
`CD_Start` INT NOT NULL ,
`CD_Stop` INT NOT NULL ,
`ORFs_ORF_ID` VARCHAR(45) NOT NULL ,
PRIMARY KEY (`ORFs_ORF_ID`, `CodRegID`) ,
INDEX `fk_Exons_ORFs1` (`ORFs_ORF_ID` ASC) ,
CONSTRAINT `fk_Exons_ORFs1`
FOREIGN KEY (`ORFs_ORF_ID` )
REFERENCES `ninikske_bioldb`.`ORFs` (`ORF_ID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `ninikske_bioldb`.`Experiment`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `ninikske_bioldb`.`Experiment` (
`Probe_GenomicPos` INT NOT NULL ,
`SampleName` VARCHAR(45) NOT NULL ,
`Intensities` FLOAT NOT NULL ,
`ExperimentName` VARCHAR(45) NOT NULL ,
`ProbeID` INT NOT NULL ,
PRIMARY KEY (`Probe_GenomicPos`, `SampleName`, `ProbeID`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `ninikske_bioldb`.`CE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `ninikske_bioldb`.`CE` (
`OrfId` VARCHAR(45) NOT NULL ,
`CodRegId` VARCHAR(45) NOT NULL ,
`GenPos` INT NOT NULL ,
`ExpSam` VARCHAR(45) NOT NULL ,
`ProbeId` INT NOT NULL ,
PRIMARY KEY (`OrfId`, `CodRegId`, `GenPos`, `ExpSam`, `ProbeId`) ,
INDEX `fk_CodingRegion_has_Experiment_Experiment1` (`GenPos` ASC, `ExpSam` ASC, `ProbeId` ASC) ,
INDEX `fk_CodingRegion_has_Experiment_CodingRegion1` (`OrfId` ASC, `CodRegId` ASC) ,
CONSTRAINT `fk_CodingRegion_has_Experiment_CodingRegion1`
FOREIGN KEY (`OrfId` , `CodRegId` )
REFERENCES `ninikske_bioldb`.`CodingRegion` (`ORFs_ORF_ID` , `CodRegID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_CodingRegion_has_Experiment_Experiment1`
FOREIGN KEY (`GenPos` , `ExpSam` , `ProbeId` )
REFERENCES `ninikske_bioldb`.`Experiment` (`Probe_GenomicPos` , `SampleName` , `ProbeID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
```
When I execute the following INSERT statement via Java:
```
String query = "INSERT INTO ninikske_bioldb.CE VALUES('" + cs.getORF_ID().getORF_ID() + "','" + cs.getCodRegID().getCodRegID() + "'," + cs.getExp().getProbePos() + ",'" + cs.getExp().getExpName()+ "', " + cs.getExp().getProbeID() + ");";
Statement stmt = con.createStatement();
stmt.executeUpdate(query);
```
I get the following error:
```
Cannot add or update a child row: a foreign key constraint fails (`ninikske_bioldb/CE`, CONSTRAINT `fk_CodingRegion_has_Experiment_Experiment1` FOREIGN KEY (`GenPos`, `ExpSam`, `ProbeId`) REFERENCES `Experiment` (`Probe_GenomicPos`, `SampleName`, `ProbeID`) )
```
I read several other questions about the same error message, but i can't seem to find the insight I need.
The query is:
`INSERT INTO ninikske_bioldb.CE VALUES('AT3G01190.1','cd474',67262,'H20', 1709);`
When I check I the parent tables, I get following results:
```
mysql> SELECT * FROM CodingRegion WHERE ORFs_ORF_ID = 'AT3G01190.1';
+----------+----------+---------+-------------+
| CodRegID | CD_Start | CD_Stop | ORFs_ORF_ID |
+----------+----------+---------+-------------+
| cd474 | 67243 | 67649 | AT3G01190.1 |
| cd475 | 67733 | 67892 | AT3G01190.1 |
| cd476 | 67991 | 68176 | AT3G01190.1 |
| cd477 | 68272 | 68484 | AT3G01190.1 |
+----------+----------+---------+-------------+
4 rows in set (0.00 sec)
mysql> SELECT * FROM CodingRegion WHERE CodRegID = 'cd474';
+----------+----------+---------+-------------+
| CodRegID | CD_Start | CD_Stop | ORFs_ORF_ID |
+----------+----------+---------+-------------+
| cd474 | 67243 | 67649 | AT3G01190.1 |
+----------+----------+---------+-------------+
1 row in set (0.03 sec)
mysql> SELECT * FROM Experiment WHERE Probe_GenomicPos = '67262';
+------------------+--------------+-------------+----------------+---------+
| Probe_GenomicPos | SampleName | Intensities | ExperimentName | ProbeID |
+------------------+--------------+-------------+----------------+---------+
| 67262 | 1signalpart1 | 8.94432 | H20 | 1709 |
+------------------+--------------+-------------+----------------+---------+
1 row in set (0.00 sec)
mysql> SELECT * FROM Experiment WHERE SampleName = 'H20'
Empty set (0.00 sec)
mysql> SELECT * FROM Experiment WHERE ProbeID = '1709';
+------------------+--------------+-------------+----------------+---------+
| Probe_GenomicPos | SampleName | Intensities | ExperimentName | ProbeID |
+------------------+--------------+-------------+----------------+---------+
| 67262 | 1signalpart1 | 8.94432 | H20 | 1709 |
+------------------+--------------+-------------+----------------+---------+
1 row in set (0.00 sec)
```
Thanks in advance.
|
Cannot add or update a child row: a foreign key constraint fails
|
CC BY-SA 3.0
| null |
2011-05-13T15:50:58.163
|
2011-05-13T16:33:13.217
|
2011-05-13T16:33:13.217
| 50,065 | 50,065 |
[
"mysql",
"foreign-keys"
] |
5,994,617 | 1 | 5,994,934 | null | 0 | 2,295 |
Hello I am trying to create an animation like  creating heart like bubbles but not 100% like this. This could on some static Activity.
But I am at no where. Documentation lacks examples and examples in API are just unacceptable. It shouldn't be so hard to make such animation.
I am pasting my code please help me.
Class File
```
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
public class AnimationTest extends Activity {
AnimationDrawable animation;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btnStart = (Button) findViewById(R.id.btnStart);
final ImageView imgView = (ImageView) findViewById(R.id.img);
btnStart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startAnimation();
}
});
imgView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
}
class Starter implements Runnable {
public void run() {
animation.start();
}
}
private void startAnimation() {
animation = new AnimationDrawable();
animation.addFrame(getResources().getDrawable(R.drawable.one), 100);
animation.addFrame(getResources().getDrawable(R.drawable.two), 100);
animation.addFrame(getResources().getDrawable(R.drawable.three), 100);
animation.addFrame(getResources().getDrawable(R.drawable.four), 100);
animation.addFrame(getResources().getDrawable(R.drawable.five), 100);
animation.addFrame(getResources().getDrawable(R.drawable.six), 100);
animation.addFrame(getResources().getDrawable(R.drawable.seven), 100);
animation.addFrame(getResources().getDrawable(R.drawable.eight), 100);
animation.setOneShot(false);
ImageView imageView = (ImageView) findViewById(R.id.img);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(80, 90);
params.alignWithParent = true;
params.addRule(RelativeLayout.CENTER_IN_PARENT);
imageView.setLayoutParams(params);
imageView.setImageDrawable(animation);
imageView.post(new Starter());
}
```
}
XML File
```
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Frame by Frame Animation Example"
android:gravity="center" />
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_gravity="center_horizontal">
<ImageView android:id="@+id/img" android:layout_width="80px"
android:layout_height="90px" android:layout_centerInParent="true" />
<Button android:id="@+id/btnStart" android:text="Start Animation"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
</LinearLayout>
```
Images, you can past some other images too
[1](https://i.stack.imgur.com/T1zTM.png)[2](https://i.stack.imgur.com/MYZmb.png)[4](https://i.stack.imgur.com/MYZmb.png)
What I want to accomplish
step1: a fish comes from left side
setp2: a fish comes from right side
step3: a heart appears and grows bigger in very center of both fish
step4: then small hearts fly away and disappear
|
Android Animation Help
|
CC BY-SA 3.0
| null |
2011-05-13T16:00:37.957
|
2012-11-09T07:03:22.707
|
2011-05-13T16:18:55.640
| 185,022 | 185,022 |
[
"android",
"animation"
] |
5,994,815 | 1 | 6,407,206 | null | 22 | 2,582 |
I'm trying to get Devanagari ligatures (in Unicode strings) rendered correctly on Mac OS X 10.6.
The strings are drawn on a `JComponent` and take `RenderingHints` for Antialiasing. The ligatures are displayed correctly in Windows XP SP2 and 7, and Ubuntu, but in Mac OS X, the ligatures are decomposed (or rather, not merged correctly), diacritics are moved away from their positions, etc. (cf. screenshots below, correct rendering example from Win XP SP2 on the left (with `RenderingHints` Antialiasing Key `ON`), wrong rendering example from Mac OS X 10.6.7 on the right (Antialising `DEFAULT` = `OFF`).
I have set the font as follows, so it should use a default font on any system:
```
new Font(null,Font.PLAIN,20);
```
I believe all this might have something to do with the fact that the default character encoding on Macs is MacRoman (NOT a UTF-8 subset), and that other systems (like Windows) use a UTF-8 subset (such as WinLatin-1) or cp1252 or such.
Even with this information at hand, I'm in the dark about how to handle this problem. Thus I would be very grateful if someone was able to point me in the right direction.

I've tried a number of things already:
- - `TextAttribute``LIGATURES_ON`
I'd be extremely thankful for any hints, or code snippets by other developers (preferrably with a Hindi background who develop on Mac).
|
Rendering Devanagari ligatures (Unicode) in Java Swing JComponent on Mac OS X
|
CC BY-SA 3.0
| 0 |
2011-05-13T16:16:53.403
|
2017-07-29T16:31:31.937
|
2017-07-29T16:31:31.937
| -1 | 731,040 |
[
"java",
"macos",
"unicode",
"rendering",
"ligature"
] |
5,994,973 | 1 | 5,995,097 | null | 1 | 1,221 |
I've got RelativeLayout as a header in Activity and I want it to have 9.png drawable as a background.
Here is drawable:

What I receive:

As you can see - there is extra spacing.
Here I use RGB color as a backgroud(and how I want it look with 9patch):

Is it me doing something funny or it's normal for 9patch to look like that?
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/relativeTop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
<--THIS IS IT-->
android:background="@drawable/cap">
<--THIS IS IT-->
<Button
android:id="@+id/btnSearchMainReset"
android:text="@string/btnSearchMainReset_text"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/relativeTop">
<RelativeLayout
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:layout_below="@id/relativeTop"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF">
<Button
android:id="@+id/btnSearchMainSearch"
android:text="@string/btnSearchMainSearch_text"
android:textSize="20sp"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:width="200dp"
/>
<RelativeLayout
android:id="@+id/relativeMain"
android:layout_below="@id/btnSearchMainSearch"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<-- MULTIPLE VIEWS HERE -->
</RelativeLayout>
<Button
android:id="@+id/btnSearchMainSearchLow"
android:text="@string/btnSearchMainSearch_text"
android:textSize="20sp"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@@id/relativeMain"
android:width="200dp"
/>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
```
|
9patch drawable as RelativeLayout background issue
|
CC BY-SA 4.0
| null |
2011-05-13T16:28:17.453
|
2019-03-03T03:48:19.817
|
2019-03-03T03:48:19.817
| 1,033,581 | null |
[
"android",
"android-layout"
] |
5,995,022 | 1 | 6,013,136 | null | 8 | 10,545 |
I resize a bitmap using the following code:
```
FileOutputStream out = new FileOutputStream("/sdcard/mods.png");
Bitmap bmp = Bitmap.createScaledBitmap(pict, (int)(pict.getWidth() / totScale),
(int)(pict.getHeight() / totScale), false);
bmp.compress(Bitmap.CompressFormat.PNG, 90, out);
out.close();
```
The code for getting the bitmap from the camera that I am using is the following:
```
mCamera.takePicture(null, null, null, new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
pict = BitmapFactory.decodeByteArray(data, 0, data.length);
}
});
```
The first picture is what I can see on the phone (in Astro file manager), and also when I draw the bitmap in my application on a canvas. This happens on every device I've tested on (HTC Legend and Galaxy Tab) The second picture is what it looks like on my computer. What is causing the blocks on the device?
## Solution:
Here is what fixed my problem:
Instead of
```
pict = BitmapFactory.decodeByteArray(data, 0, data.length);
```
I replaced that with
```
BitmapFactory.Options opts = new BitmapFactory.Options();
opts.inPreferredConfig = Bitmap.Config.ARGB_8888;
pict = BitmapFactory.decodeByteArray(data, 0, data.length, opts);
```


|
Resize Bitmap in Android
|
CC BY-SA 3.0
| 0 |
2011-05-13T16:33:05.180
|
2013-08-15T08:14:14.610
|
2020-06-20T09:12:55.060
| -1 | 137,081 |
[
"android",
"bitmap",
"camera"
] |
5,995,224 | 1 | 5,995,314 | null | 6 | 1,536 |
I have a TextBlock which is resizing itself depending on its Text which is causing my entire window to resize. I want the text to truncate instead - but I don't want to explicitly set the MaxWidth of the TextBlock in case the user resizes the window.
Before import button pressed:

Current output:

Desired output:

```
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Name="status" Margin="3" HorizontalAlignment="Stretch" TextTrimming="CharacterEllipsis"></TextBlock>
<Label Name="lblPercentage" Grid.Column="1" HorizontalAlignment="Right" ></Label>
<Button Grid.Column="2" Margin="3" Name="cmdImport" Click="import_Click" HorizontalAlignment="Right">Import</Button>
<Button Grid.Column="3" Margin="3" Name="cmdCancel" Click="cancel_Click" HorizontalAlignment="Right">Close</Button>
</Grid>
```
|
Auto clip TextBlock in WPF
|
CC BY-SA 3.0
| 0 |
2011-05-13T16:50:16.780
|
2011-05-13T19:39:29.640
| null | null | 32,598 |
[
"wpf"
] |
5,995,293 | 1 | null | null | 9 | 4,718 |
How can I get full information about single glyph from choosen font (for example Arial -> symbol "A")
This picture describe what variables I need to find:

|
Get single glyph metrics (.net)
|
CC BY-SA 3.0
| 0 |
2011-05-13T16:57:59.507
|
2016-04-08T11:18:15.993
|
2020-06-20T09:12:55.060
| -1 | 701,802 |
[
".net",
"fonts",
"glyph",
"fontmetrics"
] |
5,995,619 | 1 | 6,028,739 | null | 1 | 200 |
Is there a software for mac that lets me view the progress of the branches in either git or svn like in this image (from [here](http://nvie.com/posts/a-successful-git-branching-model/))

|
View version control progress graphically
|
CC BY-SA 3.0
| null |
2011-05-13T17:29:41.773
|
2011-05-17T09:19:51.983
|
2011-05-13T19:38:07.383
| 11,343 | null |
[
"svn",
"git",
"macos"
] |
5,995,645 | 1 | 6,226,674 | null | 0 | 1,104 |
I want to disable the option that allows users to select the different name fields(columns) available during a sharepoint library creation. I want the users to create a new column instead of chosing among the default available name columns. Is it possible to inject a script that disables these functions? or any other work arounds?
The document library is created from a custom library template. These name fields should be disabled only for libraries created from this particular template.

This is a Sharepoint 2010 app.
In general how to disable a default column option?
Any help appreciated, Thanks!
|
Disable default fields(column) available in a sharepoint library
|
CC BY-SA 3.0
| null |
2011-05-13T17:32:19.943
|
2011-06-03T11:47:37.300
|
2011-06-03T11:47:37.300
| 691,008 | 691,008 |
[
"javascript",
"jquery",
"sharepoint-2010",
"sharepointdocumentlibrary"
] |
5,995,798 | 1 | 6,019,108 | null | 6 | 8,771 |
I am loading an image in bufferedimage and then writing some text on it .After I add text it makes image blurry and text distorted. I have TEXT ANTIALIASING ON . It can be seen as attached.

|
Java Text on Image
|
CC BY-SA 3.0
| 0 |
2011-05-13T17:48:58.747
|
2013-02-15T18:16:21.433
|
2012-08-08T09:38:39.737
| 418,556 | 608,576 |
[
"java",
"image",
"image-processing",
"graphics",
"antialiasing"
] |
5,995,830 | 1 | null | null | 0 | 956 |
I've got an MVC 3 app that allows users to upload files with some data entry stuff. I've set up a controller that fetches those documents and buffers them out to the user like so
```
[OutputCache(Duration = 1200, VaryByParam = "id")]
public ContentResult GetNarrative(int id)
{
Response.Clear();
Response.BufferOutput = true;
Response.ContentType = "application/octet-stream";
var narrative = attachRepo.GetNarrative(id);
if (narrative == null || narrative.Narrative == null)
return null;
Response.AddHeader("Content-Disposition",
string.Format("attachment;filename={0}",
Server.UrlEncode(narrative.Filename)));
Response.OutputStream.Write(narrative.Narrative.ToArray(),
0, narrative.Narrative.ToArray().Length);
Response.OutputStream.Flush();
return Content("");
}
```
This works fine and well, the interesting thing is that when I have the output cache line, my firefox download dialog looks like this

However when I comment out the output cache line it looks like the expected dialog

This isn't really a blocking issue, as it works just fine in IE and Chrome just downloads by default, but I am curious why this would be happening and if anyone has experienced this and worked around it.
Thanks!
|
MVC 3 ContentResult binary file with firefox strange issue
|
CC BY-SA 3.0
| null |
2011-05-13T17:52:23.960
|
2011-06-03T21:32:31.307
| null | null | 166,658 |
[
"caching",
"asp.net-mvc-3",
"file-io"
] |
5,995,940 | 1 | 5,996,053 | null | 1 | 821 |
Hi I need to have a list view which is separated by date which native component i should use in android?can zou help me mazbe with some links, how to do it.I have an list activity coded, and working fine.thanks
or maybe some dropdown box if is better i mean sthink like that:

|
best native component to use for separate listview in android
|
CC BY-SA 3.0
| null |
2011-05-13T18:02:08.893
|
2011-05-13T18:13:09.533
| null | null | 636,803 |
[
"android",
"listview"
] |
5,995,989 | 1 | 5,996,116 | null | 3 | 6,938 |
I would like to get distinct values in my databound combo box
as an example the values it has are: blue, blue, yellow, red, orange
I would like it to just display blue once.
My main thought was to get all combo box values into an array, set the array as distinct and then re-populate the combo box. Is there any other way?
If not how would I actually get all the values from the combo box?
Thanks
EDIT -- Class:
```
public class DistinctConverter : IValueConverter
{
}
```
EDIT -- Debug:

|
Distinct Values in WPF Combobox
|
CC BY-SA 3.0
| null |
2011-05-13T18:06:29.097
|
2013-03-11T12:09:50.570
|
2011-05-15T18:17:36.970
| 251,671 | 251,671 |
[
"c#",
"wpf",
"silverlight",
"combobox",
"distinct"
] |
5,996,434 | 1 | 5,996,565 | null | 1 | 188 |
I have created a simple application in android [PhoneGap] [Eclipse] {Sorry for this convention because I am a .NET developer and I don't know how to explain that I am developing android application on eclipse}
When I am running the application I am getting the below error. No matter what I click it closes my simulator, please help

|
Error while running Eclipse Phonegap
|
CC BY-SA 3.0
| null |
2011-05-13T18:52:48.677
|
2011-05-13T19:02:21.203
| null | null | 609,582 |
[
"android",
"eclipse",
"cordova",
"visual-studio-debugging"
] |
5,996,728 | 1 | 5,998,157 | null | 1 | 4,329 |
I'm having some trouble in this python code:
```
import twitter
twitter_search = twitter.Twitter(domain="search.twitter.com")
trends = twitter_search.trends()
```
The error (404 page not found) is right here:

I'm using this package: [http://github.com/sixohsix/twitter](http://github.com/sixohsix/twitter)
|
Trouble with Twitter API using Python
|
CC BY-SA 3.0
| 0 |
2011-05-13T19:20:37.827
|
2013-04-18T07:40:05.200
|
2013-04-18T07:40:05.200
| 664,177 | null |
[
"python",
"twitter",
"http-status-code-404"
] |
5,996,787 | 1 | 5,997,454 | null | 4 | 2,369 |
In Luke, the following search expression returns 23 results:
```
docurl:www.siteurl.com docfile:Tomatoes*
```
If I pass this same expression into my C# Lucene.NET app with the following implementation:
```
IndexReader reader = IndexReader.Open(indexName);
Searcher searcher = new IndexSearcher(reader);
try
{
QueryParser parser = new QueryParser("docurl", new StandardAnalyzer());
BooleanQuery bquery = new BooleanQuery();
Query parsedQuery = parser.Parse(query);
bquery.Add(parsedQuery, Lucene.Net.Search.BooleanClause.Occur.MUST);
int _max = searcher.MaxDoc();
BooleanQuery.SetMaxClauseCount(Int32.MaxValue);
TopDocs hits = searcher.Search(parsedQuery, _max)
...
}
```
I get 0 results
Luke is using StandardAnalyzer and this is what the Explain Structure window looks like:

Must I manually create `BooleanClause` objects for each field I search on, specifying `Should` for each one then add them to the `BooleanQuery` object with `.Add()`? I thought the `QueryParser` would do this for me. What am I missing?
Simplifying a tad, `docfile:Tomatoes*` returns 23 docs in Luke, yet 0 in my app. Per Gene's suggestion, I've changed from `MUST` to `SHOULD`:
```
QueryParser parser = new QueryParser("docurl", new StandardAnalyzer());
BooleanQuery bquery = new BooleanQuery();
Query parsedQuery = parser.Parse(query);
bquery.Add(parsedQuery, Lucene.Net.Search.BooleanClause.Occur.SHOULD);
int _max = searcher.MaxDoc();
BooleanQuery.SetMaxClauseCount(Int32.MaxValue);
TopDocs hits = searcher.Search(parsedQuery, _max);
```
parsedQuery is simply `docfile:tomatoes*`
I think I've finally gotten to the root problem:
```
QueryParser parser = new QueryParser("docurl", new StandardAnalyzer());
Query parsedQuery = parser.Parse(query);
```
In the second line, `query` is `"docfile:Tomatoes*"`, but `parsedQuery` is `{docfile:tomatoes*}`. Notice the difference? Lower case 't' in the parsed query. I never noticed this before. If I change the value in the IDE to 'T', 23 results return.
I've verified that `StandardAnalyzer` is being used when indexing and reading the index. How do I force `queryParser` to keep the case of the value of `query`?
Wow, how frustrating. According to the [documentation](http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/queryParser/QueryParser.html#setLowercaseExpandedTerms%28boolean%29), I can accomplish this with:
parser.setLowercaseExpandedTerms(false);
> Whether terms of wildcard, prefix,
fuzzy and range queries are to be
automatically lower-cased or not.
Default is true.
I won't argue whether that's a sensible default or not. I suppose SimpleAnalyzer should have been used to lowercase everything in and out of the index. The frustrating part is, at least with the version I'm using, Luke defaults the other way! At least I learned a bit more about Lucene.
|
Luke Lucene BooleanQuery
|
CC BY-SA 3.0
| 0 |
2011-05-13T19:27:01.030
|
2011-05-17T18:34:46.283
|
2011-05-17T18:34:46.283
| 70,489 | 70,489 |
[
"c#",
"lucene",
"lucene.net",
"luke"
] |
5,996,847 | 1 | 6,000,003 | null | 1 | 2,206 |

I have a project like this; I want to get all the images in the “Images” folder.
If all the png files are stored in a folder on the disk, this would be easy.
But they are embedded in the project, then how can I access them?
Or even further, how do I get a tree data structure of the image resources?
Thanks
|
How to get all the image resources in a project’s sub folders?
|
CC BY-SA 3.0
| null |
2011-05-13T19:31:23.087
|
2011-05-14T05:28:54.420
| null | null | 290,284 |
[
"c#",
".net",
"visual-studio",
"resources",
"embedded-resource"
] |
5,997,160 | 1 | 5,997,631 | null | 4 | 864 |

Hello all,
I need to create a query for house search, that would match in database user entered data: date when they want to move in and leave, number of people they have in group and price per night.
dates: from 2011-01-15 to 2011-03-01 (see on picture period A1C1), for 3 people, and he is willing to spend from $90 to $125 dollars per night.
- - - - - - -
If you merge dates and calculate average price per night for the given period, search script should match array of data provided above.
My question is this: .
I was thinking about using SQL DATEDIFF function and then multiply by price ... etc but it looks to me pretty complex.
I will appreciate any advice.
Thank you
## UPDATE
Here is my database schema:
Table "apt_search_periods" which stores all merged dates (continuous dates from availability table)
```
+-----------+------------+------------+-----------+--------------+--------+
| period_id | start_date | end_date | rental_id | nb_of_people | merged |
+-----------+------------+------------+-----------+--------------+--------+
| 21 | 2011-03-31 | 2012-03-31 | 548 | 4 | y |
+-----------+------------+------------+-----------+--------------+--------+
```
Table "apt_search_periods_avail" linking merged dates with availability table
```
+----+-----------+-----------------+
| id | period_id | availability_id |
+----+-----------+-----------------+
| 21 | 21 | 20953 |
| 22 | 21 | 20952 |
| 23 | 21 | 4033 |
+----+-----------+-----------------+
```
Table "availability" with expanded dates and prices
```
+-------+-----------+------------+------------+--------------+--------------+
| id | rental_id | start_date | end_date | nb_of_people | rent_per_day |
+-------+-----------+------------+------------+--------------+--------------+
| 20952 | 548 | 2011-03-31 | 2011-07-01 | 4 | 575 |
| 4033 | 548 | 2011-07-01 | 2011-09-01 | 4 | 680 |
| 20953 | 548 | 2011-09-01 | 2012-03-31 | 4 | 575 |
+-------+-----------+------------+------------+--------------+--------------+
```
|
Query: Calculate average price of stay depending on dates
|
CC BY-SA 3.0
| 0 |
2011-05-13T20:02:47.080
|
2011-05-13T21:04:04.210
|
2011-05-13T20:59:57.593
| 136,530 | 136,530 |
[
"php",
"sql",
"search",
"stored-procedures"
] |
5,997,333 | 1 | 5,999,741 | null | 0 | 2,077 |
I have an array of movie clips (representing band members) which have various properties, among them them a property which tells where the band member went to after they left their current band. For those who formed a new group, I want to create an array. Within that array, I want to group all the ones that left for the same group into secondary arrays. So, if you had five band members and 2 of them left for group X and 3 left for group Y. What's the best way to do this? This is, roughly, my code:
```
var newGroupArr:Array = new Array() //this will hold all members leaving for a new group
for (k=0;k<memberClips.length;k++){
if (memberClips[k].outcome == "new"){
//for all groups where memberClips[k].group is the same, create a new array within newGroupArr for those similar members.
}
}
```
Alternatively I suppose if I could do without a multidimensional array and just loop through all the members and say - for those members whose group is the same, perform this function, with the name of that same group passed as the parameter for the function. I guess the trouble I'm having is identifying who's the same.

|
flash as3 best way to create multidimensional array
|
CC BY-SA 3.0
| null |
2011-05-13T20:21:15.090
|
2011-05-15T13:38:58.003
|
2011-05-15T13:38:58.003
| 287,436 | 287,436 |
[
"arrays",
"flash",
"actionscript-3"
] |
5,997,401 | 1 | null | null | 0 | 495 |
I have a UIScrollView with an image inside it. This is the code:
```
- (void)viewDidLoad {
[super viewDidLoad];
UIImageView *imView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
UIScrollView *imScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 96)];
[imScrollView addSubview:imView];
[imScrollView setContentSize:CGSizeMake(530, 96)];
[[self view] addSubview:imScrollView];
[imView release];
[imScrollView release];
}
```
This is what it looks like in portrait mode:

I want to know
1. How can I position the image exactly in the middle of the screen (horizontally).
2. How can I make sure this is going to be the same if the orientation switches to landscape. This is what currently the landscape looks like :

Thanks.
|
Position of UIScrollView after change in orientation
|
CC BY-SA 3.0
| null |
2011-05-13T20:28:45.177
|
2011-05-13T21:46:26.477
| null | null | 635,064 |
[
"objective-c",
"cocoa-touch",
"uiview",
"uiscrollview"
] |
5,997,464 | 1 | 6,862,145 | null | 1 | 155 |
This issue only happens on vista and xp. What is happening is if there is a textbox that has a lot of text and is partially off the screen and you click in it, wpf will scroll it into view and highlight text while it does this. In windows 7 it won't scroll it into view. I am using .net 4 and have tried clearing the selection on the textbox's received focus, got keyboard focus, and mouse capture events, but the scroll seems to take place after those. I have included some screen shots of what I am talking about as well as a test app that demonstrates the problem.
Before clicking on anything, In the next screen shot all I have done was click on line 6

After clicking on line 6 you can see everything is highlighted as it scrolled the textbox into view.

repro:
```
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
for (int i = 1; i < 1000; i++)
{
textBox3.AppendText(string.Format("line {0}\r\n", i));
}
}
}
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" MaxHeight="350" MaxWidth="525">
<Grid>
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBox Grid.Row="0" Text="this is some text"></TextBox>
<TextBox Grid.Row="1" Text="this is some text"></TextBox>
<TextBox Grid.Row="2" ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto" AcceptsReturn="True"
x:Name="textBox3"></TextBox>
</Grid>
</ScrollViewer>
</Grid>
</Window>
```
|
wpf randomly highlighting text on vista / xp
|
CC BY-SA 3.0
| 0 |
2011-05-13T20:34:19.417
|
2011-07-28T16:11:47.440
| null | null | 86,524 |
[
"c#",
"wpf",
".net-4.0"
] |
5,997,550 | 1 | 6,001,618 | null | 2 | 603 |
If I was to create interpolated splines from a large amount of data (about 400 charts, 500,000 values each), how could I then access the coordinates of those splines from another software quickly and efficiently?
Initially I intended to run a regression on the data and use the resulting formula in my delphi program, but that turned out to be a bigger pain than I thought.
I am currently using Matlab but I can use another software if need be.
Edit: It is probably relevant that this data represents the `empirical cumulative distribution` of some other data (which I already have in a database).
Here is what one of these charts would look like.
The emphasis is on speed of access. I intend to use this data to run simulations on financial data.
|
How can I access a MATLAB (interpolated) spline from another program?
|
CC BY-SA 3.0
| null |
2011-05-13T20:42:13.330
|
2011-05-14T11:48:52.670
|
2011-05-13T21:43:09.613
| 737,297 | 737,297 |
[
"matlab",
"performance",
"data-access"
] |
5,997,545 | 1 | null | null | 3 | 914 |
I have quite a complex class that has three one-to-many relationships and two many-to-many relationships with other classes. What I would like to do is to enable the user to fill all the details one by one - in one step or even better in multiple steps (wizard).
My class is called PeriodicTask - user has to select one Server object (which represents SQL Server instance ) and depending on the selection I need to present the user with the ability to select which databases he wants to use ( the best option would be to use checkboxes). I don't really know how to achieve this.
I would start with creating an action that returns JSON with databases for the selected server. It'll be invoked by jQuery. So far so good, but what to do then?
Should I add `<input type="checkbox">` to the form for every database or maybe create another form and post to some other action? How to parse that when the form is submitted? Can I split it somehow into smaller steps ? HTTP is stateless so I somehow need to pass or remember the data that was previously submitted - how?
PS> I'm using Entity Framework here, so part of the class hierarchy is as follows:

|
ASP.NET MVC 3 how to implement many to many relationship in Create View
|
CC BY-SA 3.0
| null |
2011-05-13T20:41:43.707
|
2011-05-16T21:51:47.280
| null | null | 195,711 |
[
"ajax",
"asp.net-mvc-3"
] |
5,997,945 | 1 | null | null | 4 | 2,626 |
Using a Column chart. My Category groups are Month and Year, with Month being the inner group so that a three-letter abbreviation of the month is shown directly under the data column and the Year is beneath that set of months. However, the data columns start at a position on the left of the month tick mark (for the first month displayed) and gradually moves to the right of the month tick mark for the last month displayed.
So, how does one set the column to be directly centered on the Month tick mark?
Here is an image of what i have now:
Thanks!
|
SSRS 2008: How to center Column directly above Month tick mark in Column Chart?
|
CC BY-SA 3.0
| null |
2011-05-13T21:25:34.930
|
2012-05-15T09:51:50.947
| null | null | 259,286 |
[
"reporting-services",
"charts"
] |
5,998,018 | 1 | null | null | 0 | 131 |
I have some old code that I would like to test using Junit. After importing it into Eclipse it looks like this:

After this, I try to test the class `ACos`. I've entered some values, but it doesn't work. I get this:

What have I done wrong?
|
Simple Junit configuration is not working
|
CC BY-SA 3.0
| null |
2011-05-13T21:33:58.890
|
2011-05-13T21:44:01.717
|
2011-05-13T21:44:01.717
| 143,804 | 504,483 |
[
"unit-testing",
"testing",
"junit",
"junit4"
] |
5,998,092 | 1 | null | null | 1 | 744 |
A strange issue with Visual Studio 2008. I have a winforms application that contains several forms.
On one of my forms, the mouse pointer has a square shape around the arrow, like in the attached image. I cannot get rid of it, no matter what I tried. The square keeps moving along with the mouse pointer. Seems funny, but it's really frustrating, really, because I cannot use the drag-and-drop functionality at all. This prevents me from working with the designer. Imagine that I cannot grab the edge of any control to resize it. I can move controls, though...
What is particular about this form is that it is derived from another form, like this:
```
public partial class MyForm : BaseForm
```
`BaseForm` is also derived from `Form`. I'd say nothing too uncommon.
Thanks for any idea.

Later Edit:
I found why I got an error when entering into MyForm's designer.
BaseForm has an Microsoft.Reporting.WinForms.ReportViewer component. The component was added as a private member.
When working with MyForm's designer, VS was automatically generating a new Microsoft.Reporting.WinForms.ReportViewer member for MyForm, so
I solved this by declaring the base class's member as public and regenerating the derived class, so no need to duplicate things.
Anyway, unfortunately, this did not solve my designer issue with the mouse cursor...
|
Square mouse pointer in Visual Studio 2008 designer
|
CC BY-SA 3.0
| null |
2011-05-13T21:43:12.513
|
2014-02-03T13:02:54.120
|
2014-02-03T13:02:54.120
| 759,866 | 274,589 |
[
"c#",
".net",
"winforms",
"visual-studio-2008",
"designer"
] |
5,998,676 | 1 | 5,998,791 | null | 1 | 2,692 |
As the title says
my code is something like this :
```
<div class=container> <img/> <div>some text with line one, line two , line three </div> </div>
```
the container should have overflow:hidden and my text would be in more than one line , so I need only a small part of my text to appear at the bottom of container, so when user hovers, the full text appears.
I want to position text over img WITHOUT absolute positioning.
I tried negative margins, but text wouldn't have BG color there.
Also tried Relative pos. => works great but not on chance on IE.
here is an image of what I want

|
(CSS) How position text (with background color) over <img> tag without absolute positioning
|
CC BY-SA 3.0
| null |
2011-05-13T23:17:09.653
|
2015-05-13T15:23:50.223
|
2011-05-14T12:33:46.553
| 405,015 | 742,115 |
[
"css",
"internet-explorer",
"internet-explorer-6",
"hover",
"positioning"
] |
5,998,811 | 1 | 5,998,854 | null | 1 | 728 |
with Server API: CGI/FastCGI

Apc hit miss cached file, and lost diagrams in apc.php.
How i can make apc run perfect, do this error happen because server use CGI/FastCGi ?
Now , it cached 32MB file but miss 99% .
|
Apc hit miss cached file, and lost diagrams in apc.php
|
CC BY-SA 3.0
| null |
2011-05-13T23:40:58.643
|
2011-05-14T16:38:50.253
|
2011-05-14T16:38:50.253
| 329,424 | 329,424 |
[
"php",
"apc"
] |
5,999,007 | 1 | null | null | 16 | 3,784 |
For [this project](http://code.google.com/p/quickscreenshots), I'm taking screenshots with the Windows API (to deal with multi-screens) and convert it to a PIL image; then I add a shadow around the window if wanted.
My problem is, the screenshot is actually of the window's rectangle; meaning I capture the background behind it around rounded-corners and I don't want that. I googled quite a bit and found docs and tuts around transparency, and I'm guessing I should find a way to get the shape of the window in order to make it a mask that I would apply to the (rectangle) image i've got. But I found noway to get that mask. Could any one help?
Below is my code:
```
hwnd = win32gui.GetForegroundWindow()
l, t, r, b = win32gui.GetWindowRect(hwnd)
w = r - l
h = b - t
hwndDC = win32gui.GetWindowDC(hwnd)
mfcDC = win32ui.CreateDCFromHandle(hwndDC)
saveDC = mfcDC.CreateCompatibleDC()
saveBitMap = win32ui.CreateBitmap()
saveBitMap.CreateCompatibleBitmap(mfcDC, w, h)
saveDC.SelectObject(saveBitMap)
saveDC.BitBlt((0, 0), (w, h), mfcDC, (0, 0), win32con.SRCCOPY)
#add cursor
if showcursor:
curFlags, curH, (curX, curY) = win32gui.GetCursorInfo()
saveDC.DrawIcon((curX, curY), curH)
#load into PIL image
"""http://stackoverflow.com/questions/4199497/image-frombuffer-with-16-bit-image-data"""
bmpinfo = saveBitMap.GetInfo()
bmpstr = saveBitMap.GetBitmapBits(True)
im = Image.frombuffer(
'RGB',
(bmpinfo['bmWidth'], bmpinfo['bmHeight']),
bmpstr, 'raw', 'BGRX', 0, 1)
win32gui.DeleteObject(saveBitMap.GetHandle())
saveDC.DeleteDC()
mfcDC.DeleteDC()
win32gui.ReleaseDC(hwnd, hwndDC)
return im
```
Below is a slightly magnified screenshot of a window above a blue background:

As you can see there are blue corners that shouldn't be there.
|
Active window screenshot with Python PIL and windows API: how to deal with rounded corners?
|
CC BY-SA 3.0
| 0 |
2011-05-14T00:20:01.000
|
2012-11-05T12:44:12.873
|
2012-11-05T12:44:12.873
| 355,230 | 571,572 |
[
"python",
"windows",
"screenshot",
"python-imaging-library",
"rounded-corners"
] |
5,999,298 | 1 | null | null | 0 | 335 |
Hey all, back again. Working on a dungeon generator and I'm actually surprising myself with the progress. Yet I still have a straggling room every now and then. I was wondering if there was a way to loop through an array and see if all the '1s' (the floor tiles) are connected, and if not, how to connect them.
Thanks!
EDIT: The array is randomly filled with rooms and corridors; here's the code:
```
import java.util.Random;
public class Level
{
Random random = new Random();
int[][] A = new int[100][100];
int minimum = 3;
int maximum = 7;
int xFeature = 0;
int yFeature = 0;
private void feature()
{
int i = 0;
while(i>=0)
{
xFeature = random.nextInt(100-1) + 1;
yFeature = random.nextInt(100-1) + 1;
if(A[xFeature][yFeature]==1)//||A[xFeature++][yFeature]==1||A[xFeature][yFeature--]==1||A[xFeature][yFeature++]==1)
break;
i++;
}
}
private void room()
{
int safeFall = 0;
int xCoPLUS = minimum + (int)(Math.random()*minimum);
int yCoPLUS = minimum + (int)(Math.random()*minimum);
if(yCoPLUS >= xCoPLUS)
{
for(int across = xFeature; across < xFeature+xCoPLUS+2; across++)
{
for(int vert = yFeature; vert < yFeature+yCoPLUS+1; vert++)
{
if(A[vert][across] == 0)
safeFall++;
else
break;
}
}
}
if(yCoPLUS < xCoPLUS)
{
for(int across = xFeature; across < xFeature+xCoPLUS+1; across++)
{
for(int vert = yFeature; vert < yFeature+yCoPLUS+2; vert++)
{
if(A[vert][across] == 0)
safeFall++;
else
break;
}
}
}
if((safeFall== (xCoPLUS+1) * (yCoPLUS+2)) || ((safeFall== (xCoPLUS+2) * (yCoPLUS+1))))
{
for(int across = xFeature; across < xFeature+xCoPLUS; across++)
{
for(int vert = yFeature; vert < yFeature+yCoPLUS; vert++)
{
A[vert][across] = 1;
}
}
}
}
private void corridor()
{
int xCoONE = xFeature;
int yCoONE = yFeature;
int xCoTWO = random.nextInt(10)+10;
int yCoTWO = random.nextInt(10)+10;
while(xCoONE > xCoTWO)
{
A[xCoONE][yCoONE] = 1;
xCoONE--;
}
while(xCoONE < xCoTWO)
{
A[xCoONE][yCoONE] = 1;
xCoONE++;
}
while(yCoONE > yCoTWO)
{
A[xCoONE][yCoONE] = 1;
yCoONE--;
}
while(yCoONE < yCoTWO)
{
A[xCoONE][yCoONE] = 1;
yCoONE++;
}
}
public Level()
{
firstroom();
for(int i = 0; i < 500; i++)
{
int x = random.nextInt(50);
feature();
if(x > 1)
room();
else
corridor();
}
troubleShoot();
}
```
So basically what happens when I create an object of this class is that a 100x100 array is filled with corridors and rooms determined by a random number. (well, a couple of them) But with how I have my room non-overlapping failsafe (safeFall in room()), I get stuck with a room that is one title out of reach every now and then.

|
How to find all connected numbers in an array?
|
CC BY-SA 3.0
| null |
2011-05-14T01:37:20.810
|
2011-05-14T02:14:46.187
|
2011-05-14T01:45:11.217
| 629,243 | 629,243 |
[
"java",
"arrays",
"continuous"
] |
5,999,317 | 1 | 6,005,630 | null | 6 | 9,369 |
I am sure I am missing something simple/obvious, but I cannot seem to bind the data of a ListView within a ListView
```
<Window x:Class="TestList.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<DataTemplate x:Key="InsideListTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock Text="test" Width="50"></TextBlock>
<TextBlock Text="{Binding OrderId}" Width="50"></TextBlock>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="OrdersTemplate">
<ListView HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
MinWidth="100"
MinHeight="25"
ItemsSource="{Binding Orders}"
ItemTemplate="{StaticResource InsideListTemplate}"
>
</ListView>
</DataTemplate>
<DataTemplate x:Key="CustomersTemplate">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Text="{Binding CustomerId}" Width="50" Foreground="Navy" VerticalAlignment="Center" />
<ListBox ItemsSource="{Binding Orders}" ItemTemplate="{StaticResource OrdersTemplate}" HorizontalContentAlignment="Stretch"></ListBox>
</StackPanel>
</DataTemplate>
</Window.Resources>
<DockPanel LastChildFill="True">
<ListView Name="listView" ItemTemplate="{StaticResource CustomersTemplate}" >
</ListView>
</DockPanel>
```
```
using System.Collections.Generic;
namespace TestList
{
public partial class MainWindow
{
public class Customer
{
public int CustomerId { get; set; }
public List<Order> Orders { get; set; }
}
public class Order
{
public int OrderId { get; set; }
}
public MainWindow()
{
InitializeComponent();
DataContext = this;
var customers = new List<Customer>
{
new Customer
{
CustomerId = 1,
Orders = new List<Order>
{
new Order {OrderId = 1},
new Order {OrderId = 2}
}
},
new Customer
{
CustomerId = 2,
Orders = new List<Order>
{
new Order {OrderId = 1},
new Order {OrderId = 2}
}
}
};
listView.ItemsSource = customers;
}
}
}
```

|
WPF ListView within a ListView
|
CC BY-SA 3.0
| 0 |
2011-05-14T01:44:18.633
|
2018-02-20T01:07:09.710
| null | null | 134,035 |
[
"wpf",
"data-binding"
] |
5,999,325 | 1 | 6,007,138 | null | 1 | 588 |
Based on IntelliJ's documentation, when folding an anonymous class you should still be able to see the contents of the inner method. See image below taken from their documentation:

This isn't the behavior I'm seeing though. Here is what I see:

I can only seem to collapse the inner method contents or the entire anonymous class body. Is this just an error in their documentation or is there a way to actually achieve this behavior?
======= =========
I've accepted the answer from Peter Gromov, but there still seems to be something amiss with my version. When I have files open and set folding closures by default (File -> Settings -> Editor -> Code Folding -> Select 'Closures' under 'Collapse by default:'), it does seem to fold correctly as seen in the following image:

Notice that the expanded Because shows a single collapsible region in the margin. Closing the file and reopening produces the following (after I collapse the first one):

When first opening the file, both of these statements are expanded (issue #1). After collapsing the outer most region for the first statement, it folds over the entire anonymous class (issue #2) rather than how it worked before I closed the file. Notice also that the second statement that I've left open has an additional collapsible region for the method of the anonymous class (issue #3). This is how it behaves with the default folding settings for closures are turned off. There's definitely something buggy here. Since I've posted this question, there has been a new version released so perhaps the issue is only with the version I have (10.0.3), but as far as I know this is a fairly old feature. I'd welcome any explanation as to why I might be seeing these issues (including "Works on my machine").
|
Does IntelliJ IDEA reveal the method body when folding anonymous classes?
|
CC BY-SA 3.0
| null |
2011-05-14T01:47:05.813
|
2011-06-21T14:58:20.670
|
2011-06-21T14:58:20.670
| 1,219,618 | 1,219,618 |
[
"intellij-idea"
] |
5,999,448 | 1 | null | null | 1 | 847 |
I am trying to send an email which contains a single HTML attachment. The problem is that the attachment html is appearing in the body of the email, and the view is showing up as the attachment. Pretty much the opposite of what I expected.
I am able to send attachments of other types properly, but when trying to send a single attachment that is HTML, it consistently is displayed rather than 'attached'.
```
class Notifier < ActionMailer::Base
default :from => "[email protected]"
def welcome(email)
attachments['this is an html file.html'] = "<b>yeah this is html!</b>"
mail(:to => email, :subject => "Attempting an attachment")
end
end
```
And my `app/views/notifier/welcome.html.erb`
```
Hi there! This is <b>html</b> within a view
```
The resulting email looks like this:
(notice the attachment html is actually displayed in the body of the email)

|
Sending an html attachment with ActionMailer 3
|
CC BY-SA 3.0
| null |
2011-05-14T02:29:42.470
|
2011-07-02T21:16:00.107
|
2011-05-18T18:49:08.273
| 71,489 | 1,691 |
[
"ruby-on-rails",
"attachment",
"actionmailer"
] |
5,999,734 | 1 | 6,353,125 | null | 1 | 1,575 |
I used the codes below to display an view(ViewController) on window.
```
ViewImagesController *vvViewImagesController=[[ViewImagesController alloc] init ];
self.vViewImagesController=vvViewImagesController;
[vvViewImagesController release];
UINavigationController *a=[[UINavigationController alloc]initWithRootViewController: vViewImagesController];
[self.view addSubview:a.view];
```
but the navigation bar appeared underneath the status bar 20 points.

Even I use the codes:
```
[a.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
```
to relocate the view, but the result is same.
Welcome any comment
|
UINavigationBar Appears Under StatusBar 20 points
|
CC BY-SA 3.0
| 0 |
2011-05-14T04:05:18.110
|
2011-07-29T03:12:51.357
|
2011-05-14T04:20:13.613
| 629,453 | 629,453 |
[
"iphone"
] |
5,999,921 | 1 | 6,000,060 | null | 2 | 414 |
If any have clue of this popup. so please share with us.
See this below image. I want like that way...

|
How to display popup in android same as Android market used?
|
CC BY-SA 3.0
| 0 |
2011-05-14T05:04:57.837
|
2011-05-14T05:48:26.247
| null | null | 487,253 |
[
"android",
"popupwindow"
] |
6,000,149 | 1 | null | null | 2 | 1,026 |
Is there a UIBarButtonSystem icon that is "-" minus? Opposite of this: 
Thanks.
|
UIBarButtonItem minus sign
|
CC BY-SA 3.0
| null |
2011-05-14T06:12:37.950
|
2017-02-16T19:46:08.093
| null | null | 635,064 |
[
"objective-c",
"cocoa-touch",
"uinavigationcontroller",
"uibarbuttonitem"
] |
6,000,543 | 1 | 6,160,174 | null | 10 | 8,852 |
Some 3rd party keyboards have more than one character on each key, for example Better Keyboard 8 has numbers and punctuation above the letters on each key:

Can this be done with the `<Key>` tag? If so I cannot figure out how. I would appreciate if anybody knows how.
Thanks in advance,
Barry
|
Customize the appearance of a <Key>
|
CC BY-SA 3.0
| 0 |
2011-05-14T07:57:55.713
|
2014-06-25T09:53:19.203
| null | null | 706,628 |
[
"android",
"android-layout",
"android-widget"
] |
6,000,789 | 1 | null | null | 0 | 3,237 |
Following is a pde of the diffusion equation. Its second order was eliminated, since D = 0.
I am new learner of the matlab, knowing that the diffusion equation has certain similarity with the heat equation, but I don't know how to apply the method in my solution.
Please send your suggestions. Thanks with all my heart.
Also, if the D is a tensor while D11 neq D12 neq D21 neq D22, then, how to solve my problem?
Diffusion equation:

F(x1, x2) & F2(x1, x2):

|
Matlab: how to solve a one order PDE (diffusion equation)
|
CC BY-SA 4.0
| null |
2011-05-14T08:56:40.150
|
2019-04-29T05:46:33.747
|
2019-04-29T05:46:33.747
| 6,651,940 | 699,013 |
[
"matlab",
"pde"
] |
6,000,900 | 1 | 6,001,101 | null | 2 | 309 |
Perviously the client uploaded same app on iTunes connect and rejected for some reason.
After some modifications I need to upload the binary again.
The previous binary details are,

Now, here are the current info.plist details,

I am using Xcode 4.0
When I tried to validate product from Xcode I got this error,

I tried different different CFBundleVersion in the Info.plist. but still error occurs.
I cleaned project, deleted build, also re-installed Xcode and retried but no use.
Please help me.
|
This bundle is invalid. iPhone App submission error
|
CC BY-SA 3.0
| null |
2011-05-14T09:17:44.127
|
2011-05-14T10:03:49.170
| null | null | 102,839 |
[
"iphone",
"distribution"
] |
6,001,011 | 1 | 6,001,092 | null | 1 | 425 |
I got a Hierarchical table with following structure

As you can see, ParentGroupUserID refers to the same table. Now when I use EF POCO t4 template to generate class for it, it comes up with following structure.
```
public partial class GroupUser
{
#region Primitive Properties
public virtual int GroupUserID
{
get;
set;
}
public virtual int GroupID
{
get;
set;
}
public virtual string UserName
{
get;
set;
}
#endregion
#region Navigation Properties
public virtual ICollection<GroupUser> GroupUser1
{
get
{
if (_groupUser1 == null)
{
var newCollection = new FixupCollection<GroupUser>();
newCollection.CollectionChanged += FixupGroupUser1;
_groupUser1 = newCollection;
}
return _groupUser1;
}
set
{
if (!ReferenceEquals(_groupUser1, value))
{
var previousValue = _groupUser1 as FixupCollection<GroupUser>;
if (previousValue != null)
{
previousValue.CollectionChanged -= FixupGroupUser1;
}
_groupUser1 = value;
var newValue = value as FixupCollection<GroupUser>;
if (newValue != null)
{
newValue.CollectionChanged += FixupGroupUser1;
}
}
}
}
private ICollection<GroupUser> _groupUser1;
public virtual GroupUser GroupUser2
{
get { return _groupUser2; }
set
{
if (!ReferenceEquals(_groupUser2, value))
{
var previousValue = _groupUser2;
_groupUser2 = value;
FixupGroupUser2(previousValue);
}
}
}
private GroupUser _groupUser2;
public virtual ICollection<Franchise> Franchises
{
get
{
if (_franchises == null)
{
var newCollection = new FixupCollection<Franchise>();
newCollection.CollectionChanged += FixupFranchises;
_franchises = newCollection;
}
return _franchises;
}
set
{
if (!ReferenceEquals(_franchises, value))
{
var previousValue = _franchises as FixupCollection<Franchise>;
if (previousValue != null)
{
previousValue.CollectionChanged -= FixupFranchises;
}
_franchises = value;
var newValue = value as FixupCollection<Franchise>;
if (newValue != null)
{
newValue.CollectionChanged += FixupFranchises;
}
}
}
}
private ICollection<Franchise> _franchises;
#endregion
#region Association Fixup
private void FixupGroupUser2(GroupUser previousValue)
{
if (previousValue != null && previousValue.GroupUser1.Contains(this))
{
previousValue.GroupUser1.Remove(this);
}
if (GroupUser2 != null)
{
if (!GroupUser2.GroupUser1.Contains(this))
{
GroupUser2.GroupUser1.Add(this);
}
}
}
private void FixupGroupUser1(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems != null)
{
foreach (GroupUser item in e.NewItems)
{
item.GroupUser2 = this;
}
}
if (e.OldItems != null)
{
foreach (GroupUser item in e.OldItems)
{
if (ReferenceEquals(item.GroupUser2, this))
{
item.GroupUser2 = null;
}
}
}
}
private void FixupFranchises(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems != null)
{
foreach (Franchise item in e.NewItems)
{
if (!item.GroupUsers.Contains(this))
{
item.GroupUsers.Add(this);
}
}
}
if (e.OldItems != null)
{
foreach (Franchise item in e.OldItems)
{
if (item.GroupUsers.Contains(this))
{
item.GroupUsers.Remove(this);
}
}
}
}
#endregion
}
```
If you see in the above code, I don't like the notion of naming my public properties GroupUser1 (which is a collection) and GroupUser2 (single object). Can anyone help me understand this naming pattern with POCO generation and is there a way I can rename it (without modifying the t4 template).
|
Entity Framework POCO template for Hierarchical table
|
CC BY-SA 3.0
| null |
2011-05-14T09:44:48.010
|
2011-05-14T10:02:59.480
| null | null | 375,777 |
[
"c#",
".net",
"asp.net",
"asp.net-mvc",
"entity-framework"
] |
6,001,281 | 1 | 6,001,374 | null | 9 | 6,878 |
Take a look at the following HTML and CSS.
```
.box {
border-radius: 15px;
border: #333 solid 3px;
background: #333;
}
```
```
<div class="box">Hello world</div>
```
It produces this in Firefox:

As you can see, the border and the background of the div leaves a tiny gap which is visible. I need the border because of a hover state with a different background-color.
|
Firefox: border-color, border-radius and background color creates ragged edges and white space
|
CC BY-SA 3.0
| 0 |
2011-05-14T10:41:44.127
|
2021-12-13T21:12:38.223
|
2012-03-06T18:27:40.833
| 398,242 | 66,158 |
[
"html",
"border",
"css"
] |
6,001,474 | 1 | 6,001,798 | null | 0 | 173 |
I am having join query that seems fetching slowly. How can I optimize it, or it is
reasonable?
> time to execute
29 total, Query took 1.6956 sec
# mysql query
```
SELECT SQL_CALC_FOUND_ROWS
t2.AuctionID ,t2.product_name ,t3.user_name ,t1.date_time ,t1.owned_price
,t2.specific_product_id
FROM table_user_ownned_auction AS t1
INNER JOIN table_product AS t2 ON t1.specific_product_id=t2.specific_product_id
INNER JOIN table_user_information AS t3 ON t3.user_id=t1.user_id
ORDER BY ownned_id DESC
```
Here's the explain output

|
MySQL query optimization
|
CC BY-SA 3.0
| null |
2011-05-14T11:19:29.443
|
2017-04-18T08:47:00.423
|
2011-05-14T12:17:39.280
| 650,492 | 430,112 |
[
"mysql",
"optimization",
"join"
] |
6,001,732 | 1 | 6,002,314 | null | 2 | 633 |
When I click on a row in the use of an object, in leaks or zombie for example, the lines are marked in blue...
and there are these percentages right in the line where reason of the leak/etc. should be.

But what does the percentage number mean?
I have sometimes trouble with understanding the percentages when there are like 5 of them with 15% and 25% and so on.
|
Percentages in Instruments right in the blue line in Xcode 4
|
CC BY-SA 3.0
| null |
2011-05-14T12:09:27.690
|
2011-05-14T14:06:00.790
|
2011-05-14T13:05:27.607
| 691,409 | 691,409 |
[
"memory-leaks",
"xcode4",
"instruments"
] |
6,001,904 | 1 | 6,001,956 | null | 1 | 1,455 |
In my application, I sometimes have to create elements dynamically, so I create them in javascript, but it make it hard for maintenance.
For example:

The above image is the information window when I click a point in the map, and in our application we have a similar requirement, we use javascript to create the whole DOM.
I do not think this is a good idea, any suggestion?
|
How to avoid writing HTML tags in javascript
|
CC BY-SA 3.0
| null |
2011-05-14T12:43:54.443
|
2011-05-14T13:10:54.683
|
2020-06-20T09:12:55.060
| -1 | 306,719 |
[
"javascript"
] |
6,002,001 | 1 | 6,002,327 | null | 2 | 114 |
I created a new branch of my project and now when I try to build and run it I get this error:
'The selected run destination is not valid for this action.' Why is this? I don't know why but I just plugged in my iphone and now the project will build. Weird.

|
I can't build my project on a new (git) branch with xcode 4. why?
|
CC BY-SA 3.0
| null |
2011-05-14T13:07:09.743
|
2011-05-14T14:07:18.860
|
2011-05-14T13:12:16.437
| 259,912 | 259,912 |
[
"git",
"xcode4"
] |
6,002,261 | 1 | 6,010,371 | null | 5 | 10,117 |
I'm trying to convert pdfs to tiff images for following OCR. I use "-density 300x300 -depth 8" as parameters.
The first problem is that from 500 KB pdf file i get 72 MB tiff file.
The second problem is bad quality of resulting image causing OCR failing.
Here you can see it yourself.
Adobe acrobat reader generated (printed) tiff image:

ImageMaggick tiff image:

The difference is huge.
How can i get as good as Adobe generated image using ImageMaggick?
Not tiff neccesary, other formats also will be good.
UPD: i've found 'antialias' option. Now it's much more better.
But still OCR result not so accurate as for Adobe version.
|
PDF to tiff ImageMagick problem
|
CC BY-SA 3.0
| 0 |
2011-05-14T13:54:50.197
|
2017-08-01T07:54:42.937
|
2011-05-15T18:37:23.753
| 359,307 | 454,097 |
[
"command-line",
"imagemagick",
"tiff",
"ghostscript",
"adobe-reader"
] |
6,002,424 | 1 | 6,008,179 | null | 18 | 8,495 |
When creating a generic base test class in MSTest, and inheriting from it, I'm unable to run the tests of all the inheriting classes.

is located in the assembly. It is the generic base class. ()
Both assemblies have a test inheriting from this base class, called . All the inherited class does is passing a specific type argument.
```
[TestClass]
public class DependencyPropertyFactoryTest
: BaseDependencyPropertyFactoryTest<ASpecificClass>
{
}
```
Only the inheriting test located in the same assembly as the base class seems to run. The inherited test in the assembly seems to be ignored entirely.
What am I doing wrong? When desired I could upload all the required source code, but you will need PostSharp for the aspects assembly.
---
As a test, I tried adding a test to the inherited test class in the aspects assembly, which calls all the tests in the base test class.
```
[TestMethod]
public void AllBaseTests()
{
ClrGetterSetterTest();
DependencyPropertyGetterSetterTest();
}
```
This gives the following result. Strangely enough this test is executed! For now this might work as a way to at least run them, but of course I don't want to edit this test each time I add extra tests in the base class.

Why are those base tests skipped, and why the indication 'Aborted'?
|
Inherited test class from generic base is ignored in MSTest
|
CC BY-SA 3.0
| 0 |
2011-05-14T14:24:06.763
|
2017-04-24T09:00:35.627
|
2015-10-30T14:08:45.983
| 590,790 | 590,790 |
[
"c#",
"visual-studio",
"unit-testing",
"mstest",
"resharper-5.1"
] |
6,002,565 | 1 | null | null | 1 | 1,338 |
did anybody know a nice (and stable) Pie menu like this

Thanks in advance!
Peter
|
Jquery - "Pie" Menu PlugIn
|
CC BY-SA 3.0
| null |
2011-05-14T14:50:45.477
|
2011-06-15T08:58:29.023
| null | null | 2,136,202 |
[
"jquery",
"menu"
] |
6,002,621 | 1 | null | null | 19 | 2,027 |
I'd like to use QWebView for an SVG thumbnailing job because it supports filters (unlike QSvgRender which only supports SVG Tiny 1.2). It seems to work quite well except for font rendering but that can be tweaked using fontconfig package. The problem is that it seems to be undersampling elements with filters. Elements without filters look good and sharp, while those with filters are pixelated and blurry.
```
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtSvg import *
from PyQt4.QtWebKit import *
import sys
import time
if __name__ == '__main__':
app = QApplication(sys.argv)
data = open('/home/xxx/workspace/yyy/zzz/out.svg').read()
# svg = QSvgRenderer(QByteArray(data))
qim = QImage(int(1024), int(768), QImage.Format_ARGB32)
web = QWebView()
web.setRenderHint(QPainter.SmoothPixmapTransform)
web.setRenderHint(QPainter.Antialiasing)
web.setRenderHint(QPainter.TextAntialiasing)
painter = QPainter()
def load_finished(ok):
web.resize(1024,768)
painter.begin(qim)
# svg.render(painter)
web.render(painter)
painter.end()
print "null:", qim.isNull()
qim.save('test2.png')
sys.exit()
web.connect(web, SIGNAL('loadFinished(bool)'), load_finished)
web.load(QUrl('file:///home/xxx/workspace/yyy/zzz/out.svg'))
sys.exit(app.exec_())
```
Qt 4.7. Same SVG file looks OK when rendered using Inkscape, rsvg or in Chrome, Firefox.

|
QWebView undersampled SVG rendering
|
CC BY-SA 3.0
| 0 |
2011-05-14T15:00:21.773
|
2011-11-17T13:19:01.983
|
2011-10-25T19:20:16.327
| 149,212 | 104,337 |
[
"python",
"qt",
"webkit",
"svg",
"pyqt"
] |
6,002,761 | 1 | 6,004,421 | null | 4 | 774 |
I have Visual Studio 2008 Pro. SP1 and Hotfix
> KB958502 - JScript Editor support for
“-vsdoc.js” IntelliSense doc. files
installed, but still no intellisense Support is available in VS2008.
```
<script type="text/javascript" src="Scripts/jquery-1.6.1.js">
$("#TextBox1").
</script>
```

|
No Jquery intellisense Support for Visual Studio 2008
|
CC BY-SA 3.0
| null |
2011-05-14T15:22:30.503
|
2011-10-24T15:40:31.660
|
2011-05-14T16:03:35.897
| 673,924 | 673,924 |
[
"jquery",
"asp.net",
"visual-studio-2008",
"intellisense"
] |
6,002,913 | 1 | 6,003,005 | null | 1 | 537 |
The styles are in a separate file and they are:
```
.newsticker-jcarousellite { width:600px; }
.newsticker-jcarousellite ul li{ list-style:none; display:block; padding-bottom:1px; margin-bottom:5px; }
.newsticker-jcarousellite .thumbnail { float:left; width:50px; height:50px; }
.newsticker-jcarousellite .info { float:right; width:535px; }
.newsticker-jcarousellite .info span.cat { display: block; font-size:10px; color:#808080; }
```
All generates this:

But now, i need to add 3 litle div on the lower part of the profile picture all of them with a black (35% transparent) background where i can put some text, the result must look like this:

Im very new at css, and i realy dont have any idea how to do this, thanks for any help!
|
Using CSS to put some DIVs over a picture (+explaining images)
|
CC BY-SA 3.0
| null |
2011-05-14T15:44:26.530
|
2011-05-14T16:04:29.460
| null | null | 310,648 |
[
"css"
] |
6,002,927 | 1 | null | null | 5 | 8,708 |
Also, how exactly are overloaded operator member functions best formatted in a UML diagram?
Here is my class:
```
class matrix
{
friend ostream& operator << (ostream&, const matrix&);
friend bool operator == (const matrix &, const matrix &);
friend matrix operator - (const matrix &, const matrix &);
private:
int size;
int range;
int array[10][10];
public:
matrix(int);
matrix(int, int);
bool operator != (const matrix &) const;
matrix operator + (const matrix &) const;
const matrix & operator = (const matrix &);
};
```
and here is what I have of my UML diagram so far:

|
should friend functions be represented in UML diagrams?
|
CC BY-SA 3.0
| null |
2011-05-14T15:46:55.410
|
2011-05-14T16:36:04.347
| null | null | 538,293 |
[
"c++",
"uml"
] |
6,002,967 | 1 | 6,002,997 | null | 5 | 13,655 |
```
$('#nav a[href][title]').qtip({
content: {
text: false // Use each elements title attribute
},
position: {
corner: {
target: 'topLeft',
tooltip: 'middleRight'
}
},
style: {
name: 'dark',
width: 230,
padding: 3,
bottom: 10,
textAlign: 'center'
}
// Give it some style
});
```
i would like to simulate: css: position:relative;bottom:10px so the tooltip gets vertical aligned (see image) with target, but i cant get it done

trying like this
```
$('#nav a[href][title]').qtip({
content: {
text: false // Use each elements title attribute
},
position: {
corner: {
target: 'topLeft',
tooltip: 'middleRight'
}
},
style: {
name: 'dark',
width: 230,
padding: 3,
position: 'relative',
bottom: 10,
textAlign: 'center'
}
// Give it some style
});
```
But the text of the tooltip gets moved, not the tooltip itself,
how can i do this?
EDIT
trying the 'adjust' property but there is a syntax mistake i can't find
```
$('#nav a[href][title]').qtip({
content: {
text: false // Use each elements title attribute
},
position: {
adjust: {
x: 10px,
y: 10px
},
corner: {
target: 'topLeft',
tooltip: 'middleRight'
}
},
style: {
name: 'dark',
width: 230,
padding: 3,
textAlign: 'center'
},
// Give it some style
});
```
|
manual positioning adjust on qtip tooltip (not working)
|
CC BY-SA 3.0
| 0 |
2011-05-14T15:54:15.903
|
2011-05-14T16:40:49.237
|
2011-05-14T16:30:54.477
| 533,941 | 533,941 |
[
"jquery",
"css",
"position",
"qtip"
] |
6,002,990 | 1 | null | null | 0 | 820 |
Following is my database with 4 tables(Student, Course, Module, Instructor). And I wan to know whether this database is correct or not and if I am doing right how can I retrieve data from tables using student id as below.
-

```
(pk) = primary key and (fk)=foreign key
```
The next thing is I wan to import some values from those above tables to a newly created table? the situation is I wan to import 's_id' and 'i_id' from above tables in 'id' attribute of newly crated table named "Everyone"; at the same time I also want to generate '0'/'1' value for 'type' attribute of "Everyone" table where 0 value for those id which are imported from 's_id' and 1 for rest of the ids imported from 'i_id'. Following is my expected new database table.
```
Everyone
id |type |
-----------------
10122345 | 0 |
10122342 | 0 |
10222346 | 0 |
20432343 | 1 |
20432311 | 1 |
20532334 | 1 |
```
Please Can anyone help me? is it possible to do with mysql and php? THanks.
|
How to retrieve data from multi-valued attributes in a relational database?
|
CC BY-SA 3.0
| null |
2011-05-14T15:57:33.660
|
2011-05-14T16:48:09.483
| null | null | 695,864 |
[
"php",
"mysql",
"database",
"database-design",
"relational-database"
] |
6,003,018 | 1 | 6,003,579 | null | 21 | 8,224 |
Please see the attached screenshot which illustrates a TToolBar from one of my programs:

Notice the last two images of the Toolbar, they are disabled. The way they have been drawn to appear disabled is not very appealing, in fact in the Delphi IDE some of the images look the same.
The issue I have with it is I want my application to look a lot cleaner. The way the disabled items are drawn doesn't look very good. The TToolBar allows to set a disabled TImageList, I tried making my images black & white but they didn't look right, and would rather not have to always make the images black and white (time and effort). This problem also shows in my menus and popup menus, which don't allow for disabled images anyway.
Is there a way to paint the disabled items to look better on the eye?
If possible I would rather not look to use 3rd Party Controls. I know the Jedi Components allow disabled images for the menu etc, but would prefer a way to not resort too 3rd Party Components, when possible I would much prefer to use the standard issue VCL, especially as sometimes I use the TActionMainMenuBar to draw Office Style menus, which match the TToolBar when DrawingStyle is set to gradient.
I have accepted RRUZ's answer, is it possible though to accept David's answer as well, both are very good answers and would like the answer to be shared between them if possible.
Thanks.
|
Make Disabled Menu and Toolbar Images look better?
|
CC BY-SA 3.0
| 0 |
2011-05-14T16:02:36.997
|
2020-05-26T14:22:31.307
|
2012-05-09T14:33:29.823
| 741,249 | null |
[
"image",
"delphi",
"menu",
"toolbar"
] |
6,003,082 | 1 | 6,003,127 | null | 6 | 13,891 |
I am making a iPhone app that allows the user to go back in a UINavigationBar. However, the way it looks now is horrendous. I am trying to customize it with my own image (minus the default UIBarButtonItem background). My image includes my custom background, but you can still see part of the button on the left and the right.
```
UIBarButtonItem *cancelButton = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back_button_normal.png"] style:UIBarButtonItemStylePlain target:self action:@selector(cancel:)] autorelease];
self.navigationItem.leftBarButtonItem = cancelButton;
```
Is there a way to remove that space? Is there a possibility I can use a UIButton so I can customize it completely? I did something in interface builder where i dragged a UIButton into the UINavigationBar's rightButton and it works perfectly. Is there anyway I can do it programmatically?
Thanks!
Here's how it looks:

EDIT #1:
```
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Show View" forState:UIControlStateNormal];
[button setBackgroundImage:[UIImage imageNamed:@"back_button_normal.png"] forState:UIControlStateNormal];
UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
[self.navigationItem setLeftBarButtonItem:barButtonItem];
```
Here's how I make my background for the UINavigationBar (places in my RootViewController):
```
@implementation UINavigationBar (UINavigationBarCustomDraw)
- (void) drawRect:(CGRect)rect {
[self setTintColor:[UIColor colorWithRed:0.85f green: 0.85f blue:0.85f alpha:1]];
if ([self.topItem.title length] > 0 && ![self.topItem.title isEqualToString:@"Back to ..."]) {
[[UIImage imageNamed:@"UINavigationBar_background.png"] drawInRect:rect];
CGRect frame = CGRectMake(0, 0, 320, 44);
UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease];
[label setBackgroundColor:[UIColor clearColor]];
label.font = [UIFont boldSystemFontOfSize: 20.0];
label.shadowColor = [UIColor colorWithWhite:0.0 alpha:1];
label.textAlignment = UITextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.text = self.topItem.title;
self.topItem.titleView = label;
} else {
[[UIImage imageNamed:@"login_button.png"] drawInRect:rect];
self.topItem.titleView = [[[UIView alloc] init] autorelease];
}
}
@end
```
|
Custom UINavigationBar's backButton?
|
CC BY-SA 3.0
| 0 |
2011-05-14T16:14:58.880
|
2012-12-01T19:13:18.827
|
2011-05-14T16:43:34.197
| 613,860 | 613,860 |
[
"objective-c",
"cocoa-touch"
] |
6,003,130 | 1 | 6,004,413 | null | 1 | 1,248 |
How can I do this effects with android
The result

Image 1

Image 2

|
How can i do mask effect of two images
|
CC BY-SA 3.0
| null |
2011-05-14T16:21:33.823
|
2011-05-14T19:49:54.460
| null | null | 699,174 |
[
"android"
] |
6,003,143 | 1 | null | null | 2 | 1,696 |
I'm doing what should be a simple http post that includes a json string as the http body.
?
All looks good except the response itself - when I turn it into a String it comes back looking strange (not text). How might I get this in plain text? Or what did I do wrong during the post to get this response? (note - if I exclude the cookies during the POST I do get plain html back from the server w/ a valid "access denied" message)
Full code for this solution is below
```
public class BaseHttpService {
public ResponseAndCookies doHttpPostWithUrlWithJson(String url, String key, CookieStore cookies) {
try {
StringEntity se = new StringEntity("{\"filters\":true}");
se.setContentType("text/xml");
se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
HttpPost httpost = new HttpPost(url);
httpost.setEntity(se);
httpost.setHeader("Accept", "application/json");
httpost.setHeader("Content-Type", "application/json");
return executeHttpRequest(httpost, cookies);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
public ResponseAndCookies executeHttpRequest(HttpRequestBase http, CookieStore cookieStore) {
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response;
String result = "";
if (cookieStore != null) {
((DefaultHttpClient) httpclient).setCookieStore(cookieStore);
}
try {
response = httpclient.execute(http);
HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream instream = entity.getContent();
result = convertStreamToString(instream);
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
List<Cookie> cookies = ((DefaultHttpClient) httpclient).getCookieStore().getCookies();
CookieStore postCookieStore = ((DefaultHttpClient) httpclient).getCookieStore();
ResponseAndCookies x = new ResponseAndCookies();
x.setCookies(cookies);
x.setResponse(result);
x.setCookieStore(postCookieStore);
httpclient.getConnectionManager().shutdown();
return x;
}
public static String convertStreamToString(InputStream is) {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return sb.toString();
}
}
```
|
Strange response after http POST with JSON in Java
|
CC BY-SA 3.0
| null |
2011-05-14T16:23:00.137
|
2011-05-14T18:21:57.370
| null | null | 2,701 |
[
"java",
"android",
"json",
"http"
] |
6,003,382 | 1 | 6,010,979 | null | 18 | 8,780 |
My goal:

So, before I knew about the issue, here's what I tried.
First, a base layout:
```
<LinearLayout
android:orientation="horizontal"
android:layout_below="@id/heading"
android:layout_marginTop="10dp"
android:layout_width="@dimen/horizontal_two_button_width"
android:layout_height="@dimen/button_height_small" >
<Button
android:id="@+id/button_one"
android:layout_width="0dp"
android:layout_weight="1.0"
android:layout_height="fill_parent"
android:padding="10dp"
style="@style/ButtonText"
android:background="@drawable/button_left_green" />
<Button
android:id="@+id/button_two"
android:layout_width="0dp"
android:layout_weight="1.0"
android:layout_height="fill_parent"
android:padding="10dp"
style="@style/ButtonText"
android:background="@drawable/button_right_green" />
</LinearLayout>
```
The 'button_left_green' drawable:
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/button_left_green_pressed"
android:state_pressed="true" />
<item android:drawable="@drawable/button_left_green_focused"
android:state_focused="true" />
<item android:drawable="@drawable/button_left_green_default" />
</selector>
```
And, for example, the 'button_left_green_default' drawable:
```
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/shadow" />
<corners
android:radius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="0dp"
android:bottomLeftRadius="5dp"
android:bottomRightRadius="0dp" />
</shape>
</item>
<item
android:bottom="19dp"
android:top="1dp"
android:left="1dp"
android:right="1dp" >
<shape android:shape="rectangle">
<gradient
android:startColor="@color/button_left_green_top_gradient_start"
android:endColor="@color/button_left_green_top_gradient_end"
android:angle="270" />
<corners
android:radius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="0dp"
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp" />
</shape>
</item>
<item
android:top="19dp"
android:bottom="1dp"
android:left="1dp"
android:right="1dp" >
<shape android:shape="rectangle" >
<solid android:color="@color/button_left_green_bottom_gradient" />
<corners
android:radius="5dp"
android:topLeftRadius="0dp"
android:topRightRadius="0dp"
android:bottomLeftRadius="5dp"
android:bottomRightRadius="0dp" />
</shape>
</item>
</layer-list>
```
So, after all that, I got the image in Figure 2:

After double-checking the definition of the bottom corners, I was convinced I was crazy until I found the known issue: [http://code.google.com/p/android/issues/detail?id=9161](http://code.google.com/p/android/issues/detail?id=9161)
I'd rather not just swap them, 'cause then if/when the issue is fixed, the buttons will be broken in newer versions.
One idea I had was to leave the actual buttons as regular rectangles (i.e. no corner radii) and wrapping both buttons with a rounded rectangle. I added a background drawable to the LinearLayout which had rounded corners, but the button corners overlapped the edge of the LinearLayout rounded edge (see Figure 3).

How can I keep the button's background within the bounds of its parent's background drawable? Or do you have any other suggestions on how to work around the bug?
|
How can I work around Android issue 9161, where bottomRightRadius and bottomLeftRadius are swapped?
|
CC BY-SA 3.0
| 0 |
2011-05-14T17:00:34.043
|
2014-07-15T16:42:01.160
|
2014-07-15T16:42:01.160
| 85,661 | 680,542 |
[
"android",
"rounded-corners"
] |
6,003,449 | 1 | 8,150,274 | null | 15 | 1,032 |
I am trying to see how new C# 5.0 asynchronous ([CTP](http://msdn.microsoft.com/en-gb/vstudio/async)) features will work. I also use ReSharper. But because it is only a CTP, ReSharper [doesn't support](http://youtrack.jetbrains.net/issue/RSRP-196518#tab=Comments) new keywords (/) and highlights them as errors.
This is how it looks (code from CTP samples)

UPDATE
I tried Early Access Program ReSharper build 6.0.2151.53 (10 May 2011) with no luck. The issue is still there so if you want it to be resolved give your vote [here](http://youtrack.jetbrains.net/issue/RSRP-196518?projectKey=RSRP) (following Peter's answer).
|
Can Resharper skip async/await keywords?
|
CC BY-SA 3.0
| 0 |
2011-05-14T17:10:00.240
|
2015-03-10T06:58:54.100
|
2015-03-10T06:58:54.100
| 254,882 | 706,456 |
[
"c#",
"resharper",
"async-ctp"
] |
6,003,796 | 1 | 6,003,999 | null | 1 | 1,207 |
I have the current Combo Box XAML:
```
<ComboBox Height="23" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=showDomainDataSource, Path=Data}" Margin="583,8,0,0" x:Name="showsComboBox" VerticalAlignment="Top" Width="233" SelectionChanged="showsComboBox_SelectionChanged" IsSynchronizedWithCurrentItem="False">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=showName, Converter={StaticResource distinctConverter}}" x:Name="showsComboxshowName" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
```
And I have the class - DistinctConverter:
```
public class DistinctConverter : IValueConverter
{
public object Convert(
object value, Type targetType, object parameter, CultureInfo culture)
{
var values = value as IEnumerable;
if (values == null)
return null;
return values.Cast<object>().Distinct();
}
public object ConvertBack(
object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
```
I have added the following to my resources:
```
<convert:DistinctConverter x:Key="distinctConverter" />
```
The problem is, I'm getting the error in my combo box:

Can anyone help me with whatever I'm doing wrong here.
|
Distinct Values in WPF Combobox Error
|
CC BY-SA 3.0
| null |
2011-05-14T18:01:39.853
|
2011-05-15T12:36:40.057
| null | null | 251,671 |
[
"c#",
"silverlight",
"xaml",
"combobox",
"ienumerable"
] |
6,004,010 | 1 | 17,013,239 | null | 9 | 412 |
I want to write a CGI script that accepts a posix path as a string, and returns a png representing it. Eg:
---
If the script is sent the string
,
it will return the following png file: 
---
An example based in any scripting platform that comes bundled with the Mac is fine by me (Python, Perl, AppleScript, BASH). I might not know it, but I can muddle through to get an idea of what I need to do.
I think what I'm looking for is a way to generate an NSPathCell-style widget, and dump its contents into an image file
|
webserver replies to ?q="/path/to/file" with a "path bar" png
|
CC BY-SA 3.0
| 0 |
2011-05-14T18:37:20.290
|
2016-10-13T21:05:26.867
|
2011-11-19T20:16:55.480
| 4,939 | 4,939 |
[
"cocoa",
"macos",
"scripting"
] |
6,004,032 | 1 | 6,080,526 | null | 4 | 10,556 |
I'm constantly getting the following Error: 
after submitting my app to the App Store. I've tried everything recommended in Apple's mail and also the answers to posts I found on Stackoverflow. Nevertheless I'm still getting this message. What could be my problem?
What I've done so far:
- - - - -
Is there something I have missed? I'm going nuts after my 20.-something submission :(
|
Invalid Binary Error after App Store submission
|
CC BY-SA 3.0
| 0 |
2011-05-14T18:39:16.637
|
2019-04-24T14:45:59.090
|
2011-05-21T08:11:53.760
| 704,149 | 704,149 |
[
"iphone",
"objective-c",
"app-store"
] |
6,004,147 | 1 | 6,009,971 | null | 3 | 4,255 |
I have created an ERD (Entity-Relationship Diagram) using ArgoUML and I wish to create two operations within a class which both have a `void` return type. However, I am only able to create one operation which returns a `void` type.
For example:

I am able to set the return type of `bookInitial()` to `void` but whenever I try to set the return type of `bookFollowUp()` to `void`, the option is not available.
Having checked with other classes in the project, it would appear that each class only allows one object to have a `void` return type - is this true for all classes?
Is there is there a way to assign the `void` return type to more than one operation?
Thank you.
|
ArgoUML Operations
|
CC BY-SA 3.0
| 0 |
2011-05-14T19:01:32.610
|
2011-06-20T02:59:28.853
|
2011-06-20T02:59:28.853
| 667,301 | 636,987 |
[
"uml",
"argouml"
] |
6,004,185 | 1 | 6,004,243 | null | 1 | 927 |
I have windows application I wrote.
I installed it on virtual server (vmware) that holds windows server 2008 and for some reason the application getting bigger and bigger. I used perfmon in order to see maybe there is a memory leak - but as I understand, there isn't:

Here is the proccess in task manager:

There are also two proccesses that use a lot of memory and cpu but are steady and not growing like SimeserManager.exe.
The memory growing slows the surfing on sited that this server holds.
Before this week I used the my application on phizical server with windows server 2003 and there were no problem with surfing. I can't restore the situtaion in the phizical machine since I don't have it anymore, but I don't believe there was memory error when using the phizical server.
The application is written in c# .net using visual studio 2010.
What can be the problem?
Where can I get some clues?
I get ANTS memory profiler and tried to seek for the problem. I created memory snapshots and here is the results:

Now I'm really lost.
I tryed the standart filters but didn't manage to find a clue for the problem. In the image you can see there is increase in the private bytes. Does that sais there is a memory leak?
Can anyone give me some clues how to continue?
Thanks!
|
performance problem - growing memory and cpu usage
|
CC BY-SA 3.0
| null |
2011-05-14T19:08:15.763
|
2011-05-15T08:06:20.847
|
2011-05-15T08:06:20.847
| 289,246 | 289,246 |
[
"performance",
"memory",
"memory-leaks",
"cpu"
] |
6,004,256 | 1 | 6,004,330 | null | 5 | 3,065 |
>
[How to hide text field in Html File Upload](https://stackoverflow.com/questions/2034826/how-to-hide-text-field-in-html-file-upload)
I'm setting up an AJAX image uploader that will allow a user to choose a file, preview it with AJAX, and then click a submit button to save their choice.
Due to the way my AJAX uploader works, it always says "no file chosen" even after the user has selected and is previewing an image. I don't want to hide the button in case the user wants to try again. I know I could use some javascript to toggle between a 'choose file' and a 'select another' button or something similar, but I'd prefer to just keep the original button so the user doesn't have to click a bunch of different buttons.
Edit:
I thought my question would be obvious, I guess it was not since I'm getting close votes...

|
how to hide file location in <input type='file'>?
|
CC BY-SA 3.0
| 0 |
2011-05-14T19:19:59.397
|
2011-05-14T19:32:48.480
|
2017-05-23T12:09:35.997
| -1 | 153,110 |
[
"html",
"css",
"input",
"input-type-file"
] |
6,004,439 | 1 | 6,006,188 | null | 4 | 853 |
I dont like to ask too many questions in relation to the appearance of components, but these days appearance in Applications seems just as important.
Anyway, please see the below images:

Both are using the TActionManager and TActionMainMenuBar to create my main menu. The menu in the left of the image is using the Platform Default Style, the menu on the right is using the XP style defined by my TActionManager.
Notice how when the left menu is highlighted, the glyph remains the same which is perfect.
Now look at the XP style menu on the right, the glyph draws a drop shadow, pops out slightly and you can see the transparency makes the glyph appear slightly odd.
I want to enable the XP style for my UI, but the way the glyphs are painted I do not like. I also want to change my TToolbar to a TActionToolBar and apply the same XP style, but this will render the glyphs the same too.
How can I make the XP style menu defined in the TActionManager, not render the glyphs like this?
Thanks.
This is now the result, having applied some of the techniques from the answers below:

Craig.
|
XP Style Glyph annoyance in ActionBars
|
CC BY-SA 3.0
| 0 |
2011-05-14T19:58:37.587
|
2011-05-15T13:20:47.620
|
2011-05-15T13:20:47.620
| null | null |
[
"delphi",
"glyph"
] |
6,004,639 | 1 | 6,481,956 | null | 3 | 1,371 |
My iPad app uses a popover to perform some searching. The search results are handled using a UISearchDisplayController, and I am having some trouble removing some little graphical artefacts.
My popover starts out looking like this:

When you click inside the search bar, the popover expands (animated) to:

All good so far... typing in the search field overlays a new table view showing the results of your search term.
But if you don't type anything into the search field, the overlay stays translucent, as above. The problem then comes when you click the cancel button next to the search field. A visual artefact appears at the bottom of the table view: an area the same height as one of the table view cells goes completely clear immediately, while the rest of the overlay animates to 0 alpha. The screenshot below is as close to the start of the animation I could get:

The popover also resizes to the original size in my case, although the artefact remains even if there is no resizing.
Given that all the important functionality of the search is handled by the UISearchDisplayController, I'm not sure what to change to solve this problem. Any ideas?
|
UISearchDisplayController inside popover - bad animation on cancelling search
|
CC BY-SA 3.0
| null |
2011-05-14T20:35:24.340
|
2011-06-26T03:27:12.140
|
2011-05-14T20:56:26.420
| 429,427 | 429,427 |
[
"ios",
"ipad",
"uisearchbar",
"uipopovercontroller",
"uisearchdisplaycontroller"
] |
6,004,792 | 1 | 6,004,847 | null | 33 | 33,328 |
For example, notice how the text isn't quite in the vertical center of the ComboBox.

Here's my XAML:
```
<Window x:Class="_24HoursBook.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="450" Width="350" MinHeight="450" MinWidth="350">
<Grid ShowGridLines="True">
<Grid.RowDefinitions>
<RowDefinition Height="0.15*" />
<RowDefinition />
</Grid.RowDefinitions>
<Image Grid.Row="0" Stretch="Fill" Source="Image/topBarBg.png" />
<StackPanel Orientation="Horizontal" Grid.Row="0">
<TextBlock Text="Platform"
Foreground="White"
FontFamily="Georgia"
FontSize="15"
Margin="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<ComboBox x:Name="cmbPlatform"
Margin="10"
FontFamily="Georgia"
FontSize="15"
MinHeight="30"
MinWidth="140"
VerticalAlignment="Center">
<ComboBoxItem>All Platforms</ComboBoxItem>
<ComboBoxItem>Playstation 3</ComboBoxItem>
<ComboBoxItem>XBox 360</ComboBoxItem>
<ComboBoxItem>Wii</ComboBoxItem>
<ComboBoxItem>PSP</ComboBoxItem>
<ComboBoxItem>DS</ComboBoxItem>
</ComboBox>
</StackPanel>
<Image Grid.Row="0" Source="Image/about.png"
Height="16" HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="0 0 10 0" />
<ListView Grid.Row="1" Background="#343434">
</ListView>
</Grid>
</Window>
```
|
How can I center a ComboBox's content vertically?
|
CC BY-SA 4.0
| 0 |
2011-05-14T21:09:01.060
|
2019-01-15T01:48:06.110
|
2018-10-06T09:27:49.077
| 1,506,454 | 699,978 |
[
"wpf",
"xaml",
"combobox"
] |
6,004,894 | 1 | 6,007,689 | null | 5 | 2,618 |
I need to generate and store a lot of small (1-10KB) PNG images (>10 millions) to the database.
The only thing I care is images/s throughput. For now I know two ways of storing GD image object to the database:
### Use output buffer:
```
ob_start();
imagepng($image);
$imageData = ob_get_contents();
ob_end_clean();
```
### Use temporary file (tmpfs/ramfs):
```
$tmpFilePath = '/dev/shm/file_000.png';
imagepng($image, $tmpFilePath);
$imageData = file_get_contents($thumbnail);
```
### Update. There is a 3rd method: Use PHP memory stream:
```
// PHP streams are NOT supported
$tmpFilePath = 'php://memory';
imagepng($image, $tmpFilePath);
$imageData = file_get_contents($tmpFilePath);
```
My question is are there any other ways to write image to DB? Any pros/cons of each method.
Maybe it is worth to write a custom stream, which writes data to DB directly?
: Storing images to filesystem is NOT an option.
## Benchmark results:

|
Efficient way to store images to DB from PHP GD image object
|
CC BY-SA 3.0
| 0 |
2011-05-14T21:27:15.273
|
2011-09-09T13:31:30.477
|
2011-09-09T13:31:30.477
| 764,846 | 544,610 |
[
"php",
"gd"
] |
6,004,940 | 1 | 6,004,968 | null | 2 | 391 |
I'm taking a practice test for the exam 70-536. Below is a screenshot. The yellow highlighted is what the exam says is the correct answer. The one with the radio button selected is the answer I thought it was.
Note the explanation at the bottom which includes the statement:
> To create a `StreamWriter` object, you must use an existing `Stream` object, such as an instance of `FileStream`.
I think the answer I chose is the most efficient use and I think the statement made in the explanation is wrong. Clearly, because the code in my selected answer worked fine.
Who's right????

|
MS Exam 70-536 Prep: Efficient use of TextWriter - The practice test answer is wrong (I think)!
|
CC BY-SA 3.0
| null |
2011-05-14T21:36:15.450
|
2013-09-13T12:56:51.113
|
2013-09-13T12:56:51.113
| 334,849 | 568,289 |
[
".net",
"textwriter"
] |
6,004,945 | 1 | 6,041,576 | null | 2 | 762 |
I'm currently learning HLSL with XNA, I figured the best place to start after tutorials would be some simple 2D shaders. I'm attempting to implement a simple lighting shader in 2D.
I draw the scene without shadows to a rendertarget, swap my rendertarget to a shadowmap, draw my light(each individually) onto the shadowmap via alpha channel, swap my rendertarget back to default and render the scene then the shadows on top.
The alpha of the light changes depending on the distance of the current pixel and the point of the light, this is all working fine for me except when I render the scene, if two lights overlap it causes a nasty blending issue.

I'm using alphablend when I draw on the shadowmap, and when I draw the shadowmap to the scene.
Am I just using the wrong blending settings here? I don't know much about blendstates.
Sorry if the question was vague.
|
Issue with alpha in 2d lighting shader in XNA 4.0
|
CC BY-SA 3.0
| 0 |
2011-05-14T21:37:49.640
|
2011-05-19T13:06:03.643
|
2011-05-14T23:00:48.193
| 400,223 | 754,018 |
[
"c#",
"xna",
"shader",
"hlsl"
] |
6,004,959 | 1 | null | null | 5 | 1,069 |
I am programming a webservice that queries different databases for prices. The web service writes a new `<Result>` node into the `XML` page that is given back when calling `http://service.com/xml.php?search=carpet` as soon as it has results from the database. Unfortunately the queries sent to the various databases take extremely long (up to 30 seconds total). Obviously I dont want the user to wait for 30 seconds, then give back the XML and build a table with this data; I want it to dynamically load.
Let's assume a user searches for , the databases will give back multiple products such as and . has two Distributors that are dynamically loaded into the table of . only has one distributor.
I need a price comparison Table like the one shown in the below picture that dynamically adds a new table if a new article is given back and that adds a new line to the table if a new distributor is found for a product.
Do you have suggestions on how to accomplish this? How do I receive only the data that has changed from my xml.php?

```
<?xml version="1.0" encoding="UTF-8"?>
<Results>
<!--Given back within 5 seconds-->
<Result>
<ArticleNumber>Red Carpet</ArticleNumber>
<Manufacturer>Big Carpet Inc</Manufacturer>
<Distributor>Amazonas</Distributor>
<Prices>
<Pricebreak>
<Quantity>1</Quantity>
<Price>$ 1.20</Price>
</Pricebreak>
<Pricebreak>
<Quantity>10</Quantity>
<Price>$ 1.00</Price>
</Pricebreak>
<Pricebreak>
<Quantity>100</Quantity>
<Price>$ 0.50</Price>
</Pricebreak>
</Prices>
</Result>
<!--Given back within another 10 seconds-->
<Result>
<ArticleNumber>Red Carpet</ArticleNumber>
<Manufacturer>Big Carpet Inc</Manufacturer>
<Distributor>Veritas</Distributor>
<Prices>
<Pricebreak>
<Quantity>1</Quantity>
<Price>$ 0.90</Price>
</Pricebreak>
<Pricebreak>
<Quantity>5</Quantity>
<Price>$ 0.70</Price>
</Pricebreak>
</Prices>
</Result>
<!--Given back within another 5 seconds-->
<Result>
<ArticleNumber>Yellow Carpet</ArticleNumber>
<Manufacturer>Smallrug Corporation</Manufacturer>
<Distributor>Veritas</Distributor>
<Prices>
<Pricebreak>
<Quantity>1</Quantity>
<Price>$ 3.90</Price>
</Pricebreak>
<Pricebreak>
<Quantity>10</Quantity>
<Price>$ 2.70</Price>
</Pricebreak>
</Prices>
</Result>
</Results>
```
|
Dynamically add new tables and rows querying XML source with Javascript and PHP
|
CC BY-SA 3.0
| 0 |
2011-05-14T21:40:43.453
|
2011-06-19T03:22:52.567
|
2011-05-14T21:50:31.507
| 420,515 | 420,515 |
[
"php",
"javascript",
"xml",
"ajax",
"xmlhttprequest"
] |
6,004,997 | 1 | null | null | 17 | 7,152 |
I have a `SplitContainer` control, and the `Splitter` in the middle is very ugly. By setting the `BackColor` of the `SplitContainer` to (insert color here), then setting the `BackColor` of `Panel1` and `Panel2` to white, I can have my splitter looking nice. But by default, Windows puts the selection mark over the Splitter, even before it's selected.
How can I make sure that the selection mark never shows on the `Splitter`?

|
Removing Windows' ugly Selection marker thing from Splitter in SpitContainer Control
|
CC BY-SA 3.0
| 0 |
2011-05-14T21:49:16.037
|
2017-03-07T06:53:29.610
|
2016-02-02T16:08:10.960
| 4,631,427 | 696,091 |
[
"c#",
".net",
"winforms",
"controls",
"splitcontainer"
] |
6,005,054 | 1 | null | null | 2 | 720 |
Very often (every time really) after I use the command `git log` my terminal becomes unresponsive to further input, this is on OSX. Is there a command that I don't know about that will make the terminal active again instead of just quitting the terminal and starting over?

|
Why does terminal become unresponsive after I use certain git commands?
|
CC BY-SA 3.0
| null |
2011-05-14T22:02:15.760
|
2011-05-14T22:06:35.743
| null | null | 259,912 |
[
"git",
"terminal"
] |
6,004,987 | 1 | 6,005,196 | null | 0 | 1,747 |
My application is fetching data from a Xml file on a webpage. That date is placed in a listView. In the XML file there is a link to a image for every item. I need some help figuring out the easiest way to get that image from the xml file into the listView together with the text.
In my code right now i have just placed a static image in the android:src ="" in the layout file.
Screenshot:

xmlfile:
[http://roskilde-festival.dk/typo3conf/ext/tcpageheaderobjects/xml/bandobjects_251_uk.xml](http://roskilde-festival.dk/typo3conf/ext/tcpageheaderobjects/xml/bandobjects_251_uk.xml)
MainClass:
```
package com.bandreminder;
import java.util.ArrayList;
import java.util.HashMap;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import android.app.ListActivity;
import android.content.Context;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
public class bandR extends ListActivity {
private ConnectivityManager connMgr;
private android.net.NetworkInfo network_info;
private boolean blnNetworkAccess=false;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listplaceholder);
connMgr = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);
network_info = connMgr.getActiveNetworkInfo();
if(network_info != null && network_info.isConnectedOrConnecting()) {
blnNetworkAccess = true;
}
if(blnNetworkAccess) {
fetchData();
}
else {
Toast.makeText(bandR.this, "No Internet connection, please enable", Toast.LENGTH_LONG).show();
}
}
public void onResume(){
super.onResume();
if(network_info != null && network_info.isConnectedOrConnecting()) {
Log.w("resume", ""+network_info);
}
else {
Toast.makeText(bandR.this, "No Internet connection, please enable", Toast.LENGTH_LONG).show();
}
}
public void onPause(){
super.onPause();
blnNetworkAccess = false;
Log.w("onPause", "test");
}
private void fetchData() {
ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();
Integer numResults;
String xml = XmlHandler.getXML();
Document doc = XmlHandler.XMLfromString(xml);
numResults = XmlHandler.numResults(doc);
if((numResults <= 0)){
Toast.makeText(bandR.this, "No Bands found", Toast.LENGTH_LONG).show();
finish();
}
NodeList nodes = doc.getElementsByTagName("item");
for (int i = 0; i < nodes.getLength(); i++) {
HashMap<String, String> map = new HashMap<String, String>();
Element e = (Element)nodes.item(i);
map.put("artistName", "Artist Name: "+ XmlHandler.getValue(e, "artistName"));
map.put("country", "Country: " + XmlHandler.getValue(e, "country"));
map.put("scene", "Scene: " + XmlHandler.getValue(e, "scene"));
map.put("tidspunkt", "Tidspunkt: " + XmlHandler.getValue(e, "tidspunkt"));
mylist.add(map);
}
ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.main,
new String[] { "artistName", "country", "scene","tidspunkt" },
new int[] { R.id.item_artistname, R.id.item_country,R.id.scene ,R.id.tidspunkt});
setListAdapter(adapter);
final ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
@SuppressWarnings("unchecked")
HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position);
Toast.makeText(bandR.this, "artistName '" + o.get("artistName") + "' was clicked.", Toast.LENGTH_LONG).show();
}
});
}
}
```
XMLHandler Class:
```
package com.bandreminder;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.URL;
import java.net.URLConnection;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import android.util.Log;
public class XmlHandler{
public static boolean connected;
public boolean getConnected(){
return connected;
}
public final static Document XMLfromString(String xml){
Document doc = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(xml));
doc = db.parse(is);
} catch (ParserConfigurationException e) {
System.out.println("XML parse error: " + e.getMessage());
return null;
} catch (SAXException e) {
System.out.println("Wrong XML file structure: " + e.getMessage());
return null;
} catch (IOException e) {
System.out.println("I/O exeption: " + e.getMessage());
return null;
}
return doc;
}
/** Returns element value
* @param elem element (it is XML tag)
* @return Element value otherwise empty String
*/
public final static String getElementValue( Node elem ) {
Node kid = null;
if( elem != null){
if (elem.hasChildNodes()){
for( kid = elem.getFirstChild(); kid != null; kid = kid.getNextSibling() ){
if( kid.getNodeType() == Node.TEXT_NODE ){
return kid.getNodeValue();
}
}
}
else
return elem.getNodeValue();
}
return "";
}
public static String getXML(){
;
String line = null;
StringBuilder result = new StringBuilder();
try {
// Send data
URL url = new URL("http://roskilde-festival.dk/typo3conf/ext/tcpageheaderobjects/xml/bandobjects_251_uk.xml");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
while((line = rd.readLine()) != null){
result.append(line);
}
//Close
rd.close();
} catch (Exception e){
connected = false;
}
return result.toString();
}
public static int numResults(Document doc){
Node results = doc.getDocumentElement();
int res = -1;
try{
res += results.getChildNodes().getLength();
}catch(Exception e ){
Log.w("Exception numresults", ""+e.getMessage());
res = -1;
}
Log.w("numres", ""+String.valueOf(res));
return res-1;
}
public static String getValue(Element item, String str) {
NodeList n = item.getElementsByTagName(str);
Log.w("element", ""+n.item(0).getTextContent());
//return XmlHandler.getElementValue(n.item(0));
return n.item(0).getTextContent();
}
}
```
Layout:
listplaceholder:
```
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawSelectorOnTop="false" />
<TextView
android:id="@id/android:empty"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="No data"/>
</LinearLayout>
```
main layout:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="7dp"
android:id="@+id/layout"
>
<TextView
android:id="@+id/item_artistname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:padding="2dp"
android:textSize="15dp" />
<TextView
android:id="@+id/item_country"
android:layout_below="@id/item_artistname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:textSize="13dp" />
<TextView
android:id="@+id/scene"
android:layout_below="@id/item_country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:textSize="13dp" />
<TextView
android:id="@+id/tidspunkt"
android:layout_below="@id/scene"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="2dp"
android:textSize="13dp" />
<ImageView
android:id="@+id/img"
android:layout_below="@id/item_artistname"
android:layout_alignParentRight="true"
android:src="@drawable/abe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
```
|
Help with mixing text and Image ind a listView
|
CC BY-SA 3.0
| null |
2011-05-14T21:48:13.883
|
2011-05-14T22:29:41.713
| null | null | 453,562 |
[
"android",
"image",
"listview",
"android-listview",
"android-imageview"
] |
6,005,639 | 1 | 6,005,748 | null | 3 | 2,681 |
Here's the XAML:
```
<ListBox Grid.Row="1" x:Name="lstGames" Background="#343434" >
<ListBox.ItemTemplate>
<DataTemplate>
<Grid ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition MaxWidth="0.5*"/> //<-----------HERE!
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Image Grid.Row="0" Grid.Column="0" Source="{Binding ImageUrl}" Stretch="UniformToFill"/>
<StackPanel Grid.Row="0" Grid.Column="1">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Title:" />
<TextBlock Text="{Binding Title}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Release Date:" />
<TextBlock Text="{Binding ReleaseDate}" />
</StackPanel>
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
```
All I want is for the first column to at most be around 35% of the total width of the window. I was under the impression that this notation was allowed, but something is wrong and I'm getting that exception fired.
Any suggestions?
If I change it to only `Width="0.5*"` then it compiles and runs, but still doesn't give the pictures (the columns) a uniform width:

|
Setting a relative column width in XAML. '0.5*' string cannot be converted to Length
|
CC BY-SA 3.0
| null |
2011-05-15T00:13:47.167
|
2011-05-15T00:42:29.903
| null | null | 699,978 |
[
"wpf",
"xaml",
"listbox",
"width"
] |
6,006,058 | 1 | 6,009,578 | null | 2 | 6,698 |
Notice how the textbox expands to the right until it has enough horizontal space to fit the content? Well I'd like it to not expand and fit the text with the space it has in the window.

If the windows expands, then the Grid.Column it's in will expand, but the textbox itself should expand to fit. Simple enough?
Any suggestions? This is my first foray into WPF and so far it's been pretty sleek.
Edit: Here's my XAML markup:
```
<Window x:Class="GameLenseWpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="450" Width="350" MinHeight="450" MinWidth="350">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.15*" />
<RowDefinition />
</Grid.RowDefinitions>
<Image Grid.Row="0" Stretch="Fill" Source="Image/topBarBg.png" />
<StackPanel Orientation="Horizontal" Grid.Row="0">
<TextBlock Text="Platform"
Foreground="White"
FontFamily="Georgia"
FontSize="15"
Margin="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<ComboBox x:Name="cmbPlatform"
Margin="10"
FontFamily="Georgia"
FontSize="15"
MinHeight="30"
MinWidth="140"
VerticalAlignment="Center"
VerticalContentAlignment="Center" SelectionChanged="cmbPlatform_SelectionChanged">
<ComboBoxItem>All Platforms</ComboBoxItem>
<ComboBoxItem>Playstation 3</ComboBoxItem>
<ComboBoxItem>XBox 360</ComboBoxItem>
<ComboBoxItem>Wii</ComboBoxItem>
<ComboBoxItem>PSP</ComboBoxItem>
<ComboBoxItem>DS</ComboBoxItem>
</ComboBox>
</StackPanel>
<Image x:Name="imgAbout" Grid.Row="0" Source="Image/about.png"
Height="16" HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="0 0 10 0" />
<ListBox Grid.Row="1" x:Name="lstGames" Background="#343434" Padding="5">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Height="120" Margin="0 10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Border BorderBrush="#202020" BorderThickness="5" CornerRadius="4" Panel.ZIndex="0">
<Image Grid.Row="0" Grid.Column="0" Source="{Binding ImageUrl}" Stretch="Fill"/>
</Border>
<StackPanel Grid.Row="0" Grid.Column="1" Margin="12 0 0 0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Title:" FontFamily="Arial" Foreground="White"/>
<TextBlock Text="{Binding Title}" FontFamily="Arial" Foreground="White" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Release Date:" FontFamily="Arial" Foreground="White" />
<TextBlock Text="{Binding ReleaseDate}" FontFamily="Arial" Foreground="White" />
</StackPanel>
<TextBlock Text="Synopsis" FontFamily="Arial" Foreground="White" />
<TextBox Background="#454545" Text="{Binding Synopsis}" MinHeight="76" />
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Window>
```
|
Making a WPF TextBox be only as wide as the room it has but expand when the space expands?
|
CC BY-SA 3.0
| null |
2011-05-15T02:09:32.433
|
2011-05-15T16:09:01.577
|
2011-05-15T02:21:07.523
| 699,978 | 699,978 |
[
"wpf",
"xaml",
"textbox",
"width"
] |
6,006,255 | 1 | 6,006,435 | null | 0 | 187 |
I have this .png:

I want to crop a 16x16 square and save it as another .png with some name, then I need to continue with the next 16 pixels (to the right and then to the next row) until I complete the entire image, so I will have a total of 256 .png with the individual sprites from the original image.
Is this possible with GD? Am I wasting my time? Is there any other way to do this than taking them with Photoshop and saving them individualy like a crazy?
Thanks :)
|
Cropping images and saving them
|
CC BY-SA 3.0
| null |
2011-05-15T03:15:05.443
|
2011-05-15T04:13:11.757
| null | null | 691,220 |
[
"php",
"image",
"gd"
] |
6,006,340 | 1 | 6,006,355 | null | 0 | 3,016 |
I'm using Firebug (for the first time) on Firefox 3.6.8 on MacOS X 10.6.7. The Firebug documentation says that you can set a breakpoint just by clicking on the source line. That's not happening for me -- it's like the source window doesn't have focus or something.
Here's the browser screen duump (below). What do I need to do to set breakpoints and debug a simple local script? 
|
How to set breakpoints using firebug
|
CC BY-SA 3.0
| null |
2011-05-15T03:40:47.847
|
2011-05-15T03:45:03.400
| null | null | 253,661 |
[
"firebug",
"firefox3.6",
"breakpoints"
] |
6,006,406 | 1 | null | null | 12 | 1,193 |
I have a booking engine which is pretty sluggish in IE7. It's ajaxified and hash/window onchange based. There are 5 total steps. The main issue I'm having is step 2 is uber slow in IE.
When a user lands on step 2, an ajax request is made to pull in data with web services in order to display hotel rooms. The hotel rooms are divided by the main room type and more specific types inside. The JS functionality that gets applied to the hotel rooms consist of:
- - - - -
All of this causes the famous:

I've googled and landed on [this](https://stackoverflow.com/questions/5667456/stop-running-this-script-ie7), [this](https://stackoverflow.com/questions/1930691/stop-running-this-script-ie-for-large-ajax-requests), and [this](https://stackoverflow.com/questions/212550/a-script-on-this-page-is-causing-ie-to-run-slowly).
So obviously the cause is that there are too many script statements executing sequentially within a specific amount of time in IE.
I basically need to refactor my code and optimize it such that there are delays in between function invocations.
The way I'm injecting the HTML after doing the ajax request is:
```
734 $( o.html ).appendTo( el )
```
`o.html` is a reference to the JSON objects `html` property which is derived from [here](https://mlb.montagehotels.com/new/ajax/?step=2).
Then, the code below runs:
```
setTimeout(function () {
$('#roomz .room-accordion').each(function () {
$(this).accordion({
header: 'h2.new-heading',
autoheight: false,
clearStyle: true,
collapsible: true,
change: function (event, ui) {
window.ui = ui;
// if it hasnt been quickflipped/subnest accordioned, do it
if (!$(ui.newContent).data('enabled')) {
$('.room-rates', ui.newContent).each(function () {
$(this).accordion({
header: 'h4.rate-name',
autoheight: false,
active: 0,
clearStyle: true
});
//if (!$.browser.msie)
$(this).jScrollPane();
})
$('.room-image', ui.newContent).quickFlip({
vvertical: true
//easing:'easeInBounce'
//easing:'easeInSine'
});
$('.back-copy-inner', ui.newContent).jScrollPane({
verticalDragMaxHeight: 131
});
$(ui.newContent).data('enabled', true);
}
}
})
var el = this;
setTimeout(function () {
$('.back-copy-inner:eq(0)', el).jScrollPane({
verticalDragMaxHeight: 131
});
}, 500);
$('.room-rates:eq(0)', this).each(function () {
$(this).accordion({
header: 'h4.rate-name',
autoheight: false,
active: 0,
clearStyle: true
});
var el = this;
setTimeout(function () {
//if (!$.browser.msie)
$(el).jScrollPane();
}, 50);
});
$('.room-image:eq(0)', this).quickFlip({
vvertical: true
//easing:'easeInBounce'
//easing:'easeInSine'
});
$('.room:eq(0)', this).data('enabled', true);
});
}, 20);
```
My first version of the code basically applied the quickflip and scrollpanes to room whether it was hidden in the accordion or not. The refactored version ( live/current one ) applies it to the very first room that's active in the accordion, and when another is clicked on through the accordion, I apply the quickflip and scrollpane to it.
I added a setTimeout around the entire thing, because this happens after the HTML gets injected. I have `setTimeout`s inside as well.
It seems like it's still too slow.
My ideas for refactoring it again consist of:
1. instead of doing an .each on .room accordion, apply a repeating operation to force a delay in between each iteration like this?
2. optimize and minify the HTML returned by the ajax even more - I have already done lots of optimization, killed whitespace, dont show HTML comments, etc..
3. Enabling Gzip
4. Doing lazy loading on the images so that only the visible accordion content images show and others are blank.gif until you activate them through the accordion
5. Instead of returning the HTML and dumping it, return only relevant data with NO HTML and instead build the HTML with a templating engine?!
If anyone can offer opinions on my ideas for refactoring in terms of which ones would produce the best results, that'd be great too.
- [this](https://mlb.montagehotels.com/new/#step-2)- [here](https://mlb.montagehotels.com/new/js/new.js)- `new.js`- [this page](https://mlb.montagehotels.com/new/ajax/?step=2)
PS - not supporting IE6
: I put a delay between iteration of `.each` and it's still uber slow. I think the custom scrollbar is the leading cause. Ugh.
: The [live code](https://mlb.montagehotels.com/new/js/new.js) is a spaghetti of setTimeouts. I tried to lazy load the scroll pane but its still too sluggish for IE.
|
What can I do to optimize my ajax application for IE7/IE8 in order to avoid "Stop running this script"?
|
CC BY-SA 3.0
| null |
2011-05-15T04:04:48.940
|
2014-08-12T12:34:24.310
|
2017-05-23T12:13:39.697
| -1 | 145,190 |
[
"javascript",
"internet-explorer",
"optimization",
"dom",
"refactoring"
] |
6,006,543 | 1 | 6,007,156 | null | 1 | 122 |
In Xcode4's Organizer Repository some of the icons can be different colors. What do they denote. For example what does this yellow dot mean?

|
What do the colored icons in Xcodes' Orginizer Repository denote?
|
CC BY-SA 3.0
| null |
2011-05-15T04:45:46.120
|
2011-05-15T07:44:32.737
| null | null | 259,912 |
[
"git",
"xcode4"
] |
6,006,717 | 1 | 6,007,024 | null | 0 | 513 |
I am trying to achieve this in an android app layout.

So far I have managed to get the buttons the way I wish, but I am having trouble working out how I am going to implement the divider and the layout on the right side of it.
Here is what I have so far:
```
<?xml version="1.0" encoding="utf-8"?>
<!-- this is main activity's layout. a main menu of sorts. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:gravity="center" android:background="@drawable/background">
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:id="@+id/layout_maintest2_relativelayoutleft">
<Button android:text="@string/string_main_NewCalculation" android:drawableLeft="@drawable/calculator5" android:onClick="onClickButton_NewCalculation" android:id="@+id/button_main_NewCalculation" android:layout_width="300px" android:layout_height="90px" android:drawablePadding="0px"></Button>
<Button android:text="@string/string_main_Help" android:drawableLeft="@drawable/question" android:onClick="onClickButton_Help" android:id="@+id/button_main_Help" android:layout_width="150px" android:layout_height="90px" android:drawablePadding="0px" android:layout_below="@id/button_main_NewCalculation"></Button>
<Button android:text="@string/string_main_Share" android:drawableLeft="@drawable/share" android:onClick="onClickButton_Share" android:id="@+id/button_main_Share" android:layout_width="150px" android:layout_height="90px" android:drawablePadding="0px" android:layout_below="@id/button_main_NewCalculation" android:layout_toRightOf="@id/button_main_Help"></Button>
</RelativeLayout>
<RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/layout_maintest2_relativelayoutright" android:layout_toRightOf="@id/layout_maintest2_relativelayoutleft" android:layout_alignTop="@id/layout_maintest2_relativelayoutleft">
<TextView android:layout_width="wrap_content" android:textSize="24px" android:textStyle="bold" android:layout_height="match_parent" android:id="@+id/textView_calculator_CalculatorTitle" android:text="@string/string_calculator_CalculatorTitle"></TextView>
</RelativeLayout>
</LinearLayout>
```
|
How can I achieve this layout?
|
CC BY-SA 3.0
| null |
2011-05-15T05:38:36.850
|
2011-05-15T07:07:32.523
|
2011-05-15T06:28:09.593
| 688,573 | 688,573 |
[
"android",
"user-interface",
"button",
"menu",
"android-layout"
] |
6,006,716 | 1 | null | null | 1 | 276 |
Let's just say that I have controls on my Form, and when a User clicks on one of them, its height will expand. This means that, currently, when this clicked-control expands, other controls below it will become overlapped by the expanded control.
But what I want to happen, is for each Control below the expanded control to slide down, so that they are below the expanded control again.
I know how to handle sliding, but I just don't know how to make every control except for one move everytime a given control is moved.
Any help at all is greatly appreciated, thank you!
This is what I was thinking:
```
void newOrderReceived(object sender, EventArgs e)
{
foreach(Control OrderNotificationBox in OrdersPanel.Controls)
{
if(OrderNotificationBox is NotificationBox) // Checks to see if the control is a NotificationBox
{
// Add my code to slide controls down.
}
}
}
```
But... How do I know if the control is the expanded control?
Is this how I should go about changing the location of all controls below the expanded control?
Edit: Just had a thought, to check to see if a NotificationBox is below the Expanded NotificationBox, see revised code below:
```
void newOrderReceived(object sender, EventArgs e)
{
foreach(Control OrderNotificationBox in OrdersPanel.Controls)
{
if(OrderNotificationBox is NotificationBox) // Checks to see if the control is a NotificationBox
{
if(OrderNotificationBox.Location.Y <= ExpandedNotificationBox.Location.Y + ExpandedNotificationBox.Size.Width)
{
// Add my code to slide controls down.
}
}
}
}
```
But would this be sufficient? Currently, this is working, so I guess I just answered my own question. But, isn't there a better way to do this? A more elegant/efficient way?
Here's a sample of how it should look:

|
Move contents of Form when a Control is re-Located
|
CC BY-SA 3.0
| null |
2011-05-15T05:38:26.593
|
2011-05-15T06:53:13.180
|
2011-05-15T05:49:47.190
| 696,091 | 696,091 |
[
"c#",
".net",
"winforms",
"controls",
"location"
] |
6,006,980 | 1 | 6,006,997 | null | 20 | 44,059 |


I have installed SQL Server Management Studio 2005. I can't find my server name when I click browse for more but i know that my server name will be the same as the user name as in the picture below.
|
Cannot connect to SQL Server express from SSMS
|
CC BY-SA 3.0
| 0 |
2011-05-15T06:58:40.747
|
2022-10-20T20:05:07.477
|
2014-03-15T10:20:38.127
| 330,315 | 485,880 |
[
"sql",
"sql-server",
"sql-server-2005",
"ssms"
] |
6,007,232 | 1 | 6,007,415 | null | 1 | 1,348 |
I am trying to migrate a small ASP.NET 'web site' (not web application) to Windows Azure. I have added the website to the solution by Add Existing Project> Selecting the *.sln file.
After this, when I right click on the Web Role in Windows Azure, the "Add Web Role Project in solution" is freezed and so, I am not able to create the web role?

Why is the option freezed? What's going wrong in here?
|
Add Web Role Project in solution option freezed
|
CC BY-SA 3.0
| null |
2011-05-15T08:02:37.697
|
2011-05-15T08:47:11.677
| null | null | 458,790 |
[
"visual-studio-2010",
"azure"
] |
6,007,289 | 1 | 6,011,251 | null | 3 | 12,641 |
for homework of graph theory, I asked to calculate the (s) [Critical (s) Routes (s)](http://en.wikipedia.org/wiki/Program_Evaluation_and_Review_Technique) and timing slack of a project under the following format:
Entry:
The first line of input will be an integer C, which indicates the number of test cases (graphs modeling the activities of a project). The first line of each test case contains two integers N and M respectively, where N represents the number of nodes in the project and the amount M of activities. Then come m lines, each with 3 integers I, J and D, where I and J represent the start and end node of an activity.
The entry should be read from the file "entrada.in" which will be in the
program folder. Be considered a bonus if your program provides the opportunity to read
the file from any path through a graphical interface (ie, without
write the full path).
Output:
In the first line of each test case must display the following string "Case G: Duration Total P", where G represents the number of test case (starting at 1) and P the total project duration. Then X lines on which activities should be expressed for the (s) Critical (s) Route (s) of the project, following the same format as the input (except the integer that represents the duration), but additionally, the edges are be ordered (as the first priority should be taking home nodes from lower to higher and end nodes as the second lowest to highest). Then must follow "Y" lines, corresponding to noncritical activities, following the same order listed above. For each noncritical activity should show 4 integers, I, J, T and F, where T and F represent the total slack and free slack of each activity respectively. Additionally you must add an R at the end of the line if the activity is marked with a red flag. Should obviate the dummy activities are not part of the critical path for output.
After each test case should print a blank line.
The output should be written in the file "salida.out. "
Example:

I need to tell me some idea of how to do what I required, I am not asking for a solution just a little help (pseudocode for example), Thanks to all
|
Calculating the critical path of a graph
|
CC BY-SA 3.0
| 0 |
2011-05-15T08:15:21.733
|
2011-05-18T01:19:50.267
|
2011-05-18T01:19:50.267
| 59,468 | 59,468 |
[
"graph",
"path",
"graph-theory"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.