Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,473,465 | 1 | 6,473,551 | null | 1 | 325 |
The following code works nicely on the iPhone simulator but, on Android 2.3, I just get a blank map with the Google logo on it (see attached screenshot).
```
var mainWin = Ti.UI.createWindow({backgroundColor:'#fff', fullscreen:true, navBarHidden: true})
mainWin.open();
var win = mainWin;
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5},
animate:true,
regionFit:true,
userLocation:true
});
win.add(mapview);
```
Any idea what's going on?

|
Can't get a map to display on Android 2.3
|
CC BY-SA 3.0
| null |
2011-06-24T20:32:50.883
|
2011-06-24T20:53:47.380
|
2020-06-20T09:12:55.060
| -1 | 305 |
[
"javascript",
"android",
"titanium",
"appcelerator"
] |
6,473,826 | 1 | 6,476,501 | null | 2 | 3,625 |
I am plotting to different datasets into one graph with pylab.plot(), which works great. But one dataset has values between 0% an 25% and the other has values between 75% and 100%. I want to skip 30% to 70% on the y-axis to save some space. Do you have any suggestions how this might be work with pyplot?
EDIT:
For clearness I added the following graphic. I want to skip 30% to 60% on the y axis, so that the red line and the green line come closer together.

|
Pyplot, plot 2 dataset into one figure, skip part of the y-axis
|
CC BY-SA 3.0
| null |
2011-06-24T21:12:38.280
|
2021-06-18T01:04:16.267
|
2016-07-26T10:13:50.453
| 2,666,859 | 765,011 |
[
"python",
"matplotlib"
] |
6,474,109 | 1 | 6,474,255 | null | 2 | 711 |
..but I haven't seen it yet! How did I get it?
The project is a WCF project. When F5 is pressed in most circumstances, you simply see a webpage for the entire project (showing that it is running in the background). However, per the solution below, if your mouse has a .svc file highlighted before you press F5, it will launch the very slick WCF test client - saving you from having to build your own.

|
Once when I pressed F5, I got the WCF Test Client
|
CC BY-SA 3.0
| null |
2011-06-24T21:46:22.660
|
2011-06-25T00:16:22.777
|
2011-06-25T00:16:22.777
| 339,843 | 339,843 |
[
"c#",
"wcf"
] |
6,474,168 | 1 | null | null | 16 | 20,321 |
Here is an image of what I'm talking about:

Is there a way to get the corners like this using css3 or do I have to resort to images? I believe I saw a tutorial on this somewhere but I can't seem to find it.
|
How do I make corners angled like this using css?
|
CC BY-SA 3.0
| 0 |
2011-06-24T21:54:07.013
|
2012-11-19T19:35:46.593
|
2011-06-24T22:35:03.423
| 645,836 | 645,836 |
[
"css"
] |
6,474,260 | 1 | 6,546,080 | null | 10 | 688 |
On my cross-platform SWT Java application, I'm using TrayItem's setImages() function to set the dock and status bar icon. The icon is a 128x128 transparent PNG. The status and tray icons are appropriately clipped on both Windows and Linux distributions, but on the Mac I have problems that make the status bar icon appear with strange padding on both sides like this:

It's strange to me that this is working on all other platforms but the Mac. For instance, here is the same status bar icon without the problem on my Linux box:

Does anyone have any idea how to prevent this extra padding on the Mac?
|
SWT TrayItem.setImage does not scale properly in Mac status bar
|
CC BY-SA 3.0
| 0 |
2011-06-24T22:07:27.643
|
2011-07-01T09:26:32.150
|
2011-06-26T22:33:23.380
| 23,649 | 808,678 |
[
"java",
"macos",
"swt",
"statusbar"
] |
6,474,517 | 1 | null | null | 2 | 1,755 |
Example image here:

Used the tutorial from here:
[http://www.kaloer.com/making-your-app-tablet-friendly-3-steps](http://www.kaloer.com/making-your-app-tablet-friendly-3-steps)
So I am sure I am missing some setting or line that I just didn't see. So the sides of the image are right its a tablet emulator skin. Though the main view looks like it is insisting on some lower res version in landscape mode. The really odd thing is I have a layout-xlarge folder that is getting utilized so it "knows" its a large screen to use but isn't using it. Any ideas what I did wrong? Ideally the list would be on the far left and wider and the other side would be much larger as well?
oh and the StudioTab Icon and title would be on the far left too, just cannot figure out what little bit I am missing to make that happen?
|
ListFragment in Tablet app for android, not using full screen?
|
CC BY-SA 3.0
| null |
2011-06-24T22:48:54.857
|
2011-07-28T23:31:09.827
|
2017-02-08T14:32:33.227
| -1 | 327,258 |
[
"android-layout",
"android"
] |
6,474,697 | 1 | 6,474,729 | null | 0 | 2,875 |
So I have setup my settings bundle which works in the iPhone's settings app. I want to add one of the settings within my own app. I know I can use InAppSettings framework, but I just want to add one settings, not all of them, and I already have an page ready that I want to add this settings option to.
So I have replicated the cell with `UISwitch` in my app which looks the same as the settings one. My question is, how can I now connect this `UISwitch` to my `NSUserDefaults` so it functions as a settings `UISwitch`?
In my appDelegate, I have:
```
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:@"No" forKey:@"isKgs"];
[defaults registerDefaults:appDefaults];
[defaults synchronize];
```
Edit - All related code:
```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:NO forKey: @"isKgs"];
[defaults synchronize];
}
```
The cell inside the app where I want the UISwitch to be
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UISwitch *switchView = [[UISwitch alloc] initWithFrame:CGRectZero];
cell.accessoryView = switchView;
[switchView addTarget:self action:@selector(switchChanged:) forControlEvents:UIControlEventValueChanged];
[switchView setOn:[[NSUserDefaults standardUserDefaults] boolForKey:@"isKgs"] animated:NO];
[switchView release];
}
```
And the settings bundle where I have the same UISwitch that can be acceded through iPhone settings app:

Edit 2:
```
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (nil == [defaults objectForKey:@"isKgs"])
{
[defaults setBool:NO forKey: @"isKgs"];
}
else
{
}
[defaults synchronize];
```
|
How To Connect NSUserDefaults To UISwitch?
|
CC BY-SA 3.0
| null |
2011-06-24T23:22:24.250
|
2012-07-13T13:25:57.647
|
2011-06-25T01:57:15.520
| null | null |
[
"iphone",
"objective-c",
"xcode",
"settings",
"nsuserdefaults"
] |
6,474,885 | 1 | null | null | 6 | 7,163 |
I have the following JTable (Actually it's a [ETable](http://bits.netbeans.org/dev/javadoc/org-netbeans-swing-outline/org/netbeans/swing/etable/ETable.html) from Netbeans). It stretches across the container it's in - I'd like to keep that, and not use JTable.AUTO_RESIZE_OFF

I'd like to fit it programatically like below, resizing each column to fit the only the cell content, or column header text and having the rightmost column fill the remaining space. How can I do that ?

|
Auto/best fit JTable columns, but stretch the last column
|
CC BY-SA 3.0
| 0 |
2011-06-24T23:58:23.177
|
2020-03-06T20:01:45.330
| null | null | 613,821 |
[
"java",
"swing"
] |
6,474,913 | 1 | 6,475,486 | null | 0 | 188 |
I have the following problem:
1. There is an array that consists of 6 numbers, each two digits at maximum.
2. Y is an array whose i th element is the sum of the first i +1 elements of the first array.
3. Accept a numerical input via keyboard. If it matches one of the numbers in Y display a message; If not, restart the program.

This is the algorithm that I am thinking:
- - - - - -
I would be really grateful for any guidance or help with this problem.
|
Adding Elements in a Array
|
CC BY-SA 3.0
| null |
2011-06-25T00:05:45.820
|
2011-06-25T02:55:55.690
|
2011-06-25T02:34:42.033
| 314,166 | 814,884 |
[
"ruby",
"arrays",
"algorithm"
] |
6,474,977 | 1 | 6,496,165 | null | 2 | 6,257 |
When I wanted to generate a RESTful Webservice with Netbeans I was asked for "the way REST resources will be registered in the application". I accidentally clicked on "Netbeans will generate a subclass of javax.ws.rs.core.Application [...]" instead of "Create default Jersey REST servlet adaptor [...]" (see image below).

Source: [Getting Started with RESTful Web Services](http://netbeans.org/kb/docs/websvc/rest.html)
I deleted the generated subclass and created the Jersey REST servlet adaptor manually. Everything works fine, except that Netbeans is still generating a subclass of Application on every publish. Do you know a way how to switch this off? (I do not get the dialog a second time.)
|
Change the way REST resources are registered in Netbeans
|
CC BY-SA 3.0
| null |
2011-06-25T00:21:28.613
|
2013-09-02T05:22:57.090
| null | null | 344,480 |
[
"web-services",
"netbeans",
"netbeans-7"
] |
6,475,133 | 1 | 6,475,163 | null | 0 | 116 |

Also on the server side error_log:
```
PHP Notice: Undefined index: theid in /.../postsForExtension.php on line 27
```
That code:
```
$personid = strip_tags($_POST['theid']);
Note: $personid is true.
```
|
Crazy xhr error
|
CC BY-SA 3.0
| null |
2011-06-25T01:06:25.957
|
2012-01-21T23:17:53.477
|
2012-01-21T23:17:53.477
| 398,242 | 565,877 |
[
"php",
"javascript",
"ajax",
"post"
] |
6,475,142 | 1 | 6,475,397 | null | 1 | 220 |
Looking at [this question](https://stackoverflow.com/questions/2786336/creating-a-semi-transparent-blurred-background-wpf/6474980#6474980) I managed to get something like:

The window Files Pro that I created appears with the collor that I select when I go to:
```
Control Panel\Appearance and Personalization\Personalization\Window Color and Appearance
```
Is there a way of changing the color so that it will always display the same color regardless of which color is selected for windows?
|
Customize window color for current application
|
CC BY-SA 3.0
| 0 |
2011-06-25T01:10:24.293
|
2011-06-25T02:23:32.710
|
2017-05-23T12:19:48.617
| -1 | 637,142 |
[
"c#",
"wpf",
"transparency"
] |
6,475,200 | 1 | 6,475,470 | null | 2 | 308 |
Note how the letters of the title of my window glow:

How could I create a label with the same effect?
|
Create label with the same properties as the title
|
CC BY-SA 3.0
| null |
2011-06-25T01:26:57.000
|
2011-06-25T02:46:38.417
| null | null | 637,142 |
[
"c#",
"wpf",
"glow"
] |
6,475,345 | 1 | 6,475,614 | null | 0 | 1,374 |
I have an empty template with just a safecracker form consists of 2 custom field. When i try to load it up in the browser, it takes about 2-3 seconds to load. Looking in firebug i see the following GET
```
http://localhost/ee1/?ACT=7&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=scrollable,scrollable.navigator,ee_filebrowser,ee_fileuploader,markitup,thickbox,toolbox.expose,overlay,tmpl&v=1308711156&use_live_url=y&include_jquery=y
```
I don't need to load most of the things showing in the url above. How can i control what is loaded with safecracker form. I will be loading jQuery/UI directly from google so i don't need safecracker to load it. I'm able to remove jQuery and datepicker from safecracker form by doing `datepicker="no" include_jquery="no"`, but what about removing other things mentioned in the url such as scrollable, draggable, thickbox and other things.

|
expressionEngine safecracker loading unwanted widgets
|
CC BY-SA 3.0
| null |
2011-06-25T02:10:25.757
|
2012-03-01T04:35:46.600
|
2011-06-28T08:14:39.813
| 21,234 | 635,300 |
[
"php",
"expressionengine",
"safecracker"
] |
6,475,399 | 1 | 6,475,446 | null | 4 | 26,697 |
My webpage has a header image that always remains at the top of the window. When the window is maximised the header image is centred, but when viewing in a small window (or a smart-phone browser) the header is set to the left of the window, and the right side cropped. Because the header div is wider than the page content, the horizontal scroll-bar appears when the window is smaller than the header, not the page.
I would like the header image to be centered on the page at all times, with both left and right sides being cropped if the window is smaller than header. Also the horizontal scroll-bar to only be turned on if window width is less than page width.
This image might explain it more clearly:

[http://postimage.org/image/49ne3k3o/](http://postimage.org/image/49ne3k3o/)
My code so far:
CSS:
```
#headerwrap {
position: relative;
width: 998px;
height: 100px;
margin: 0 auto;
pointer-events: none;
}
#header{
position: fixed;
top: 0;
width: 998px;
margin: 0;
background: url('../images/top.png') no-repeat;
height:100px;
z-index: 1;
pointer-events: none;
}
```
and HTML implementation:
```
<div id="headerwrap"\>
<div id="header">
</div>
</div>
```
(the page is 690px wide, the header is 998px)
Any help would be much appreciated.
|
Centre a header image regardless of page size
|
CC BY-SA 3.0
| 0 |
2011-06-25T02:23:48.933
|
2012-11-01T03:48:39.857
|
2011-12-22T13:04:53.743
| 53,195 | 661,969 |
[
"html",
"css",
"image",
"center",
"crop"
] |
6,475,410 | 1 | 6,475,594 | null | 12 | 24,676 |
I would like to know if a ListView in Android has an option to place alphabets on the right like the paradigm of iPhone ListView, like below

If yes, can someone provide me with sample codes.
I am not looking for the one with an Alphabet overlay from ApisDemo but an exact one like the iPhone paradigm. Is it possible?
|
ListView with alphabets on the right, like the iPhone. Is it possible?
|
CC BY-SA 3.0
| 0 |
2011-06-25T02:27:37.253
|
2015-04-23T21:45:34.483
|
2014-01-24T07:49:20.430
| 550,966 | 402,637 |
[
"android",
"android-listview"
] |
6,475,771 | 1 | null | null | 1 | 999 |
On [this page](http://glest.wikia.com/wiki/User:Hofmic/sandbox), there is a div box which holds a code example, where a certain line is supposed to be given a background color. This background color is actually done by using regular expressions to replace a start and end symbol with the code to make a div with our red background. This works fine, we have our red background, the regular expressions are doing their work.
However, if we scroll over a bit in code box, we notice that the red background color stops where the actual edge to the code box is (but we can scroll over, so it's not the end). This should illustrate what I mean:

I've tried pretty much every CSS value I could think of with firebug, including trying every possible overflow option. With width, if I manually give an absolute width, it can extend it further, but this won't do because the background coloring is generated automatically, with javascript using a method with good fallback in case the javascript fails to load or is disabled.
So, does anyone know a way to get those backgrounds extending all the way to the end? I considered counting the characters, but since the background colors often cover more than a single line, and even hundreds of lines on some other pages, it seems impractical and rather resourcy. A CSS method would be prefered, though should it come to it, I'll go with a javascript fix.
If you want to take a look at the page for yourself, feel free, that one is just a sandbox to show the specific problem, and the script that replaces certain comments with div elements to make this background image is found [here](http://glest.wikia.com/wiki/MediaWiki:Common.js/SyntaxHighligtBackground.js).
Thanks in advance for any help and/or advice.
|
Background color won't extend past visible area in a div box with scrollbars
|
CC BY-SA 3.0
| null |
2011-06-25T04:16:43.427
|
2011-06-25T05:59:20.230
|
2011-06-25T05:59:20.230
| 813,388 | 813,388 |
[
"javascript",
"html",
"css",
"wiki"
] |
6,475,815 | 1 | 6,475,873 | null | 0 | 5,768 |
It seems to have magically corrected itself because now it works, but I emphasize that it wasn't a cache issue because even I was able to update with new images but they always appeared "below" rather than "next to"... I don't understand...but suddenly it worked now.
if you check [www.dodomainer.com](http://www.dodomainer.com) in Safari and Chrome, the two images in the header float, but not in Firefox. Any idea how to fix this? Note, it's definitely not this way in Firefox as a result of a cache
this is the code that I use. Any idea how to fix the problem?
```
<div class="header a"><a href="http://dodomainer.com/">
<img src="http://dodomainer.com/images/dodo4.jpg" width="400" height="50" padding-left="10px" alt="dodobird" />
</a></div>
<div class="header b">
<a href="http://dodomainer.com/">
<img src="http://dodomainer.com/images/dodotest.jpg" width="380" height="70" padding-left="10px" alt="dodobird" />
</a>
</div>
```
CSS
```
.header {
float: left;
width: 400px;
}
.a {
height: 50px;
}
.b {
height: 70px;
padding-left: 100px;
}
```

|
Firefox CSS float bug?
|
CC BY-SA 3.0
| 0 |
2011-06-25T04:30:45.877
|
2012-05-31T17:03:15.513
|
2012-05-31T17:03:15.513
| 44,390 | 577,455 |
[
"css",
"firefox",
"css-float"
] |
6,475,927 | 1 | 6,475,957 | null | 25 | 20,373 |
In Eclipse Helios I have the nice feature of a dependency graph inside the maven pom editor.

But in later installations (Helios-sr2 and Indigo) this feature is missing. Does anybody know how to activate this? (I'm using OSX, 64bit cocoa)
|
Maven POM-Editor: Dependency Graph missing
|
CC BY-SA 3.0
| 0 |
2011-06-25T04:55:40.357
|
2016-01-04T19:16:18.350
| null | null | 753,377 |
[
"java",
"eclipse",
"maven"
] |
6,476,147 | 1 | 6,476,655 | null | 0 | 2,387 |

Hii,
I am creating a WPF aplication. My home page will look like the one I have shown in the image.
In which i will have following componenents:
1. Topbar
2. Left bar - slide down menu like accordion which will slide down on selection if it has any submenu items otherwise on selection it will show related form.
3. Main panel - in which i will open my child forms
4. Bottom bar.
I would prefer if i get already implemented application that i can reuse in my application, as I think this form is gonna take hell lot of time. And Also as , I would love to have some guidance about following points
1. How to make a slide down accordion like menu in WPF, which are also supposed to have submenu in it. ex. Report menu - will have list of all reports in it, which will be displayed when you click on the reports menu. How can I accomplish this in WPF>
2. How to open child form in right side panel? What controls/components should I use in my form to host child forms?
3. Any sample applications, web references, or already implemented code will be of great help as I have very strict deadline and dont afford to spend much time in exploring.
|
Need help to prepare Main Home Page for WPF application having vertical menu
|
CC BY-SA 3.0
| null |
2011-06-25T05:53:40.403
|
2011-06-28T21:51:43.673
| null | null | 756,722 |
[
"asp.net",
"wpf",
"windows"
] |
6,476,595 | 1 | 6,476,686 | null | 0 | 170 |
I need to get a script working for our billing system (WHMCS) using their sample code that shows the average response time to support tickets for each month. Something like this already exists, however it gives a time based on all replies rather than just the first one. Since we put a lot of tickets on-hold, or flag them for other staff members, we would like to just be able to see how long on average the first response takes.
Here is an image of what the table looks like in the database. The psuedo code/logic would basically be find all of the "New Support Ticket Opened" entries and then find the first entry after that for "New Ticket Response made by..." for that same ticket ID, and find the difference in in time between the dates.
I am not overly experienced with PHP/MYSQL though so could use some help to get this working. Thanks!

|
Query MySQL and Compare Entries?
|
CC BY-SA 3.0
| null |
2011-06-25T07:52:45.930
|
2011-06-25T08:41:07.157
| null | null | null |
[
"php",
"mysql",
"whmcs"
] |
6,476,607 | 1 | 6,476,764 | null | 17 | 32,487 |
I added the `bin` directory of the VS2010 (not SP1) C++ compiler to my `PATH` variable on Windows XP. When i try to run it, it tells me that a DLL was not found.
I added this line to my `PATH`:
```
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;
```
Update: it still fails when I `cd` to the bin directory above, and then run the compiler

Can you help me out?
|
VC++ cl.exe -- DLL not found
|
CC BY-SA 3.0
| 0 |
2011-06-25T07:57:05.257
|
2015-06-22T20:46:33.173
|
2013-12-30T22:00:40.160
| 214,892 | 720,223 |
[
"visual-studio-2010",
"visual-c++",
"compiler-construction"
] |
6,476,678 | 1 | null | null | 0 | 234 |
I have a small problem when I test my html and css.
I'm making the HTML to a new Wordpress theme. I make the whole structure and call the CSS and JS files.
They appear in Chrome but not in other browsers. How to fix this?




|
Grid 960 and CSS - doesn't show in all browsers
|
CC BY-SA 3.0
| null |
2011-06-25T08:15:03.237
|
2011-08-13T19:27:58.557
|
2011-08-13T19:27:58.557
| 112,968 | 625,617 |
[
"html",
"css",
"google-chrome",
"internet-explorer-8",
"opera"
] |
6,476,814 | 1 | 6,476,974 | null | 0 | 1,284 |
I am trying to insert Carousel inside tabs.. so that there is a Slide show inside every tabs.
The first tab Slide show works fine. but the rest of the tabs its acting weird with components missing
Tabify: [http://www.unwrongest.com/projects/tabify/](http://www.unwrongest.com/projects/tabify/)
jCarousel: [http://sorgalla.com/projects/jcarousel/](http://sorgalla.com/projects/jcarousel/)


Link: [http://bakasura.in/king/components.html](http://bakasura.in/king/components.html)
|
Jquery Carousel problem
|
CC BY-SA 3.0
| null |
2011-06-25T08:50:48.750
|
2011-06-25T09:28:47.070
| null | null | 155,196 |
[
"jquery",
"jcarousel",
"carousel",
"jquery-tabs"
] |
6,476,991 | 1 | 6,478,631 | null | 39 | 5,478 |
I just don't get the various elements of the [traceview](http://developer.android.com/guide/developing/debugging/debugging-tracing.html) output, and I can't find a tutorial. Could someone please explain the following with reference to the diagram below:

1. The width of the bars corresponds to the time the function takes. What does the height correspond to?
2. What is specific difference between Inclusive and Exclusive. I assumed that inclusive includes the calls of all the children functions?
3. Would this be true: The sum of (Time per call times Calls) = time the program runs (what about async tasks?)
4. Can async tasks be ignored when debugging slowdown on the main thread ?
5. Should the sum of all the percents in Excl% equal 100%?
6. What happens when there are gaps (white in the midst of black)? Is that when other android processes are running, or just your own async tasks (it looks like the gaps in one are aligned with the filled in part in the other, if thats the case then is there any point in moving intensive tasks to an AsyncTask)?
|
Android Eclipse: Traceview, I just don't get it
|
CC BY-SA 3.0
| 0 |
2011-06-25T09:30:53.333
|
2015-04-26T06:29:32.610
| null | null | 530,634 |
[
"android",
"eclipse",
"profiling"
] |
6,477,018 | 1 | 6,477,145 | null | 1 | 685 |

I am creating textfield for my text.
when i create its showing me a line attached to my text field.
i attached the image to this..
My code is
```
-(void)createTextField{
if (([[UIDevice currentDevice]orientation]==UIDeviceOrientationLandscapeLeft)||([[UIDevice currentDevice]orientation]==UIDeviceOrientationLandscapeRight)) {
[text setFrame:CGRectMake(640, 15, 300,40)];
}
else {
[text setFrame:CGRectMake(390,15,300,50)];
}
text.font = [UIFont systemFontOfSize:20];
text.layer.cornerRadius = 20;
text.delegate=self;
[text setTextColor:[UIColor blackColor]];
text.alpha=1.0;
text.autocorrectionType = UITextAutocorrectionTypeNo;
text.returnKeyType=UIReturnKeySearch;
UIImageView *searchLogo = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon-search-black.png"]];
[text setLeftView:searchLogo];
[text setLeftViewMode:UITextFieldViewModeAlways];
[searchLogo release];
text.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
text.borderStyle=UITextBorderStyleRoundedRect;
[text setBackgroundColor:[UIColor whiteColor]];
[text setHidden:NO];
[self addSubview:text];
[text becomeFirstResponder];
}
```
|
Problem TextField changing into search text
|
CC BY-SA 3.0
| null |
2011-06-25T09:39:55.983
|
2011-06-25T10:14:10.497
|
2011-06-25T09:54:11.390
| 491,980 | 793,820 |
[
"ios",
"cocoa-touch",
"ipad",
"uitextfield"
] |
6,477,284 | 1 | 6,477,526 | null | 0 | 221 |
I have create a sample which has differet layout for few rows in ListView based on the this [link](http://android.amberfog.com/?p=296). Here is the layout

As i want only first row to have a different layout , whenever the position is zero i am applying layout one ( Name & Phone) and for rest i am applying layout two (Address).
the problem i am facing is when i fire notifyDataSetChanged on adapter , only my Address get changed but Name & Phone row i.e. first row doesn't update. I am firing notifyDataSetChanged when the submenu item is selected.
Here is the code.
```
public static final int TYPE_ADDRESS = 1;
public static final int TYPE_NAME = 0;
public static final int TYPE_MAX_COUNT =2;
@Override
public int getItemViewType(int position) {
if(position == 0)
return TYPE_NAME;
else
return TYPE_ADDRESS;
}
@Override
public int getViewTypeCount() {
return TYPE_MAX_COUNT;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder=null;
int type = getItemViewType(position);
System.out.println("getView " + position + " " + convertView + " type = " + type);
if (convertView == null) {
holder = new ViewHolder();
switch (type) {
case TYPE_ADDRESS:
convertView = mInflater.inflate(R.layout.layout_address, null);
holder.address = (TextView) convertView.findViewById(R.id.address_id);
holder.address.setText(data.getAddress(position));
break;
case TYPE_NAME:
convertView = mInflater.inflate(R.layout.layout_name, null);
holder.name = (TextView)convertView.findViewById(R.id.name_id);
holder.phone = (TextView)convertView.findViewById(R.id.phone_id);
holder.name.setText(data.getName(position));
holder.phone.setText(data.getPhone(position));
break;
}
convertView.setTag(holder);
}else {
holder = (ViewHolder) convertView.getTag();
}
return convertView;
}
static class ViewHolder {
TextView address;
TextView name;
TextView phone;
}
```
|
unable to update different row in a ListView
|
CC BY-SA 3.0
| null |
2011-06-25T10:54:02.270
|
2011-06-25T11:47:26.377
|
2011-06-25T11:18:27.433
| 405,383 | 405,383 |
[
"android",
"listview"
] |
6,477,417 | 1 | null | null | 0 | 590 |
I am using WIX installer to develop installer.
I want to enhance the installer in terms of UI. I want to change the images at run-time on the same screen (not like billboard) like below

I have fixed 5 features. So there will be no scroll bar and all. I just want to show the current feature being installed and if any error occurs for particular feature red error icon should be displayed.
Is this possible using WIX
|
Changing images at runtime on installer using WIX
|
CC BY-SA 3.0
| null |
2011-06-25T11:24:26.987
|
2011-06-25T11:35:49.140
| null | null | 317,255 |
[
"installation",
"wix",
"windows-installer",
"wix3.5"
] |
6,477,529 | 1 | null | null | 1 | 283 |
I want to create standard native options menu which shows after pushing Options soft key on Nokia E52.
It something similar to this one:

My code look like that:
```
this->changefile = menuBar()->addAction(tr("Change file"),this,SLOT(openFileChooser()));
this->changefile->setEnabled(true);
```
Problem is that when I push the button which should show this menu nothing happens. There is no menu. What is wrong with my code? Please help.
|
Problem with creating options menu on S60 device using Qt
|
CC BY-SA 3.0
| null |
2011-06-25T11:48:11.963
|
2011-06-27T09:58:14.300
| null | null | 693,227 |
[
"qt",
"menu",
"symbian",
"s60"
] |
6,477,649 | 1 | 6,477,760 | null | 3 | 921 |
Consider the following list :
```
dalist = {{47.9913, 11.127, 208}, {47.5212, 10.3002, 208},
{49.7695, 9.96838, 160}, {48.625, 12.7042, 436}}
```
Those are coordinatees of Eye fixations on a screen where, within each sublist,
`#1` is the X coordinate,
`#2` the Y coordinate and
`#3`, the duration spent at that particular location
I then use the following :
```
Disk[{#[[1]], #[[2]]}, 3N[#[[3]]/Total[dalist[[All, 3]]]]] & /@ dalist
```
to draw disk with duration weighted diameter.
I would like to draw cross instead where the 2 segments intersect at their middle and the length of each is equivalent to the disk diameter as illustrated bellow.

This is what I have yet :
```
Graphics[{
Line[{{#[[1]] - 3 N[#[[3]]/Total[dalist[[All, 3]]]], #[[2]]},
{#[[1]] + 3 N[#[[3]]/Total[dalist[[All, 3]]]], #[[2]]}}] & /@ dalist,
Line[{{#[[1]], #[[2]] - 3 N[#[[3]]/Total[dalist[[All, 3]]]]},
{#[[1]], #[[2]] + 3 N[#[[3]]/Total[dalist[[All, 3]]]]}}] & /@ dalist}]
```
I was wondering if there was a simpler way, using something similar to PlotMarkers that exist in ListPlot
|
Replacing Disks by Crosses using Graphics in Mathematica
|
CC BY-SA 3.0
| null |
2011-06-25T12:13:57.823
|
2011-08-24T07:12:20.503
|
2011-06-25T12:54:07.243
| 769,551 | 769,551 |
[
"graphics",
"wolfram-mathematica"
] |
6,477,722 | 1 | 6,478,478 | null | 1 | 6,235 |
Im trying to generate a week view calendar using codeigniter's calendar library.. something like this

how can i do that? :/
thanx
|
Generate a week view calendar with codeigniter
|
CC BY-SA 3.0
| null |
2011-06-25T12:30:21.970
|
2011-06-26T23:54:41.333
|
2011-06-25T13:57:44.170
| 135,978 | 815,293 |
[
"php",
"codeigniter",
"calendar"
] |
6,478,046 | 1 | 6,478,279 | null | 0 | 798 |
Beginner to assembly programming for x86. I have a simple asm file which I assemble using nasm version - NASM version 2.10rc6 compiled on Jun 6 2011, for windows(My windows is Windowa-7 64 bit). NASM is downloaded from [here](http://www.nasm.us/pub/nasm/releasebuilds/2.10rc6/win32/) ( nasm-2.10rc6-win32.zip).
```
ORG 100
USE16
mov ah, 09
mov dx, msg
int 21h
mov ah, 01
int 21h
mov ah, 4ch
int 21h
msg db 'Hello assembly', 0Ah, '$'
```
Then I assemble using command -
> nasm -f bin hello.asm -o hello.com
Then I run the generated executable hello.com using Dosbox(Dos emulator for 64 bit OS Windows-7).
When it runs the output output on the console has my string 'Hello assembly' plus some junk characters/control characters printed before it, as shown below:

What is the reason for this. Anything wrong in the code?
What do I need to do to fix this?
EDIT: When i tried to give a option -f to nasm to generate a specific type of executable output , e.g. Win32 or Win64 output i keep getting error saying:
```
nasm -f win64 hello.asm -o hello.com
hello.asm:1: error: parser: instruction expected
```
What is it expecting? How can i generate a win32/win64 executable using nasm? or for that matter any other executable like elf32/coff, which nasm says it supports?
|
Junk characters on console when execute assembly code
|
CC BY-SA 3.0
| null |
2011-06-25T13:34:34.750
|
2011-06-25T14:12:47.130
| null | null | 2,759,376 |
[
"assembly",
"x86",
"nasm"
] |
6,478,145 | 1 | 6,508,409 | null | 4 | 3,929 |
I'm downloading images in my iPhone/iPad app - and because they remain the same most of the time, I'd like to cache them on disk:
```
ASIDownloadCache *cache = [ASIDownloadCache sharedCache];
[asiRequest setDownloadCache:cache];
[asiRequest setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy];
[asiRequest setCachePolicy:ASIOnlyLoadIfNotCachedCachePolicy];
[asiRequest setSecondsToCache:60*60*24*30]; // Cache for 30 days
[asiRequest setDelegate:self]; // A delegate must be specified
[asiRequest setDidFinishSelector:@selector(requestFinished:)];
[asiRequest startAsynchronous];
```
In my requestFinished-method, it's recognized that the caching was successful, but the data inside my request-object is empyt; what am I missing?
```
- (void) requestFinished:(ASIHTTPRequest *)request {
if ([request didUseCachedResponse]) {
NSLog(@"cache, size: %i", [[request responseData] length]); // is always zero
[self buildImageWithData:[request responseData]];
}
[...];
}
```
Thanks a lot!
my complete code which isn't working: the first time, I get the "not cached" statement, from then, "cache, size: 0"... I have NO idea why :(
```
- (void)viewDidLoad {
[super viewDidLoad];
for (int i = 0; i < 10; i++) {
asiRequest = [[ASIHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.myimageserver.com/myimage.jpg"]];
ASIDownloadCache *cache = [ASIDownloadCache sharedCache];
[asiRequest setDownloadCache:cache];
[asiRequest setCacheStoragePolicy:ASICachePermanentlyCacheStoragePolicy];
[asiRequest setCachePolicy:ASIOnlyLoadIfNotCachedCachePolicy];
[asiRequest setSecondsToCache:60*60*24*30]; // Cache for 30 days
[asiRequest setDelegate:self]; // A delegate must be specified
[asiRequest setDidFinishSelector:@selector(requestFinished:)];
[asiRequest startAsynchronous];
}
}
- (void) request:(ASIHTTPRequest *)request didReceiveResponseHeaders:(NSDictionary *)responseHeaders {
self.imageDataLoadedFromURL = [NSMutableData data];
}
- (void) request:(ASIHTTPRequest *)request didReceiveData:(NSData *)data {
[imageDataLoadedFromURL appendData:data];
}
- (void) requestFinished:(ASIHTTPRequest *)request {
if ([request didUseCachedResponse]) {
NSLog(@"cache, size: %i", [[request responseData] length]); // is always zero
} else {
NSLog(@"not cached");
}
}
```
seems like the cache already contains the 0-byte-image; so it's not the problem of reading from caching but writing to it...

You can download the small test project from [http://tinyurl.com/68wuwj2](http://tinyurl.com/68wuwj2)
|
ASIHTTPRequest - data from cache always empty
|
CC BY-SA 3.0
| 0 |
2011-06-25T13:50:26.560
|
2012-08-24T13:46:27.300
|
2011-06-28T15:12:00.117
| 27,404 | 27,404 |
[
"ios",
"caching",
"asihttprequest"
] |
6,478,284 | 1 | 6,478,355 | null | 4 | 2,482 |
For example I have a pixel with these values:
```
CGFloat red = 34 // 0 - 255
CGFloat green = 128
CGFloat blue = 190
```
and I want to increase luminance so that blue is 255.
NOTE: With "Luminance" I mean the L-component of Photoshop in LAB color space. See pictures!
There must be a special formula to compute the RGB values for the increased luminance, because the R G B values are modified in a non-linear way!
Proof: I did a test in Photoshop and created this same color, and then opened the color picker to examine it:

Then I activated the L component of the LAB color space, which controls luminance (at least that is what I am talking about - I mean the brightness controlled by that L component. Guess that is luminance).
So with L activated, I dragged the slider on the left upwards until B reached 255:

Now read the resulting R G B values:
```
CGFloat newRed = 112 // 0 - 255
CGFloat newGreen = 188
CGFloat newBlue = 255
```
The differences between these is:
```
newRed - red = +78
newGreen - green = +60
newBlue - blue = +65
```
The percentages are:
```
red shift: +38.42%
green shift: +29.55%
blue shift: +32.01%
```
This does not correspond with the known formula for computing Luminance out of R G B, which is something close to `luminance = (red * 0.3) + (green * 0.6) + (blue * 0.1)`.
Obviously, they have been shifted in a non-linear manner.
Is there a known way to compute newRed, newGreen, newBlue out of red, green, blue in a similar fashion how Photoshop does it?
|
What's the formula to increase the luminance in an image in a similar way how the L component in Photoshop does it?
|
CC BY-SA 3.0
| 0 |
2011-06-25T14:14:07.663
|
2011-06-25T14:39:46.710
| null | null | 221,023 |
[
"math",
"image-processing",
"formula",
"luminance"
] |
6,478,123 | 1 | 6,478,522 | null | 10 | 2,798 |
I have some problems animating a loaded COLLADA Model. I've written my own parser and now I also want to write my own draw routine as well. The problem ist, that as soon as I enable the animation on my model, the hands, legs and the head is stretched away from the origin of the model. (The loader is implemented based on the tutorial here: [COLLADA Tutorial](http://www.wazim.com/Collada_Tutorial_2.htm))
The first thing I do in my draw function of the model is setup the joints matrices (not it's world matrices!) with the given targets from the read blocks,
If I for example read a channel like:
```
<channel source="#some_sampler" target="some_joint/transform(3)(2)"/>
```
I will modify the matrix component (3)(2) from the joint's jointMatrix with the sid="transform" in this first step:
```
if( mCurrentAnimations_.size() > 0 ) {
unsigned currentFrame = GEAR::Root::getSingleton().getFrameEvent().frame;
bool updateTime = false;
if( currentFrame != mLastFrameUpdate_ ) {
if( timeSinceLastFrame < 1.0f )
updateTime = true;
mLastFrameUpdate_ = currentFrame;
}
/****************************************************
* If we have an active animation, *
* we animate it in each of it's defined channels *
***************************************************/
std::list<DAEAnimation*>::iterator it = mCurrentAnimations_.begin();
while( it != mCurrentAnimations_.end() ) {
for( int c = 0; c < (*it)->animation->channels.size(); ++c ) {
// update the time of the channelanimation if requested
if( updateTime ) {
(*it)->channelStates[c].elapsedTime += timeSinceLastFrame;
}
GEAR::COLLADA::Channel* channel = (*it)->animation->channels[c];
// read the two indices depending on the time we're
int firstKeyframeTimeIndex = 0;
int secondKeyframeTimeIndex = 0;
for( int i = 0; i < channel->sampler->inputSource->mFloatArray_->mCount_; ++i ) {
float time = channel->sampler->inputSource->mFloatArray_->mFloats_[i];
if( firstKeyframeTimeIndex == secondKeyframeTimeIndex && time > (*it)->channelStates[c].elapsedTime && i > 0) {
firstKeyframeTimeIndex = i-1;
secondKeyframeTimeIndex = i;
break;
}
if( firstKeyframeTimeIndex == secondKeyframeTimeIndex && i == channel->sampler->inputSource->mFloatArray_->mCount_-1 ) {
(*it)->channelStates[c].elapsedTime = 0.0f;
firstKeyframeTimeIndex = i;
secondKeyframeTimeIndex = 0;
break;
}
}
// look what kind of TargetAccessor we have
if( channel->targetAccessor != NULL && channel->targetAccessor->type == GEAR::MATRIX_ACCESSOR ) {
// ok we have to read 1 value for first and second index
float firstValue = channel->sampler->outputSource->mFloatArray_->mFloats_[firstKeyframeTimeIndex];
float secondValue = channel->sampler->outputSource->mFloatArray_->mFloats_[secondKeyframeTimeIndex];
float firstTime = channel->sampler->inputSource->mFloatArray_->mFloats_[firstKeyframeTimeIndex];
float secondTime = channel->sampler->inputSource->mFloatArray_->mFloats_[secondKeyframeTimeIndex];
float interpolateValue = 1.0f / (secondTime - firstTime) * (secondTime - (*it)->channelStates[c].elapsedTime);
// now we calculate an linear interpolated value
float value = (secondValue*interpolateValue) + (firstValue*(1.0-interpolateValue));
// now we have to write this value to the Joint's Matrix
int entry = ((COLLADA::MatrixTargetAccessor*)channel->targetAccessor)->firstAccessor*4+((COLLADA::MatrixTargetAccessor*)channel->targetAccessor)->secondAccessor;
channel->targetJoint->matrix->jointSpaceMatrix.entries[entry] = channel->targetJoint->matrix->matrix.entries[entry] + value;
}
}
++it;
}
}
```
After the jointMatrices are modified by all channels, I recalculate the joint's worldMatrices by calling the following function on the root Joint:
```
void
COLLADA::Joint::recalcWorldSpaceTransMat() {
GEAR::Mat4 parentMat;
if( parent != NULL )
parentMat = parent->worldSpaceTransformationMatrix;
// @todo Here we have to test against NULL!
if( matrix != NULL )
this->worldSpaceTransformationMatrix = parentMat * matrix->jointSpaceMatrix;
else {
this->worldSpaceTransformationMatrix = parentMat;
}
//std::cout << "Joint " << sid << " recalculated\n";
for( int i = 0; i < mChildJoints_.size(); ++i )
mChildJoints_[i]->recalcWorldSpaceTransMat();
}
```
Now everything should be ready to draw my model width the following last part of my draw function:
```
for( int i = 0; i < mSubMeshes_.size(); ++i ) {
for( int k = 0; k < mSubMeshes_[i]->mSubMeshes_.size(); ++k ) {
// first we animate it
GEAR::DAESubMesh* submesh = mSubMeshes_[i]->mSubMeshes_[k];
submesh->buffer->lock( true );
{
for( unsigned v = 0; v < submesh->buffer->getNumVertices(); ++v ) {
// get the array of joints, which influence the current vertex
DAEVertexInfo* vertexInfo = submesh->vertexInfo[v];
GEAR::Vec3 vertex; // do not init the vertex with any value!
float totalWeight = 0.0f;
for( int j = 0; j < vertexInfo->joints.size(); ++j ) {
Mat4& invBindPoseMatrix = vertexInfo->joints[j]->joint->invBindPoseMatrix;
Mat4& transMat = vertexInfo->joints[j]->joint->worldSpaceTransformationMatrix;
totalWeight += vertexInfo->joints[j]->weight;
vertex += (transMat*invBindPoseMatrix*(submesh->skin->bindShapeMatrix*vertexInfo->vertex))*vertexInfo->joints[j]->weight;
}
if( totalWeight != 1.0f ) {
float normalizedWeight = 1.0f / totalWeight;
vertex *= normalizedWeight;
}
submesh->buffer->bufferVertexPos( v, vertex );
}
}
submesh->buffer->unlock();
mSubMeshes_[i]->mSubMeshes_[k]->buffer->draw( GEAR::TRIANGLES, 0, mSubMeshes_[i]->mSubMeshes_[k]->buffer->getNumVertices() );
}
}
```
Now The problem is, that the output looks like the following:

I'm sure to have the data loading routine implemented right, because the general animation of the walking man is visible, but the mesh is deformed:

As I said, when I uncomment the line:
```
channel->targetJoint->matrix->jointSpaceMatrix.entries[entry] = channel->targetJoint->matrix->matrix.entries[entry] + value;
```
The animation is disabled and the model is displayed in it's standard pose:

Now in addition when I add a normalization to the first 3 columns of the jointMatrices like this before I recalculate the joint's worldMatrix:
```
GEAR::Vec3 row1( matrix->jointSpaceMatrix.entries[0], matrix->jointSpaceMatrix.entries[1], matrix->jointSpaceMatrix.entries[2] );
row1.normalize();
matrix->jointSpaceMatrix.entries[0] = row1.x;
matrix->jointSpaceMatrix.entries[1] = row1.y;
matrix->jointSpaceMatrix.entries[2] = row1.z;
GEAR::Vec3 row2( matrix->jointSpaceMatrix.entries[4], matrix->jointSpaceMatrix.entries[5], matrix->jointSpaceMatrix.entries[6] );
row2.normalize();
matrix->jointSpaceMatrix.entries[4] = row2.x;
matrix->jointSpaceMatrix.entries[5] = row2.y;
matrix->jointSpaceMatrix.entries[6] = row2.z;
GEAR::Vec3 row3( matrix->jointSpaceMatrix.entries[8], matrix->jointSpaceMatrix.entries[9], matrix->jointSpaceMatrix.entries[10] );
row3.normalize();
matrix->jointSpaceMatrix.entries[8] = row3.x;
matrix->jointSpaceMatrix.entries[9] = row3.y;
matrix->jointSpaceMatrix.entries[10] = row3.z;
```
The Problem still exists, but this time in another output. The Man now looks like an alien :D, but this reduces the scaling:

I do not exactly now, whether I've done the normalization the right way. Is this normaliation really needed? It isn't described in the tutorial and I also was not able to find anything related.
After all I was taken a look at the implementation of the interpolation in the code from the tutorial page. AND: They do not use any quaternions at all to intrpolate the hole matrix. What they do is the following (which does not work for me):
```
Mat4 temp;
for (int i = 0; i < 16; ++i)
temp.entries[i] = interpolatef(matrix->jointSpaceMatrixStart.entries[i],matrix->jointSpaceMatrixFinish.entries[i],matrix->delta);
Vec3 forward,up,right,translation;
forward = Vec3(temp.entries[8], temp.entries[9], temp.entries[10]);
up= Vec3(temp.entries[4], temp.entries[5], temp.entries[6]);
right = Vec3(temp.entries[0], temp.entries[1], temp.entries[2]);
forward.normalize();
up.normalize();
right.normalize();
temp.entries[8] = forward.x; temp.entries[9] = forward.y; temp.entries[10] = forward.z;
temp.entries[4] = up.x; temp.entries[5] = up.y; temp.entries[6] = up.z;
temp.entries[0] = right.x; temp.entries[1] = right.y; temp.entries[2] = right.z;
matrix->jointSpaceMatrix = GEAR::Mat4(temp);
```
Then I use quaternions in another approach like that (also not works for me):
```
// wat we need for interpolation: rotMatStart, rotMatFinish, delta
// create rotation matrices from our 2 given matrices
GEAR::Mat4 rotMatStart = matrix->jointSpaceMatrixStart;
rotMatStart.setTranslationPart( GEAR::VEC3_ZERO );
GEAR::Mat4 rotMatFinish = matrix->jointSpaceMatrixFinish;
rotMatFinish.setTranslationPart( GEAR::VEC3_ZERO );
rotMatStart.transpose();
rotMatFinish.transpose();
// create Quaternions, which represent these 2 matrices
float w = GEAR::Tools::sqr(1.0 + rotMatStart.entries[0] + rotMatStart.entries[5] + rotMatStart.entries[10]) / 2.0;
float w4 = (4.0 * w);
float x = (rotMatStart.entries[6] - rotMatStart.entries[9]) / w4 ;
float y = (rotMatStart.entries[8] - rotMatStart.entries[2]) / w4 ;
float z = (rotMatStart.entries[1] - rotMatStart.entries[4]) / w4 ;
GEAR::Quaternion rotQuadStart(x, y, z, w);
rotQuadStart.normalize();
w = GEAR::Tools::sqr(1.0 + rotMatFinish.entries[0] + rotMatFinish.entries[5] + rotMatFinish.entries[10]) / 2.0;
w4 = (4.0 * w);
x = (rotMatFinish.entries[6] - rotMatFinish.entries[9]) / w4 ;
y = (rotMatFinish.entries[8] - rotMatFinish.entries[2]) / w4 ;
z = (rotMatFinish.entries[1] - rotMatFinish.entries[4]) / w4 ;
GEAR::Quaternion rotQuadFinish(x, y, z, w);
rotQuadFinish.normalize();
// create the interpolated rotation matrix
GEAR::Quaternion slerpedRotQuat = slerp(rotQuadStart, rotQuadFinish, matrix->delta );
slerpedRotQuat.normalize();
GEAR::Mat4 rotMat;
slerpedRotQuat.createMatrix( rotMat );
// interpolate the translation part
GEAR::Vec3 transVecStart(0.0,0.0,0.0);
matrix->jointSpaceMatrixStart.getTranslatedVector3D( transVecStart );
GEAR::Vec3 transVecFinish(0.0,0.0,0.0);
matrix->jointSpaceMatrixFinish.getTranslatedVector3D( transVecFinish );
GEAR::Mat4 transMat;
transMat.setTranslation( transVecFinish*matrix->delta + (transVecStart*(1.0f-matrix->delta)) );
// now write the resulting Matrix back to the Joint
matrix->jointSpaceMatrix = transMat * rotMat;
```
It will also not work for me. Nothing seems to work. I really have no idea what's going on with this.
---
I want to inform all how I got it working. Now everything seems clear and it was only a small step all the time.
Now we start with the animation part. I iterate over all channels and save the starting and ending values as well as a interpolation delta value in range 0.0 1.0 to the joint, the channel animates:
```
if( mCurrentAnimations_.size() > 0 ) {
unsigned currentFrame = GEAR::Root::getSingleton().getFrameEvent().frame;
bool updateTime = false;
if( currentFrame != mLastFrameUpdate_ ) {
if( timeSinceLastFrame < 1.0f )
updateTime = true;
mLastFrameUpdate_ = currentFrame;
}
/****************************************************
* If we have an active animation, *
* we animate it in each of it's defined channels *
***************************************************/
std::list<DAEAnimation*>::iterator it = mCurrentAnimations_.begin();
while( it != mCurrentAnimations_.end() ) {
for( int c = 0; c < (*it)->animation->channels.size(); ++c ) {
// update the time of the channelanimation if requested
if( updateTime ) {
(*it)->channelStates[c].elapsedTime += timeSinceLastFrame;
}
GEAR::COLLADA::Channel* channel = (*it)->animation->channels[c];
// read the two indices depending on the time we're
int firstIndex = 0;
int secondIndex = 1;
for( int i = 0; i < channel->sampler->inputSource->mFloatArray_->mCount_; ++i ) {
float time = channel->sampler->inputSource->mFloatArray_->mFloats_[i];
if( time > (*it)->channelStates[c].elapsedTime ) {
firstIndex = i-1;
secondIndex = i;
if( firstIndex == -1 ) // set to last frame
firstIndex = channel->sampler->inputSource->mFloatArray_->mCount_ - 1;
break;
}
else if( i == channel->sampler->inputSource->mFloatArray_->mCount_ - 1 ) {
(*it)->channelStates[c].elapsedTime -= channel->sampler->inputSource->mFloatArray_->mFloats_[i];
firstIndex = 0;
secondIndex = 1;
break;
}
}
// look what kind of TargetAccessor we have
if( channel->targetAccessor != NULL && channel->targetAccessor->type == GEAR::MATRIX_ACCESSOR ) {
/************************************************************************
* Matrix accessors, which are read from a COLLADA <channel> block *
* will always target one matrix component they animate. *
* Such accessors are for example: *
* <channel source"#someSource" target="someJoint/transform(0)(2)"/> *
* *
* @TODO: *
* In a pre processing step, we have to group all channels, which *
* operate on the same joint. In order to accelerate the processing of *
* grouped channels, we have to expand the number of keyframes of all *
* channels to the maximum of all channels. *
************************************************************************/
unsigned entry = ((COLLADA::MatrixTargetAccessor*)channel->targetAccessor)->index;
float firstTime = channel->sampler->inputSource->mFloatArray_->mFloats_[firstIndex];
float secondTime = channel->sampler->inputSource->mFloatArray_->mFloats_[secondIndex];
// in case of matrix accessor, we write the startMatrix and the endMatrix to the Joints accessor, who finally will do the animation interpolation
channel->targetJoint->matrix->interpolationRequired = true;
// write out the start and end value to the jointSpaceMatrix
// this matrix will later be interpolated
channel->targetJoint->matrix->jointSpaceMatrixStart.entries[entry] = channel->sampler->outputSource->mFloatArray_->mFloats_[firstIndex];
channel->targetJoint->matrix->jointSpaceMatrixFinish.entries[entry] = channel->sampler->outputSource->mFloatArray_->mFloats_[secondIndex];
// the delta value is in the range [0.0,1.0]
channel->targetJoint->matrix->delta = 1.0f / (secondTime - firstTime) * (secondTime - (*it)->channelStates[c].elapsedTime);
}
}
++it;
}
}
```
As you can see, here is no interpolation at all. We simply cache the start and end values and a delta for all animated joints (and we also set a flag on each modified joint)
Now after all animations are done, we call the function interpolateMatrices() on all root joint:
```
for( int i = 0; i < mSourceModel_->mVisualSceneLibrary_.mVisualScenes_.size(); ++i ) {
for( int v = 0; v < mSourceModel_->mVisualSceneLibrary_.mVisualScenes_[i]->mSkeleton_.size(); ++v ) {
if( mSourceModel_->mVisualSceneLibrary_.mVisualScenes_[i]->mSkeleton_[v]->mRootJoint_ != NULL ) {
/************************************************************************************
* Now we have constructed all jointSpaceMatrixces for the start and the end and *
* we're ready to interpolate them and to also recalculate the joint's *
* worldSpaceMatrix. *
***********************************************************************************/
mSourceModel_->mVisualSceneLibrary_.mVisualScenes_[i]->mSkeleton_[v]->mRootJoint_->interpolateMatrices();
}
}
}
```
This isn't new, but the interesting part now is the implementation of the interpolation. Nothing qith quaternions at all:
```
void COLLADA::Joint::interpolateMatrices() {
if( matrix != NULL && matrix->interpolationRequired ) {
for (unsigned i = 0; i < 16; ++i)
matrix->jointSpaceMatrix.entries[i] = interpolatef(matrix->jointSpaceMatrixStart.entries[i],matrix->jointSpaceMatrixFinish.entries[i],matrix->delta);
Vec3 forward,up,right,translation;
forward = Vec3(matrix->jointSpaceMatrix.entries[8], matrix->jointSpaceMatrix.entries[9], matrix->jointSpaceMatrix.entries[10]);
up= Vec3(matrix->jointSpaceMatrix.entries[4], matrix->jointSpaceMatrix.entries[5], matrix->jointSpaceMatrix.entries[6]);
right = Vec3(matrix->jointSpaceMatrix.entries[0], matrix->jointSpaceMatrix.entries[1], matrix->jointSpaceMatrix.entries[2]);
forward.normalize();
up.normalize();
right.normalize();
matrix->jointSpaceMatrix.entries[8] = forward.x; matrix->jointSpaceMatrix.entries[9] = forward.y; matrix->jointSpaceMatrix.entries[10] = forward.z;
matrix->jointSpaceMatrix.entries[4] = up.x; matrix->jointSpaceMatrix.entries[5] = up.y; matrix->jointSpaceMatrix.entries[6] = up.z;
matrix->jointSpaceMatrix.entries[0] = right.x; matrix->jointSpaceMatrix.entries[1] = right.y; matrix->jointSpaceMatrix.entries[2] = right.z;
matrix->jointSpaceMatrix.entries[15] = 1.0f; // this component is always 1.0! In some files, this is exported the wrong way, which causes bugs!
}
/********************************************************
* After the interpolation is finished, *
* we have to recalculate the joint's worldSpaceMatrix. *
********************************************************/
GEAR::Mat4 parentMat;
if( parent != NULL )
parentMat = parent->worldSpaceTransformationMatrix;
if( matrix != NULL )
worldSpaceTransformationMatrix = (parentMat * matrix->jointSpaceMatrix);
else
worldSpaceTransformationMatrix = parentMat;
skinningMatrix = worldSpaceTransformationMatrix*invBindPoseMatrix;
// also interpolate and recalculate all childs
for( unsigned k = 0; k < mChildJoints_.size(); ++k )
mChildJoints_[k]->interpolateMatrices();
```
}
As you can see we simply intrpolate all values of the matrix and after that we normalize the upper 3 columns of the matrix.
After that we immediately recalculate the worldSpaceMatrix for that Joint, as well as the complete skinning matrix to save performance.
Now we're nearly complete with all. Last thing to do is to really animate the vertices and then to draw the mesh:
```
for( int i = 0; i < mSubMeshes_.size(); ++i ) {
for( int k = 0; k < mSubMeshes_[i]->mSubMeshes_.size(); ++k ) {
// first we animate it
GEAR::DAESubMesh* submesh = mSubMeshes_[i]->mSubMeshes_[k];
submesh->buffer->lock( true );
{
for( unsigned v = 0; v < submesh->buffer->getNumVertices(); ++v ) {
// get the array of joints, which influence the current vertex
DAEVertexInfo* vertexInfo = submesh->vertexInfo[v];
GEAR::Vec3 vertex; // do not init the vertex with any value!
float totalWeight = 0.0f;
for( int j = 0; j < vertexInfo->joints.size(); ++j ) {
totalWeight += vertexInfo->joints[j]->weight;
vertex += ((vertexInfo->joints[j]->joint->skinningMatrix*(vertexInfo->vertex))*vertexInfo->joints[j]->weight);
}
// since it isn't guaranteed that the total weight is exactly 1.0, we have no normalize it
// @todo this should be moved to the parser
if( totalWeight != 1.0f ) {
float normalizedWeight = 1.0f / totalWeight;
vertex *= normalizedWeight;
}
submesh->buffer->bufferVertexPos( v, vertex );
}
}
submesh->buffer->unlock();
mSubMeshes_[i]->mSubMeshes_[k]->buffer->draw( GEAR::TRIANGLES, 0, mSubMeshes_[i]->mSubMeshes_[k]->buffer->getNumVertices() );
}
}
```
All in all it was nearly the same as the code I started with.
But now things are much clearer for me and I can start to also support <translation>, <rotation> and <scale> animations as well. Feel free to look into my implementation at [gear3d.de](http://project.gear3d.de) (download the SVN trunk)
I hope this helps some people out there implementing their own solution on this wonderful topic :)
|
Problems animating COLLADA Model
|
CC BY-SA 3.0
| 0 |
2011-06-25T13:46:21.377
|
2011-06-27T07:59:38.323
|
2011-06-27T07:59:38.323
| 720,456 | 720,456 |
[
"c++",
"xml",
"opengl",
"collada"
] |
6,478,521 | 1 | 6,478,648 | null | 0 | 708 |
I'm trying to integrate a UIWebView in my app following a tutorial. I believe I've written up the code correctly, but I'm having a little problem with the instructions from the tutorial:
> We start by adding a new view to the
project. Drag and drop an UIWebView
control on the view. As always, create
an controller to handle the view, I
have named the view and the view
controller “WebView” and
“WebViewController” respectively. We
create a new object of type UIWebView
and also declare an associated
property. We will use this object to
connect “WebView” view placed on the
view.
My MainWindow.xib looks like this:

And I have a ViewController called iPhoneTestAppViewController that looks like this:

My question is this: . Like I said, I believe my code is good (pretty much exactly the same as in the tutorial). I'm just lacking in the Interface Builder skills.
|
Setting up .xib, views, controllers, etc. for UIWebView
|
CC BY-SA 4.0
| null |
2011-06-25T14:55:38.083
|
2019-05-23T12:16:05.010
|
2019-05-23T12:16:05.010
| 1,033,581 | 385,559 |
[
"iphone",
"objective-c",
"xcode",
"uiwebview",
"interface-builder"
] |
6,478,681 | 1 | null | null | 0 | 6,154 |
I installed SOA Suite 11g, Weblogic and Jdeveloper and I try to follow some training.
I user Win Server 2008.
When it comes time to deploy I am not able to connect to the soa_server.
That's when I notice from the em that the soa-infra is down.
I started managedweblogic and I see that soa_server1 is up.
What am I missing and how can I get the soa-infra started?
I would appreciate any help.
What should the classpath point to?
Steve
I found an entry in the log. Maybe that will help to bebug.
(WebAppServletContext.java:449)
at weblogic.servlet.internal.WebAppServletContext.(WebAppServletContext.java:493)
at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:972)
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:382)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused By: java.lang.ClassNotFoundException: javax.wsdl.WSDLException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.getMethods(BaseJ2eeAnnotationProcessor.java:1055)
at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.getMethods(BaseJ2eeAnnotationProcessor.java:1074)
at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.getMethods(BaseJ2eeAnnotationProcessor.java:1043)
at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.processJ2eeAnnotations(BaseJ2eeAnnotationProcessor.java:99)
at weblogic.j2ee.dd.xml.J2eeAnnotationProcessor.processJ2eeAnnotations(J2eeAnnotationProcessor.java:37)
at weblogic.servlet.internal.WebAnnotationProcessorImpl.processServlets(WebAnnotationProcessorImpl.java:226)
at weblogic.servlet.internal.WebAnnotationProcessorImpl.processJ2eeAnnotations(WebAnnotationProcessorImpl.java:209)
at weblogic.servlet.internal.WebAnnotationProcessorImpl.processAnnotations(WebAnnotationProcessorImpl.java:105)
at weblogic.servlet.internal.WebAppServletContext.processAnnotations(WebAppServletContext.java:1368)
at weblogic.servlet.internal.WebAppServletContext.(WebAppServletContext.java:449)
at weblogic.servlet.internal.WebAppServletContext.(WebAppServletContext.java:493)
at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:972)
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:382)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:58)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:141)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:39)
at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:191)
at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:21)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:165)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:122)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

|
soa-infra is not starting
|
CC BY-SA 3.0
| null |
2011-06-25T15:22:28.087
|
2020-03-31T12:02:15.330
| null | null | 233,309 |
[
"oracle11g",
"soa",
"weblogic-10.x",
"jdeveloper"
] |
6,478,863 | 1 | 6,479,585 | null | 0 | 112 |
I have this UINavigationControl that has its toolbar visible and is showing the RootViewController. Then I push a new viewController into the screen but I like the toolbar to be invisible, while this other viewController is being shown.
Then, to show the viewController and hide the toolbar of the UINavigationControl I do this:
```
self.navigationController.toolbar.hidden = YES;
UIViewController *newVC = [[UIViewController alloc] init];
[self.navigationController pushViewController:newVC animated:YES];
```
The problem is that any touch on this new view controller in the are correspondent where the toolbar was visible on the last view controller is not detected.
As you know, the toolbar sits on a rectangle at the bottom of the screen, has the screen width and 44 pixels high (if I am not wrong). So, the new pushed view controller responds to touch on its full view are except those on this rectangle.
See the following picture. I have 3 buttons. Buttons 1 and 2 will respond to touches, but not button 3, because it is inside the area where the toolbar of the other view was...
And more than that, if I paint the background color of the new view with red, for example, the whole screen will be red, except for that bottom rectangle that will be white (and white is not the color of the previous view). I have checked and the view has 320 x 480...

any clues? thanks.
|
iPhone - pushed view blocked by invisible toolbar (?)
|
CC BY-SA 3.0
| 0 |
2011-06-25T15:59:39.783
|
2011-06-25T18:03:38.893
| null | null | 316,469 |
[
"iphone"
] |
6,479,221 | 1 | 6,479,299 | null | 3 | 889 |
i [am using date.js](http://www.datejs.com/) to parse date in my javascript code
i just found an issue where i pass in
"12 Aug 2011" into a Date.Parse() method and it returns August 1, 2011.
here is a screenshot of the input string (as you can see i am passing in "12 Aug 2011"):

and here is a screenshot of the output date after the parse (as you can see it thinks its Aug 1 2011):

Is there anything i am doing wrong here or is this a bug in the library
|
is this a bug in Date.js?
|
CC BY-SA 3.0
| 0 |
2011-06-25T17:00:52.830
|
2011-08-02T15:19:43.560
| null | null | 4,653 |
[
"javascript",
"jquery",
"parsing",
"date"
] |
6,479,213 | 1 | 6,483,703 | null | 1 | 3,182 |
I followed the [AutoCompleteTextView tutorial](http://developer.android.com/resources/tutorials/views/hello-autocomplete.html) exactly. The layout gets wrong when a soft keyboard is involved.

After tapping inside the dropdown (to select or scroll), the layout is broken:

I tried various combinations of attributes on the AutoCompleteTextView but none seems to work. I also tried setting windowSoftInputMode. The dropdown always pops up above the textbox, and stays there forever.
In landscape orientation, the layout is OK:

Is the standard autocomplete useless? Should I use a different one / write my own?
The code I used is the following:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Country" />
<AutoCompleteTextView android:id="@+id/autocomplete_country"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"/>
</LinearLayout>
```
MainActivity.java:
```
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_country);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_item, COUNTRIES);
textView.setAdapter(adapter);
}
```
|
Android autocomplete and soft keyboard
|
CC BY-SA 3.0
| null |
2011-06-25T16:57:54.200
|
2011-07-06T19:45:00.900
|
2011-06-26T21:37:16.557
| 90,998 | 90,998 |
[
"android",
"android-widget"
] |
6,479,232 | 1 | 6,480,748 | null | 17 | 23,090 |
I want create glossy buttons with GDI+ or Silverlight with C#, any ideas or trickery how to create a glossy button? Somethings like images below:
I am interesting more in GDI+ solutions.

|
How create glossy button in C#?
|
CC BY-SA 3.0
| 0 |
2011-06-25T17:02:06.497
|
2018-03-18T20:08:28.303
|
2011-06-25T17:47:21.377
| 41,956 | 755,097 |
[
"c#",
".net",
"silverlight",
"graphics",
"gdi+"
] |
6,479,243 | 1 | 6,479,279 | null | 0 | 1,497 |
I have a set of pages which look like this --

Links I click in the top section cause the `links`, and `content` sections to change (as intended), but it also refreshes the `bottom` section.
I want the `bottom` section to remain unchanged (clicking on `links` in the `top` section must not refresh the `bottom`) between these pages.
Are iframes the only way of doing this? Is there a way of doing this in ASP.NET using some AJAX control?
Someone please suggest the best way of going about this...
|
How to do Partial Page reloads?
|
CC BY-SA 3.0
| null |
2011-06-25T17:03:59.687
|
2011-06-25T17:16:10.523
|
2011-06-25T17:07:46.880
| 35,434 | 759,019 |
[
"javascript",
"asp.net",
"html",
"ajax",
"iframe"
] |
6,479,257 | 1 | 6,551,578 | null | 3 | 2,850 |
I'm goin mad.
I'm using XCode 4 and finally i finished my app,and i was about to submit it to App Store,uploading to iTunes Connect. I tried to to Build for Archive but this warning showed up:
```
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate. (-19011)
```
I've googled all day long,i've tried to renew all my certificates in Provisioning Center,i've even tried to upload it with Application loader but anything happened. Same error there too. I've tried to validate it through the Archive tab in Organizer but anything, this warning won't go away.
I've read some answers here, and even if the answers were a bit old, anything worked for me, i've tried to reinstall XCode too,i've tried to select the right profile on Build in Targets..
Thanks to anyone who will help me
edit:
When i try to start a new project and select "Build for Archive" and then Archive, the warning appears but i can still share the archive as ipa. I tried to copy all the files from my old project into the new one, build for archive, archived. But when i select "Share" as .ipa it shows an error
```
The operation couldn't be completed. No such files or directory.
```
May this be 'cause i added 2 frameworks to my project to work? Should i select something from Target,or Project? Also,i want to say that all my profiles are ok, certificates etc. I've tried to bypass the error -19011 by turning on NO "Validate built product".
EDIT2:
The -19011 doesn't show up anymore, but when i try to validate or submit,i got this error:
```
The archive is invalid. var/folders/*randomnumbers* app.ipa does not exist.
```
What am i supposed to do in this case? I've already read some of the answers but none worked.

|
XCode 4, Invalid Signature (-19011)
|
CC BY-SA 3.0
| 0 |
2011-06-25T17:05:34.853
|
2015-05-27T22:02:28.343
|
2011-06-27T19:10:08.020
| 781,322 | 781,322 |
[
"objective-c",
"ios",
"xcode4",
"distribution",
"signature"
] |
6,479,387 | 1 | null | null | 2 | 2,096 |
We have an image like:

We have 4 coordinates top:10, bottom:10, left:10, right:10 we have resize to values like newWidth:100, newHeight:35 we have some `SDL_Rect Sprite` which was generated from some `SDL_Surface *button` how to performe on that Sprite such resize transformations?
So how to inplement 9-slice scaling in SDL?
|
Sdl 1.3: how to inplement simple scale-9-grid for image resize?
|
CC BY-SA 3.0
| null |
2011-06-25T17:29:22.723
|
2019-03-13T10:34:27.077
|
2019-03-12T14:37:56.177
| 44,729 | 434,051 |
[
"c++",
"c",
"sdl",
"nine-patch",
"scale9grid"
] |
6,479,534 | 1 | 6,479,698 | null | 2 | 801 |
I am calling a ajax method as below
```
var srchText = "Chicago";
$.ajax({
url: "/Ajax/GetCities",
data: "{'srchText' : '" + srchText + "'}",
dataType: "json",
type: "POST",
async: false,
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
cityList = data.d;
}
});
```
The url is pointing to a MVC controller, as below,
```
[HttpPost]
public ActionResult GetCities(string srchText)
{
List<City> result = new List<City>();
EventsBIZ objBIZ = new EventsBIZ();
result = objBIZ.ToList<City>(objBIZ.GetCities(srchText));
return this.Json(new GetEventsResponse() { d = result }, JsonRequestBehavior.AllowGet);
}
```
There is something wrong with the code, that the method is called successfully, but the srchText is coming as null. Please help me to figure out wat went wrong. Thanks in advance
Adding the request tracked from firebug.

|
Asp.net ajax with mvc2
|
CC BY-SA 3.0
| null |
2011-06-25T17:53:17.690
|
2011-06-25T18:29:49.640
|
2011-06-25T18:21:54.083
| 29,407 | 709,333 |
[
"jquery",
"asp.net",
"asp.net-mvc",
"asp.net-mvc-2"
] |
6,479,563 | 1 | 6,479,828 | null | 1 | 329 |
I need to visualize stuff and want to ask for some hints and tutorials. Or which technique to use (Cocos2D, OpenGL, Quartz, ...)
Anyone here who did Visualization on iOS Devices?
It's about moving objects, fading, particles and more...
Any help is appreciated. I attached two examples.
 
|
Visualization: best approach?
|
CC BY-SA 3.0
| null |
2011-06-25T17:59:04.600
|
2011-06-25T18:51:03.777
| null | null | 710,350 |
[
"iphone",
"ios",
"visualization",
"visualizer"
] |
6,479,581 | 1 | 6,480,830 | null | 6 | 1,534 |
I would like to plot a matrix of zeros and ones into a figure such that for every 1 i have a marker shaped like a vertical bar is plotted " | ". Such that when a series of 1s are on the same x axis, the look like a long straight line.
This example illustrates my intentions:
Given the following matrix:
```
0 0 1 1 0 1 0
0 1 0 1 1 1 0
0 1 0 1 1 1 0
1 0 0 1 1 1 0
```
I get:

|
Plotting with a Specific Marker
|
CC BY-SA 3.0
| 0 |
2011-06-25T18:03:11.310
|
2012-10-10T13:18:47.353
|
2012-10-10T13:18:47.353
| null | 777,050 |
[
"matlab",
"plot",
"gnuplot"
] |
6,479,586 | 1 | 6,479,648 | null | 1 | 2,636 |
I need to know how to remove the numbers from X and Y axes.
I'm don't think this is related to the X grid or Y grid because in the axes Inspector
the XGrid and YGrid is in off state.

I tried all but it did not help.

thanks...
|
Axes Properties - Matlab
|
CC BY-SA 3.0
| null |
2011-06-25T18:03:46.367
|
2011-06-26T16:10:10.430
|
2011-06-26T16:10:10.430
| 556,011 | 556,011 |
[
"matlab",
"graph",
"properties",
"axes"
] |
6,479,727 | 1 | 9,196,170 | null | 19 | 5,587 |
When I apply a rotation transform to a `UITextView` and then click inside to begin editing, it appears that the content size is automatically being made wider. The new width of the content view is the width of the rotated view's bounding box. For example, given a text box of width 500 and height 400, and rotated by 30 degrees, the new content width would be:
```
(500 * cos(30)) + (400 * sin(30)) = 633
```
Or graphically:

Interestingly, if you are already editing the text view and THEN apply the transform, then it appears that no modification is made to the content size. So it appears that sometime around the start of text editing, the text view looks at its `frame` property and adjusts the content size based on the frame width. I imagine the solution to this is to tell it to use the `bounds` property instead, however I don't know where to do this, as I'm not sure exactly where the text view is deciding to modify the content size.
I have googled but can't seem to find any references to using transformed UITextViews. Does anybody have any ideas about this?
```
- (IBAction)rotateButtonTapped:(id)sender {
if (CGAffineTransformIsIdentity(self.textView.transform)) {
self.textView.transform = CGAffineTransformMakeRotation(30.0 * M_PI / 180.0);
}
else {
self.textView.transform = CGAffineTransformIdentity;
}
NSLog(@"contentsize: %.0f, %.0f", textView.contentSize.width, textView.contentSize.height);
}
```
|
Applying transform to UITextView - prevent content resizing
|
CC BY-SA 3.0
| 0 |
2011-06-25T18:26:32.113
|
2012-02-08T15:21:17.807
|
2011-06-25T23:57:34.750
| 429,427 | 429,427 |
[
"ios",
"rotation",
"uitextview",
"transform",
"cgaffinetransform"
] |
6,479,898 | 1 | null | null | 1 | 1,554 |
I want to know how to do something like Adium does, where when you type more text than the field can handle it expands into a new line. Like this:

Either how can I do this, or where in the Adium source code can I find this?
|
Multi-line NSTextFields
|
CC BY-SA 3.0
| 0 |
2011-06-25T19:04:37.070
|
2015-09-04T17:36:35.837
| null | null | 794,560 |
[
"cocoa",
"macos",
"nstextfield"
] |
6,480,025 | 1 | null | null | -5 | 11,841 |
I have a try catch block in my WCF service method that contains an if check on an object. The object 'objRequest' comes in as a service operation input parameter. This is the code:
```
try
{
if (objRequest == null)
{
//the lines here dont execute even though objRequest is null
...
...
}
//remaining code here
}
catch
{
...
}
```
Now comes the strange part. If I put that if check outside the try block, the if check works.
```
if (objRequest == null)
{
//This 'if' check returns true when outside the try block and the line now executes.
.....
....
}
try
{
//remaining code here
}
catch
{
...
}
```
Clipped an image here to prove what I am saying. If the object is null, why did it go into the else block?

I find this magical, and not in a good way. What am I missing here?
|
null check in try catch
|
CC BY-SA 3.0
| 0 |
2011-06-25T19:28:09.973
|
2011-06-25T21:33:27.457
|
2011-06-25T20:19:27.057
| 20,358 | 20,358 |
[
"c#",
".net",
"if-statement",
"try-catch"
] |
6,480,119 | 1 | 6,480,280 | null | 2 | 818 |
When I make a right click in a `TMemo`component the system display a popup menu like this

but when I use a `TSynEdit` component this popup menu is not shown, the question is exist any way to activate this system popup menu in a TSynEdit component or do I have to implement myself a right-click popup menu for the TSynEdit component to get right-click Cut,Copy,Paste,Delete functionality ?
|
How i can call the system popup menu from a TSynEdit component
|
CC BY-SA 3.0
| null |
2011-06-25T19:46:53.647
|
2019-03-11T15:17:27.787
| null | null | 167,454 |
[
"delphi",
"synedit"
] |
6,480,258 | 1 | null | null | 5 | 8,031 |
How could I create this custom tabbar and what does it consist of?

|
How could I create a custom tabbar similar to this
|
CC BY-SA 3.0
| 0 |
2011-06-25T20:15:40.050
|
2011-06-25T21:52:39.210
|
2011-06-25T20:31:02.333
| 115,730 | 815,648 |
[
"iphone",
"objective-c",
"uitabbar"
] |
6,480,299 | 1 | 6,480,399 | null | 0 | 630 |
I have a UISwitch in my app along with one in my settings bundle with the same functionality. The UISwitch in my app however is not saving its settings properly. Can anyone see anything wrong with the code?
```
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Set the application defaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:@"No" forKey:@"isKgs"];
[defaults registerDefaults:appDefaults];
[defaults synchronize];
}
- (void)switchChanged
{
[[NSUserDefaults standardUserDefaults] setBool:unitSwitch.selected forKey:@"isKgs"];
[[NSUserDefaults standardUserDefaults] synchronize];
NSLog(@"SwitchGhanged:");
}
-(void)cellForRowAtIndexPath
{
[unitSwitch addTarget:self action:@selector(switchChanged) forControlEvents:UIControlEventValueChanged];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"isKgs"])
{
[unitSwitch setOn:YES animated:NO];
}
}
```
And here is the settings bundle

|
UISwitch Not Responding To NSUserDefault Changes
|
CC BY-SA 3.0
| null |
2011-06-25T20:24:17.133
|
2011-06-25T20:45:37.497
| null | null | null |
[
"iphone",
"objective-c",
"xcode",
"nsuserdefaults",
"uiswitch"
] |
6,480,641 | 1 | 6,480,656 | null | 5 | 3,135 |
Hi I want to draw these kind of architectural diagrams for my project. Can you please tell me which tools should I use
|
tools for architectural diagram of my application
|
CC BY-SA 3.0
| 0 |
2011-06-25T21:27:56.857
|
2011-11-30T20:09:12.847
| null | null | 798,104 |
[
"architecture"
] |
6,480,915 | 1 | 6,528,456 | null | 3 | 452 |
A picture says more then thousand words:

I created src foulder and webscraper folder with file named dblp.py in it. Why is Aptana/Eclipse showing the duplicates?
|
Why does Aptana (eclipse) create duplicate python packages/files?
|
CC BY-SA 3.0
| null |
2011-06-25T22:30:10.760
|
2012-08-27T12:30:58.297
| null | null | 641,514 |
[
"python",
"eclipse",
"file",
"aptana",
"duplication"
] |
6,480,924 | 1 | 6,480,931 | null | 6 | 3,010 |

For years, I have just saved the image as a background or cut the tail part and use that as the background; I have always used an image when coding on websites. Is there a way to do it without using an image now? I can create the box with rounded corners using CSS, but how can I make the tail?
|
Is there a way to create a tail in a bubble with HTML 5?
|
CC BY-SA 3.0
| null |
2011-06-25T22:31:45.677
|
2011-06-25T22:34:20.250
| null | null | 170,365 |
[
"html",
"css"
] |
6,481,160 | 1 | 6,484,759 | null | 0 | 140 |
This is actually my first project where I use PDO.
It worked very well so far but in this particular case I end up with the following content in my database:

The unmodified code I use is this:
```
<?php
$dbh=new PDO('mysql:host=localhost;dbname=domain-me;port=3306','domain-me','****',array(PDO::MYSQL_ATTR_INIT_COMMAND=>"SET NAMES utf8"));
$sql="
INSERT INTO payments_paypal (
tid ,
txn_id ,
item_number ,
item_name ,
mc_currency ,
mc_gross ,
payment_date ,
payment_status ,
custom ,
payer_email ,
raw_data
)
VALUES (
NULL , ':txn_id', ':item_number', ':item_name', ':mc_currency', ':mc_gross', ':payment_date', ':payment_status', ':custom', ':payer_email', ':raw_data'
);
";
$sth=$dbh->prepare($sql);
$do=$sth->execute(array(':txn_id'=>@$_POST["txn_id"],':item_number'=>$_POST["item_number"],':item_name'=>$_POST["item_name"],':mc_currency'=>$_POST["mc_currency"],':mc_gross'=>$_POST["mc_gross"],':payment_date'=>$_POST["payment_date"],':payment_status'=>$_POST["payment_status"],':custom'=>$_POST["custom"],':payer_email'=>$_POST["payer_email"],':raw_data'=>$_POST["raw_data"],));
?>
```
edit:
I now did it using the old mysql_function and it works now. However I have this query that works just fine:
```
$sql = "INSERT INTO users ( puid,refcode,extuid, login,login_proxy, pass, email)
VALUES (:puid,:refcode,:extuid,:login,:login_proxy,:pass,:email);";
$sth = $dbh->prepare($sql);
$do = $sth->execute(
array(
':puid' => $refuser,
':refcode' => crc32(uniqid('')),
':extuid' => md5(uniqid('')),
':login' => $_POST['login'],
':login_proxy' => $_POST['login'],
':pass' => sha1($_POST['pass']),
':email' => $_POST['email'] ,
)
);
```
|
Why do I end up with my param names instead of their values in this PDO insert statement?
|
CC BY-SA 3.0
| 0 |
2011-06-25T23:31:59.250
|
2013-12-13T23:14:14.907
|
2013-12-13T23:14:14.907
| 413,910 | 413,910 |
[
"php",
"mysql",
"pdo"
] |
6,481,192 | 1 | 6,482,989 | null | 1 | 650 |
By default, if you add a NSTextView to an application and go to Format -> Text -> Show Ruler, a ruler will be shown on top of the text view like in TextEdit with various formatting options, and will look like so:

How would I go about changing the background colour of that ruler? (The ruler should also be there on 10.6, maybe even earlier)
Thanks for any hints/suggestions!
After stabbing around a bit what a call to `description` on the ruler and what it's subviews are, I came to these results:
```
Description of ruler: <NSRulerView: 0x10056e580>
Orientation: horizontal, Rule thickness: 16.0
Flipped: Yes, frame: {{0.0, 0.0}, {528.0, 55.0}}, bounds: {{0.0, 0.0}, {528.0, 55.0}}
Accessory frame: {{0.0, 0.0}, {528.0, 24.0}}
Ruler's Subviews: (
"<NSStopTouchingMeBox: 0x10059b940>"
)
```
That's a pretty interesting class name, isn't it? =P
|
Change background colour of NSTextView's default top ruler
|
CC BY-SA 3.0
| null |
2011-06-25T23:40:15.240
|
2011-06-26T08:44:18.627
|
2011-06-25T23:46:14.543
| 219,515 | 219,515 |
[
"cocoa",
"macos",
"nstextview",
"rulers"
] |
6,481,556 | 1 | 6,481,718 | null | 0 | 150 |
I am making an Android app and am nearly finished.
When I started the app, I made my main pages as Activity type using buttons for the user to perform actions.
Now that I'm nearly done, I thought it'd be much nicer to change the buttons to an image and text, something like:

Is there a way to put a listview in an Activity or do I need to redo all of those pages and recreate them extended from Listview instead of Activity?
|
Can an Android Activity contain a listview?
|
CC BY-SA 3.0
| null |
2011-06-26T01:21:42.857
|
2011-06-26T02:04:49.113
| null | null | 763,472 |
[
"android",
"listview",
"android-activity"
] |
6,481,581 | 1 | 6,481,654 | null | 15 | 13,118 |
I can't figure out an elegant way to accomplish the following using CSS:

I need the numbers of the ordered list to have the teal bubble-looking background. I have this image (which includes the white stroke):

But I can't figure out how to put it behind each of the numbers using CSS. Thanks.
|
Add background image to <ol> numbers
|
CC BY-SA 3.0
| 0 |
2011-06-26T01:28:44.147
|
2015-07-28T11:31:47.803
|
2011-06-26T08:15:15.783
| null | 538,400 |
[
"css"
] |
6,481,632 | 1 | null | null | 8 | 33,027 |
I am printing a cell using the FPDF([http://www.fpdf.org/](http://www.fpdf.org/)) class in php. The cell should be placed into the top left corner.
Everything works great, except that a left padding is added inside the cell.
Here is my code:
```
$pdf = new FPDF('L', 'mm', array(50.8,88.9));
$pdf->addPage('L', array(50.8,88.9));
$pdf->SetDisplayMode(100,'default');
$pdf->SetTextColor(0,0,0);
$pdf->SetMargins(0,0,0);
$pdf->SetAutoPageBreak(0);
$pdf->SetFont('Arial','',8.5);
$pdf->SetXY(0, 0); //sets the position for the name
$pdf->Cell(0,2.98740833, "Your Name", '1', 2, 'L', false); //Name
```
Here's a screenshot of the PDF that is outputting with FPDF:

Why is there a left padding in a cell using FPDF in php and how can I remove the padding?
|
Why is there a left padding in a cell using FPDF in php?
|
CC BY-SA 3.0
| null |
2011-06-26T01:41:05.873
|
2022-05-12T08:12:59.630
|
2011-06-26T04:29:55.763
| 83,916 | 83,916 |
[
"php",
"pdf",
"pdf-generation",
"fpdf"
] |
6,481,699 | 1 | 6,483,248 | null | 2 | 2,567 |
I have a list here generated from a long query which the data is used to pump to a report.
```
var result =
from..
where..
select new { sale.Id, Username = u.Name, Amount = p.amount};
output = result.Tolist();
```
However, i would like to get rid of that long query by creating my own list of value instead. So i create a dictionary to store the key and value.
My purpose is to convert a dictionary back to a list which has the same output like the query above so that it can be pumped to my report
```
public static object GetSalesDataBySaleOrderID(SaleOrder sale)
{
List<KeyValuePair<string, object>> list = new List<KeyValuePair<string, object>>();
for (int i = 0; i < sale.saleOrderItem.Count(); i++)
{
Dictionary<string, object> result = new Dictionary<string, object>()
{
{sale.Id.ToString(), sale.Id},
{"UserName", sale.User.GetSingleUserById(sale.saleOrderItem[i].UserId).Name},
{"Amount", sale.saleOrderItem[i].Amount},
};
list.Add(result);
}
return list;
}
```
I got an error at `list.Add(result);`
> Error 5 Argument '1': cannot convert from 'System.Collections.Generic.Dictionary' to 'System.Collections.Generic.KeyValuePair'
I have changed to `List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();` and it solved my error.
However i am still getting the value in dictionary format

This should be the intended output format in List

|
Convert Dictionary to List
|
CC BY-SA 3.0
| null |
2011-06-26T01:58:15.287
|
2011-06-26T21:03:44.700
|
2011-06-26T02:27:40.497
| 606,543 | 606,543 |
[
"c#",
"winforms"
] |
6,481,806 | 1 | 6,481,816 | null | 11 | 74,108 |
I currently have a database like the picture below.

Where there is a query that selects the rows with number1 equaling 1. When using
```
mysql_fetch_assoc()
```
in php I am only given the first is there any way to get the second? Like through a dimesional array like
```
array['number2'][2]
```
or something similar
|
How to select multiple rows from mysql with one query and use them in php
|
CC BY-SA 3.0
| 0 |
2011-06-26T02:36:32.817
|
2022-05-03T23:49:01.787
|
2014-04-18T13:31:17.213
| 3,359,432 | 402,746 |
[
"php",
"mysql",
"multidimensional-array",
"fetch",
"multirow"
] |
6,482,041 | 1 | 6,482,063 | null | 2 | 1,017 |
I'm trying to use the binarySearch method documented at the [Java API Specification](http://download.oracle.com/javase/6/docs/api/java/util/Arrays.html#binarySearch%28java.lang.Object%5B%5D,%20int,%20int,%20java.lang.Object%29) but my IDE, Eclipse (Helios), is not recognizing the signature.
My class, boiled down to its 2 data members and the method in which I'm trying to call the Arrays.binarySearch:
```
import java.util.Arrays; // Access Arrays class
public class SortedStringArrayList {
// member data
private String[] items;
private int size;
// methods
public int testBinSearch(String item) {
int index = Arrays.binarySearch(items, 0, size, item);
}
}
```
When I code in the method, Eclipse assumes I want a different signature and tells me:
> The method binarySearch(int[], int) in
the type Arrays is not applicable for
the arguments (String[], int, int,
String)
The signatures for binarySearch it suggested as available were:

I'm very new to Java/Eclipse. Anyone know what the problem is?
|
Java Arrays.binarySearch(Object[], int, int, Object) Signature Not Recognized
|
CC BY-SA 4.0
| null |
2011-06-26T03:54:19.390
|
2018-11-28T23:51:07.200
|
2018-11-28T23:51:07.200
| 472,495 | 732,878 |
[
"java",
"arrays",
"eclipse",
"signature",
"binary-search"
] |
6,482,128 | 1 | 6,482,134 | null | 1 | 1,015 |
here is my error

even i tried: `dtp_ngaycap.Value` it still confirms me that error.
here is the code of `CNcommands` class
```
public bool CNcommands(string commandType,string tenchunha,string nguoidaidien, string chucvu, int soCMDN, DateTime ngaycap, string diachi, string masothue, string nguoithuhuong, string sotaikhoan,string nganhang,string sodienthoai, string diachiemail, string diachinganhang, int maCN)
{
if (commandType == "insert")
{
string insertCN = "INSERT INTO [QLThueNha].[dbo].[ChuNha][MaChuNha],[TenChuNha],[Nguoidaidien],[Chucvu],[SoCMND],[Ngaycap],[Diachi],[Masothue],[Nguoithuhuong],[Sotaikhoan],[Nganhang],[Sodienthoai],[DiachimailCN],[Diachinganhang])VALUES('" + tenchunha + "','" + nguoidaidien + "','" + chucvu + "','" + soCMDN + "','" + ngaycap + "','" + diachi + "','" + masothue + "','" + nguoithuhuong + "','" + sotaikhoan + "','" + nganhang + "','" + sodienthoai + "','" + diachiemail + "','" + diachinganhang + "')";
if (executeQuery(insertCN, ref rowAffect_) == true && rowAffect_ == 1)
{
return true;
}
return true;
}
else if (commandType == "update")
{
string updateCN = "UPDATE [QLThueNha].[dbo].[ChuNha] SET [TenChuNha] = '" + tenchunha + "',[Nguoidaidien] = '" + nguoidaidien + "',[Chucvu] = '" + chucvu + "',[SoCMND] = '" + soCMDN + "',[Ngaycap] = '" + ngaycap + "',[Diachi] = '" + diachi + "',[Masothue] = '" + masothue + "',[Nguoithuhuong] = '" + nguoithuhuong + "',[Sotaikhoan] = '" + sotaikhoan + "',[Nganhang] = '" + nganhang + "',[Sodienthoai] = '" + sodienthoai + "',[DiachimailCN] = '" + diachiemail + "',[Diachinganhang] = '" + diachinganhang + "' WHERE <Search Conditions,,>";
if (executeQuery(updateCN, ref rowAffect_) == true && rowAffect_ == 1)
{
return true;
}
return true;
}
else
{
return false;
}
//if (commandType == "delete")
//{
// string deleteCN = "SET [TenChuNha] = '" + tenchunha + "',[Nguoidaidien] = '" + nguoidaidien + "',[Chucvu] = '" + chucvu + "',[SoCMND] = '" + soCMDN + "',[Ngaycap] = '" + ngaycap + "',[Diachi] = '" + diachi + "',[Masothue] = '" + masothue + "',[Nguoithuhuong] = '" + nguoithuhuong + "',[Sotaikhoan] = '" + sotaikhoan + "',[Nganhang] = '" + nganhang + "',[Sodienthoai] = '" + sodienthoai + "',[DiachimailCN] = '" + diachiemail + "',[Diachinganhang] = '" + diachinganhang + "' WHERE <Search Conditions,,>";
// if (executeQuery(deleteCN, ref rowAffect_) == true && rowAffect_ == 1)
// {
// return true;
// }
//}
}
```
|
error datetime picker converting
|
CC BY-SA 3.0
| null |
2011-06-26T04:24:05.990
|
2014-02-14T09:40:29.070
|
2014-02-14T09:40:29.070
| 2,040,039 | 728,724 |
[
"c#",
"datetimepicker"
] |
6,483,326 | 1 | 13,308,484 | null | 11 | 17,798 |
I am printing a cell using the TCPDF([http://www.tcdf.org/](http://www.tcpdf.org/doc/classTCPDF.html)) class in php. The cell should be placed into the top left corner.
Everything works great, except that a left and top padding is added inside the cell.
Here is my code:
```
require_once('../config/lang/eng.php');
require_once('../tcpdf.php');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetMargins(0,0,0);
$pdf->SetAutoPageBreak(0,0);
$pdf->SetFont('dejavusans', '', 8.5, '', true);
$pdf->AddPage('L', array(50.8,88.9));
$pdf->SetDisplayMode(100,'default');
$pdf->SetXY(0, 0);
$pdf->Cell(0,2.98740833, "Your Name", '1', 2, 'L', false); //Name
$pdf->Output('example.pdf', 'I');
```
Here's a screenshot of the PDF that is outputting with TCPDF:

Here's a screenshot of the same cell at 300% magnification:

How can I remove the unwanted padding?
//////
I managed to remove the left padding by using the setCellPaddings() function:
```
$pdf->setCellPaddings(0,0,0,0);
```
I am however still getting padding above and below the text within the cell:

I can increase the size of the cell, but when I try to make the height of the cell smaller to try and close it in on the text, the cell won't get any smaller than the current size. How can I decrease the height of the cell or remove the unwanted top and bottom padding of the cell?
|
Why is there a left and top padding in a cell using TCPDF in php?
|
CC BY-SA 3.0
| 0 |
2011-06-26T10:11:25.170
|
2014-02-19T17:31:13.443
|
2011-06-26T11:39:50.907
| 83,916 | 83,916 |
[
"php",
"pdf",
"pdf-generation",
"tcpdf"
] |
6,483,413 | 1 | 6,484,507 | null | -4 | 2,434 |
I found this interview question in Java, and I think the output is right to left order under number 3, means:
2 1 2 0 1
Am I right ?
thnx !!
```
public class IntNode;
{
private int _value;
private IntNode _next;
public IntNode (int val, IntNode n)
{
_value = val;
_next = n;
}
public IntNode getNext () {return _next;}
public void setNext (IntNode node) {_next = node;}
public int getValue () {return _value;}
public void setValue (int v) {_value = v;}
}
```
```
public class IntList
{
private IntNode _head;
public IntList() {_head = null;}
public void addHead (int val)
{
_head = new IntNode (val, _head);
}
}
```
```
public class Node
{
private int _number;
private Node _leftSon, _rightSon;
public Node (int number)
{
_number = number;
_leftSon = null;
_rightSon = null;
}
public int getNumber() {return _number;}
public Node getLeftSon() {return _leftSon;}
public Node getRightSon() {return _rightSon;}
}
```
```
The BinaryTree Class:
public class BinaryTree
{
public static IntList what (Node root , int i)
{
IntList level = new IntList();
if (root != null)
what (level, i, root);
return level;
}
private static void what (IntList level, int i, Node t)
{
if (t != null)
{
if (i>0)
{
what (level, i-1, t.getRightSon());
what (level, i-1, t.getLeftSon());
}
else
level.addHead(t.getNumber());
}
}
}
```
1) For the following tree(pic), what will be printed on screen for the following lines:
```
IntList list = BinaryTree.what(root, 3);
Sys...out... (list);
```
2) What does the method '' generaly, when she receives a root of a binary tree ?

|
Interview question in Java
|
CC BY-SA 3.0
| null |
2011-06-26T10:35:02.610
|
2020-06-17T21:53:21.970
|
2011-06-26T11:17:40.970
| 719,178 | 719,178 |
[
"java",
"binary-tree"
] |
6,483,423 | 1 | 6,483,478 | null | 10 | 3,966 |
I implemented a path simplification algorithm after reading the article here:
[http://losingfight.com/blog/2011/05/30/how-to-implement-a-vector-brush/](http://losingfight.com/blog/2011/05/30/how-to-implement-a-vector-brush/)
It's worked for me pretty well for generating optimized level geometry for my game. But, I'm using it now to clean up a* pathfinding paths and it's got a weird edge case that fails miserably.
Here's a screenshot of it working - optimizing the path from red circle to the blue circle. The faint green line is the a* output, and the lighter whiteish line is the optimized path.

And here's a screenshot of it failing:

Here's my code. I adapted the ObjC code from the article to c++
Note: `vec2fvec` is a `std::vector< vec2<float> >`, and 'real' is just a typedef'd float.
```
void rdpSimplify( const vec2fvec &in, vec2fvec &out, real threshold )
{
if ( in.size() <= 2 )
{
out = in;
return;
}
//
// Find the vertex farthest from the line defined by the start and and of the path
//
real maxDist = 0;
size_t maxDistIndex = 0;
LineSegment line( in.front(), in.back() );
for ( vec2fvec::const_iterator it(in.begin()),end(in.end()); it != end; ++it )
{
real dist = line.distance( *it );
if ( dist > maxDist )
{
maxDist = dist;
maxDistIndex = it - in.begin();
}
}
//
// If the farhtest vertex is greater than our threshold, we need to
// partition and optimize left and right separately
//
if ( maxDist > threshold )
{
//
// Partition 'in' into left and right subvectors, and optimize them
//
vec2fvec left( maxDistIndex+1 ),
right( in.size() - maxDistIndex ),
leftSimplified,
rightSimplified;
std::copy( in.begin(), in.begin() + maxDistIndex + 1, left.begin() );
std::copy( in.begin() + maxDistIndex, in.end(), right.begin() );
rdpSimplify(left, leftSimplified, threshold );
rdpSimplify(right, rightSimplified, threshold );
//
// Stitch optimized left and right into 'out'
//
out.resize( leftSimplified.size() + rightSimplified.size() - 1 );
std::copy( leftSimplified.begin(), leftSimplified.end(), out.begin());
std::copy( rightSimplified.begin() + 1, rightSimplified.end(), out.begin() + leftSimplified.size() );
}
else
{
out.push_back( line.a );
out.push_back( line.b );
}
}
```
I'm really at a loss as to what's going wrong. My spidey sense says it's in the std::copy calls... I must be copying garbage in some circumstances.
EDIT:
I've rewritten the algorithm dropping any use of iterators and std::copy, and the like. It still fails in the exact same way.
```
void rdpSimplify( const vec2fvec &in, vec2fvec &out, real threshold )
{
if ( in.size() <= 2 )
{
out = in;
return;
}
//
// Find the vertex farthest from the line defined by the start and and of the path
//
real maxDist = 0;
size_t maxDistIndex = 0;
LineSegment line( in.front(), in.back() );
for ( size_t i = 0, N = in.size(); i < N; i++ )
{
real dist = line.distance( in[i] );
if ( dist > maxDist )
{
maxDist = dist;
maxDistIndex = i;
}
}
//
// If the farthest vertex is greater than our threshold, we need to
// partition and optimize left and right separately
//
if ( maxDist > threshold )
{
//
// Partition 'in' into left and right subvectors, and optimize them
//
vec2fvec left, right, leftSimplified, rightSimplified;
for ( size_t i = 0; i < maxDistIndex + 1; i++ ) left.push_back( in[i] );
for ( size_t i = maxDistIndex; i < in.size(); i++ ) right.push_back( in[i] );
rdpSimplify(left, leftSimplified, threshold );
rdpSimplify(right, rightSimplified, threshold );
//
// Stitch optimized left and right into 'out'
//
out.clear();
for ( size_t i = 0, N = leftSimplified.size(); i < N; i++ ) out.push_back(leftSimplified[i]);
for ( size_t i = 1, N = rightSimplified.size(); i < N; i++ ) out.push_back( rightSimplified[i] );
}
else
{
out.push_back( line.a );
out.push_back( line.b );
}
}
```
|
Ramer-Douglas-Peucker path simplification algorithm
|
CC BY-SA 3.0
| 0 |
2011-06-26T10:37:28.977
|
2011-06-26T12:33:07.147
|
2011-06-26T10:54:31.783
| 235,825 | 769,829 |
[
"c++",
"algorithm",
"debugging"
] |
6,483,642 | 1 | 6,483,684 | null | 0 | 171 |
Can anyone tell me why in the image below the text information is not on the same level?
As far as I'm aware, the exact same styles are governing both the email address and the other stuff, but they're not level...The only styles I've added are the ones printed below and then there's the default stuff that comes with the wordpress blogging software.
If you're willing to help, it might be easier if you visit the site. Thanks
www.dodomainer.com [dodomainer.com](http://dodomainer.com)

Links
```
<div class="topnav">
<li><a href="http://dodomainer.com/"><span class="class6">||</span><span class="class7"> My abilities in 6 modern languages (中文, Deutsch, French, Spanish, 日本語 & English) can help you find new value in the daily drop list</span></a></li>
<li><a href="http://dodomainer.com/"><span class="class7">mike@</span>
<span class="class7">dodo</span><span class="class7">mainer</span><span class="class7">.com</span></a></li>
</div>
```
CSS
```
.custom .topnav li { float: right; padding: 3px 10px 3px 0px; }
.custom .topnav li a { font-size: 1.5em; color: #000000; }
```
|
Can't get the CSS to make elements on same level
|
CC BY-SA 3.0
| null |
2011-06-26T11:35:16.567
|
2011-10-31T20:20:24.947
| null | null | 577,455 |
[
"css"
] |
6,483,779 | 1 | 6,483,821 | null | -1 | 1,257 |
Could someone point me in the right direction, for Tray Notification Windows, similar to the example below:

|
C# - Tray Notification Windows
|
CC BY-SA 3.0
| null |
2011-06-26T12:07:08.760
|
2011-06-26T12:14:30.793
|
2011-06-26T12:11:19.087
| 419 | 816,110 |
[
"c#",
".net",
"windows"
] |
6,483,796 | 1 | 6,484,715 | null | 3 | 17,020 |
I need an interface on my Rails 3 app to upload multiple files to Amazon S3 (because i'm on heroku), possibly with progress bars.
I've easily managed how to set up paperclip and upload single files, but i'm really lost now on how to go ahead.
Please can you give me some advices? It's 2 days i'm searching across all the internet, but i can't find a working solution
---
** EDIT **
I really can't understand... I'm going mad 'cause I'm losing too many hours on this... please help me.
If I try to open the example app cited by Johnny I only get this (and in my app it is the same):

Where is the UI?
Is there something wrong on my browser?
---
** EDIT 2 **
[Here on GitHub you can find my testapp](https://github.com/AndreaBarbon/testapp)... please can you explain me why the damn upload UI is not showing up? Thanks!
---
** EDIT 3 **
Thank you very much Johnny, i wasn't aware of the fact that jquery and prototype can't live together.
Now the plugin is showing up correctly, but as a try to upload something it creates a new "upload" record, but its attachment field is blank, and the files are not on s3.
This is what the console is saying:
```
Started POST "/uploads" for 127.0.0.1 at 2011-06-27 16:17:22 +0200
Processing by UploadsController#create as JSON
Parameters: {"utf8"=>"✓", "authenticity_token"=>"GesRBTiZR1f2LV/bAeAdxWqF++gxcDJw4pPGStYGsH8=", "upload"=>{"attachment"=>[#<ActionDispatch::Http::UploadedFile:0x000001032834b8 @original_filename="animal-tiger-66550.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"upload[attachment][]\"; filename=\"animal-tiger-66550.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/var/folders/Qj/QjEqvUUNGTmuki5SXOaaG++++TI/-Tmp-/RackMultipart20110627-1818-1syiex9>>]}}
AREL (0.5ms) INSERT INTO "uploads" ("attachment", "created_at", "updated_at", "attachment_file_name", "attachment_content_type", "attachment_file_size", "attachment_updated_at") VALUES (NULL, '2011-06-27 14:17:23.049136', '2011-06-27 14:17:23.049136', NULL, NULL, NULL, NULL)
[paperclip] Saving attachments.
Completed 200 OK in 64ms (Views: 4.2ms | ActiveRecord: 0.7ms)
```
|
Multiple files upload with Rails 3 and paperclip on heroku
|
CC BY-SA 3.0
| 0 |
2011-06-26T12:10:25.777
|
2016-09-29T05:40:47.703
|
2011-06-27T14:25:11.157
| 396,133 | 396,133 |
[
"ruby-on-rails",
"paperclip"
] |
6,483,939 | 1 | 6,491,327 | null | 8 | 20,653 |
Is there a simple way to generate a 5 star rating element in Jquery-mobile?
Similar to [http://orkans-tmp.22web.net/star_rating/](http://orkans-tmp.22web.net/star_rating/).

|
How to make an awesome star rating
|
CC BY-SA 3.0
| 0 |
2011-06-26T12:33:22.910
|
2016-05-12T15:31:49.033
|
2012-08-20T14:39:57.737
| 472,495 | 337,531 |
[
"jquery-mobile",
"rating"
] |
6,484,197 | 1 | 6,485,707 | null | 2 | 554 |
I have made a search but couldn't find a solution which works for me.
I just wonder how Facebook or Linkedin manages to handle same type activity with one sentence?
I mean, if you store every activity with different IDs in an Activity Table, how can you list them as "Member_a and 15 more people changed their photos"
I'm trying to make a social activity wall for my web-site, it's not that big but I just wanted to know the logic on this situation.
For example, when first page loads, I make an Ajax call and listing 0-10 records and if user scrolls down, page makes another ajax call which lists 11-20 records.
Now; if I try to combine same type of activity after sql select query with using if else, if this 10 records are the same, the user will only see 1 item. I hope I could explain what I want to say :)
So, I need a solution which makes this query in SQL Statement.
I'm not asking from you to write a query for me, I just want to know the logic.
Here is a screenshot what I want to achieve:


You see, they are actually different stored data but they combined it and made it as a 1 item network update.
By the way, I'm using C# and SQL Server 2008.
|
How to combine multiple activity data like Facebook with SQL Server?
|
CC BY-SA 3.0
| 0 |
2011-06-26T13:22:18.263
|
2011-06-26T17:59:04.387
|
2011-06-26T15:44:19.630
| 265,570 | 235,555 |
[
"sql-server",
"facebook",
"android-activity",
"feed",
"linkedin"
] |
6,484,401 | 1 | 6,484,785 | null | 3 | 3,244 |
I have a JScrollPane with number of huge JTables in it.

While i'm scrolling down the JScrollPane by mouse scroll, it just stops when the mouse pointer passes a JTable. (i.e. Scrollbar works only on B area but not in A.)
How can I avoid this? Thanks.
Here is the code:
```
/*
* test.java
*
* Created on Jun 26, 2011, 7:39:43 PM
*/
package collector;
import javax.swing.JScrollPane;
/**
*
* @author Bhathiya
*/
public class test extends javax.swing.JFrame {
/** Creates new form test */
public test() {
initComponents();
jScrollPane2.setWheelScrollingEnabled( false );
jScrollPane3.setWheelScrollingEnabled( false );
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jPanel1 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jScrollPane3 = new javax.swing.JScrollPane();
jTable2 = new javax.swing.JTable();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jTable1.setAutoscrolls(false);
jScrollPane2.setViewportView(jTable1);
jScrollPane3.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane3.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
jTable2.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jTable2.setAutoscrolls(false);
jTable2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jScrollPane3.setViewportView(jTable2);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 374, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(151, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 131, Short.MAX_VALUE)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(194, 194, 194))
);
jScrollPane1.setViewportView(jPanel1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new test().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JTable jTable1;
private javax.swing.JTable jTable2;
// End of variables declaration
}
```
|
Scrollbar in JScrollPane does not work on JTables
|
CC BY-SA 4.0
| 0 |
2011-06-26T13:57:47.690
|
2022-01-19T21:06:56.907
|
2022-01-19T21:06:56.907
| 4,294,399 | 805,563 |
[
"java",
"swing",
"jtable",
"jscrollpane",
"mouse-cursor"
] |
6,484,435 | 1 | 6,485,151 | null | 1 | 2,907 |
I'm following an example in Beginning Iphone Development 4 for basic user interaction.
I'm using xcode 4.02 with sdk 4.3
I have a basic viewcontroller.xib with two textbox's, one for numeric values and another for text. Once I'm finished editing either of the text fields I wish to tap the background and have the keypad disappear.
The books says to change the container UIView object to a UIControl and then add an action onto the UIControl event Touch Down. Then create a method to resign the first responder of each of the textbox's and link this to the touch down event. I've done this. Here is my code, is there anything I've missed? At the moment nothing happens.

Thanks
```
@interface ControlFunViewController : UIViewController {
UITextField *nameField;
UITextField *numberField;
}
@property (nonatomic, retain) IBOutlet UITextField *nameField;
@property (nonatomic, retain) IBOutlet UITextField *numberField;
- (IBAction)textFieldDoneEditing:(id)sender;
- (IBAction)backgroundTap:(id)sender;
```
Implementation:
```
#import "ControlFunViewController.h"
@implementation ControlFunViewController
@synthesize nameField;
@synthesize numberField;
- (void)dealloc
{
[nameField release];
[numberField release];
[super dealloc];
}
- (IBAction)textFieldDoneEditing:(id)sender {
[sender resignFirstResponder];
}
- (IBAction)backgroundTap:(id)sender {
[nameField resignFirstResponder];
[numberField resignFirstResponder];
}
```
|
IPhone app xcode, trying to hide text input by clicking on the background?
|
CC BY-SA 3.0
| 0 |
2011-06-26T14:04:09.853
|
2012-03-11T09:00:58.393
|
2011-06-26T14:10:34.487
| 358,297 | 358,297 |
[
"iphone",
"xcode",
"uicontrol",
"keypad",
"resignfirstresponder"
] |
6,484,448 | 1 | null | null | 0 | 977 |
I'm using cascading dropdownlist. When I select make it post makeId to the server using webservice and returns models. Then I add models to dropdownlist
The problem is. If I inspect models dropdownlist in firefox using firebug tool, I'm able to see just added models, but when I click it opens empty.
I'm using jQuery Mobile and jQuery Selectbox.
Here is my code:
```
$(document).ready(function () {
$('#Makes').change(function () {
getModels();
});
});
function getModels() {
var make = $('#Makes').val();
$.ajax({
type: "POST",
url: "/Services/CarService.asmx/Models",
data: "{makeId: '" + make + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
alert(response.d);
var models = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
$('#Models').attr('disabled', false).removeOption(/./);
for (var i = 0; i < models.length; i++) {
var val = models[i];
var text = models[i];
$('#Models').addOption(val, text, false);
alert(models[i]);
}
}
});
}
@Html.DropDownList("Makes", "Please select make")
<select id="Models"></select>
[WebMethod]
public List<string> Models(int makeId)
{
var dataContext = new SearchModel();
var models = from m in dataContext.GetAllModels()
where m.Id == makeId
select m.Model;
return models.ToList();
}
```

|
ASP.NET MVC3 cascading DropDownList is not working properly
|
CC BY-SA 3.0
| 0 |
2011-06-26T14:06:35.860
|
2011-06-26T16:25:04.770
|
2011-06-26T16:25:04.770
| 41,956 | 747,393 |
[
"c#",
"jquery",
".net",
"asp.net-mvc-3",
"jquery-mobile"
] |
6,484,619 | 1 | 6,484,632 | null | 3 | 118 |
This is one of the common issues i face and i end up having nasty additional spacer markup to avoid having a margin in the right or the left ( also at the top or the bottom if it's a vertical menu ).
Is there a clean css way to avoid applying the margin for the last element?
---

|
How to apply spacing between divs without having an excess at the right or the left?
|
CC BY-SA 3.0
| 0 |
2011-06-26T14:40:26.853
|
2011-06-26T16:11:00.513
| null | null | 241,654 |
[
"css"
] |
6,484,699 | 1 | 6,485,116 | null | 2 | 13,448 |
all, i tried to use Visual Leak Detector, and followed the instructions:
Visual C++ 2010: Go to View ->Property Manager, select Microsoft.Cpp.Win32.user. Select VC++ Directories and then "Include files" from the tree. Add the include subdirectory from the Visual Leak Detector installation directory. Move it to the bottom of the list. Then select "Library files" from the drop-down menu and add the lib\Win32 subdirectory from the Visual Leak Detector installation directory. Again, move it to the bottom of the list. Repeat for Microsoft.Cpp.x64.user, but select lib\Win64 subdirectory instead.
and include in one of my source file, and got the error c1083, so whats going on?
this is what i entered:
C:\Program Files\Visual Leak Detector\lib\Win32;$(IncludePath)
for Microsoft.Cpp.Win32.user
C:\Program Files\Visual Leak Detector\lib\Win64;$(IncludePath)
for Microsoft.Cpp.X64.user

cheers
daiyue
|
fatal error C1083: Cannot open include file: 'vld.h': No such file or directory
|
CC BY-SA 3.0
| 0 |
2011-06-26T14:54:13.157
|
2011-06-26T16:17:47.597
|
2011-06-26T15:41:36.000
| 766,708 | 766,708 |
[
".net",
"c++",
"visual-c++"
] |
6,484,978 | 1 | 6,485,035 | null | 2 | 7,896 |
I tried using a raycasting-style function to do it but can't get any maintainable results. I'm trying to calculate the intersection between two tangents on one circle. This picture should help explain:

I've googled + searched stackoverflow about this problem but can't find anything similar to this problem. Any help?
|
Calculating intersection point of two tangents on one circle?
|
CC BY-SA 3.0
| null |
2011-06-26T15:50:02.753
|
2013-09-12T03:42:57.073
|
2013-09-12T03:42:57.073
| 1,915,005 | 771,394 |
[
"math",
"geometry",
"raycasting"
] |
6,485,321 | 1 | 6,639,519 | null | 0 | 220 |
Probably simple but i cannot figure this out.
I have a subclass of SlidingDrawer only to handle the hight correctly.
(thanks to [@seydhe](https://stackoverflow.com/questions/3654492/android-can-height-of-slidingdrawer-be-set-with-wrap-content) for the solution)
The problem is that when i open the drawer the hight is not set correctly,
It get set as soon as i lift my finger from the handle-butten.
How can i make the SlidingDrawer set the hight before i start pulling the drawer?
I have tries in various combinations to `slidingDrawerRight.requestLayout();`
and it works. The problem is where can i call it?
I have tried in various places like
OnClickListener
OnTouchListener
OnDrawerCloseListener
but i cannot get it to work.
Maybe there's a way to fix the xml to do this?
adding tree images and the xml.
As shown in down belove picture nr:1,
I start to open the drawer
and the size is irregular:
NR1: Image when being opened..

```
NR2: Image when fully opened as soon as i let go of finger.
```

nr3 Image when SD background is set to #eeffae and RelativLayout background is @null

```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/examplegallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<RelativeLayout
android:id="@+id/InnerRelativeLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button
android:id="@+id/btn_newpen_drawtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pen"
/>
<EditText
android:id="@+id/etx_addtext_drawtext"
android:layout_width="fill_parent"
android:layout_toLeftOf="@+id/btn_delete_pen"
android:layout_toRightOf="@+id/btn_newpen_drawtext"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="Enter text here"
/>
<Button
android:id="@+id/btn_delete_pen"
android:layout_toLeftOf="@+id/btn_save_drawtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Del"
/>
<Button
android:id="@+id/btn_save_drawtext"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="save"
/>
</RelativeLayout>
<LinearLayout android:id="@+id/linearLayoutSlidingDrawerRight"
android:layout_width="150dip"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
>
<com.bollen.sppik.editimage.WrappingSlidingDrawer android:id="@+id/slidingDrawerRight"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:handle="@+id/slideHandleButtonRight"
android:content="@+id/contentLayout2"
android:orientation="horizontal">
<ImageButton android:id="@+id/slideHandleButtonRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:onClick="btnSlidingDrawerHandler">
</ImageButton>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:id="@+id/contentLayout2"
android:orientation="vertical"
android:background="#C0C0C0"
>
<ImageButton android:id="@+id/btn_A"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Button_A"
android:background="@android:color/transparent"
android:src="@drawable/right_drawer"
android:onClick="btnAListener">
</ImageButton>
<ImageButton android:id="@+id/btn_B"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@+id/btn_A"
android:text="Button_B"
android:background="@android:color/transparent"
android:src="@drawable/right_drawer"
android:onClick="btnBListener">
</ImageButton>
</RelativeLayout>
</com.bollen.sppik.editimage.WrappingSlidingDrawer>
</LinearLayout>
</RelativeLayout>
```
|
android why is a sublass slidingDrawer hight behaving bad?
|
CC BY-SA 3.0
| null |
2011-06-26T16:54:06.037
|
2011-07-10T06:01:14.630
|
2017-05-23T12:19:02.320
| -1 | 538,837 |
[
"android",
"slidingdrawer"
] |
6,485,460 | 1 | 6,485,523 | null | 0 | 631 |
How could I enable to edit the properties of my user control in the properties window of visual studio. Let me show you what I mean:
here I have a date Picker control and note how I can modify the date and other properties within the properties window:

An here I have a simple user control that just consists of two textblocks in order to produce a glow effect:

So when I place that user control on my main window how could I modify the text withing the properties window in visual studio?

It will be nice if I could create a custom property that will be visible in that property window just like the date picker control. I change the properties of that user control with code when the window loads.
|
Change user control's objects properties from properties panel in visual studio
|
CC BY-SA 3.0
| null |
2011-06-26T17:19:36.763
|
2011-06-26T18:00:57.567
|
2011-06-26T18:00:57.567
| 546,730 | 637,142 |
[
"c#",
"wpf",
"visual-studio",
"binding",
"properties"
] |
6,485,636 | 1 | 6,486,154 | null | 2 | 268 |
I have the following code, and it does exactly what I want it to do, except that it is ridiculously slow. I would not be so bothered, except that when I process the code "manually", i.e., I break it into parts and do them individually, it's near instantaneous.
Here is my code:
```
Coefficient[Product[Sum[x^(j*Prime[i]), {j, 0, Floor[q/Prime[i]]}],
{i, 1, PrimePi[q]}], x, q]
```
Picture added for clarity:

I think it is trying to optimize the sum, but am not sure. Is there a way to stop that?
In addition, since all my coefficients are positive, and I only want the x^qth one, is there a way to get Mathematica to discard all exponents that are larger than that and not do all the multiplication with those?
|
Mathematica exponentiation and finding a specified coefficient
|
CC BY-SA 3.0
| null |
2011-06-26T17:48:04.723
|
2011-06-26T23:24:19.203
|
2011-06-26T22:14:58.003
| 421,225 | 725,709 |
[
"optimization",
"wolfram-mathematica",
"discrete-mathematics"
] |
6,485,703 | 1 | 6,485,724 | null | 8 | 14,273 |
This is a part of me trying to get used to working with XCode4...
OK, so i've created a new project in XCode 4 and I used the template; I wish to build the new app as Apple intended me to use this template.
So I'm using the automatically-created-view-controller which is called from the AppDelegate (so far I haven't touched anything). Now, I want to the . As far as I understand, what I should do, is go to the and in the set the field to (this is how I used to do it so far), but mercilessly when I run the application the STATUS BAR is still there (!).
I also tried to do the same thing on the file (the setting the STSTUS BAR attribute to None thing) and the app runs with this bar that blocks my view...
Anyone?

|
How to Remove Status Bar in "View Based Application" - iOS
|
CC BY-SA 3.0
| 0 |
2011-06-26T17:58:02.640
|
2011-06-27T18:08:59.250
| null | null | 1,143,060 |
[
"ios",
"templates",
"xcode4",
"statusbar"
] |
6,485,752 | 1 | 6,485,776 | null | 1 | 261 |
Is it possible to get the result as shown in this figure from the table:

How can i do this using mysql query?
Thank you,
|
MySql merge rows and show item count in result table?
|
CC BY-SA 3.0
| null |
2011-06-26T18:05:23.010
|
2011-06-26T18:16:37.460
| null | null | 750,965 |
[
"mysql",
"sql"
] |
6,485,848 | 1 | null | null | 3 | 842 |
This image below says python takes lot of time in user space. Is it possible to reduce this time at all ?
In the sense I will be running a script several 100 times. Is it possible to start python so that it takes time to initialize once and doesn't do it the subsequent time ??

|
Avoid python setup time
|
CC BY-SA 3.0
| 0 |
2011-06-26T18:21:43.880
|
2012-06-05T11:07:24.373
|
2011-06-26T18:23:01.380
| 142,162 | 290,542 |
[
"python",
"compiler-construction",
"interpreter",
"profile",
"performance"
] |
6,486,227 | 1 | 6,486,342 | null | 2 | 902 |
For a program, stars appear at the bottom or top of the screen at a random, precalculated position. The stars travel to their predetermined destination which is the top or bottom of a letter (based on if the star originated above or below the letter). Currently the star' motion are mostly linear, with a bit of curve from some homebrewed equation. I would like a solid parabolic equation in which the stars reach their destination position at an angle that is roughly perpendicular (+- 20 or so degrees) to the top/bottom of the destination letter. I phoned in calc 3 so I can't figure out how to implement the parabola for this problem. I'm also open to a completely different way of animating these objects. Help appreciated. Thanks!



Extraneous info: the stars' source position is never directly above or below the letter they are to collide with, and is never more than half the screen's width away for the bottom-originating stars or 1/3 of the screen's width away for the top-originating stars.
|
Deriving a parametric parabolic equation given the source and destination coordinates
|
CC BY-SA 3.0
| 0 |
2011-06-26T19:35:56.933
|
2011-06-26T20:24:04.200
|
2011-06-26T20:24:04.200
| 371,588 | 371,588 |
[
"java",
"math"
] |
6,486,214 | 1 | 6,486,458 | null | 131 | 53,343 |
Why does FOOBARZ get layed out all the way at the bottom when no elements are `layout_height="fill_parent"` in other words, all elements are wrap_content for height?

```
<?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="wrap_content">
<TextView
android:id="@+id/feed_u"
android:layout_width="50dip"
android:layout_height="50dip"
android:layout_marginLeft="5dip"
android:scaleType="centerCrop"
android:drawableTop="@android:drawable/presence_online"
android:text="U" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/feed_u">
<ImageView
android:id="@+id/feed_h"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_minus" />
<ImageView
android:id="@+id/feed_ha"
android:layout_toLeftOf="@id/feed_h"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/btn_plus" />
<TextView
android:id="@+id/feed_t"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title">
</TextView>
<TextView
android:id="@+id/feed_a"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Band"
android:layout_below="@id/feed_t">
</TextView>
<TextView
android:id="@+id/feed_s"
android:layout_below="@id/feed_a"
android:text="S"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
</TextView>
<TextView
android:id="@+id/feed_tm"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="FOOBARZ"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
</TextView>
</RelativeLayout>
</RelativeLayout>
```
|
RelativeLayout is taking fullscreen for wrap_content
|
CC BY-SA 3.0
| 0 |
2011-06-26T19:34:00.517
|
2022-04-20T02:09:14.273
|
2014-11-28T13:55:08.090
| 1,331,488 | 420,259 |
[
"android",
"android-layout"
] |
6,486,346 | 1 | 6,486,472 | null | 0 | 1,966 |
I've got a video (more than one actually, but that doesent matter), here is the JW setup:
```
jwplayer('myvideo').setup({
'allowscriptaccess': 'always',
'flashplayer': 'video/player.swf',
'file': 'video/clips/video.mp4',
'controlbar': 'over',
'width': 620,
'height': 480,
});
```
In normal mode, it displays fine, however in Fullscreen:

The black border is not supposed to be there.
I checked the example in the JW Setup Wizard, and their fullscreen works fine. Why doesent mine? Can it be my video? What should I do? Thanks in advance! :)
: By using stretching = fill, I got it to fill the black borders, however, it makes it too big. I need it to fit the screen size :)
|
JW Player Remove Fullscreen boxing
|
CC BY-SA 3.0
| null |
2011-06-26T19:55:57.460
|
2011-06-26T22:57:08.080
|
2011-06-26T21:50:19.350
| 64,763 | 561,545 |
[
"javascript",
"jwplayer"
] |
6,486,406 | 1 | 6,486,512 | null | 8 | 1,624 |
I am doing this:
```
ClearAll[matrix];
matrix[p_,q_,nu_:0]:=Module[{sigma},
sigma=p/q;
N@SparseArray[
{{m_,m_}\[Rule]2Cos[2\[Pi]*m*p/q+nu],{i_,j_}/;
Abs[i-j]\[Equal]1\[Rule]1},{q,q}]]
ClearAll[attachsigma]
attachsigma[sigma_,lst_]:={sigma,#}&/@lst
```
and then execute
```
fracs = Table[p/q, {q, 2, 30}, {p, 2, q}] // Flatten // DeleteDuplicates;
pq = {Numerator@#, Denominator@#} & /@ fracs;
(ens = Eigenvalues[#] & /@
Normal /@ (matrix[#[[1]], #[[2]]] & /@ pq);) // Timing
pts = Flatten[#, 1] &@MapThread[attachsigma, {fracs, ens}];
```
and finally I plot the points as follows (here is the real point of the question):
```
plot = ListPlot[pts,
PlotMarkers \[Rule] Graphics[{PointSize[Tiny], Point[{0, 0}]}]]
```

Calculating all the points takes around around 2.6s on my machine, but the plot takes around 25s. If, on the other hand, I plot it like this
```
ListPlot[pts]
```

then it is almost instantaneous, as it should (it's just 5256 points). So, it seems `PlotMarkers` slows things down immensely.
Could anybody
a) explain why (this much I vaguely understand, in analogy with what happens to `Sort` if you give it custom ordering function) and, more importantly,
b) explain how to avoid this slowdown? I am trying to create plots with quite a bit more points than this so they're really slow; in addition, I am creating lots of them (a movie actually).
One solution would be to not plot all of them, but as I vary parameters it becomes nontrivial to find out which I should include and which not (this would of course work if I only needed this one frame). So, I'd like to speed up the plot creation without removing points.
EDIT: Answered after hints from Sjoerd:
```
ListPlot[pts] /. Point[List[x___]] \[RuleDelayed] {PointSize[Tiny], Point[List[x]]}
```
produces the right thing instantaneously. This simply replaces the `Points` inside the `Graphics` structure by smaller points by hand.
Now one can increase the upper limit in the table in `fracs = Table[p/q, {q, 2, 30}, {p, 2, q}] // Flatten // DeleteDuplicates` to 80 or so to get many more points (this thing is the Hofstadter butterfly, and it's a fractal):

|
Slow ListPlot with PlotMarkers
|
CC BY-SA 3.0
| null |
2011-06-26T20:06:39.510
|
2011-08-24T03:59:09.833
|
2011-06-26T21:01:21.013
| 559,318 | 559,318 |
[
"wolfram-mathematica"
] |
6,486,482 | 1 | 6,497,504 | null | 0 | 164 |
I am trying to draw an image from .png resource file.
I have tried 2 ways. When creating an ImageView and assigning it the R.drawable - the image looks fine:

But when I draw the image myself on Canvas with the following code:
```
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inDither = false;
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.img, options);
canvas.drawBitmap(bmp, x, y, null);
```
the image looks like this:

if you will notice, there are light grey vertical lines inside the image.
Does anyone know, why is this difference in appearance between the 2 methodologies?
Thanks,
Henry.
|
Android: difference in appearance when showing ImageView and when drawing on Canvas
|
CC BY-SA 3.0
| null |
2011-06-26T20:19:05.447
|
2011-06-27T18:52:26.527
| null | null | 57,735 |
[
"android",
"graphics"
] |
6,486,499 | 1 | 6,486,515 | null | 21 | 21,211 |
Given a point's coordinates, how can I determine if it is within an arbitrary shape?
The shape is defined by an array of points, I do not know where the shape is 'closed', the part I really need help is to work out where the shape is closed.
Here's an image to illustrate what I mean a little better:

|
determine if a point sits inside an arbitrary shape?
|
CC BY-SA 3.0
| 0 |
2011-06-26T20:21:22.240
|
2011-06-27T18:16:28.647
|
2011-06-26T20:37:25.083
| 50,476 | 816,444 |
[
"algorithm",
"math",
"geometry",
"shapes"
] |
6,486,544 | 1 | null | null | 1 | 76 |
I am using Ruby on Rails 3.0.7 and I am writing some documentation for my application using RDoc. In my application file I have this:
```
#[EXAMPLE 1 - Some text.]
#
# [CASE 1 - Some text.]
#
# class User < ActiveRecord::Base
# has_many :account,
# :class_name => 'User::Account',
# :foreign_key => 'account_id'
# end
```
On generating documentation for my application the above commented code will leave `class User < ActiveRecord::Base` and `end` parts outside the paragraph block where those should appear.
The following is the related screen shot:

I get the same output (outside the paragraph block where the class statement should appear) if I use this
```
#[Example 1 - Some text.]
#
# class User < ActiveRecord::Base
# has_many :account,
# :class_name => 'User::Account',
# :foreign_key => 'account_id'
# end
```
or this
```
#class User < ActiveRecord::Base
# has_many :account,
# :class_name => 'User::Account',
# :foreign_key => 'account_id'
#end
```
|
Documenting classes using labeled lists
|
CC BY-SA 3.0
| null |
2011-06-26T20:29:22.803
|
2011-06-27T08:30:15.500
|
2011-06-27T07:53:42.180
| 314,166 | 502,052 |
[
"ruby-on-rails",
"ruby",
"class",
"documentation",
"rdoc"
] |
6,486,644 | 1 | null | null | 8 | 11,938 |
I'm trying use the [directlabels](http://directlabels.r-forge.r-project.org/) package to label two lines I have in a simple plot (I'm using [ggplot2](http://had.co.nz/ggplot2/))

My code is as follows:
```
# libraries
library(ggplot2)
library(directlabels)
# Variables
A = array(1000,100)
F = seq(length=100, from=0, by=10)
f = array(5,100)
# make data frame 1
df <- data.frame(X = F * f/A, Y = F/A)
# plot line 1
p = ggplot(df, aes(x=X,y=Y))
p = p + geom_line(colour="#56B4E9")
# make data frame 2
df1 <- data.frame(X = F * f * 2/A, Y = F/A)
# plot line 2
p = p + geom_line(aes(x=X,y=Y), data=df1, colour="#56B4E9")
# label line
direct.label(p, 'last.points')
```
However I get the following error message:
```
Error in direct.label.ggplot(p, "last.points") :
Need colour aesthetic to direct label.
```
I've tried adding several arguments to the `direct.label()` function, but I don't understand what aesthetic argument should be used.
|
How can you use directlabels and ggplot2?
|
CC BY-SA 3.0
| 0 |
2011-06-26T20:47:56.103
|
2015-05-06T22:58:06.613
|
2015-05-06T22:58:06.613
| 419,994 | 258,755 |
[
"r",
"ggplot2",
"label",
"direct-labels"
] |
6,486,823 | 1 | 6,493,372 | null | 23 | 18,646 |
How do you implement a fetched property in Xcode 4?
Here is an example of two entities, a book and a page:

I followed the guidelines here to create a fetched property that references a value from the source entity using the variable $FETCH_SOURCE: [http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdRelationships.html)
Now, once I have this saved and I generate the source code I get this:
```
// Book.h
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@class Pages;
@interface Book : NSManagedObject {
@private
}
@property (nonatomic, retain) NSString * title;
@property (nonatomic, retain) NSNumber * pageCount;
@property (nonatomic, retain) Pages * pages;
@end
```
And...
```
// Book.m
#import "Book.h"
#import "Pages.h"
@implementation Book
@dynamic title;
@dynamic pageCount;
@dynamic pages;
@end
```
Where is the fetched property 'fetchLastPage'? How can I use it in code?
|
Xcode 4 Core Data: How to use fetched property created in Data Model editor
|
CC BY-SA 3.0
| 0 |
2011-06-26T21:21:03.373
|
2011-06-27T14:59:08.637
|
2011-06-26T21:32:52.017
| 158,687 | 158,687 |
[
"iphone",
"objective-c",
"ios",
"core-data",
"xcode4"
] |
6,486,907 | 1 | 6,486,926 | null | 7 | 4,916 |
Considering the following :
```
lalist = {{{{1, 1}, 1}, {{3, 3}, 1}, {{5, 5}, 1}},
{{{1, 5}, 1}, {{3, 3}, 1}, {{5, 1}, 1}}}
```

```
Row[{
Graphics[{
Opacity[0.5],Red,
Disk @@@ lalist[[1]]},
Frame -> True],
Graphics[{
Opacity[0.5],Blue,
Disk @@@ lalist[[2]]},
Frame -> True]}
]
```

-
Below is not what I need :

|
Display multiple 2D plots in 3D using Graphics in Mathematica?
|
CC BY-SA 3.0
| 0 |
2011-06-26T21:37:52.830
|
2011-06-27T13:02:11.603
|
2011-06-26T22:04:04.457
| 615,464 | 769,551 |
[
"graphics",
"3d",
"wolfram-mathematica"
] |
6,486,989 | 1 | 6,488,403 | null | 2 | 331 |
I've created a widged with [Orchard](http://www.orchardproject.net). Unfortunately I've used the same "Title" for a jPlayer widget twice. Now I receive an error:
Server Error in '/wgk' Application.
Sequence contains more than one element
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
```
Exception Details: System.InvalidOperationException: Sequence contains more than one element
Source Error:
Line 2: <fieldset>
Line 3: <div>@Html.LabelFor(o => o.MediaGalleryName, @T("Media gallery"))</div>
Line 4: @if(!Model.HasAvailableGalleries) {
Line 5: <div>@T("You need first to create an media gallery on Media Gallery menu")</div>
Line 6: }
Source File: x:\Intepub\wgk\Modules\Orchard.jPlayer\Views\EditorTemplates\Parts\MediaGallery.cshtml Line: 4
Stack Trace:
[InvalidOperationException: Sequence contains more than one element]
System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +4206966
NHibernate.Linq.Visitors.ImmediateResultsVisitor`1.HandleSingleOrDefaultCall(MethodCallExpression call) +51
NHibernate.Linq.Visitors.ImmediateResultsVisitor`1.VisitMethodCall(MethodCallExpression call) +411
NHibernate.Linq.Visitors.ExpressionVisitor.Visit(Expression exp) +371
```
In MediaGallery.cshtml (found in error description above) is written:
```
@model Orchard.jPlayer.Models.MediaGalleryPart
<fieldset>
<div>@Html.LabelFor(o => o.MediaGalleryName, @T("Media gallery"))</div>
@if(!Model.HasAvailableGalleries) {
<div>@T("You need first to create an media gallery on Media Gallery menu")</div>
}
else {
<div>@Html.DropDownListFor(o => o.SelectedGallery, Model.AvailableGalleries)</div>
<div>@Html.LabelFor(o => o.SelectedType, @T("Media gallery type"))</div>
<div>@Html.DropDownListFor(o => o.SelectedType, Model.AvailableTypes)</div>
<div>@Html.LabelFor(o => o.AutoPlay, @T("Auto play"))</div>
<div>@Html.CheckBoxFor(o => o.AutoPlay)</div>
}
</fieldset>
```
My problem is now, I cannot find or edit the widget with double used name. I would love to replace it to another name. But I do not know where to do this.
Please advice.
I've deleted the last entry in database (SDF File). I've used this tool [Primeworks mobile](http://www.primeworks-mobile.com/Downloads/Files/DPCon/DPConsole_1.8.6348.57.html). Now it works for short time. After editing entries in jPlayer widget again it could occour same error again.

|
jPlayer widget created with static error as result
|
CC BY-SA 3.0
| null |
2011-06-26T21:56:01.860
|
2011-06-30T11:36:16.233
|
2011-06-30T11:36:16.233
| 719,246 | 719,246 |
[
"asp.net",
"asp.net-mvc",
"asp.net-mvc-3",
"razor",
"orchardcms"
] |
6,487,014 | 1 | 6,487,051 | null | 2 | 196 |
In my understanding, assigning a variable of a struct to another variable of the same type will make a copy. But this rule seems broken as shown on the following figure. Could you explain why this happened?

```
using System;
namespace ReferenceInValue
{
class Inner
{
public int data;
public Inner(int data) { this.data = data; }
}
struct Outer
{
public Inner inner;
public Outer(int data) { this.inner = new Inner(data); }
}
class Program
{
static void Main(string[] args)
{
Outer p1 = new Outer(1);
Outer p2 = p1;
Console.WriteLine("p1:{0}, p2:{1}", p1.inner.data, p2.inner.data);
p1.inner.data = 2;
Console.WriteLine("p1:{0}, p2:{1}", p1.inner.data, p2.inner.data);
p2.inner.data = 3;
Console.WriteLine("p1:{0}, p2:{1}", p1.inner.data, p2.inner.data);
Console.ReadKey();
}
}
}
```
|
Assigning a variable of a struct that contains an instance of a class to another variable
|
CC BY-SA 3.0
| 0 |
2011-06-26T22:02:19.167
|
2011-06-27T06:34:33.693
| null | null | 397,524 |
[
"c#",
"class",
"struct",
"value-type",
"reference-type"
] |
6,487,226 | 1 | 6,487,430 | null | 2 | 303 |
Ive been working on my personal page which is based on drupal.
Ive noticed that it takes forever to load 6-10 seconds often.
After looking into some performance tests, specifically from site-perf.com,
I noticed that the load time is 80% queue time.

It seems lightbox2 and my theme contribute about 2/3 of the queue time.
Any suggestions on speeding this up?
|
How to speedup webpage loading? main issue is queue time
|
CC BY-SA 3.0
| null |
2011-06-26T22:47:02.723
|
2011-06-26T23:29:35.357
| null | null | 295,084 |
[
"drupal",
"optimization",
"web"
] |
6,487,538 | 1 | null | null | 3 | 1,167 |

In the image the red trail is a trail that pygame is creating when I have a bounding rectangle added around sprites. The sprite also does it and the simplest solution was to just clear the surface to black after each redraw. However attempting to do so on the entire main surface is not such a good idea. How can I fix this?
|
Pygame how to fix 'trailing pixels'?
|
CC BY-SA 3.0
| null |
2011-06-26T23:51:15.967
|
2021-01-17T06:46:12.640
|
2017-06-27T06:47:52.177
| 142,637 | 815,667 |
[
"pygame",
"draw"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.