Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,928,851 | 1 | 5,929,443 | null | 2 | 11,120 |
I am trying to use a UILabel to replace the title at the UINavigationBar, the code is as follows:
```
UINavigationBar *bar = [self.navigationController navigationBar];
[bar setBackgroundColor:[UIColor blackColor]];
UILabel * nav_title = [[UILabel alloc] initWithFrame:CGRectMake(80, 2, 220, 25)];
nav_title.font = [UIFont fontWithName:@"Arial-BoldMT" size:18];
nav_title.textColor = [UIColor whiteColor];
nav_title.adjustsFontSizeToFitWidth = YES;
nav_title.text = title;
nav_title.backgroundColor = [UIColor clearColor];
[bar addSubview:nav_title];
[nav_title release];
```
The problem is that, how do I remove the original title of the bar? I didn't declare any self.title = @"title", but it always shows it there:

If I do self.title = nil, then everything is gone... How do eliminate this mysterious title from the navbar and just use the UILabel I created.
|
UINavigationBar title
|
CC BY-SA 3.0
| 0 |
2011-05-08T16:53:31.803
|
2014-08-23T18:05:53.963
| null | null | 721,937 |
[
"iphone",
"objective-c",
"uinavigationbar"
] |
5,929,243 | 1 | 5,930,983 | null | 1 | 355 |
I am implementing a DQPSK modulator and Demodulator. I would like to calculate the exp(1j*Phase) in Simulink.
How can I realize such a model ?
Here is the part of the model to calculate the Phase:

Incidentally, ROM3 block in the model stores the values: 0, pi/2, pi, 3*pi/2 ( Constellation points)
|
Sine of the signal in Xilinx Simulink
|
CC BY-SA 4.0
| null |
2011-05-08T18:04:46.497
|
2020-06-17T11:41:28.950
|
2020-06-17T11:41:28.950
| 472,495 | 276,859 |
[
"matlab",
"verilog",
"fpga",
"simulink",
"xilinx"
] |
5,929,340 | 1 | 5,929,376 | null | 7 | 6,890 |
I've encountered a problem while writing code in Delphi.
Namely I can't get acces to Components, even though they're declared and I used them in code above ( previously in procedures, now I am trying to use them in functions - maybe this is the reason, I don't know, I am not good at Delphi ).
I made a few screens to make it look clearer.
Take a look.


http://imageshack.us/photo/my-images/135/weirddelphi3.png/">
As you can see on the first screen I'm getting compiler error. It says that the component doesn't exist, but on the third screen you can see that this component exists. On the second screen I can even use this component ( Code Completion can be invoked successfully, but if I try to invoke it in secondFunction's scope I get error like this :
"Unable to invoke Code Completion due to errors in source code " - but what the hell is the error?! ). If I comment these two lines, which refer to Edit7 and Edit8, I can run the program without problems. I really can't figure out what is wrong, if any of you could give me some advice, it would be greatly appreciated. I didn't wanted to post whole code here, because it would take about 300 lines, however if u need to know something else to sort this out then ask I will tell you..
I don't have enough reputation points to post more than 2 hyperlinks so you have to do "copy & paste " with the last one :D
|
Delphi can't get text from TEdit
|
CC BY-SA 3.0
| null |
2011-05-08T18:21:28.400
|
2011-05-08T18:43:04.877
|
2011-05-08T18:43:04.877
| 11,225 | 659,389 |
[
"delphi",
"function"
] |
5,929,357 | 1 | null | null | 2 | 7,271 |
I'm on my first approach with photoshop patterns.I'm buildin a webpage where I want to use my pattern to give a nice effect to my webpage background.
The

If I was done here I should use this css:
```
background-imag:url(mypattern.jpg);
background-repeat:repeat;
```
But Im not done.Id like to **add to my page's background a linear gradient(dir=top/down col=light-blue/green) with the pattern fill layer on top of it, with blending mode=darken **.
This is the final effect:

I come to the point.
Combining linear vertical-gradient effect and my 120x120 pattern is it possible to find a pattern that I could use to repeat itself endlessly both vertical and horizontal??which is a common solution in this case?
Hope It's clear
thanks
Luca
|
CSS repeat pattern with linear gradient
|
CC BY-SA 3.0
| 0 |
2011-05-08T18:25:21.533
|
2014-03-06T13:09:15.923
|
2013-11-10T14:23:50.060
| 220,834 | 505,762 |
[
"html",
"css",
"repeat"
] |
5,929,401 | 1 | null | null | 0 | 234 |
I've created a composition in Quartz Composer, and am following the examples on "[Quartz Composer Programming Guide](http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Conceptual/QuartzComposer/qc_play_ib_input/qc_play_ib_input.html#//apple_ref/doc/uid/TP40001357-CH208-TPXREF101#//apple_ref/doc/uid/TP40001357-CH208-CJBFDCJC)" on Apple's website for connecting it to a XIB.
My goal is to be able to bind inputs in my Quartz Composition with UI controls (sliders, keyboard input, etc.) within my Cocoa application. It seems that this tutorial is sufficient for what I want to do.
However, I can't get the Quartz Composer Patch Controller to load my composition. I add the Patch Controller to my XIB document window, then I go to "Load Composition".

Every time I click "Load Composition", I choose my file and it gives me an error message box that says "Loading Failed: Loading CheckLog".
Here's what may be interesting:

I've tried loading other compositions, I get the same error. I tried in a different computer, on a new project, same XCode version (4.0.1), and I still get the error.
I've only done the steps outlined in the tutorial, and I am referencing the Quartz framework in my project. My first thought is that there might be some procedures that are not outlined in the programming guide that I may be skipping.
So how do I resolve this error? Please help!
|
"Loading Checklog" error while loading quartz composition using Quartz Composer Patch Controller
|
CC BY-SA 3.0
| null |
2011-05-08T18:30:09.317
|
2013-08-07T17:06:10.177
|
2013-08-07T17:06:10.177
| 60,724 | 508,700 |
[
"objective-c",
"xcode",
"cocoa",
"quartz-graphics",
"cocoa-bindings"
] |
5,929,797 | 1 | 5,930,401 | null | 1 | 3,470 |
first, sorry about my english, i still learning.
I writing Python module for my framework, which parsing CSS files. I try regex, ply (python lexer and parser), but i found myself in ANTLR.
First try, i need to parse comments from CSS file.
This is my CSS string to parse:
```
/*test*/
/*
test1
/*
/*test2/*nested*/comment/*
```
I know that CSS doesn't allow nested comments, but i need it in my framework. I wrote simple ANTLR grammar:
```
grammar CSS;
options {
language = Python;
}
styleSheet
: comments EOF ;
comments
: NESTED_ML_COMMENT*
;
NESTED_ML_COMMENT
: '/*'
(options {greedy=false;} : (NESTED_ML_COMMENT | . ) )*
'*/'
;
LINEBREAK
: ('\n\r' | '\n')+{$channel=HIDDEN; };
```
What i get in result is:

What i expect (paint work :D):

Notice that i want /* and */ in result.
Is there any way to do this in pure ANTLR? I have no problem with using python in ANTLR, but if there any way to do this without python i will be grateful.
|
ANTLR get and split lexer content
|
CC BY-SA 3.0
| null |
2011-05-08T19:35:11.237
|
2011-05-09T09:29:56.243
|
2011-05-08T21:20:21.863
| 50,476 | 744,165 |
[
"python",
"antlr"
] |
5,930,056 | 1 | 5,930,199 | null | 24 | 31,979 |
I need an example of how to use Crypto++ to generate a SHA256 hash from a std::string and output a std::string. I can't seem to figure it out. Everything I've tried gives me invalid output.
Here's the new code after interjay's answer:
```
string SHA256(string data)
{
byte const* pbData = (byte*) data.data();
unsigned int nDataLen = data.size();
byte abDigest[CryptoPP::SHA256::DIGESTSIZE];
CryptoPP::SHA256().CalculateDigest(abDigest, pbData, nDataLen);
return string((char*)abDigest);
}
```
The output for SHA256("A"); is

How can I turn this into a readable format?
Thanks to interjay's answer I was able to generate the final hash.
|
Generating a SHA256 hash with Crypto++, using a string as input and output?
|
CC BY-SA 3.0
| 0 |
2011-05-08T20:14:47.460
|
2018-02-23T06:27:01.280
|
2017-05-17T17:48:25.437
| 608,639 | 740,891 |
[
"c++",
"hash",
"stdstring",
"sha256",
"crypto++"
] |
5,930,069 | 1 | 5,937,437 | null | 6 | 2,563 |
I thought that I have a developer account at PayPal (still logging in successfully to [https://developer.paypal.com](https://developer.paypal.com)), but when clicked the [PayPal Developer Network](https://www.x.com/) link on that page (to ask a question that's specific to PayPal API), I was prompted to login again. This time, my developer.paypal.com's account userid & password simply wouldn't work there.
Am I supposed to create account there? If so, will it be linked to the developer.paypal.com one (just as accounts in SO/SE are linked)?
If I may explain my confusion further: I have a "regular" PayPal account (for purchasing stuff online), I have a business account (for accepting online payments), I have a developer account (for testing integration of shopping cart with paypal). How many accounts do I need with PayPal? When I create an x.com account, will it conflict with my existing accounts?
Thanks.
: What's even more confusing is the question in the login page to x.com:
> Already have a PayPal account?
Well, of course I have PayPal account. In fact, I have 3 of them. Do I need to create one, just to post a question in the developer network forum?

|
What is the difference between developer.paypal.com and x.com?
|
CC BY-SA 3.0
| null |
2011-05-08T20:16:41.257
|
2011-05-09T13:18:59.740
|
2011-05-08T20:51:48.960
| 722,603 | 722,603 |
[
"paypal",
"paypal-sandbox"
] |
5,930,265 | 1 | 5,930,295 | null | 0 | 430 |
Is there any framework or set of classes that will allow me to play an audio file(mp3) with a small view displaying controls (slider, pause/play, etc)?
This image explains what I am talking about, it doesn't have to be exactly like that, but similar:

Thanks!
|
Playing audio with controls
|
CC BY-SA 3.0
| null |
2011-05-08T20:45:56.277
|
2011-05-08T21:13:15.173
| null | null | 635,064 |
[
"objective-c",
"cocoa-touch",
"ios",
"mpmovieplayercontroller",
"core-audio"
] |
5,930,287 | 1 | 5,930,305 | null | 0 | 76 |
I am a bit newbie in ASP.NET and i don't really understand where should save some of the data that is related to my users.
Ill explain myself:
I use ASP 2.0 and i created a simple app that has registration and login mechanism. That data is stored in a DataBase that ASP automatically prepared for me (ASPNETDB.MDF)
I see the following user related data in that database:

These are my doubts:
1. Can i add there another 3 columns for other data related to the user?
2. Should i create a new table within this database and link it to aspnet_Users with a FK?
3. Should i create a new database different than this one(This is just for security and similar stuff)?
4. If 3 is yes, how will i know witch row of data is related to witch user in the ASPNET.DB?
I am very confused, could someone tell me where should i store my other data related to user(age, city,bloodtype...)
|
How should i add data to a database in an application that implements Forms Security?
|
CC BY-SA 3.0
| null |
2011-05-08T20:49:05.900
|
2011-05-08T20:53:09.583
|
2011-05-08T20:53:09.583
| 614,141 | 614,141 |
[
"c#",
".net",
"asp.net",
"database-design",
"ado.net"
] |
5,930,312 | 1 | 5,930,454 | null | 1 | 6,264 |
How to make rectangle in XAML with different radius for corners?
I need to create it using only "Rectangle" tag, because width will change dynamically and I don't want to play with few figures.
Exmple:

|
How to make rectangle in XAML with different radius for corners?
|
CC BY-SA 3.0
| null |
2011-05-08T20:55:13.937
|
2011-05-09T14:56:29.577
| null | null | 291,896 |
[
"silverlight",
"xaml"
] |
5,930,425 | 1 | 8,829,083 | null | 5 | 13,546 |
certainly touches on previous questions regarding map display during initialization. Yet the issue here is with map display being set to none after map should have already initialized. The last line of my widow.onload sets the map to display: none; The map initialization should have already completed by that time, but the fact remains, the final call is causing the problem.
window.onload(); function...
```
window.onload = function(){
changeTheme(me); // do it now so current_theme is avaible to switchTabs();
switchTabs("tab3"); // sets map div visible
initMaps(); // map initialization. code included.
loadFavoritePlaces(); // asynch $getJSON call, adds markers. No matter the condition of map, markers appear in their proper locations.
closePopup("images");
closePopup("location"); // sets maps.mini_map display: none; Problems if we loadUserTable() later. Otherwise OK. Odd!
closePopup("tweet");
centerDiv();
document.title = '@'+me.screen_name+' - PithyTwits.com';
users[me.id_str] = me;
getPage(); // asynch $.getJSON loads tweets. Not an issue.
// Append a scroll event handler to tweet_div
$("#tweet_div").scroll(function() {
var pos = $(this)[0].scrollHeight - $(this).scrollTop();
if(pos != prev_scroll){ // hack to prevent scroll function from firing twice
prev_scroll = pos;
if (pos == $(this).outerHeight()) {
$("#throbber").fadeIn();
getPage();
}
}
});
loadUserTable(me.id_str);
/* loadUserTable(); calls switchTabs("tab1"); which sets map div display: none;
if I comment this out the map initialization completes properly, but my 'tab1'
doesn't get populated properly. And page doesn't start on 'tab1', which is required. */
// end window.onload()
}
```
initMaps(); function...
```
function initMaps() {
// markers list
maps.markers = new Object;
// visibility status'
maps.markerStatus = new Object;
maps.markerStatus['query'] = true;
maps.markerStatus['tweet'] = true;
maps.markerStatus['favorite'] = true;
// define marker images
maps.reticleImage = new google.maps.MarkerImage('images/reticle.png',
new google.maps.Size(63, 63),
new google.maps.Point(0,0),
...
Declarations removed to streamline post.
...
new google.maps.Point(0,0),
new google.maps.Point(1, 13));
maps.markerShape = {
type: "poly",
coords: [9,22,16,11,16,5,11,1,6,1,2,5,2,11,9,22]
}
// setup map options
var latlng = new google.maps.LatLng(39.520427, -94.770621);
var latlng2 = new google.maps.LatLng(46.1912, -122.1944);
var myOptions = {
zoom: 3,
center: latlng,
mapTypeId: google.maps.MapTypeId.HYBRID
};
var myOptions2 = {
zoom: 13,
center: latlng2,
disableDefaultUI: true,
draggable: false,
keyboardShortcuts: false,
mapTypeControl: false,
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.HYBRID
};
// initialize maps
maps.main_map = new google.maps.Map(document.getElementById("map_div"), myOptions);
maps.mini_map = new google.maps.Map(document.getElementById("mini_map"), myOptions2);
// default map center markers
maps.mini_map_marker = new google.maps.Marker({
position: latlng2,
map: maps.mini_map,
icon: maps.favoriteMarker,
shadow: maps.markerShadow,
});
maps.reticleMarker = new google.maps.Marker({
position: latlng,
map: maps.main_map,
shape: reticleShape,
icon: maps.reticleImage,
});
// event handlers
google.maps.event.addListener(maps.main_map, 'zoom_changed', mapZoomed);
google.maps.event.addListener(maps.main_map, 'bounds_changed',
function(){maps.reticleMarker.setPosition(maps.main_map.getCenter());});
//idle event listener provided by @Guan in the marked answer.
google.maps.event.addListenerOnce(maps.main_map, 'idle', function() {
var div = document.getElementById("tab3_content");
div.style.display = "none";
div.style.position = "relative";
div.style.left = "0px";
});
// initialize controls
var controls = document.getElementById("visibility_controls");
maps.main_map.controls[google.maps.ControlPosition.TOP_CENTER].push(controls);
controls.style.display = "inline";
var controls = document.getElementById("control_controls");
maps.main_map.controls[google.maps.ControlPosition.RIGHT_CENTER].push(controls);
controls.style.display = "inline";
var controls = document.getElementById("query_controls");
maps.main_map.controls[google.maps.ControlPosition.BOTTOM_CENTER].push(controls);
controls.style.display = "inline";
}
```
If I call loadUserTable(); at the end of window.onload(); I get this... (munged)

If I don't call loadUserTable(); at the end of window.onload(); I get this... (correct)

Since the problem stems from the maps display being set to none after the maps should have initialized, it would lead one to believe that the map initialization is actually happening non-syncronously. So how do I know when it is finished, and it is safe to hide the maps div? And also there is the question of why the mini_map seems to be dependent on visibility of the main_map, rather than its own visibility? I get the same results in both Chrome and Firefox, on Linux.
Any help is help :)
Skip
UPDATE: I changed the final call to setTimeout("loadUserTable();", 1000); and 1 second is enough of a pause to let things work, but isn't what I want! Since @Jobsz verifies this is known issue, I'm going to resort to off screen initialization, and move the map into position either when needed for display, or hide it and put it in position after a short timeout.
Provided by @[Guan](https://stackoverflow.com/users/934354/guan) (Checked answer)
I did not want the map visible during initialization. But wanted it initialized and ready when the user chose that tab.
The map div is initially set thus...
```
id="tab3_content" style="display: block;position: absolute; left: -1000px;"
```
That makes it visible, but offscreen to the left.
And then set a listener for the idle event in the map initialization...
```
google.maps.event.addListenerOnce(maps.main_map, 'idle', function() {
var div = document.getElementById("tab3_content");
div.style.display = "none";
div.style.position = "relative";
div.style.left = "0px";
});
```
That event fires once when the map is idle(ready). It hides the div and moves it into position on screen.
The loadUserTable() function is called in the normal program flow, and life is good. :)
|
Google Maps JS v3: Map display: none; after map initialization causing corrupted map
|
CC BY-SA 3.0
| 0 |
2011-05-08T21:14:33.313
|
2013-02-19T03:04:14.020
|
2020-06-20T09:12:55.060
| -1 | 710,913 |
[
"javascript",
"google-maps"
] |
5,930,466 | 1 | 5,930,483 | null | 1 | 110 |
```
<?php
$title = "This is the page title";
require_once '/includes/header.php';
?>
```
```
<head>
<title><?= $title ?></title>
</head>
```

|
Passing variable to an include
|
CC BY-SA 3.0
| null |
2011-05-08T21:21:31.193
|
2011-05-09T14:27:34.143
|
2011-05-09T14:27:34.143
| 560,648 | 199,700 |
[
"php",
"server-side-includes"
] |
5,930,490 | 1 | 5,930,758 | null | 3 | 7,671 |
I am doing some homework. The users of my database uses some other attributes, not just the ones that ASP 2.0 automatically created for me when i implemented the login and registration mechanism. But when i try to save the modification displays me an error. Can someone give me a hand?
This is the error:

The error says:
> 'aspnet_Users' table
- Unable to modify table. ALTER TABLE only allows columns to be added
that can contain nulls, or have a
DEFAULT definition specified, or the
column being added is an identity or
timestamp column, or alternatively if
none of the previous conditions are
satisfied the table must be empty to
allow addition of this column. Column
'kjoptekvoten' cannot be added to
non-empty table 'aspnet_Users' because
it does not satisfy these conditions.
That database was automatically created when i implemented Forms based authentification and registration. The problem now is that that users needs some more attributes. How can i give to it more attributes? What is the easiest way to do it?Does not mind if it is not theorically correct(It is just for a homework).
I would appreciate a lot your help.
|
Why i cant add new columns to my Users table?
|
CC BY-SA 3.0
| null |
2011-05-08T21:25:20.833
|
2011-11-21T02:41:12.437
|
2011-11-21T02:41:12.437
| 3,043 | 614,141 |
[
"sql-server"
] |
5,930,492 | 1 | 5,930,648 | null | 10 | 28,303 |
when i try to build and run my app, it crashes and i got this in the log :
```
reason: '[<LoadingViewController 0x6b2c5a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key aproposViewController.'
```
the strange is that `aproposViewController` is not used in `LoadingViewController`, it's just another view controller in my app. please help, thx in advance :)
```
@class LoadingViewController;
@interface TopStationAppDelegate : NSObject <UIApplicationDelegate,CLLocationManagerDelegate> {
UIWindow *window;
LoadingViewController *loadingView;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet LoadingViewController *loadingView;
@end
```
:
```
#import "LoadingViewController.h"
@implementation TopStationAppDelegate
@synthesize window;
@synthesize loadingView;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[window addSubview:loadingView.view];
[window makeKeyAndVisible];
return YES;
}
- (void)dealloc {
[loadingView release];
[window release];
[super dealloc];
}
@end
```
there is no declaration of aproposViwController, even in IB for the main view !!
here two screenshot of my besic set in the main and loadingView in interface builder :


|
this class is not key value coding-compliant for the key XXXXXX
|
CC BY-SA 3.0
| 0 |
2011-05-08T21:25:25.120
|
2016-06-20T13:18:40.220
|
2011-05-08T22:25:16.080
| 734,308 | 734,308 |
[
"ios",
"uiviewcontroller",
"interface-builder"
] |
5,930,634 | 1 | 5,930,642 | null | 0 | 159 |
Does anyone know on how to create a UITextField that behaves like this:

My guess is that it's just a UITextField that is put inside a UIToolBar?
Or is it a searchbar used as an input? If anyone knows how to make a multiline
textinput that looks like this, please share.
|
how does this UITextField work?
|
CC BY-SA 3.0
| null |
2011-05-08T21:56:52.733
|
2011-05-08T22:11:47.773
| null | null | 721,937 |
[
"iphone",
"objective-c",
"uitextfield"
] |
5,931,018 | 1 | 5,972,152 | null | 0 | 2,003 |
I have some code as such on my website. FF, Chrome, and IE9 all works well, but . Also seems like in IE7 compatibility mode (Not sure what version really reverts to as HTML if condition doesn't even catch it as IE7), mouseleave is not honored or goes unnoticed.
I have a haunch it is a rotate bug (or unimplemented for IE7), but to ask for second opinion, here is sample
[http://jsfiddle.net/robx/wR29n/12/](http://jsfiddle.net/robx/wR29n/12/)
This is the plugin i am using: [http://jqueryrotate.googlecode.com/files/jQueryRotateCompressed.2.1.js](http://jqueryrotate.googlecode.com/files/jQueryRotateCompressed.2.1.js)
mouseenter and mouseleave works just fine without the rotate; tested by replacing rotate line with `$(this).html("enter")` and `$(this).html("leave")`.
HTML Code:
```
<ul class="subMenu">
<li>
<a href="" id="a" title="">
<img class="icon" src="http://www.bestfreeware.com/soft-icon/f/free-business-icons-pack-108561.jpg" alt="" />
</a>
</li>
<li>
<a href="" id="b" title="">
<img class="icon" src="http://icons.iconarchive.com/icons/iconka/beer/48/messenger-icon.png" alt="" />
</a>
</li>
</ul>
```
Edited Fix JQuery code with Lee's update:
```
$(".icon").rotate({bind:{
mouseenter: function(){
$(this).rotate({
angle: 0,
animateTo:360,
duration: 2000
})
},
mouseout: function(){
alert('test');
}
}
});
```
span, group, and image are not my doing, it is from the rotate script. I used < img /> and it was replaced (Not sure if that changes anything in IE7). Span and group were added by the rotate script.

|
jquery rotate in IE7 only rotates once
|
CC BY-SA 3.0
| null |
2011-05-08T23:11:37.480
|
2011-05-25T11:36:16.200
|
2011-05-12T04:53:18.467
| 731,636 | 731,636 |
[
"jquery",
"html",
"jquery-plugins"
] |
5,931,479 | 1 | 5,936,968 | null | 17 | 20,807 |
It seems that creating publication-quality graphics with mma is a black art that dates back decades. Although things have much improved in recent years, it is still hard to get consistent results when exporting to files. The way the final result looks seems to be somewhat format-dependent (with EPS working best in my experience).
Quite often, the lines in frames and tick marks end up being too faint in the EPS file, and when trying to do something like `FrameStyle->AbsoluteThickness[2]`, it is easy to get lines that are too thick. So, my current approach involves taking five parameters -- three line thicknesses (in FrameStyle, AxesStyle, and PlotStyle), ImageSize, and FontSize in BaseStyle -- and randomly tweaking them until the exported plot looks acceptable. This is somewhat unsatisfactory and time consuming.
Is there a better way and/or a standard prescription to follow in order to achieve balanced, good-looking plots?
Edit: here's one example. Looks good on screen (see screenshot), but export it into EPS and you'll probably see two things: (a) There's a bug with EPS font embedding: for me, the epsilon inside the figure doesn't embed properly unless I remove the `FontWeight->Normal` directive. (b) The frame/tick lines are light-gray and 1 pixel thick. If I wanted to shrink this figure (e.g. to place it as an inset), it would trash the quality. However, using `AbsoluteThickness[2]` looks bad -- so I have to increase `ImageSize`. But then the fonts are too small and/or lines in the plot look too thin, etc, etc.
```
With[{exSubscript = "\[UpTee]", epsFontSize = 24,
xcoords = {0.63, 2.2}}, testInset = Style[Inset[Cell[TextData[Cell[
BoxData[FormBox[SubscriptBox["\[Epsilon]", exSubscript],
TraditionalForm]]]]], xcoords, {Left, Baseline}],
FontWeight -> Normal, FontSize -> epsFontSize];
];
Show[Plot[10 x^2, {x, 0, 1}, PlotStyle -> Thick, Frame -> True,
PlotRange -> {-2, 8}, Epilog -> {testInset}], Axes -> {True, True},
AxesOrigin -> {0, 0}, AxesStyle -> Dashed,
FrameLabel -> {"\[Lambda] [\[Mu]m]", "Re{\[Epsilon]}"},
BaseStyle -> {FontSize -> 22, FontWeight -> Plain,
FontFamily -> Helvetica}, ImageSize -> 500]
Export["test.eps", %]
```

Edit: Accepting Szabolcs' answer, but Mr.Wizard should be given credit for pointing out the `FontFamily -> Helvetica` vs `FontFamily -> "Helvetica"` behavior (which seems like a bug). Without the quotes, PDF export is a non-starter due to screwed-up fonts.
|
Exporting graphics for publications: how to achieve consistent line thicknesses in plot elements?
|
CC BY-SA 3.0
| 0 |
2011-05-09T01:02:04.380
|
2012-12-20T17:49:53.743
|
2011-05-10T06:58:47.413
| 133,234 | 133,234 |
[
"wolfram-mathematica"
] |
5,931,492 | 1 | 5,931,588 | null | 19 | 760 |
in one of our servers, Garbage Collection took nearly three hours to try to bring down (successfully) 1.2GB of heap memory. From 1.4GB to 200MB.
During this time the CPU usage was high, almost 80-100%. What could be the reason? We have 4 of such servers with the same configuration (JVM settings, server configuration, hardware, network), assuming nobody has made any changes to it, what could be the reason that the particular server ran a 3 hours GC.
All the other servers were taking only 5 to 10 minutes for each GC activity.
Kindly attached a graph from HP BAC for your easy reference. Shows the time where i suppose GC kicked in, and when GC stopped.

(As Stephen points out for more conclusive findings) Providing these information when the server administrator gets back to me:
- - - - - -
|
Three hours taken for GC to bring down 1.2GB of heap, what could be the reason?
|
CC BY-SA 3.0
| 0 |
2011-05-09T01:05:27.580
|
2011-05-09T13:16:07.370
|
2011-05-09T07:54:39.173
| 321,862 | 321,862 |
[
"java",
"garbage-collection",
"jvm"
] |
5,931,571 | 1 | 5,932,378 | null | 5 | 3,051 |
I am creating an Area using ASP.NET MVC 3, by right clicking the project to add an Area called `MyArea`.

Visual Studio 2010 automatically created the AreaRegistration and add RegisterAllAreas() to Application_Start() in Global.asax
But this URL doesn't work: [http://localhost:1733/MyArea/AreaHome/Index](http://localhost:1733/MyArea/AreaHome/Index)

Even though the route seems to be registered.

Could anyone see what I am doing wrong?
Thanks in advance.
|
ASP.NET MVC 3 - Area not working
|
CC BY-SA 3.0
| null |
2011-05-09T01:22:40.283
|
2011-05-09T04:05:09.840
|
2011-05-09T01:33:49.750
| 36,036 | 36,036 |
[
"asp.net-mvc",
"asp.net-mvc-3",
"routes"
] |
5,931,735 | 1 | 5,932,031 | null | 6 | 7,916 |
I need an algorithm which can parse a 2D array and return the largest continuous rectangle. For reference, look at the image I made demonstrating my question.

|
Finding largest rectangle in 2D array
|
CC BY-SA 3.0
| 0 |
2011-05-09T01:56:11.870
|
2015-08-22T16:09:30.217
|
2011-05-09T02:09:58.193
| 392,315 | 422,382 |
[
"c++",
"arrays",
"parsing"
] |
5,931,917 | 1 | null | null | 1 | 125 |
My model object `Reading` has a `Location` but it's not a direct relationship in the database. In the DB, this "has-a" relationship or "reference" spans 3 tables, as shown in this snip:

My `Reading` maps to the ComponentReading table and i want my `Location` to map to the Location table. My `ClassMap<Reading>` class looks like this for now:
```
public class ReadingMap : ClassMap<Reading>
{
public ReadingMap()
{
Table("ComponentReading");
Id(x => x.ID).Column("ComponentReadingId");
//References(x => x.Location).Formula(
Join("VehicleReading", vr =>
{
Join("TrainReading", tr =>
{
tr.References(x => x.Location, "LocationId");
});
});
Map(x => x.TemperatureValue).Column("Temperature");
}
}
```
And here is my simple `Location` mapping:
```
public class LocationMap : ClassMap<Location>
{
public LocationMap()
{
Id(x => x.ID).Column("LocationId");
Map(x => x.Name);
}
}
```
The commented `References(` method sort of shows what i want to achieve with the relationship between `Reading` and `Location` but obviously i can't express it to FNH as simply as the commented line suggests.
I don't think the `Join(` code is even nearly correct either, but it also tries to communicate the relationship that i'm after.
I hope someone can see what i'm trying to do here. Can you help me?
[This question is related.](https://stackoverflow.com/q/5906163/56145)
|
References/has-a mapping thru 3 tables
|
CC BY-SA 3.0
| null |
2011-05-09T02:29:24.860
|
2011-05-19T11:54:05.937
|
2017-05-23T10:30:21.980
| -1 | 56,145 |
[
"nhibernate",
"orm",
"join",
"fluent-nhibernate",
"domain-driven-design"
] |
5,932,025 | 1 | 5,932,110 | null | 2 | 443 |
I am trying to create a normal map in opengl that I can load into the shader and change dynamically, though currently i am stuck at how to create the texture.
I currently have this:
```
glActiveTexture(GL_TEXTURE7);
glGenTextures(1, &normals);
glBindTexture(GL_TEXTURE_2D, normals);
texels = new Vector3f*[256];
for(int i = 0; i < 256; ++i){
texels[i] = new Vector3f[256];
}
this->setup_normals();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 3, 256, 256, 0, GL_RGB, GL_FLOAT, texels);
```
...
```
void setup_normals(){
for(int i = 0; i < 256; ++i){
for(int j = 0; j < 256; ++j){
texels[i][j][0] = 0.0f;
texels[i][j][1] = 1.0f;
texels[i][j][2] = 0.0f;
}
}
}
```
where Vector3f is: typedef float Vector3f[3];
and texels is: Vector3f** texels;
When I draw this texture to a screenquad using an orthogonal matrix( which works for textures loaded in) I get .
I am unsure why it does not appear fully green and also what is causing the black streaks to appear within it. Any help appreciated.
|
opengl texturing
|
CC BY-SA 3.0
| null |
2011-05-09T02:52:40.707
|
2011-05-09T03:12:10.490
| null | null | 192,686 |
[
"opengl"
] |
5,932,095 | 1 | 5,941,083 | null | 0 | 292 |
I want to create a navigation of text but rather than using serverside i want to use jquery and just write out the content once.
see sample image ....
The nav bars will be the arrows at the bottom. If you get to the end turn the arrow to white or if you're starting make the left arrow white.
Any help will be appreciated
|
A simple jquery navigation
|
CC BY-SA 3.0
| null |
2011-05-09T03:08:51.983
|
2011-05-09T18:44:44.420
| null | null | 470,567 |
[
"jquery",
"html",
"css"
] |
5,932,201 | 1 | 6,191,011 | null | 139 | 187,478 |
I want to create an inline-block that will take on some unknown width and height. (It'll have a table inside it with content dynamically generated). Further, the inline-block should be placed inside a line of text, such as "my text (BLOCK HERE)". To make it look pretty, . So if the block looks like this:
```
TOP
MIDDLE
BOTTOM
```
Then the line of text will read: "My text ( [MIDDLE] )" (with TOP and BOTTOM above and below the line)
Here's what I have so far.
### CSS
```
.example {
background-color: #0A0;
display: inline-block;
margin: 2px;
padding: 2px;
position: relative;
text-align: center;
}
```
### HTML
```
<div class="example">TOP<br />MIDDLE<br />BOTTOM</div>
```

|
How to vertical align an inline-block in a line of text?
|
CC BY-SA 3.0
| 0 |
2011-05-09T03:29:09.070
|
2016-06-06T15:49:00.507
|
2020-06-20T09:12:55.060
| -1 | 522,047 |
[
"html",
"vertical-alignment",
"css"
] |
5,932,374 | 1 | 5,933,763 | null | 0 | 438 |
I would like to create something like this:

The copy, star, reply, details. Is this just a UIPopover with a segmented button on it?
Here's another example of what I want:

Anyone got something like this?
|
UIPopover in ipad
|
CC BY-SA 3.0
| 0 |
2011-05-09T04:04:27.367
|
2011-05-09T07:18:59.510
|
2011-05-09T07:14:56.913
| 95,265 | 95,265 |
[
"iphone",
"objective-c",
"ipad"
] |
5,932,507 | 1 | 5,932,790 | null | 0 | 884 |
Here's my fiddle: [http://jsfiddle.net/DmcEB/54/](http://jsfiddle.net/DmcEB/54/)
I'd like it to looks like this:

The code should be smart enough to know that it should only create connectors for the rows after the event pick and before the game date.
|
Tree-like Connectors in Table (HTML/CSS/Prototype)
|
CC BY-SA 3.0
| null |
2011-05-09T04:28:42.130
|
2011-12-29T14:44:50.403
|
2011-12-29T14:44:50.403
| 938,089 | 251,257 |
[
"javascript",
"html",
"css",
"prototypejs"
] |
5,932,525 | 1 | null | null | 2 | 855 |
I'm doing a review for a final tomorrow. I'm being asked to draw the subtype hierarchy of the following types. I want to make sure all the answers I've gotten are correct. I kept in mind generic rules regarding subtypes. Is this correct?
1. List<?>, List<Integer>, List<Object>, List<Number>, List<? extends Number>, List<? super Number>
2. Set<Integer>, List<String>, Object, Collection<Integer>, Collection<Object>, Collection<?>
My drawing:
> 
|
Is <?> higher than all others in the Java wildcard subtype hierarchy?
|
CC BY-SA 3.0
| null |
2011-05-09T04:30:55.077
|
2014-05-22T15:25:49.173
|
2014-05-22T15:25:49.173
| 444,991 | 744,518 |
[
"java"
] |
5,932,529 | 1 | 5,937,259 | null | 0 | 638 |
I can use iCal to make a new event.
```
tell application "iCal"
tell calendar "Todo"
set new_event to make new event at end of events
tell new_event
set start date to date "Friday, May 6, 2011 4:00:00 PM"
set end date to date "Friday, May 6, 2011 4:30:00 PM"
set summary to "Feed ferret"
set location to "Home 2"
set allday event to false
set status to confirmed
end tell
end tell
end tell
```
However, when I use a variable to replace the string, I got an error.
```
tell application "iCal"
tell calendar "Todo"
set new_event to make new event at end of events
set m_date to "Friday, May 6, 2011 4:00:00 PM" --> variable m_date
tell new_event
set start date to date m_date --> Error
set end date to date "Friday, May 6, 2011 4:30:00 PM"
set summary to "Feed ferret"
set location to "Home 2"
set allday event to false
set status to confirmed
end tell
end tell
end tell
```

Why can't I use variables for setting up iCal event?
|
Why can't I use variables for setting up iCal event?
|
CC BY-SA 3.0
| null |
2011-05-09T04:31:51.050
|
2011-05-09T14:50:34.843
| null | null | 260,127 |
[
"date",
"applescript",
"icalendar"
] |
5,932,562 | 1 | 5,932,674 | null | 1 | 3,314 |

Hi, I am looking for multi-column table and also want to send that table in email.
Is there any library which can help me ?
|
How to make multi-column table in iPhone & formate it for the email as shown in image?
|
CC BY-SA 3.0
| 0 |
2011-05-09T04:37:58.070
|
2011-05-09T04:55:17.073
|
2011-05-09T04:52:58.897
| 664,067 | 664,067 |
[
"iphone",
"objective-c",
"cocoa-touch",
"ios4"
] |
5,932,673 | 1 | null | null | 0 | 449 |

in Image table - 1 is table with Primery key ID autonumber and DeclarationContentId as FK from another table. There are two column GrantedAmount and DeclaredAmount Identified by the another column AmountType. I want a left outer join query which will return me a for DeclartionContentId with GrantedAmount and DeclaredAmount togather in a single row
|
Left outer join query
|
CC BY-SA 3.0
| null |
2011-05-09T04:55:11.230
|
2011-05-09T05:57:44.167
|
2011-05-09T05:35:03.823
| 13,302 | 705,624 |
[
"sql-server",
"outer-join"
] |
5,932,891 | 1 | 5,933,912 | null | 0 | 6,482 |
I have a `ASPxGridview` (Normally 21 column but i just want process 4 column).

Every column has a decimal value.
`MV_EDDIE` column is empty.
What i want is, calculating programmaticly ,`MV_EDDIE` columns is `RISK_EUR - (IPOTEK + MV_BERND)` only in `GroupSummary` and `TotalSummary`.
For example;
If
```
RISK_EUR = 100
IPOTEK = 40
MV_BERND = 50
```
Then `MV_EDDIE` column should be 100 - (40 + 50) = 10
How can i do that?
: I have a `Sql` like this
```
SELECT A.HESAP_NO, A.TEKLIF_NO1 || '/' || A.TEKLIF_NO2 AS TEKLIF,
A.MUS_K_ISIM, A.RISK,
(CASE WHEN A.DOVIZ_KOD = 21 THEN 'EUR' WHEN A.DOVIZ_KOD = 2 THEN 'USD' WHEN A.DOVIZ_KOD = 1 THEN 'TL' END) AS DOVIZ,
ROUND(KRISK_CV(A.TEKLIF_NO1, A.TEKLIF_NO2,A.DOVIZ_KOD,:TAR),2) AS RISK_EUR,
NVL(IPOTEK(A.HESAP_NO, :TAR),0) AS IPOTEK,
ROUND(SUM(M_V(A.TEKLIF_NO1, A.TEKLIF_NO2,:TAR)),2) AS MV_BERND,
ROUND(SUM(MV_EX(A.TEKLIF_NO1, A.TEKLIF_NO2,:TAR)),2) AS MV_EDDIE,
(CASE WHEN ROUND(SUM(MV_K(A.TEKLIF_NO1, A.TEKLIF_NO2,:TAR)),2) < 0 THEN
ROUND(SUM(MV_EX(A.TEKLIF_NO1, A.TEKLIF_NO2,:TAR)),2) ELSE
ROUND(SUM(MV_K(A.TEKLIF_NO1, A.TEKLIF_NO2,:TAR)),2) END) AS MV_KASKO,
B.TARIH, GGUNK(A.TEKLIF_NO1,A.TEKLIF_NO2,:TAR) AS GUN
FROM S_TEKLIF A, TMP_TAKIP B
WHERE A.HESAP_NO = B.HESAP
--AND A.HESAP_NO = 316
AND A.RISK > 0
GROUP BY B.TARIH, A.HESAP_NO, A.TEKLIF_NO1 || '/' || A.TEKLIF_NO2 ,
A.MUS_K_ISIM, GGUNK(A.TEKLIF_NO1,A.TEKLIF_NO2,:TAR),
A.RISK, A.DOVIZ_KOD,KRISK_CV(A.TEKLIF_NO1, A.TEKLIF_NO2,A.DOVIZ_KOD,:TAR)
ORDER BY 3
```
: I can solve this problem changing my sql query, but i don't want it. My query is complicated already. I don't want change it. Because of that, i want to solve it programmaticly ..
: I want calculate it only `GroupSummary` and `TotalSummary`. Not other row.
|
Calculating a ASPxGridview Column in DevExpress
|
CC BY-SA 3.0
| null |
2011-05-09T05:29:32.077
|
2011-05-09T07:34:59.833
| null | null | 447,156 |
[
"c#",
".net",
"asp.net",
"devexpress",
"aspxgridview"
] |
5,932,953 | 1 | 5,938,502 | null | 4 | 317 |
In my scenario to print something, I don't want the printer has to be connected with a computer. Rather I am trying to connect that with a Modem(GSM or any other). when a sms arrives to the modem, the print command will fire and the sms will be printed.My question is, If not, i will be delighted if you provide some alternatives.
|
Print Using Modem and Printer Through BTS
|
CC BY-SA 3.0
| null |
2011-05-09T05:41:51.717
|
2011-05-09T14:49:39.013
| null | null | 326,597 |
[
"c#",
"printing",
"embedded",
"sms"
] |
5,933,045 | 1 | 5,933,241 | null | 44 | 41,528 |
This is maybe a fine point, but it concerns the warning that the compiler issues if you do something like:
```
class A
{
public virtual void F() { }
}
class B : A
{
public void F() { }
}
```
Then you get the warning:
`'EomApp1.B.F()' hides inherited member 'EomApp1.A.F()'. To make the current member override that implementation, add the override keyword. Otherwise use the new keyword.`

QUESTION: What is the warning actually warning me will happen if I do nothing about it? Will my program function differently if I add the 'new' keyword vs. if I do not?
(Note: I know I could test this easily enough but I figured it was worth asking here)
|
What if I don't heed the warning "hides inherited member. To make the current member override that implementation...."
|
CC BY-SA 3.0
| 0 |
2011-05-09T05:54:09.437
|
2016-07-11T22:27:24.310
|
2012-03-06T15:28:07.067
| 326,110 | 398,546 |
[
"c#",
"warnings",
"virtual-functions"
] |
5,933,136 | 1 | null | null | 0 | 269 |
this is evernot app dashboard layout ...

how can i create this type of image button.. and also title bar ....
|
how to create this image type layout?
|
CC BY-SA 3.0
| 0 |
2011-05-09T06:05:27.977
|
2011-05-09T06:33:28.840
| null | null | 716,492 |
[
"android",
"layout"
] |
5,933,310 | 1 | 5,934,512 | null | 6 | 14,505 |
My App is having a search bar for searching records from the table view,which is populated by sqlite DB.
My problem is that when the view opens the "cancel" button is not enabled and also I cant touch on that, just like a image only.It is there but no action is with that.
when we click on that search bar text the cancel button will be changed to "done" it is enabled one.
so here is my code
this is my search bar view,see that cancel button.It is not enabled

```
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
//[newSearchBar setShowsCancelButton:YES animated:YES];
newSearchBar.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;
NSLog(@"search begin edit") ;
//searchString = searchBar.text;
//NSLog(@"print did edit searchstring : %@", searchString) ;
for(UIView *view in [searchBar subviews])
{
//shareItemId =newSearchBar.text;
if([view isKindOfClass:[NSClassFromString(@"UINavigationButton") class]]) {
[(UIBarItem *)view setTitle:@"Done"];
}
}
- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
{
NSLog(@"searchBarTextDidEndEditing:");
[searchBar resignFirstResponder];
//[self dismissModalViewControllerAnimated:YES];
}
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
NSLog(@"searchBarSearchButtonClicked");
searchString = searchBar.text;
NSLog(@"search %@", searchBar.text);
[newSearchBar setShowsCancelButton:NO animated:YES];
[searchBar resignFirstResponder];
//[self dismissModalViewControllerAnimated:YES];
}
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
NSLog(@" searchBarCancelButtonClicked");
[searchBar resignFirstResponder];
shareItemName =newSearchBar.text;
[self dismissModalViewControllerAnimated:YES];
}
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar {
NSLog(@"searchBarShouldBeginEditing");
[newSearchBar setShowsCancelButton:YES animated:YES];
return YES;
}
```
These are my delegates for that
Please check my code and give me the answer. I need to enable the "Cancel" button when the view is loaded and it action will be go back to previous view
I need like this

Or else how can I add a another cancel button on exciting cancel button.so that I can enable that.please give me all the details
|
Search Bar Cancel Button is Not Working
|
CC BY-SA 3.0
| 0 |
2011-05-09T06:26:55.833
|
2015-12-16T22:17:33.627
|
2013-04-03T04:50:44.397
| 739,363 | 739,363 |
[
"iphone",
"objective-c",
"cocoa-touch",
"uisearchbar"
] |
5,933,330 | 1 | 5,943,709 | null | 10 | 2,644 |
I have just loaded the ShareKit files into my project (which worked nicely otherwise), and went to build and run (with no code additions as yet).
I received 11 warnings and 37 errors!

Is there something I'm missing here? The warnings are for deprecated functions in the SHK**** files.
Any ideas?
Using Xcode 4.
Thanks for any assistance,
Kolya
|
ShareKit in Xcode 4 - lots of deprecated
|
CC BY-SA 3.0
| 0 |
2011-05-09T06:29:01.043
|
2012-02-04T21:16:07.967
|
2011-05-09T09:05:09.327
| 743,066 | 743,066 |
[
"iphone",
"ios4",
"xcode4",
"sharekit"
] |
5,933,361 | 1 | 5,933,496 | null | 0 | 83 |
I have a UITextView in my IB:

However when I run the simulator and go into this view, it's not there:

How is this even possible??
|
UITextView in IB but not in simulator
|
CC BY-SA 3.0
| null |
2011-05-09T06:32:59.727
|
2011-05-09T06:46:58.497
| null | null | 95,265 |
[
"iphone",
"objective-c",
"uitableview"
] |
5,933,353 | 1 | 5,933,720 | null | 3 | 2,070 |
once again conversion problem in Delphi. I've been through some other topics, that refer to similar problem, but nothing seems to work..
What I want to do is to simple convert computetd solution ( in Extended format ) to String and then display it in TMemo.
I tried these :
```
FloatToStrF( value, ffExponent, 15, 2 );
```
and I also tried to set these :
```
procedure TfrmMain.FormCreate(Sender: TObject);
begin
DecimalSeparator := '.';
Application.UpdateFormatSettings := false;
end;
```
and then use the simpliest one :
```
FloatToStr
```
but I still can't get it working. I've no idea why it works here :
[http://delphi.about.com/library/rtl/blrtlFloatToStrF.htm](http://delphi.about.com/library/rtl/blrtlFloatToStrF.htm)
and doesn't in my program. I know that there is also 2nd version of FloatToStr with second parameter, but I haven't used it before and I am rather not a Delphi expert, so could someone give me an example code of the 2nd version of FloatToStr ?
best regards


|
FloatToStr Delphi Conversion EInvalidOp
|
CC BY-SA 3.0
| 0 |
2011-05-09T06:31:58.700
|
2012-06-25T13:07:13.693
|
2012-06-25T13:07:13.693
| 44,390 | 659,389 |
[
"delphi",
"floating-point"
] |
5,933,432 | 1 | 5,934,395 | null | 0 | 1,174 |
I have a bit gantt chart that i want to be visible on an iphone.
It is 7200 x 1800px large, and consists of ~600 bars, each of which is a UILabel.
It is to look like this:

Now i've gotten it to work. And at ~100 bars, i can make it run quite smoothly by simply adding them all to the scroll view. However, with the full 600 (or more eventually) it simply crashes when i instantiate all those uilabels and add them all to the scroll view as subviews.
So what i've done is made it create only the uilabels for the currently visible rows, and as the user scrolls up and down it removes the invisible uilabels and adds the newly visible ones.
However, this jerks quite noticeably as you scroll vertically as it crosses each row boundary, and has to render another row and remove the old row.
Does anyone have any suggestions to solve this? Any ideas what is the slow part? Instantiating the uilabels, or adding them as subviews, or anything?
All help will be greatly appreciated.
|
How to smoothly scroll through 600ish uilabels on a big uiscrollview (iphone)
|
CC BY-SA 3.0
| null |
2011-05-09T06:39:56.383
|
2011-05-09T08:26:41.193
| null | null | 59,198 |
[
"iphone",
"objective-c",
"uiscrollview",
"uilabel"
] |
5,933,501 | 1 | 5,933,633 | null | 0 | 590 |
I'm using [http://tablesorter.com/docs/](http://tablesorter.com/docs/) to try to sort a table. It works with a cosmetic issue that is not so much disturbing. The "zebra" doesn't activate until you really try to order the table. Isn't annoying at all but I couldn't find why this happens.
My really problem is that I'm trying to use also the pager plugin. The pager div appears at the top of the page. It may be caused (both problems) because I have the table inside a prior hidden tab the first time it appears. The content is loaded from a PHP file via AJAX and, when loaded, depending on the data, I could active tabs and tablesorter (or not).
If I do that, I do with this lines of code:
```
(".tab_content").hide();
$("ul.tabs li:first").addClass("active").show();
$(".tab_content:first").show();
$("#calls").tablesorter({widthFixed: true, widgets: ['zebra']}).tablesorterPager({container: $("#pager")});
```
The "pager" div is inside the tab, just below the target table.
As @mu is to shoort stated pager needs to know where the table is.
Tabs are loaded with
```
<ul class="tabs">
<li><a href="#cont-standard-report">Standard</a></li>
<li><a href="#cont-extensions-report">Extensions</a></li>
<li><a id="calls" href="#cont-calling-report">Callings</a></li>
</ul>
```
So, I tried with the proposed function but it even doesn't call it when clicking the tab.
```
$("#cont-calling-report").one('click', function() {
alert ("Test");
$("#calls").tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $("#pager")});
});
```
This is what happens. No click needed.

Managed to solve with this
Managed to solve it with this:
```
if (activeTab == '#cont-callings-report' && !tablesorter){
$("#calls").tablesorter({widthFixed: true, widgets: ['zebra']}).tablesorterPager({container: $("#pager")});
tablesorter = 1;
}
```
Inside the tab function.
|
Div strangely shown at the top with Tablesorter
|
CC BY-SA 3.0
| null |
2011-05-09T06:47:32.713
|
2011-05-09T08:35:44.600
|
2011-05-09T08:35:44.600
| 664,071 | 664,071 |
[
"jquery",
"jquery-plugins",
"tablesorter"
] |
5,933,580 | 1 | 5,933,876 | null | 2 | 954 |
We did following ugly thing:

So, how can we achieve another `reintegrate`?
What did I try so far?
- - `trunk`-
merge-infos for trunk do not show any merged revisions of the desired branch (as I've rolled them back with r101)
|
How can I reintegrate an already reintegrated and rolled-back branch in SVN?
|
CC BY-SA 3.0
| 0 |
2011-05-09T06:57:00.143
|
2015-05-22T21:50:32.417
|
2015-05-22T21:50:32.417
| null | null |
[
"svn",
"svn-reintegrate"
] |
5,933,874 | 1 | 5,974,618 | null | 4 | 10,304 |
The new release of ExtJS can make your chrome unstable (Or is it my code?)! Let me explain my situation.
I am working on the new MVC architecture of ExtJS 4.0. I have a tree panel displaying my applications menu or navigation. As per the architecture, I tried to split my tree panel into controller, view and a separate store.
Here is my view:
```
Ext.define('CRM.view.menu.View', {
alias: 'widget.menutree',
extend: 'Ext.tree.Panel',
initComponent: function() {
console.log('initComponent of View...');
Ext.apply(this, {
title: 'Simple Tree',
width: 200,
store: 'MainMenu',
rootVisible: false
});
this.callParent(arguments);
}
});
```
My tree's store:
```
Ext.define('CRM.store.MainMenu', {
extend: 'Ext.data.TreeStore',
constructor: function() {
console.log('Constructor of MainMenu TreeStore');
config = Ext.apply(this,{
proxy: {
type: 'ajax',
url: 'data/menu.json'
},root: {
text: 'Menu',
id: 'src',
expanded: true
}
});
this.callParent(arguments);
}
});
```
And in my controller I have provided my store info as well. Here is part of my controller config:
```
Ext.define('CRM.controller.MainMenu',{
extend: 'Ext.app.Controller',
stores: ['MainMenu'],
refs: [
{ref:'menu',selector: 'menutree'},
{ref:'cp',selector: 'centerpane'}
],
.
.
.
```
On initial execution, I get the following error:
> Object MainMenu has no method
'getRootNode'
But now, I get more weird error:
Notice that chrome stops execution in the constructor of the tree store.
At the same time, in firefox:
Firefox executes better, but there is no application rendered!
After some trail and error.. I did find a way to get my application running.. and that is to avoid using my store and directly provide the store information as shown below:
```
Ext.define('CRM.view.menu.View', {
alias: 'widget.menutree',
extend: 'Ext.tree.Panel',
initComponent: function() {
console.log('initComponent of View...');
Ext.apply(this, {
title: 'Simple Tree',
width: 200,
store: {
proxy: {
type: 'ajax',
url: 'data/menu.json'
},root: {
text: 'Menu',
id: 'src',
expanded: true
}
},
rootVisible: false
});
this.callParent(arguments);
}
});
```
Now the application executes with no issues at all!
Did anybody try creating tree panel using MVC architecture? I have no clue into how to fix this!
|
Trouble with TreeStore in ExtJS 4.0 MVC application
|
CC BY-SA 3.0
| 0 |
2011-05-09T07:30:25.140
|
2011-05-12T07:18:41.030
| null | null | 185,655 |
[
"model-view-controller",
"tree",
"extjs4"
] |
5,933,978 | 1 | 5,955,530 | null | 2 | 9,552 |
I am Developing a web application by using ASP.NET 3.5, jQuery and RadAjax Telerik Control. I get Error Messages when page Loading. that is :"Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined" . Image:
and when I click to Open RadWindow then get same Error Message. and could not open radwindow.
Image 2:
How can I solved this Error. Help me..
Thanks
Nahid
|
Microsoft JScript runtime error: Unable to set value of the property 'control': object is null or undefined
|
CC BY-SA 3.0
| 0 |
2011-05-09T07:43:58.107
|
2012-02-22T23:23:35.650
|
2011-05-09T07:49:06.747
| 51,108 | 51,108 |
[
"jquery",
"asp.net",
"telerik",
"runtime-error",
"microsoft-ajax"
] |
5,934,023 | 1 | 5,934,277 | null | 1 | 1,410 |
I have built a simple pagination list and styled it using CSS. However, I've run into a problem. Because I want the list elements to be centred on the page, I've used a container `div` with `relative` positioning.
Here's an illustration that shows what I have at the moment, and what I would like to achieve:

Notice the seeming lack of a border on the current page number.
Here's the HTML markup for the list:
```
<div class="pagination-cont">
<ul class="pagination">
<li class="disabled"><span>< Previous</span></li>
<li class="current"><span>1</span></li>
<li><a href="#" title="Page 2">2</a></li>
<li><a href="#" title="Page 3">3</a></li>
<li class="separator">…</li>
<li><a href="#" title="Page 9">9</a></li>
<li><a href="#" title="Page 10">10</a></li>
<li><a href="#" title="Page 11">11</a></li>
<li><a href="#" title="Next Page">Next ></a></li>
</ul>
</div>
```
and here's the CSS:
```
div#content div.pagination-cont {
float: left;
width: 100%;
overflow: hidden;
position: relative;
margin: 15px 0;
border-top: 1px solid #d1d1d3;
padding-bottom: 2px;
background-color: #e4e4e6;
}
div#content div.pagination-cont ul.pagination {
clear: left;
float: left;
list-style: none;
padding: 0;
margin: 0;
position: relative;
left: 50%;
text-align: center;
}
div#content ul.pagination li {
display: block;
float: left;
list-style: none;
margin: 0;
padding: 0;
position: relative;
right: 50%;
font-size: 110%;
text-transform: uppercase;
font-weight: bold;
}
div#content ul.pagination li.disabled span,
div#content ul.pagination li.separator {
color: #bbb;
text-shadow: 1px 1px 0 #f2f2f2;
padding: 10px 20px;
display: block;
}
div#content ul.pagination li.separator {
border-left: 1px solid #d1d1d3
}
div#content ul.pagination li a {
display: block;
padding: 10px 20px;
color: #004276;
text-decoration: none;
border-left: 1px solid #d1d1d3;
margin-bottom: 1px
}
div#content ul.pagination li.current span {
display: block;
padding: 10px 20px;
border-left: 1px solid #d1d1d3;
background-color: #fff;
color: #999;
border-bottom: 1px solid #d1d1d3
}
```
Any help would be gratefully received!
|
Tabbed Pagination Help
|
CC BY-SA 3.0
| null |
2011-05-09T07:49:11.520
|
2011-05-09T08:18:24.210
| null | null | 367,401 |
[
"html",
"css",
"pagination"
] |
5,934,219 | 1 | 5,935,053 | null | 0 | 188 |
In Firefox my cursor turns into the one you see when you select a text field (I'm using Ubuntu 11.04).
The problem seem to be the commented line below (because the cursors returns to default or pointer if I comment it):
```
<script type="text/javascript" >
$(function(){
var btnUpload=$('#upload');
var status=$('#logo-upload-status');
new AjaxUpload(btnUpload, {
action: '<?php bloginfo('template_directory'); ?>/upload-file.php',
name: 'uploadfile',
/* this is the problem -> onSubmit: function(file, ext){ */
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
status.text('Only JPG, PNG or GIF files are allowed');
return false;
}
status.text('Uploading...');
}
onComplete: function(file, response){
//On completion clear the status
status.text('');
//Add uploaded file to list
if(response==="success"){
$('<li></li>').appendTo('#files').html('<img src="<?php bloginfo('template_directory'); ?>/images/'+file+'" alt="" /><br />'+file).addClass('success');
$('#<?php echo $logo_image; ?>').val(file);
} else{
$('<li></li>').appendTo('#files').text(file).addClass('error');
}
}
});
});
</script>
```
The button:
```
<input type="button" class="background_pattern_button" id="upload" value="Choose Logo" />
```
Any suggestions?
EDIT:
Firebug Inspector (For some reason the cursor looks normal in the screenshot):

|
A jQuery line of code makes my cursor turn to 'text cursor'?
|
CC BY-SA 3.0
| null |
2011-05-09T08:12:31.627
|
2011-05-09T09:37:46.987
|
2011-05-09T08:59:52.670
| 122,536 | 122,536 |
[
"jquery"
] |
5,934,552 | 1 | null | null | 0 | 46,557 |
I want to get selected listview item onclicked listner of listview.
Right now I have implemented `onItemClickListener` but when I click on an item text then it is raised. I want to raise it on a listview row click.
Any idea how to achieve this? To get the text value of the list onClick listener?
```
lv1.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String value = lv1.getAdapter().getItem(position).toString();
//display value here
}
});
```


|
how to get position of clicked item in OnClickListener of Listview?
|
CC BY-SA 4.0
| 0 |
2011-05-09T08:45:04.197
|
2020-07-28T17:04:33.253
|
2020-07-28T17:04:33.253
| 3,396,821 | 249,991 |
[
"android",
"listview"
] |
5,934,538 | 1 | 5,934,814 | null | 19 | 9,385 |
In order to play around a bit with frame hierarchy I wrote a small html page which allows nesting an arbitrary number of frames (code available at the end of the question).
However this doesn't work, on IE9 and Firefox 4 the inner frames are created but aren't rendered (the `head` and `body` are empty):

and on Chrome it works for two levels and then if I click the `Add` button on the inner frame nothing happens (no error message in the console either).
If I copy the file `N` times and have each file use a different file it works for any depth (but not if there's a cycle).
I tried to search for such a limitation but I must not have used the right keywords. Does anyone have any reference for this?
Here's the file:
```
<!DOCTYPE html>
<html>
<head>
<title>Add and Remove Frames</title>
<script type="text/javascript">
function add() {
var f = document.createElement('iframe');
f.src = 'addRemoveFrames.html';
document.getElementById('frameContainer').appendChild(f);
}
function remove() {
var c = document.getElementById('frameContainer');
var f = c.lastChild;
if (f)
c.removeChild(f);
}
</script>
</head>
<body>
<input type="button" onclick="add()" value="Add"/>
<input type="button" onclick="remove()" value="Remove"/>
<hr />
<div id="frameContainer"></div>
</body>
</html>
```
---
I've modified [@davin](https://stackoverflow.com/users/448296/davin)'s answer slightly so each frame's URL reflects its full path in the hierarchy.
```
var counter = 0;
function add() {
var f = document.createElement('iframe');
var sep = location.search ? (location.search + '.') : "?";
f.src = 'addRemoveFrames.html' + sep + ++counter;
document.getElementById('frameContainer').appendChild(f);
}
```
|
Is there a limitation on an IFRAME containing another IFRAME with the same URL?
|
CC BY-SA 4.0
| 0 |
2011-05-09T08:42:54.180
|
2022-07-13T08:12:23.273
|
2022-07-13T08:12:23.273
| 3,848 | 3,848 |
[
"javascript",
"html",
"dom",
"iframe"
] |
5,934,634 | 1 | 5,960,564 | null | 0 | 447 |
Scenario: Clients will be providing me with PDF-templates. I need to programmatically fill these with information.
What is the best way to do this?
Say for example a client sends me the beautiful template seen below and I want to fill in the Price Field. The research I've done so far has led me to believe that there is no way for me to programmatically 'understand' where the Price Field is, is this correct? A workaround I've heard of is creating another template on top of the existing template. I want to make this as hassle-free as possible, is there a program that let's me create a template easily using say drag-and drop forms, with another template as a base? Then perhaps I could load the clients template, then my own created template, populate that with values and merge it all into one PDF. Is this a sensible approach?
Very thankful for any thoughts or suggestions.

|
Best way to modify PDFs using iText?
|
CC BY-SA 3.0
| null |
2011-05-09T08:55:10.327
|
2011-05-11T07:14:21.073
|
2011-05-09T09:01:02.670
| 463,833 | 463,833 |
[
"c#",
"visual-studio",
"itext"
] |
5,934,702 | 1 | null | null | 0 | 255 |
I need to develop an application in Winform C# and trying to find out suitable design pattern for this application.
Basically, My application Interacts with couple of Exes and output is monitored and based on the output, user will click button to trigger another console application (as shown in fig).
Right now, I have written separate class for every console application with which my application is interacting. 
What are best ways to solve this problem (using Design Patterns).
Thank you,
Harsha
|
Design Patterns or Good ways to solve the problem
|
CC BY-SA 3.0
| 0 |
2011-05-09T09:02:13.283
|
2011-05-09T09:09:31.853
| null | null | 341,184 |
[
"c#",
"design-patterns"
] |
5,934,762 | 1 | 5,935,042 | null | 2 | 554 |
I'm wondering why list items as last row are missing bottom margin on IE7?
[http://jsfiddle.net/JeaffreyGilbert/sW5DB/](http://jsfiddle.net/JeaffreyGilbert/sW5DB/)

|
Last row list items are missing bottom margin on IE7
|
CC BY-SA 3.0
| null |
2011-05-09T09:08:54.467
|
2011-05-09T09:44:16.840
|
2011-05-09T09:44:16.840
| 405,015 | 351,564 |
[
"css",
"internet-explorer",
"internet-explorer-7"
] |
5,935,125 | 1 | 5,935,198 | null | 0 | 1,644 |
I'm using a YUI rich text editor in my project. it works fine for me, but I'm facing an issue. It doesn't break lines automatically when writing one big word as shown in the image.
|
my Div doesn't break lines automatically when writing one big word
|
CC BY-SA 3.0
| 0 |
2011-05-09T09:43:44.533
|
2011-05-09T09:50:25.640
| null | null | 526,481 |
[
"css",
"yui",
"richtext"
] |
5,935,200 | 1 | 5,936,121 | null | 2 | 7,942 |
I just got this message from Visual Studio 2005, when I clicked on the delete command I added to my gridview using the interface for configuring the grid:
> Deleting is not supported by data
source 'transactionsSqlDataSource'
unless DeleteCommand is specified.
How can I activate that? I want my user to be able to delete a row when they click on the button Delete.
I already changed the property DeleteCommandType of my SQLDataSource to StoredProcedure.
What else do I need to do?
This is what I did, but I am missing something, I can't compile:
This is what I did at .cs:
```
public string DeleteCommand { get; set; }
```
How can I fix that, it says that the get is missing the body. I am not use to ASP.NET. Could you help me fixing this part of my code?
This is what I did at .aspx:
```
<asp:SqlDataSource ID="transactionsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:membershipsDBConnectionString %>"
SelectCommand="SELECT [brukerId], [kjoptekvoten], [pengeneutbetalt], [fyringsolje], [biltype], [kjoptid] FROM [Informasjon]" DeleteCommandType="StoredProcedure"
DeleteCommand="DELETE FROM [Informasjon] WHERE fyringsolje='Kull: 2,42 kg';">
</asp:SqlDataSource>
```
Is the configuration for the datasource correct? Dont worry if you see that the delete command does not use parameters like the one above, it is just for a homework(I only need the query to pass).
I keep trying but i cant fix it. I am really newbie in ASP.NET and I am not very familiar with all the terminology. What exactly is happening here? How can I know the name of my store procedure?:
CS:
```
public string DeleteCommand { get { return DeleteCommand; } set { DeleteCommand = "";}
```
Aspx:
```
<asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:membershipsDBConnectionString %>"
DeleteCommandType="StoredProcedure" SelectCommand="SELECT [id], [kjoptekvoten], [pengeneutbetalt], [fyringsolje], [biltype], [kjoptid] FROM [Informasjon]"
DeleteCommand="StoredProcedureName">
</asp:SqlDataSource>
```
When I click on Delete that row needs to be erased from table

|
Deleting is not supported in my data source? How can i activate that?
|
CC BY-SA 3.0
| null |
2011-05-09T09:50:35.233
|
2015-11-17T12:20:03.907
|
2011-05-09T11:58:26.690
| 7,872 | 614,141 |
[
"c#",
".net",
"asp.net",
"visual-studio"
] |
5,935,299 | 1 | 5,937,275 | null | 1 | 141 |
[Here](http://glamourunderground.com/fitness/) (on Chrome 10) the footer seems to be aligning with the side bar (too far to the right) instead of center like it's supposed to be.
I didn't edit the footer's CSS. I was editing the sidebar and the index when this happened, but it's so far down the page that I didn't notice 'til later, so I have no idea what the problem is.
Any suggestions welcome! Thank you :)
Tara
UPDATE: I've checked all the DIVs are correctly closing. Some were missing in the side bar, and that's [fixed the problem on the front page](http://glamourunderground.com) but [not on sub pages or articles](http://glamourunderground.com/fitness/). Now there is a black line appearing at the top (under the menu) that appears to be the #footer!!. I can't understand why it's there.

|
Footer Positioning Problem
|
CC BY-SA 3.0
| null |
2011-05-09T10:00:05.347
|
2011-05-09T13:05:15.713
|
2011-05-09T12:29:28.693
| 725,430 | 725,430 |
[
"html",
"css",
"footer"
] |
5,935,613 | 1 | 5,935,756 | null | 6 | 3,398 |
I have created a new WPF application and added an event handler for Loaded event in MainWindow:
```
Loaded += (s, e) => { throw new Exception("AAAA!"); };
```
Then i start this application from Visual C# and the application doesn't crash nor show an uncaught exception.
I expect that it would crash and this application indeed crashes on other computers. But why does it work on mine?
Added a screenshot:
|
WPF: An application does not crash if an exception occurs in Loaded event
|
CC BY-SA 3.0
| null |
2011-05-09T10:32:17.837
|
2013-09-02T14:39:32.800
|
2013-09-02T14:39:32.800
| 96,780 | 265,712 |
[
"c#",
"wpf",
"exception"
] |
5,935,946 | 1 | 5,936,033 | null | 1 | 1,261 |
Has anyone else had problems with ckeditor and characters like this?
I've just downloaded a new version and I'm a little lost.

Thanks for your help.
Richard
|
I've got some weird characters in ckeditor dialogs
|
CC BY-SA 3.0
| null |
2011-05-09T11:02:21.807
|
2011-05-09T11:08:54.307
| null | null | 278,853 |
[
"php",
"javascript",
"ckeditor",
"character"
] |
5,935,953 | 1 | 5,936,046 | null | 1 | 2,252 |
I have the following directory structure on my Apache web root.
I would like to restrict the "source" folder to the outside world. Currently it can be accessed via its url.
How can this be done?

|
Folder Access Restrictions Apache
|
CC BY-SA 3.0
| null |
2011-05-09T11:02:57.003
|
2013-03-02T09:23:33.963
|
2011-05-09T11:21:45.417
| 56,338 | 529,215 |
[
"php",
"linux",
"apache",
".htaccess"
] |
5,936,438 | 1 | 6,015,091 | null | 4 | 6,547 |
i want to generate an ID card for various group members belonging to different section. Each has a different format depending on what user selects e.g

What i also want is the photo portion should be adjustable in the area where the user wants to amd also the photo that comes from database should be able to crop as per the user requirements.
Is this possible doing using Crystal Reports.Any tutorials and guidelines will be helpful as i am absolutely new to using Crystal Reports.
If not using=Crystal Reports,what is the other best option.
Please help me to get the ID card to be generated dynamically.
|
Using Crystal reports to generate ID card dynamically
|
CC BY-SA 3.0
| null |
2011-05-09T11:48:40.603
|
2011-05-16T09:01:22.053
| null | null | 243,680 |
[
"c#",
"asp.net",
"crystal-reports",
"id-card"
] |
5,937,160 | 1 | 5,937,445 | null | 0 | 447 |
I have the following code:
```
var wqry:TAdoQuery;
...
FillChar(wSpaces,cSpacesAfter,' ');
try
wqry := TADOQuery.Create(nil);//here the error
wqry.Connection:=...
```
cSpacesAfter is a constant and has the value 1035. wSpaces is a local string variable. The problem is that I receive the following error when TAdoQuery is created

even it is in french, I believe you got the idea.....
If I comment the FillChar code, everything works ok. I have the usual compiler directives, nothing special. I'm using Delphi 7.
Can someone tell me what is wrong with that code?
|
Delphi - ADO query and FillChar generates errors
|
CC BY-SA 3.0
| 0 |
2011-05-09T12:54:14.187
|
2016-07-21T10:49:10.550
|
2016-07-21T10:49:10.550
| 368,364 | 368,364 |
[
"string",
"delphi",
"delphi-7",
"tadoquery"
] |
5,937,229 | 1 | 5,937,418 | null | 1 | 2,006 |

Is it possible to have the "Save note" button under the "Create note" button using GridLayout? If not, what layout should I be using? dataPanel contains both text fields and both labels. buttonPanel is the save note button and namePanel is the create note button.
```
container.add(dataPanel, BorderLayout.CENTER);
container.add(buttonPanel, BorderLayout.SOUTH);
container.add(namePanel, BorderLayout.EAST);
```
Thanks in advance!
|
Java - Is it possible to have two components on the same side with GridLayout?
|
CC BY-SA 3.0
| null |
2011-05-09T13:01:46.693
|
2011-05-09T13:17:31.570
|
2011-05-09T13:11:10.393
| 21,234 | 737,188 |
[
"java",
"swing",
"layout"
] |
5,937,621 | 1 | 5,938,111 | null | 0 | 146 |
I have a requirement to pop up a small option-view on clicking bar button item, similar to this image.
How can I achieve this? Any tutorial or link is highly appreciated.

|
How do I show a small option view on clicking bar button item?
|
CC BY-SA 3.0
| null |
2011-05-09T13:35:56.773
|
2011-05-09T14:14:09.183
|
2011-05-09T13:41:45.050
| 83,075 | 720,235 |
[
"iphone"
] |
5,937,623 | 1 | 5,951,367 | null | 0 | 815 |
I'm trying to display an extra row at the top of a ListField - called "Add Item" and it almost works, but the very last row "Item 4" of my data is not displayed.

How would you fix this issue?
Please see my very simple test code below:
```
package mypackage;
import java.util.*;
import net.rim.device.api.collection.*;
import net.rim.device.api.collection.util.*;
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.decor.*;
import net.rim.device.api.util.*;
public class MyList extends UiApplication {
public static void main(String args[]) {
MyList app = new MyList();
app.enterEventDispatcher();
}
public MyList() {
pushScreen(new MyScreen());
}
}
class MyScreen extends MainScreen {
ObjectListField myList = new ObjectListField() {
public void drawListRow(ListField list,
Graphics g,
int index,
int y,
int width) {
if (index == 0) {
Font i = getFont().derive(Font.ITALIC);
g.setFont(i);
g.drawText("Add Item", 0, y);
} else {
String str = (String) get(this, index - 1);
g.drawText(str, 0, y);
}
}
protected boolean navigationClick(int status, int time) {
int index = myList.getSelectedIndex();
String str = (index > 0 ? (String) get(this, index - 1) :
"Add item");
Status.show("You have clicked: " + str);
return true;
}
};
public MyScreen() {
setTitle("How to display an extra row?");
myList.set(new String[]{"Item 1","Item 2","Item 3","Item 4",});
// myList.setSize(5);
add(myList);
}
}
```
I've tried adding but get an ArrayIndexOutOfBoundsException thrown by Vector.elementAt(4)
On Michael's suggestion I've switched from ObjectListField to KeywordFilterField (which is what I actually use in my real program) and now I can call without any exception being thrown.
But the last row is still not displayed:

```
package mypackage;
import java.util.*;
import net.rim.device.api.collection.*;
import net.rim.device.api.collection.util.*;
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.decor.*;
import net.rim.device.api.util.*;
public class MyList extends UiApplication {
public static void main(String args[]) {
MyList app = new MyList();
app.enterEventDispatcher();
}
public MyList() {
pushScreen(new MyScreen());
}
}
class MyScreen extends MainScreen {
static final int EXTRA_ROWS = 1;
MyItemList myItems = new MyItemList();
KeywordFilterField myList = new KeywordFilterField() {
protected boolean navigationClick(int status, int time) {
int index = getSelectedIndex();
String str = (index < EXTRA_ROWS ? "Add item" :
((MyItem) getElementAt(index - EXTRA_ROWS)).toString());
Status.show("You have clicked - " + str);
return true;
}
};
public MyScreen() {
setTitle(myList.getKeywordField());
myList.setSourceList(myItems, new MyItem.MyProvider());
myItems.doAdd(new MyItem(1, "Eins"));
myItems.doAdd(new MyItem(2, "Zwei"));
myItems.doAdd(new MyItem(3, "Drei"));
myItems.doAdd(new MyItem(4, "Vier"));
myList.setSourceList(myItems, new MyItem.MyProvider());
myList.setCallback(new MyListFieldCallback());
myList.setSize(myItems.size() + EXTRA_ROWS);
myList.updateList();
add(myList);
}
private class MyListFieldCallback implements ListFieldCallback {
public void drawListRow(ListField list, Graphics g, int index, int y, int width) {
if (index < EXTRA_ROWS) {
Font i = getFont().derive(Font.ITALIC);
g.setFont(i);
g.drawText("Add Item", 0, y);
return;
}
if (index >= EXTRA_ROWS) {
MyItem item = (MyItem) ((KeywordFilterField) list).getElementAt(index - EXTRA_ROWS);
g.drawText(item.toString(), 0, y);
return;
}
g.drawText(list.getEmptyString(), 0, y);
}
public Object get(ListField listField, int index) {
return null;
}
public int getPreferredWidth(ListField listField) {
return 0;
}
public int indexOfList(ListField listField, String prefix, int start) {
return 0;
}
}
}
class MyItemList extends SortedReadableList {
public MyItemList() {
super(new MyItem.MyComparator());
}
protected void doAdd(Object obj) {
super.doAdd(obj);
}
protected boolean doRemove(Object obj) {
return super.doRemove(obj);
}
}
class MyItem {
int _num;
String _name;
public MyItem(int num, String name) {
_num = num;
_name = name;
}
public String toString() {
return _num + ": " + _name;
}
static class MyComparator implements Comparator {
public int compare(Object obj1, Object obj2) {
MyItem item1 = (MyItem) obj1;
MyItem item2 = (MyItem) obj2;
return item1.toString().compareTo(item2.toString());
}
}
static class MyProvider implements KeywordProvider {
public String[] getKeywords(Object obj) {
MyItem item = (MyItem) obj;
return new String[]{ Integer.toString(item._num), item._name };
}
}
}
```
I have a feeling, that (instead of 5) is called inbetween - because I see the last row for a moment and then it disappears again.
Thank you!
Alex
|
Displaying extra rows in a ListField
|
CC BY-SA 3.0
| 0 |
2011-05-09T13:36:06.247
|
2011-05-19T18:04:26.650
|
2011-05-19T18:04:07.510
| 165,071 | 165,071 |
[
"blackberry",
"listfield",
"draw-list"
] |
5,937,695 | 1 | 5,937,858 | null | 2 | 782 |
I've recently bought a new computer, installed XCode 4 on it (which comes with the iOS version 4.3 of the SDK) and moved over all of my old projects from my previous computer (which was also running XCode4 as well but iOS version 4.0).
Im facing two major problems now:
1) All of my projects compile fine, but crash upon loading in the simulator (I get a hex dump and the message "Program ended with exit code: 1"). All of this is still working fine on my previous computer and I cant seem to figure why this would be happening here. The only solution I came to was on a forum which suggested there was a bug with apple that wont allow the new sandy bridge mac's to build anything targeted at iOS 4.3 in the simulator. Is this correct? Are there any other possible reasons why they are crashing on a fresh install all of a sudden?
Which brings me to my second question:
2) When I try to build my XCode project - the only options that are available to me are related to iOS 4.3 (i.e. iPhone or iPad - I have attached a screenshot)  - What I would like to do is target the base iOS 4.0 and see if I can build for that, but for the life of me I can't seem to find a way to install / include the previous iOS versions and make them available in XCode. How can I do this? Any suggestions?
Thank you to the community in advance!
|
How to install previous iOS versions in XCode (only iOS 4.3 is visible)
|
CC BY-SA 3.0
| null |
2011-05-09T13:42:04.527
|
2011-08-06T00:30:48.753
| null | null | 380,154 |
[
"xcode",
"ios",
"xcode4"
] |
5,937,741 | 1 | null | null | 9 | 5,263 |
I want to make custom gallery view in android where i have to show 3 images on screen following.



while flinging on gallery view the images should look like in this pattern?
I have also tried [cover flow example](http://www.inter-fuser.com/2010/01/android-coverflow-widget.html) after making some changes. that is giving that same effect but it puts selected image always in center where I have to show 1st child at left side | 2nd child in middle | 3rd child in right side.
Please share your suggestion.
Thanks in advance.
|
Custom gallery view in android
|
CC BY-SA 3.0
| 0 |
2011-05-09T13:46:21.440
|
2014-01-29T08:00:31.623
|
2011-05-10T11:14:01.823
| 534,709 | 534,709 |
[
"android",
"gallery"
] |
5,937,904 | 1 | 5,941,510 | null | 0 | 418 |
Here is a picture of the errors:

Here is a copy of my web.config:
```
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="BaseConnectionString" connectionString="Data Source=BRYAN-PC;Initial Catalog=Base;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="Data Source=BRYAN-PC;Initial Catalog=Base;Integrated Security=True"
cookieless="false"
timeout="500000"
/>
<httpRuntime requestValidationMode="2.0" />
<!-- Prevent excess code to clutter source -->
<pages buffer="true" validateRequest="true" enableViewState="true"/>
</system.web>
</configuration>
```
I am curious as to why these errors are happening. The only ajax I have going on is the jsTree pluggin which originally wasn't showing these errors. I set up the jsTree plugin to use `[System.Web.Services.WebMethod]` to talk to the code behind.
Can anyone shed some light on how to fix these errors? The code or it's functionality isn't broken but these errors clearly show that I am missing something.
IF anyone requires additional information, please let me know. Thanks!
EDIT: I forgot to mention that it didn't matter what page I was on. The errors shows up all the time.
EDIT2: I am not even using any AJAX Toolkit things at all so I removed it and the ScriptResource issues went away but not my WebResource Issues.
|
ScriptResource & WebResource Errors
|
CC BY-SA 3.0
| 0 |
2011-05-09T13:57:56.150
|
2011-05-09T21:08:09.807
|
2011-05-09T19:23:31.323
| 76,337 | 316,429 |
[
"c#",
"asp.net",
"webresource.axd",
"scriptresource.axd"
] |
5,938,198 | 1 | null | null | 3 | 7,049 |
How to show the remaining KB's of file is to be downloaded in progress bar in android.
e.g 12kb/120kb is remaining..then 97kb/120kb...etc
Can we have this progress dialog as shown in the image
|
File download progress bar in android
|
CC BY-SA 3.0
| 0 |
2011-05-09T14:21:10.293
|
2012-10-17T20:22:05.227
| null | null | 478,700 |
[
"android"
] |
5,938,221 | 1 | 5,938,272 | null | 13 | 5,297 |
I'm pretty sure this is a simple fundamental flaw in my newb PHP knowledge, but I was surprised when the following happened:

`$result` is `TRUE`... so why is it considered equal to the string "email"? I'm guessing this is because, technically, it's a `bool` and it isn't false? So when it's compared against a string (e.g. "email") it returns true.
Should I change my method to return as the result as a `string` containing "true" (instead of `return true;` on success), or is there another way I should be doing this?
Thanks.
|
String compare on a bool
|
CC BY-SA 3.0
| null |
2011-05-09T14:23:19.623
|
2017-04-02T19:10:51.500
|
2017-04-02T19:10:51.500
| 199,700 | 199,700 |
[
"php",
"conditional-statements",
"boolean-operations"
] |
5,938,267 | 1 | 5,938,916 | null | 5 | 1,616 |
`Graph[]` has a tendency to cut off vertex labels in Mathematica. I am looking for a robust workaround.
Example:
```
Graph[{1 -> 2, 2 -> 3, 3 -> 1}, VertexLabels -> "Name"]
```
![Graph[] cuts off the label '2'](https://i.stack.imgur.com/29GgU.png)
My present workaround:
```
SetOptions[Graph, ImagePadding -> 12]
```
This is not robust because the value of `ImagePadding` needs to be manually adjusted depending on the label size.
|
Graph[] cuts off vertex labels in Mathematica
|
CC BY-SA 3.0
| null |
2011-05-09T14:26:32.700
|
2012-01-15T11:19:47.880
|
2012-01-15T11:19:47.880
| 695,132 | 695,132 |
[
"graphics",
"wolfram-mathematica",
"mathematica-8"
] |
5,938,287 | 1 | 5,941,552 | null | 0 | 54 |
I need to add a column to the "Cases" Activity and History view

I want to add the a column for the `Description` field of a case record.
Extra: I'd like to limit the amount of text shown in the cell but maybe have the full description appear in the tooltip.
|
Adding a column to "Cases" summary/main page grid
|
CC BY-SA 3.0
| null |
2011-05-09T14:27:34.660
|
2015-11-08T23:37:52.837
|
2015-11-08T23:37:52.837
| 1,505,120 | 745,314 |
[
"view",
"customization",
"dynamics-crm-4"
] |
5,938,382 | 1 | 5,938,489 | null | 0 | 411 |
I'm building a quote/testimonial display for a website and I want to be display multiple snippets inside the same container. The following image should help clarify the subsequent text ....

I have a container built into a sidebar and inside this container I've created another sub-container with a series of divs set to display:inline. What I would like to do is display div 01 and then, after a certain amount of time, have the sub-container slide to the left and display div 02 - and so on.
Then, when it get's to the end, say div 10, I'd like it to continue sliding and again display div 01 as opposed to sliding to the right - all the way back through all of the divs to reach div 01. CSS3 animate function or JS solutions are fine - whichever might work best.
|
How do I animate a block of divs inside a container automatically?
|
CC BY-SA 3.0
| 0 |
2011-05-09T14:34:48.483
|
2012-08-11T22:16:39.780
|
2012-08-11T22:16:39.780
| null | 706,859 |
[
"jsp",
"animation",
"css",
"html"
] |
5,938,449 | 1 | 5,944,219 | null | 1 | 259 |
Hi I want to find a module or a js script to embed to drupal that can show me all the images uploaded to a node (CCK fields as images) and when I click on one to load that image as the highlighted one (big picture) just like in the following layout.
Can anyone tell me if such a module exist?

or

an image has to be loaded by default
|
click gallery without lightbox in drupal (multiple cck images)
|
CC BY-SA 3.0
| null |
2011-05-09T14:40:43.650
|
2011-05-10T01:20:20.287
| null | null | 249,071 |
[
"javascript",
"drupal",
"view",
"module",
"gallery"
] |
5,938,500 | 1 | 5,938,532 | null | 1 | 79 |
[On this page](http://glamourunderground.com) you can see that elements of the sidebar are hidden by the content (as shown in pic below). This happened while I was editing the menu... Any idea what's going wrong here?
Thanks,
Tara
|
Why Are Elements of Sidebar Hidden?
|
CC BY-SA 3.0
| null |
2011-05-09T14:44:18.967
|
2011-05-09T14:46:59.350
| null | null | 725,430 |
[
"css",
"sidebar"
] |
5,938,567 | 1 | 5,965,100 | null | 0 | 512 |
We have successfully deployed a LightSwitch app in a web server IIS 7. The app works perfectly when accessed via the internal IP ([http://servername](http://servername)), but when it is done via the external IP ([https://www.example.com](https://www.example.com)), the queries don't work. It does fetch ALL data but if something is entered in search fields the query fails, it shows data
fields with a red X.
Fiddler shows the following info:
```
<LI id=L_defaultr_12>Error Code: 500 Internal Server Error. The request was rejected by the HTTP filter. Contact the server administrator. (12217)
```
And the screen looks like this:

Any suggestion on how to trace this problem would be greatly appreciated.
|
lightswitch search fails when deployed to IIS behind ISA Server
|
CC BY-SA 3.0
| null |
2011-05-09T14:49:24.907
|
2017-01-08T16:15:42.410
|
2017-01-08T16:15:42.410
| 559,745 | 120,007 |
[
"visual-studio-2010",
"iis-7",
"visual-studio-lightswitch"
] |
5,938,743 | 1 | 5,939,631 | null | 2 | 4,225 |
I have a file (/test.txt) that contains iCal event info.
```
Friday, May 6, 2011 4:00:00 PM
05/08/2011 11:20:00 PM
summary
location
Friday, May 6, 2011 4:00:00 PM
05/08/2011 11:20:00 PM
summary
location
```
And this is the applescript to read this file to make iCal event.
```
set Names to paragraphs of (read ("/test.txt"))
set my_list to {}
set temp_list to {}
repeat with nextLine in Names
if length of nextLine is greater than 0 then
set temp_list to temp_list & nextLine
else
copy temp_list to end of my_list
set temp_list to {}
end if
end repeat
repeat with e in my_list
set my_list to {}
tell application "iCal"
tell calendar "Todo"
set new_event to make new event at end of events
tell new_event
repeat with j from 1 to count e
set content to item j of e
if j is 1 then
set start date to date content --> Error
end if
if j is 2 then
set end date to date content
end if
if j is 3 then
set summary to content
end if
if j is 4 then
set location to content
end if
end repeat
end tell
end tell
end tell
end repeat
```
Running this code gives me an error

Why is this error?
|
Reading iCal info from file to make iCal event
|
CC BY-SA 3.0
| 0 |
2011-05-09T15:02:41.903
|
2011-05-09T17:25:26.703
| null | null | 260,127 |
[
"applescript",
"icalendar"
] |
5,938,775 | 1 | null | null | -1 | 219 |
i have 5 pages that use tinyMCE, all of them are in iframe but just one them works out.
how can i solve this problem ?

the init code is:
```
tinyMCE.init({
// General options
mode: "exact",
theme: "advanced",
elements: "txtBody",
dialog_type: "modal",
width: "500",
height: "400",
plugins: "autolink,lists,table,advhr,media,searchreplace,contextmenu,paste,directionality,noneditable,xhtmlxtras,template",
theme_advanced_buttons1: "styleselect,formatselect,fontselect,fontsizeselect,justifyleft,justifycenter,justifyright,justifyfull,",
theme_advanced_buttons2: "bold,italic,underline,strikethrough,cut,copy,paste,pastetext,pasteword,search,replace,insertfile,insertimage,",
theme_advanced_buttons3: "undo,redo,link,unlink,image,cleanup,code,forecolor,backcolortablecontrols,removeformat,sub,sup,media,advhr,ltr,rtl",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "right",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
skin: "o2k7",
skin_variant: "silver",
content_css: "../../App_Themes/Document.css"
});
```
|
How to Make multiple TinyMCE frames simultaneously work
|
CC BY-SA 3.0
| 0 |
2011-05-09T15:05:12.407
|
2012-06-22T22:29:49.557
|
2011-05-15T17:07:12.753
| 690,430 | 717,483 |
[
"tinymce",
"wysiwyg"
] |
5,938,885 | 1 | 5,938,907 | null | 1 | 1,328 |
I have the following Qt class:
```
class GLWidget : public QGLWidget
{
Q_OBJECT
public:
GLWidget(QWidget *parent = 0);
private:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
double posX;
double posY;
double posZ;
};
```
When I put this in the constructor, my program produces a `SIGABRT` during `GLWidget::~GLWidget`:
```
this->posX = 0.0;
this->posY = 0.0;
this->posZ = 1.0;
```
These member variables aren't used anywhere else in the class. If I don't initialize the member variables, the program doesn't fail. How can this lead to a `SIGABRT`?

|
Mysterious SIGABRT in destructor if certain member variables are initialized in the constructor
|
CC BY-SA 3.0
| 0 |
2011-05-09T15:14:04.827
|
2011-05-09T16:11:37.753
|
2011-05-09T15:24:37.790
| 217,649 | 217,649 |
[
"c++",
"qt",
"opengl"
] |
5,938,828 | 1 | 5,940,625 | null | 8 | 271 |
I have a simple algorithm to implement: compare each line with each other line. Each line contains one number, and the comparison function is the distance. The sum of all distances is the final result.
This can be implemented as simply as follows:
```
sumOfDistancesOnSmallFile :: FilePath -> IO Integer
sumOfDistancesOnSmallFile path = withFile path ReadMode $ \h->do
distances <- liftM ( (map textRead) ) $ hListToEOF Text.hGetLine h
let subSet = drop offset distances
let emptySubSet = null subSet
return $ if (emptySubSet)
then (0)
else (distancesManyToMany subSet)
hListToEOF :: (Handle -> IO a) -> Handle -> IO [a]
hListToEOF func h = do
element <- func h
atEOF <- hIsEOF h
rest <- case(atEOF) of
True -> return []
False -> hListToEOF func h
return $ element:rest
distancesManyToMany :: [Integer]->Integer
distancesManyToMany (x:xs) = distancesOneToMany x xs + (distancesManyToMany xs)
distancesManyToMany _ = 0
distancesOneToMany :: Integer -> [Integer] -> Integer
distancesOneToMany one many = sum $ map (distance one) many
distance :: Integer -> Integer -> Integer
distance a b = (a-b)
```
To get reasonable big data on each line, i've used the following file generator:
```
createTestFile :: Int -> FilePath -> IO ()
createTestFile n path = writeFile path $ unlines $ map show $ take n $ infiniteList 0 1
where infiniteList :: Integer->Integer-> [Integer]
infiniteList i j = (i+j) * (i+j) : infiniteList j (i+j)
```
A 2000 line file, of 840kb will take 1.92 seconds and 1.5Gb allocations, with a maximum usage of around 1.5Mb.
A 6k line file, of 7.5mb will take 22 seconds, 34Gb allocations, with a maximum memory usage of around 15Mb
Unfortunately my data will be millions of lines. I initially attempted to improve speed (about which I asked in 2 previous posts about [MapReduce](https://stackoverflow.com/questions/5541784/why-does-my-modified-real-world-haskell-mapreduce-implementation-fails-with-to) combined with [Iteratee IO](https://stackoverflow.com/questions/5856435/why-does-my-mapreduce-implementation-real-world-haskell-using-iteratee-io-also)), but the actual limiting problem is space.
:This could be overcome by reading the complete file for each number to compare. This does take a lot of additional time, because the file needs to be opened and parsed for each line that is to be compared with the remainder of the file. Also the number of memory allocations will become quadratic. So that's not really useful as a final solution
:
That was my first step towards my goal: batched execution. I would like to take a few k lines into memory. Apply the ManyToMany algorithm on those in memory. Then, iterate through the remainder of the file. On each iteration step, only one successive line needs to be read and parsed, which then can be compared to all items in the memory batch.
By choosing a batch size big enough the file does not have to be re-read often. My implementation is as follows:
```
sumOfDistancesOnBigFileUsingBatches :: FilePath -> Int -> Int -> IO Integer
sumOfDistancesOnBigFileUsingBatches path batchSize offset = do
(firstResult, maybeRecurse) <- singleResultBatch path batchSize offset
recursiveResult <- case maybeRecurse of
Nothing -> return 0
Just newOffset -> sumOfDistancesOnBigFileUsingBatches path batchSize newOffset
return $ firstResult + recursiveResult
singleResultBatch :: FilePath -> Int -> Int -> IO(Integer, Maybe Int)
singleResultBatch path batchSize offset = withFile path ReadMode $ \h->do
distances <- readDistances h
let (batch, subSet) = splitAt batchSize $ drop offset distances
let batchInner = distancesManyToMany batch
let recursionTerminated = null subSet
let (batchToSubSet, newOffset) = if (recursionTerminated)
then (0, Nothing)
else (distancesSetToSet batch subSet, Just (offset+batchSize))
return (batchInner+batchToSubSet, newOffset)
where
readDistances h = liftM ( (map textRead) ) $ hListToEOF Text.hGetLine h
distancesSetToSet :: [Integer] -> [Integer] -> Integer
distancesSetToSet xs ys = sum $ map (\one->distancesOneToMany one xs) ys
```
On the 2k line file, with a batch size of 500 it finished with 2.16secs, 2.2Gb allocations and around 6Mb required space. That is 4 times the space of the simplest version! It might be coincidence, but there are also 4 batches utilized...
What surprised me, is that all the required space is consumed initially, later on the required space only decreases. This becomes a problem with a 50k line file (500MB), because then it runs out of memory.
why does the batches solution consume more memory? It seems to keep the whole file in memory for each batch, even though it should (at least that's my intention) only keep one single batch in memory.
:
I removed the details of the 6k line file and 500line batches (I took a wrong profile file)
And as addition, here is the space profile generated using the 2k line file and 500line batches:

:
Profiling with retainer resulted in:
```
total time = 2.24 secs (112 ticks @ 20 ms)
total alloc = 2,126,803,896 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc
textRead MapReduceTestStrictStrings 47.3 44.4
distance MapReduceTestStrictStrings 25.9 25.3
distancesOneToMany MapReduceTestStrictStrings 18.8 29.5
singleResultBatch MapReduceTestStrictStrings 4.5 0.0
readTextDevice Data.Text.IO.Internal 2.7 0.0
individual inherited
COST CENTRE MODULE no. entries %time %alloc %time %alloc
MAIN MAIN 1 0 0.0 0.0 100.0 100.0
main Main 1604 2 0.0 0.0 100.0 100.0
sumOfDistancesOnBigFileUsingBatches MapReduceTestStrictStrings 1605 4 0.0 0.0 100.0 100.0
singleResultBatch MapReduceTestStrictStrings 1606 20 4.5 0.0 100.0 100.0
distancesSetToSet MapReduceTestStrictStrings 1615 3 0.0 0.0 34.8 43.3
distancesOneToMany MapReduceTestStrictStrings 1616 3000 14.3 23.2 34.8 43.2
distance MapReduceTestStrictStrings 1617 1500000 20.5 20.0 20.5 20.0
textRead MapReduceTestStrictStrings 1614 5000 47.3 44.4 47.3 44.4
distancesManyToMany MapReduceTestStrictStrings 1611 2004 0.0 0.0 9.8 11.7
distancesOneToMany MapReduceTestStrictStrings 1612 2000 4.5 6.3 9.8 11.6
distance MapReduceTestStrictStrings 1613 499000 5.4 5.3 5.4 5.3
hListToEOF MapReduceTestStrictStrings 1609 23996 0.9 0.6 3.6 0.6
readTextDevice Data.Text.IO.Internal 1610 1660 2.7 0.0 2.7 0.0
CAF:main4 Main 1591 1 0.0 0.0 0.0 0.0
CAF:main5 Main 1590 1 0.0 0.0 0.0 0.0
main Main 1608 0 0.0 0.0 0.0 0.0
CAF GHC.Num 1580 1 0.0 0.0 0.0 0.0
CAF GHC.IO.Handle.FD 1526 2 0.0 0.0 0.0 0.0
CAF GHC.IO.FD 1510 2 0.0 0.0 0.0 0.0
CAF System.Event.Thread 1508 3 0.0 0.0 0.0 0.0
CAF GHC.IO.Encoding.Iconv 1487 2 0.0 0.0 0.0 0.0
CAF System.Event.Internal 1486 2 0.0 0.0 0.0 0.0
CAF System.Event.Unique 1483 1 0.0 0.0 0.0 0.0
CAF GHC.Conc.Signal 1480 1 0.0 0.0 0.0 0.0
CAF Data.Text.Internal 813 1 0.0 0.0 0.0 0.0
CAF Data.Text.Array 811 1 0.0 0.0 0.0 0.0
Retainer sets created during profiling:
SET 2 = {<MAIN.SYSTEM>}
SET 3 = {<MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 15 = {<GHC.IO.FD.CAF>}
SET 17 = {<System.Event.Thread.CAF>}
SET 18 = {<>}
SET 44 = {<GHC.IO.Handle.FD.CAF>}
SET 47 = {<GHC.IO.Handle.FD.CAF>, <MAIN.SYSTEM>}
SET 56 = {<GHC.Conc.Signal.CAF>}
SET 57 = {<>, <MAIN.SYSTEM>}
SET 66 = {<MAIN.SYSTEM>, <MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 67 = {<System.Event.Thread.CAF>, <>, <MAIN.SYSTEM>}
SET 72 = {<GHC.Conc.Sync.CAF>, <MAIN.SYSTEM>}
SET 76 = {<MapReduceTestStrictStrings.hListToEOF,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 81 = {<GHC.IO.Handle.FD.CAF>, <MAIN.SYSTEM>, <MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 83 = {<GHC.IO.Encoding.Iconv.CAF>, <GHC.IO.Handle.FD.CAF>, <MAIN.SYSTEM>, <MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 86 = {<GHC.Conc.Signal.CAF>, <>}
SET 95 = {<MapReduceTestStrictStrings.distancesOneToMany,MapReduceTestStrictStrings.distancesManyToMany,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 96 = {<MAIN.SYSTEM>, <MapReduceTestStrictStrings.distancesOneToMany,MapReduceTestStrictStrings.distancesManyToMany,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 100 = {<MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>, <MapReduceTestStrictStrings.hListToEOF,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 102 = {<MAIN.SYSTEM>, <MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>, <MapReduceTestStrictStrings.distancesOneToMany,MapReduceTestStrictStrings.distancesManyToMany,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 103 = {<MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 136 = {<GHC.IO.Handle.FD.CAF>, <MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 143 = {<GHC.Conc.Sync.CAF>, <GHC.IO.Handle.FD.CAF>, <MAIN.SYSTEM>}
SET 144 = {<MapReduceTestStrictStrings.distancesOneToMany,MapReduceTestStrictStrings.distancesSetToSet,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 145 = {<MAIN.SYSTEM>, <MapReduceTestStrictStrings.distancesOneToMany,MapReduceTestStrictStrings.distancesSetToSet,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 146 = {<MapReduceTestStrictStrings.distancesSetToSet,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 147 = {<MAIN.SYSTEM>, <MapReduceTestStrictStrings.distancesSetToSet,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
SET 148 = {<MapReduceTestStrictStrings.distancesSetToSet,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>, <MapReduceTestStrictStrings.distancesOneToMany,MapReduceTestStrictStrings.distancesSetToSet,MapReduceTestStrictStrings.singleResultBatch,MapReduceTestStrictStrings.sumOfDistancesOnBigFileUsingBatches,Main.main>}
```
And the following .hp image:

The previous code all used the packages:
```
Data.Text.IO
Data.Text
Data.Text.Read
```
When i use the lazy versions of them, the total time / memory / space usages doesn't really change: 2.62 secs, 2.25Gb allocations and 5.5MB space
The lazy versions did not work because the hListToEOF forced a full file read (I expected the : constructor to work lazily).
The solution is to use he following imports:
```
import qualified Data.ByteString.Char8 as Str
import qualified Data.Text.Lazy.IO as TextIO
import qualified Data.Text.Lazy as T
import Data.Text.Lazy.Read
```
and in the function the following modification:
```
readDistances = liftM ( (map textRead . T.lines)) $ TextIO.readFile path
```
Then the both the speed (2.72s) and the memory allocations (2.3GB) do not change, which is expected.
The heap profile (space usage) does improve (1.8MB instead of 5.5MB), as visible in:

|
Haskell batched file processing does not improve space profile
|
CC BY-SA 3.0
| null |
2011-05-09T15:09:10.227
|
2011-05-11T17:42:48.777
|
2017-05-23T10:24:28.160
| -1 | 691,415 |
[
"haskell",
"profiling",
"heap-memory"
] |
5,939,091 | 1 | 5,939,364 | null | 0 | 126 |
i have a MySQL SELECT query which fetches data from 6 tables using Mysql JOIN. here is the MySQL query i am using.
```
SELECT
u.id,u.password,
u.registerDate,
u.lastVisitDate,
u.lastVisitIp,
u.activationString,
u.active,
u.block,
u.gender,
u.contact_id,
c.name,
c.email,
c.pPhone,
c.sPhone,
c.area_id,
a.name as areaName,
a.city_id,
ct.name as cityName,
ct.state_id,
s.name as stateName,
s.country_id,
cn.name as countryName
FROM users u
LEFT JOIN contacts c ON (u.contact_id = c.id)
LEFT JOIN areas a ON (c.area_id = a.id)
LEFT JOIN cities ct ON (a.city_id = ct.id)
LEFT JOIN states s ON (ct.state_id = s.id)
LEFT JOIN countries cn ON (s.country_id = c.id)
```
although query works perfectly fine it sometimes returns duplicate results if it finds any duplicate values when using LEFT JOIN. for example in contacts table there exist two rows with area id '2' which results in returning another duplicated row. how do i make a query to select only the required result without any duplicate row. is there any different type of MySQL Join i should be using?
thank you
here is the contacts table, the column area_id may have several duplicate values.

there was an error in my condition in last LEFT JOIN where i have used `(s.country_id = c.id)` instead it should be `(s.country_id = cn.id)` after splitting the query and testing individually i got to track the error. thank you for your response. it works perfectly fine now.
|
Problem using MySQL Join
|
CC BY-SA 3.0
| null |
2011-05-09T15:31:11.993
|
2011-05-09T16:16:28.287
|
2011-05-09T16:16:28.287
| 396,476 | 396,476 |
[
"mysql"
] |
5,939,130 | 1 | 5,940,673 | null | 3 | 4,158 |
I have an ASP.NET 4.0 web application which . I have played around with the available options and I am getting following:
When I compile I get a separate assembly for each page as following:

1. When I compile I get a single assembly of the web application but on the live server every page is dynamically compiled and a temp file is generated.

1. I need a way to compile my web application into a single assembly which allows UI updates (HTML changes not the code) and does not generate temporary files.

|
ASP.NET pre-compile into a single assembly
|
CC BY-SA 3.0
| 0 |
2011-05-09T15:34:05.523
|
2011-05-09T18:24:01.853
|
2011-05-09T17:56:20.723
| 193,098 | 193,098 |
[
".net",
"asp.net",
"visual-studio-2010"
] |
5,939,240 | 1 | 5,939,258 | null | 7 | 13,268 |
How to fix it.
It look like this page is dedicated to that kind of error.

|
System.StackOverflowException was unhandled - C#, .NET
|
CC BY-SA 3.0
| 0 |
2011-05-09T15:43:34.497
|
2011-05-09T15:46:15.107
| null | null | 465,408 |
[
"c#",
".net",
"exception",
"stack-overflow"
] |
5,939,394 | 1 | null | null | 0 | 937 |
I have a custom menu I built that I would like to deploy to my SharePoint Site's Master Page.
I have the asp.net menu build as a c# project is VS2010, but have no idea how to deploy it to SharePoint. Once compiled, the project of course creates a dll file and has a few .config files.
Where can I place these files? I heard in the GAC but I am not sure where that specifically is (folder) on the server. Also, will I be required to Reference that dll in my project (point it to the GAC on the Sp2010 server)?
What is the standard, most accepted way of deploying a custom asp.net menu to a SharePoint Master Page?
Thanks
In Addition:
After playing with this, I create a VERY simple asp.net menu in Visual Studio 2010. The following is the entirety of my default.aspx file:
```
<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<html4f><body><head runat="server"></head>
<form id="Form1" runat="server">
<asp:Menu ID="Menu1" runat="server">
<Items>
<asp:MenuItem Text="Menu1" Value="Menu1">
<asp:MenuItem Text="SubMenu1" Value="SubMenu1"></asp:MenuItem>
<asp:MenuItem Text="SubMenu2" Value="SubMenu2"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Menu2" Value="Menu2"></asp:MenuItem>
</Items>
</asp:Menu>
</form>
```
Root web folder after publish:

Bin folder:

How do I add this to my SharePoint master page file? I now realize I need to add the dll's (all of them?) to the Sharepoint BIN folder for that particular site collection, as well as modify the web.config file, but I am unsure how to find out the information I need to do so. The .config files require some "keys" and I am unsure how to find out the GUID for the dll's I am using?
This should be a simple thing - add a menu to sharepoint, but finding I don't know what to search for in order to proceed. Thanks for any help you can offer.
|
Replacing SharePoint menu with custom asp.net menu
|
CC BY-SA 3.0
| null |
2011-05-09T15:54:38.680
|
2011-05-11T21:02:40.580
|
2011-05-11T21:02:40.580
| 13,959 | 13,959 |
[
"asp.net",
"dll",
"sharepoint-2010"
] |
5,939,568 | 1 | 5,940,459 | null | 0 | 1,275 |
I have a question regarding the conversion of regular expressions to non-deterministic finite state automata:
Convert (a*|b*)* to NFA. My attempt is as follows:

Am I completely off the mark? Or somewhat there?
NB E => ε
|
Converting RE -> NFA
|
CC BY-SA 3.0
| 0 |
2011-05-09T16:09:53.787
|
2011-05-09T17:45:51.373
| null | null | 559,142 |
[
"regex",
"compiler-construction",
"finite-automata",
"nfa"
] |
5,939,577 | 1 | null | null | 3 | 1,292 |
So basically what I need to do in a C sharp rich text box, is take the text from how it looks in this image:

1. Product Data: Submit manufacturers printed product literature, specifications and datasheet in accordance with specifications.
2. Test Reports & Certificates: Test Reports: Submit one draft of test plan and report for review including: Procedures for system and equipment testing. Testing checklist. Recorded video from each channel of video including metadata which shows record rate, resolution and compression format. Certificates: Submit certificates signed by manufacturer certifying that materials comply with specified performance characteristics and physical properties. Submit ULC/UL Product Safety Certificates.
I have tried playing with the rtb.sethangingIndent method, but that just sets it for the ENTIRE textbox at the same time
As I am sure you can see, There are different levels that the text needs to be indented by, depending on which level you are at, which I think confuses things a lot!
Is there a way to do this without looping through each line of the textbox, and counting the amount of whitespace before the top line of "block" (that would need to be indented)?
|
Is it possible to set the hanging indent of each line in a RTB in c#?
|
CC BY-SA 3.0
| null |
2011-05-09T16:10:56.317
|
2014-01-13T18:38:34.770
|
2014-01-13T18:38:34.770
| 881,229 | 607,079 |
[
"c#",
"richtextbox",
"indentation"
] |
5,939,630 | 1 | null | null | 31 | 2,310 |
I find the array library Repa for Haskell very interesting, and wanted to make a simple program, to try to understand how to use it. I also made a simple implementation using lists, which proved to be much faster. My main question is how I could improve the Repa code below to make it the most efficient (and hopefully also very readable). I am quite new using Haskell, and I couldn't find any easily understandable tutorial on Repa [ there is one at the [Haskell Wiki](http://haskell.org/haskellwiki/Numeric_Haskell:_A_Repa_Tutorial), that I somehow forgot when I wrote this], so don't assume I know anything. :) For example, I'm not sure when to use force or deepSeqArray.
The program is used to approximately calculate the volume of a sphere in the following way:
1. The center point and radius of the sphere is specified, as well as equally spaced coordinates within a cuboid, which are known to encompass the sphere.
2. The program takes each of the coordinates, calculates the distance to the center of the sphere, and if it is smaller than the radius of the sphere, it is used to add up on the total (approximate) volume of the sphere.
Two versions are shown below, one using lists and one using repa. I know the code is inefficient, especially for this use case, but the idea is to make it more complicated later on.
For the values below, and compiling with "ghc -Odph -fllvm -fforce-recomp -rtsopts -threaded", the list version takes 1.4 s, while the repa version takes 12 s with +RTS -N1 and 10 s with +RTS -N2, though no sparks are converted (I have a dual-core Intel machine (Core 2 Duo E7400 @ 2.8 GHz) running Windows 7 64, GHC 7.0.2 and llvm 2.8). (Comment out the correct line in main below to just run one of the versions.)
Thank you for any help!
```
import Data.Array.Repa as R
import qualified Data.Vector.Unboxed as V
import Prelude as P
-- Calculate the volume of a sphere by putting it in a bath of coordinates. Generate coordinates (x,y,z) in a cuboid. Then, for each coordinate, check if it is inside the sphere. Sum those coordinates and multiply by the coordinate grid step size to find an approximate volume.
particles = [(0,0,0)] -- used for the list alternative --[(0,0,0),(0,2,0)]
particles_repa = [0,0,0::Double] -- used for the repa alternative, can currently just be one coordinate
-- Radius of the particle
a = 4
-- Generate the coordinates. Could this be done more efficiently, and at the same time simple? In Matlab I would use ndgrid.
step = 0.1 --0.05
xrange = [-10,-10+step..10] :: [Double]
yrange = [-10,-10+step..10]
zrange = [-10,-10+step..10]
-- All coordinates as triples. These are used directly in the list version below.
coords = [(x,y,z) | x <- xrange, y <- yrange, z <- zrange]
---- List code ----
volumeIndividuals = fromIntegral (length particles) * 4*pi*a**3/3
volumeInside = step**3 * fromIntegral (numberInsideParticles particles coords)
numberInsideParticles particles coords = length $ filter (==True) $ P.map (insideParticles particles) coords
insideParticles particles coord = any (==True) $ P.map (insideParticle coord) particles
insideParticle (xc,yc,zc) (xp,yp,zp) = ((xc-xp)^2+(yc-yp)^2+(zc-zp)^2) < a**2
---- End list code ----
---- Repa code ----
-- Put the coordinates in a Nx3 array.
xcoords = P.map (\(x,_,_) -> x) coords
ycoords = P.map (\(_,y,_) -> y) coords
zcoords = P.map (\(_,_,z) -> z) coords
-- Total number of coordinates
num_coords = (length xcoords) ::Int
xcoords_r = fromList (Z :. num_coords :. (1::Int)) xcoords
ycoords_r = fromList (Z :. num_coords :. (1::Int)) ycoords
zcoords_r = fromList (Z :. num_coords :. (1::Int)) zcoords
rcoords = xcoords_r R.++ ycoords_r R.++ zcoords_r
-- Put the particle coordinates in an array, then extend (replicate) this array so that its size becomes the same as that of rcoords
particle = fromList (Z :. (1::Int) :. (3::Int)) particles_repa
particle_slice = slice particle (Z :. (0::Int) :. All)
particle_extended = extend (Z :. num_coords :. All) particle_slice
-- Calculate the squared difference between the (x,y,z) coordinates of the particle and the coordinates of the cuboid.
squared_diff = deepSeqArrays [rcoords,particle_extended] ((force2 rcoords) -^ (force2 particle_extended)) **^ 2
(**^) arr pow = R.map (**pow) arr
xslice = slice squared_diff (Z :. All :. (0::Int))
yslice = slice squared_diff (Z :. All :. (1::Int))
zslice = slice squared_diff (Z :. All :. (2::Int))
-- Calculate the distance between each coordinate and the particle center
sum_squared_diff = [xslice,yslice,zslice] `deepSeqArrays` xslice +^ yslice +^ zslice
-- Do the rest using vector, since I didn't get the repa variant working.
ssd_vec = toVector sum_squared_diff
-- Determine the number of the coordinates that are within the particle (instead of taking the square root to get the distances above, I compare to the square of the radius here, to improve performance)
total_within = fromIntegral (V.length $ V.filter (<a**2) ssd_vec)
--total_within = foldAll (\x acc -> if x < a**2 then acc+1 else acc) 0 sum_squared_diff
-- Finally, calculate an approximation of the volume of the sphere by taking the volume of the cubes with side step, multiplied with the number of coordinates within the sphere.
volumeInside_repa = step**3 * total_within
-- Helper function that shows the size of a 2-D array.
rsize = reverse . listOfShape . (extent :: Array DIM2 Double -> DIM2)
---- End repa code ----
-- Comment out the list or the repa version if you want to time the calculations separately.
main = do
putStrLn $ "Step = " P.++ show step
putStrLn $ "Volume of individual particles = " P.++ show volumeIndividuals
putStrLn $ "Volume of cubes inside particles (list) = " P.++ show volumeInside
putStrLn $ "Volume of cubes inside particles (repa) = " P.++ show volumeInside_repa
```
: Some background that explains why I have written the code as it is above:
I mostly write code in Matlab, and my experience of performance improvement comes mostly from that area. In Matlab, you usually want to make your calculations using functions operating on matrices directly, to improve performance. My implementation of the problem above, in Matlab R2010b, takes 0.9 seconds using the matrix version shown below, and 15 seconds using nested loops. Although I know Haskell is very different from Matlab, my hope was that going from using lists to using Repa arrays in Haskell would improve the performance of the code. The conversions from lists->Repa arrays->vectors are there because I'm not skilled enough to replace them with something better. This is why I ask for input. :) The timing numbers above is thus subjective, since it may measure performance more than that of the abilities of the languages, but it is a valid metric for me right now, since what decides what I will use depends on if can make it work or not.
tl;dr: I understand that my Repa code above may be stupid or pathological, but it's the best I can do right now. I would love to be able to write better Haskell code, and I hope that you can help me in that direction (dons already did). :)
```
function archimedes_simple()
particles = [0 0 0]';
a = 4;
step = 0.1;
xrange = [-10:step:10];
yrange = [-10:step:10];
zrange = [-10:step:10];
[X,Y,Z] = ndgrid(xrange,yrange,zrange);
dists2 = bsxfun(@minus,X,particles(1)).^2+ ...
bsxfun(@minus,Y,particles(2)).^2+ ...
bsxfun(@minus,Z,particles(3)).^2;
inside = dists2 < a^2;
num_inside = sum(inside(:));
disp('');
disp(['Step = ' num2str(step)]);
disp(['Volume of individual particles = ' num2str(size(particles,2)*4*pi*a^3/3)]);
disp(['Volume of cubes inside particles = ' num2str(step^3*num_inside)]);
end
```
: New, faster and simpler version of the Repa code
I have now read up a bit more on Repa, and thought a bit. Below is a new Repa version. In this case, I create the x, y, and z coordinates as 3-D arrays, using the Repa extend function, from a list of values (similar to how ndgrid works in Matlab). I then map over these arrays to calculate the distance to the spherical particle. Finally, I fold over the resulting 3-D distance array, count how many coordinates are within the sphere, and then multiply it by a constant factor to get the approximate volume. My implementation of the algorithm is now much more similar to the Matlab version above, and there are no longer any conversion to vector.
The new version runs in about 5 seconds on my computer, a considerable improvement from above. The timing is the same if I use "threaded" while compiling, combined with "+RTS -N2" or not, but the threaded version does max out both cores of my computer. I did, however, see a few drops of the "-N2" run to 3.1 seconds, but couldn't reproduce them later. Maybe it is very sensitive to other processes running at the same time? I have shut most programs on my computer when benchmarking, but there are still some programs running, such as background processes.
If we use "-N2" and add the runtime switch to turn off parallel GC (-qg), the time consistently goes down to ~4.1 seconds, and using -qa to "use the OS to set thread affinity (experimental)", the time was shaved down to ~3.5 seconds. Looking at the output from running the program with "+RTS -s", much less GC is performed using -qg.
This afternoon I will see if I can run the code on an 8-core computer, just for fun. :)
```
import Data.Array.Repa as R
import Prelude as P
import qualified Data.List as L
-- Calculate the volume of a spherical particle by putting it in a bath of coordinates. Generate coordinates (x,y,z) in a cuboid. Then, for each coordinate, check if it is inside the sphere. Sum those coordinates and multiply by the coordinate grid step size to find an approximate volume.
particles :: [(Double,Double,Double)]
particles = [(0,0,0)]
-- Radius of the spherical particle
a = 4
volume_individuals = fromIntegral (length particles) * 4*pi*a^3/3
-- Generate the coordinates.
step = 0.1
coords_list = [-10,-10+step..10] :: [Double]
num_coords = (length coords_list) :: Int
coords :: Array DIM1 Double
coords = fromList (Z :. (num_coords ::Int)) coords_list
coords_slice :: Array DIM1 Double
coords_slice = slice coords (Z :. All)
-- x, y and z are 3-D arrays, where the same index into each array can be used to find a single coordinate, e.g. (x(i,j,k),y(i,j,k),z(i,j,k)).
x,y,z :: Array DIM3 Double
x = extend (Z :. All :. num_coords :. num_coords) coords_slice
y = extend (Z :. num_coords :. All :. num_coords) coords_slice
z = extend (Z :. num_coords :. num_coords :. All) coords_slice
-- Calculate the squared distance from each coordinate to the center of the spherical particle.
dist2 :: (Double, Double, Double) -> Array DIM3 Double
dist2 particle = ((R.map (squared_diff xp) x) + (R.map (squared_diff yp) y) + (R.map ( squared_diff zp) z))
where
(xp,yp,zp) = particle
squared_diff xi xa = (xa-xi)^2
-- Count how many of the coordinates are within the spherical particle.
num_inside_particle :: (Double,Double,Double) -> Double
num_inside_particle particle = foldAll (\acc x -> if x<a^2 then acc+1 else acc) 0 (force $ dist2 particle)
-- Calculate the approximate volume covered by the spherical particle.
volume_inside :: [Double]
volume_inside = P.map ((*step^3) . num_inside_particle) particles
main = do
putStrLn $ "Step = " P.++ show step
putStrLn $ "Volume of individual particles = " P.++ show volume_individuals
putStrLn $ "Volume of cubes inside each particle (repa) = " P.++ (P.concat . ( L.intersperse ", ") . P.map show) volume_inside
-- As an alternative, y and z could be generated from x, but this was slightly slower in my tests (~0.4 s).
--y = permute_dims_3D x
--z = permute_dims_3D y
-- Permute the dimensions in a 3-D array, (forward, cyclically)
permute_dims_3D a = backpermute (swap e) swap a
where
e = extent a
swap (Z :. i:. j :. k) = Z :. k :. i :. j
```
The same types of profiles as Don Stewart made below, but for the new Repa code.



|
Best way of "looping over a 2-D array", using Repa
|
CC BY-SA 3.0
| 0 |
2011-05-09T16:15:01.347
|
2011-05-31T06:02:39.647
|
2011-05-16T15:25:55.933
| 745,447 | 745,447 |
[
"arrays",
"performance",
"haskell",
"profiling",
"repa"
] |
5,939,781 | 1 | 5,939,815 | null | 12 | 3,219 |
I have a couple of buttons inside a div with a specific width, and I am facing a problem where the buttons are being rendered differently in firefox vs chrome and safari.
In firefox, the buttons are bigger and are messing up my layout.
```
<div id="sort_by">
<button id="sort_by_price" class="sortButton" value="1">Price</button>
<button id="sort_by_bedrooms" class="sortButton" value="1">Bedrooms</button>
<button id="compareButton" class="sortButton">Compare</button>
</div>
```
CSS:
```
button {
display:inline;
float:left;
background-color:orange;
border:1px solid orange;
border-radius:5px;
-moz-border-radius:5px;
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
font-size:14px;
text-decoration:none;
font-weight:bold;
color:#FFFFFF;
cursor:pointer;
padding:4px 10px 3px 7px;
}
#sort_by {
width:265px;
height:35px;
border-bottom-style:solid;
border-bottom-width:2px;
border-color:#c9c9c9;
padding-top:3px;
padding-bottom:3px;
padding-left:5px;
}
```
Rendered in firefox:

Rendered in Chrome:

It can be seen that the buttons in firefox are bigger. How can I fix this? Thanks.
|
Button rendered differently in Firefox vs Webkit
|
CC BY-SA 3.0
| 0 |
2011-05-09T16:31:02.713
|
2014-12-10T14:50:20.787
| null | null | 269,106 |
[
"html",
"css",
"firefox",
"google-chrome"
] |
5,939,804 | 1 | 5,941,315 | null | 1 | 848 |
I'm able to run the WCF-SecureProfile sample that comes with the MSFT WCF samples download ([http://msdn.microsoft.com/en-us/library/ee818238.aspx](http://msdn.microsoft.com/en-us/library/ee818238.aspx))
However I can't port this server component to IIS. I get the error that
`<MakeConnectionBindingElement/>` can't be loaded. Considering that I have the behavior extensions loaded I don't know why IIS can't see the extension, however the self-host version of my app can.
I uploaded the sourcecode of the project into codeplex for easy browsing. Here is a direct [link to web.config](http://rsp4iis.codeplex.com/SourceControl/changeset/view/77568#1545704) and all other files.
[2](http://rsp4iis.codeplex.com/SourceControl/changeset/view/77568#1545704)
|
Custom binding element can't be loaded in WCF under IIS, however it can load under WCF Self-Host
|
CC BY-SA 3.0
| null |
2011-05-09T16:32:59.423
|
2011-05-09T21:42:18.150
|
2011-05-09T21:42:18.150
| 328,397 | 328,397 |
[
"wcf",
"iis-7",
"iis-express",
"reliable-secure-profile"
] |
5,939,823 | 1 | null | null | 0 | 1,153 |
First page's image

Second page's image

First page's code
```
<jsp:useBean id="labelBean" scope="session"
class="my.com.infopro.ibank.ui.bean.LabelBean" />
<jsp:useBean id="txLimitMaintBean" scope="session"
class="my.com.infopro.ibank.ui.bean.TxLimitMaintBean" />
<jsp:useBean id="lang" scope="session"
class="my.com.infopro.ibank.ui.bean.LanguageBean" />
<%@ page import="java.util.Iterator"%>
<%@ page import="my.com.infopro.ibank.dto.TxLimitMaintDto"%>
<%@ page import="my.com.infopro.ibank.ui.bean.TxLimitMaintBean"%>
<%
request.getSession(true);
String contextPath = request.getContextPath();
txLimitMaintBean.queryTxList();
//String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
<%
labelBean.getLabel("TRANSACTION_LIMIT");
%>
</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<jsp:include page="/ScriptHeader.jsp"/>
</head>
<body>
<form name="form" method="POST" action="" dir="<%=lang.getDir()%>">
<table width="500" border="0" align="center">
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4">
<p align="left" class="mainHeader"><%=labelBean.getLabel("TRANSACTION_LIMIT")%>
</p>
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4">
<p align="left" class="subHeader"><%=labelBean.getLabel("CURR_TRNSCT_LMT")%></p>
</td>
</tr>
<tr>
<td colspan="3"><div align="center">
<p class="statusError">
<%if(request.getParameter("error") != null) out.println(labelBean.getLabel(request.getParameter("error"))); else out.println("");%>
</p>
</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4">
<p align="left"><%=labelBean.getLabel("FILL_IN_NEWLMT")%></p>
</td>
</tr>
<tr>
<td colspan="4">
<p align="left"><%=labelBean.getLabel("MAX_LMT")%></p>
</td>
</tr>
</table>
<br />
<table align="center">
<tr class="table_header">
<td width="130" align="left" class="tableHeader"><%=labelBean.getLabel("LIMIT")%></td>
<td width="130" align="left" class="tableHeader"><%=labelBean.getLabel("EXISTING_LIMIT")%></td>
<td width="130" align="right" class="tableHeader"><%=labelBean.getLabel("MAX_LIMIT")%></td>
<td width="80" align="left" class="tableHeader"></td>
</tr>
<%
for (Iterator iter = txLimitMaintBean.getTxLimitMaintList().iterator(); iter
.hasNext();) {
TxLimitMaintDto txLimitMaintDto = (TxLimitMaintDto) iter.next();
%>
<tr class="tableRowEven">
<td><%=txLimitMaintDto.getTxType()%></td>
<td><%=txLimitMaintDto.getTxCurrLimit()%></td>
<td><%=txLimitMaintDto.getTxMaxLimit()%></td>
<td><a href="<%=contextPath%>/TxLimitMaintServlet?tranx=update&typeUpdate=<%=txLimitMaintDto.getTxType()%>"><%=labelBean.getLabel("UPDATE")%></a> </td>
</tr>
<%
}
%>
</table>
<br />
<br />
<table width="500" border="0" align="center">
<tr>
<td align="left" class="footer"><%=labelBean.getLabel("DISCLAIMER")%></td>
</tr>
<tr>
<td align="left" class="footer">
<ul>
<li><%=labelBean.getLabel("TRANSFER_SUCCESS")%></li>
</ul>
</td>
</tr>
</table>
<jsp:include page="/Footer.jsp" />
</form>
</body>
</html>
```
Second page's code
```
<jsp:useBean id="labelBean" scope="session"
class="my.com.infopro.ibank.ui.bean.LabelBean" />
<jsp:useBean id="txLimitMaintBean" scope="session"
class="my.com.infopro.ibank.ui.bean.TxLimitMaintBean" />
<jsp:useBean id="lang" scope="session"
class="my.com.infopro.ibank.ui.bean.LanguageBean" />
<%@ page import="java.util.Iterator"%>
<%@ page import="my.com.infopro.ibank.dto.TxLimitMaintDto"%>
<%@ page import="my.com.infopro.ibank.ui.bean.TxLimitMaintBean"%>
<%
//request.getSession(true);
String contextPath = request.getContextPath();
//String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>
<%
labelBean.getLabel("TRANSACTION_LIMIT");
%>
</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<jsp:include page="/ScriptHeader.jsp"/>
<script language="JavaScript">
function back() {
document.form.action="<%=contextPath %>/TxLimitMaintServlet?tranx=start";
document.form.submit();
}
function validateAndSubmit() {
var msg1 = "<%=labelBean.getLabel("MSG_REQUIRED_FIELD")%>";
var msg2 = "<%=labelBean.getLabel("MSG_CANNOT_CONTAIN_CHARACTER")%>";
var msg3 = "<%=labelBean.getLabel("MSG_IN_THE_FIELD")%>";
var msg4 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER")%>";
var msg5 = "<%=labelBean.getLabel("WITH")%>";
var msg6 = "<%=labelBean.getLabel("TO")%>";
var msg7 = "<%=labelBean.getLabel("MSG_CHARACTER")%>";
var msg8 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_VALID_NUMBER")%>";
var msg9 = "<%=labelBean.getLabel("MSG_REQUIRED_FIELD")%>";
var msg10 = "<%=labelBean.getLabel("MSG_WITH_EXACTLY")%>";
var msg11 = "<%=labelBean.getLabel("MSG_WITH_VALID_DATE")%>";
var msg12 = "<%=labelBean.getLabel("MSG_EXAMPLE_DATE")%>";
var msgNum11 = "<%=labelBean.getLabel("MSG_WITH_A_MINIMUM_VALUE_OF")%>";
var msgNum12 = "<%=labelBean.getLabel("MSG_WITH_A_MAX_VALUE_OF")%>";
var msgNum13 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_ROUND_INETEGER")%>";
var msgNum14 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_AT_MOST")%>";
var msgNum15 = "<%=labelBean.getLabel("MSG_DECIMAL_PLACES")%>";
var maxLimit = parseInt(form.maxLimit.value);
var newLimit = parseInt(form.txNewLimit.value);
if (! validateNumericEntry(form.txNewLimit, "<%=labelBean.getLabel("NEW_LIMIT")%>" + " ", true, 2, 1, <%=TxLimitMaintBean.getTotalMaxLimit()%>, msg9, msg8, msg4,
msgNum11, msgNum12, msgNum13, msgNum14, msgNum15))
return false;
if( newLimit > maxLimit){
alert("<%=labelBean.getLabel("MSG_CANNOT_EXCEED")%>");
return false;
}
return true;
}
</script>
</head>
<body>
<form name="form" method="POST" action="<%=contextPath%>/TxLimitMaintServlet?tranx=confirm" onsubmit="#" dir="<%=lang.getDir()%>">
<table width="500" border="0" align="center">
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4">
<p align="left" class="mainHeader"><%=labelBean.getLabel("TRANSACTION_LIMIT")%>
</p>
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4">
<p align="left" class="subHeader"><%=labelBean.getLabel("CURR_TRNSCT_LMT")%></p>
</td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4">
<p align="left"><%=labelBean.getLabel("FILL_IN_NEWLMT")%></p>
</td>
</tr>
<tr>
<td colspan="4">
<p align="left"><%=labelBean.getLabel("MAX_LMT")%></p>
</td>
</tr>
</table>
<br />
<table align="center">
<tr class="table_header">
<td width="130" align="left" class="tableHeader"><%=labelBean.getLabel("LIMIT")%></td>
<td width="130" align="left" class="tableHeader"><%=labelBean.getLabel("EXISTING_LIMIT")%></td>
<td width="130" align="left" class="tableHeader"><%=labelBean.getLabel("NEW_LIMIT")%></td>
<td width="80" align="right" class="tableHeader"><%=labelBean.getLabel("MAX_LIMIT")%></td>
</tr>
<tr class="tableRowEven">
<td><%=txLimitMaintBean.getTxType()%></td>
<td><input name="txCurrLimit" + type="text"
value="<%=txLimitMaintBean.getTxCurrLimit()%>" readonly="readonly"></td>
<td><input name="txNewLimit" type="text"></td>
<td><%=txLimitMaintBean.getTxMaxLimit()%></td>
<td><input name="maxLimit" value="<%=txLimitMaintBean.getTxMaxLimit()%>" type="hidden"></input></td>
</tr>
</table>
<br />
<table align="center">
<tr>
<td align="right"><input type="button" class="button" value="Back" onclick="back();"></td>
<td align="right"><input type="reset" class="button"
value="Reset"></td>
<td align="left"><input type="submit" class="button" value="Next"
onClick="return validateAndSubmit();"></td>
</tr>
</table>
<br />
<table width="500" border="0" align="center">
<tr>
<td align="left" class="footer"><%=labelBean.getLabel("DISCLAIMER")%></td>
</tr>
<tr>
<td align="left" class="footer">
<ul>
<li><%=labelBean.getLabel("TRANSFER_SUCCESS")%></li>
</ul>
</td>
</tr>
</table>
<jsp:include page="/Footer.jsp" />
</form>
</body>
</html>
```
The problem is: how can I validate add up of both 3rd Party Transfer and Bill Payment can not exceed 10,000?
|
How to do validation in java script involve two jsp page?
|
CC BY-SA 3.0
| null |
2011-05-09T16:34:41.857
|
2011-05-18T18:41:49.973
|
2011-05-09T16:37:48.727
| 157,882 | 745,510 |
[
"java",
"javascript",
"jsp"
] |
5,939,903 | 1 | 5,940,284 | null | 0 | 1,908 |
How can I color the ColumnSeries differently based on data. I need something like a labelFunction only for the column fill.
I'm sure it's very easy.
: Attached image for JAX to understand. :)

Thank you.
|
Flex 4 ColumnChart: How to color bars differently based on data
|
CC BY-SA 3.0
| null |
2011-05-09T16:42:03.977
|
2011-05-16T14:52:01.900
|
2011-05-16T14:52:01.900
| 383,148 | 383,148 |
[
"apache-flex",
"charts"
] |
5,939,947 | 1 | null | null | 2 | 2,110 |
I have a span that holds a jquery-ui icon, and an outer span that gets the error state.
However the icon is shifted up, so that part of the icon is not contained in the outer span. I can tell because with the ui-state-error, the outer span has a red background, and the icon is partially above this red area.
Any ideas why?
```
<span style="width:20px;height:20px;display:none" class="userNameInvalidIcon ui-state-error">
<span style="display:inline-block" class="ui-icon ui-icon-circle-close"/>
</span>
```

|
jquery ui icon not centered on span
|
CC BY-SA 3.0
| null |
2011-05-09T16:46:40.120
|
2012-05-02T15:18:50.010
| null | null | 351,980 |
[
"jquery",
"html",
"css",
"jquery-ui"
] |
5,940,982 | 1 | 5,941,836 | null | 5 | 19,518 |
I want to have each subplot share the same colorbar scale. I know `caxis` works for integers greater than 1, but there appears to be a problem using `caxis` with values such as 0.001.
```
x = 0:1:10;
y = 0:1:10;
z1 = .1:-.01:0;
z2 = .01:-.001:0;
figure;
subplot(1,2,1);
scatter(x,y,10,z1); colorbar;
subplot(1,2,2);
scatter(x,y,10,z2); colorbar;
```

Now I want to have the scatter subplots to have a common colorbar scale. I tried to use `caxis`, however I do not get the desired results. How can this be corrected?
```
ca = [0 .01];
figure;
subplot(1,2,1);
scatter(x,y,10,z1); caxis(ca); colorbar;
subplot(1,2,2);
scatter(x,y,10,z2); caxis(ca); colorbar;
```

|
Common colorbar for scatter plots in Matlab with small numbers
|
CC BY-SA 3.0
| 0 |
2011-05-09T18:35:49.270
|
2011-05-09T19:58:00.513
| null | null | 363,829 |
[
"matlab",
"plot",
"scatter-plot",
"colorbar"
] |
5,941,105 | 1 | 5,961,168 | null | 0 | 2,406 |
I'm not sure if I'm using the correct terminology to describe what I'm looking for but it's the best I could come up with.
Essentially I have a list of items that I'm currently displaying in DIVs. I'm using the jQuery UI plug-ins and hooking up styles to toggle when the user hovers over each item. Now I'd like to have a small toolbar-like set of buttons appear in the upper-right corner of each item when the mouse hovers over that item. When the mouse moves up or down to the next item, the toolbar "moves" to that item. Of course, it doesn't really move - I'm assuming that I'm toggling the visibility of a toolbar associated with each item.
The latter point is due to a couple of factors including that the buttons are encoded with the id value for each list item so the command knows which item to work against.
What I need to know is how to create the HTML and CSS so that I can have a DIV with contents that are unaffected by the display of the toolbar. And the markup and style settings to get the toolbar to appear in the upper-right corner of each item, above the existing content.
I basically have a <DIV> wrapper that contains another <DIV> with text and another <DIV> that contains a set of image buttons (images wrapped in anchors). What I need is the HTML and CSS so that the <DIV> (or whatever other element is required to make it work) containing the buttons appears to float in the top-right corner of the parent <DIV> as shown in the picture below:

I can then use jQuery to show and hide the buttons when the item is hovered.
|
jQuery/CSS floating/overlay toolbar/buttons
|
CC BY-SA 3.0
| null |
2011-05-09T18:47:41.823
|
2011-05-12T16:00:11.683
|
2011-05-11T17:41:54.740
| 173,281 | 173,281 |
[
"css",
"jquery-ui"
] |
5,941,241 | 1 | 5,941,527 | null | 2 | 245 |
I think this will require javascript. I figured it wouldn't hurt to ask though.
We all know how to float an image or div right or left and have the text flow around and below that image. I'm trying to float a div at a fixed width from the top of a container and have text flow around above and below it.
It would be easiest if I could place this div above the paragraph text, but I could insert it if I had to.
I made this crude image outlining what I'm trying to do.
Thanks!
|
How can I float a div at a fixed height from the top of the container?
|
CC BY-SA 3.0
| null |
2011-05-09T19:02:01.643
|
2011-05-09T19:33:03.217
| null | null | 324,307 |
[
"javascript",
"html",
"css"
] |
5,941,674 | 1 | 6,083,185 | null | 6 | 3,753 |
I need to somehow customize the jqGrid plugin, either by clever tricks, hacks, or modification of the plugin, to support the following type of aggregation/grouping.
I would be very grateful for some ideas from the jqGrid community on how to implement this.
The aggregation/grouping works as follows.
The user is initially presented with a grid of data as in the following, grouped according to "Column 1." Notice the hyperlinks (e.g. "+5"); these hyperlinks represented "collapsed" rows in which all of the data in those rows have the same values for all columns except the ones with hyperlinks.

By clicking, for example, on the "+5" link, the table expands to display the 5 rows which were previously collapsed into one (replacing the collapsed row that included the "+5" link). Notice that now the expanded rows all have unique values in Column 2, which previously had the "+5" link.

Any ideas on how to implement this? Is this possible in with any other grid plugins?
|
Custom aggregation/grouping in jqGrid
|
CC BY-SA 3.0
| 0 |
2011-05-09T19:43:13.193
|
2011-05-21T17:00:44.980
|
2011-05-11T13:40:51.820
| 717,442 | 717,442 |
[
"javascript",
"jquery",
"jquery-ui",
"jquery-plugins",
"jqgrid"
] |
5,941,724 | 1 | 5,968,773 | null | 0 | 1,100 |
This may be a dumb question, I realize, but this is quite frustrating for me right now so I'm going to ask anyway.
I'm following the C/C++ Development User Guide in the Eclipse help.
I'm at C/C++ Development User Guide -> Getting Started -> Debugging projects
At this point I am told the following:
`In the Variables view, right-click the input variable, and select Change Value... and type 'm' between the single quotes and hit OK.`
Except, there is no `Change Value...`! Here is a screenshot of what it looks like for me:

Where is `Change Value...`? Whiskey Tango Foxtrot?!
|
How can I change a variable through the debugger in the Eclipse CDT on a mac?
|
CC BY-SA 3.0
| null |
2011-05-09T19:48:09.247
|
2012-06-20T02:44:38.283
| null | null | 379,360 |
[
"eclipse",
"macos",
"debugging",
"eclipse-cdt"
] |
5,941,869 | 1 | 5,941,949 | null | 1 | 394 |
I have an MDI application that I have set up with a starting window state of "Normal". When I open each new child form, it automagically opens in a cascading format. It ends up looking like this:

This is fine for a few times, but it keeps opening lower and lower even if:
1. you close one or all of them
2. you move one or all of them
3. it runs way out of the visible space (forcing you to scroll or move it to see it). It will eventually reset after 11 opened instances and start opening from the top like it did originally.
I can't figure out how to change that "11" number to ... maybe... "3". How do I do that?
What is the name of this hidden property?
I fear it may be something I need .Net Reflector to even see... Is there a better way to solve this problem?
|
Number of windows to cascade in MDI winform
|
CC BY-SA 3.0
| null |
2011-05-09T20:02:10.557
|
2011-05-09T20:10:24.373
|
2020-06-20T09:12:55.060
| -1 | 88,257 |
[
".net",
"winforms",
"mdi"
] |
5,942,183 | 1 | 5,942,393 | null | 6 | 3,867 |
when i use jqgrid and enter values on the top toolbar filter or the advanced filter and then click the "refresh grid" button in the footer of the grid, it wipes out the values in the filters.
is this a bug in jqgrid, or is there something that you have to do explicitally for it to keep the state of the toolbar column filters.
is there anyway to get this to work?
|
jqgrid refresh grid button doesn't pass along filters
|
CC BY-SA 3.0
| null |
2011-05-09T20:34:29.517
|
2011-05-09T20:55:02.783
| null | null | 4,653 |
[
"jquery",
"jqgrid",
"filter"
] |
5,942,296 | 1 | 5,942,364 | null | 2 | 639 |
the image says what I want to do

|
How add box shadow to a div inside a container ? (Image included)
|
CC BY-SA 3.0
| 0 |
2011-05-09T20:46:33.853
|
2011-05-09T20:59:54.617
|
2011-05-09T20:48:36.097
| 390,989 | 742,115 |
[
"html",
"css"
] |
5,942,510 | 1 | 7,954,737 | null | 50 | 1,591 |
We are developing a top-down RPG using XNA. Recently we bumped into a setback when writing the code to display our maps. When drawing the map, top-down view with a normal transformation matrix, everything seems to be fine. When using a non-flat transformation matrix, such as squeezing the top or bottom to mimic depth, black lines (rows when top or bottom, column when left or right is squeezed) that move around when the camera changes position, appear. The movement and placement appear to be random. (Image provided further down.)
# Background information
The maps consist of tiles. The original texture has tiles consisting of 32x32 pixels. We draw the tiles by creating 2 triangles and displaying part of the original texture on these triangles. A shader does this for us. There are three layers of triangles. First we draw all the opaque tiles and all opaque pixels of all semi-opaque and partial-transparent tiles, then all the semi-opaque and partial-transparent tiles and pixels. This works fine (but when we zoom by a floating point factor, sometimes color-blended lines are in between tile rows and/or columns).
## Renderstates
We use the same rasterizerState for all tiles and we switch between two when drawing solid or semi-transparent tiles.
```
_rasterizerState = new RasterizerState();
_rasterizerState.CullMode = CullMode.CullCounterClockwiseFace;
_solidDepthState = new DepthStencilState();
_solidDepthState.DepthBufferEnable = true;
_solidDepthState.DepthBufferWriteEnable = true;
_alphaDepthState = new DepthStencilState();
_alphaDepthState.DepthBufferEnable = true;
_alphaDepthState.DepthBufferWriteEnable = false;
```
In the shade we set the SpriteBlendMode as follows:
The first solid layer 1 uses
```
AlphaBlendEnable = False;
SrcBlend = One;
DestBlend = Zero;
```
All the other solid and transparent layers (drawn later) use
```
AlphaBlendEnable = True;
SrcBlend = SrcAlpha;
DestBlend = InvSrcAlpha;
```
Other shaders use this too. The `SpriteBatch` for the `SpriteFonts` used, uses default setting.
## Generated Texture
Some tiles are generated on the fly and saved to file. The file is loaded when the map is loaded. This is done using a `RenderTarget` created as follows:
```
RenderTarget2D rt = new RenderTarget2D(sb.GraphicsDevice, 768, 1792, false,
SurfaceFormat.Color, DepthFormat.None);
sb.GraphicsDevice.SetRenderTarget(rt);
```
When generated, the file is saved and loaded (so we don't lose it when the device resets, because it no longer will be on a `RenderTarget`). I tried using mipmapping, but it is a spritesheet. There is no information on where tiles are placed, so mipmapping is useless and it didn't solve the problem.
## Vertices
We loop through every position. No floating points here yet, but position is a Vector3 (Float3).
```
for (UInt16 x = 0; x < _width; x++)
{
for (UInt16 y = 0; y < _heigth; y++)
{
[...]
position.z = priority; // this is a byte 0-5
```
To position the tiles the following code is used:
```
tilePosition.X = position.X;
tilePosition.Y = position.Y + position.Z;
tilePosition.Z = position.Z;
```
As you know, floats are 32 bit, with 24 bits for precision. The maximum bit value of z is 8 bits (5 = 00000101). The maximum values for X and Y are 16 bits resp. 24 bits. I assumed nothing could go wrong in terms of floating points.
```
this.Position = tilePosition;
```
When the vertices are set, it does so as follows (so they all share the same tile position)
```
Vector3[] offsets = new Vector3[] { Vector3.Zero, Vector3.Right,
Vector3.Right + (this.IsVertical ? Vector3.Forward : Vector3.Up),
(this.IsVertical ? Vector3.Forward : Vector3.Up) };
Vector2[] texOffset = new Vector2[] { Vector2.Zero, Vector2.UnitX,
Vector2.One, Vector2.UnitY };
for (int i = 0; i < 4; i++)
{
SetVertex(out arr[start + i]);
arr[start + i].vertexPosition = Position + offsets[i];
if (this.Tiles[0] != null)
arr[start + i].texturePos1 += texOffset[i] * this.Tiles[0].TextureWidth;
if (this.Tiles[1] != null)
arr[start + i].texturePos2 += texOffset[i] * this.Tiles[1].TextureWidth;
if (this.Tiles[2] != null)
arr[start + i].texturePos3 += texOffset[i] * this.Tiles[2].TextureWidth;
}
```
## Shader
The shader can draw animated tiles and static tiles. Both use the following sampler state:
```
sampler2D staticTilesSampler = sampler_state {
texture = <staticTiles> ; magfilter = POINT; minfilter = POINT;
mipfilter = POINT; AddressU = clamp; AddressV = clamp;};
```
The shader doesn't set any different sampler states, we also don't in our code.
Every pass, we clip at the alpha value (so we don't get black pixels) using the following line
```
clip(color.a - alpha)
```
Alpha is 1 for solid layer 1, and 0 for any other layer. This means that if there is a fraction of alpha, it will be drawn, unless on the bottom layer (because we wouldn't know what to do with it).
## Camera
We use a camera to mimic lookup from top down at the tiles, making them appear flat, using the z value to layer them by external layering data (the 3 layers are not always in the right order). This also works fine. The camera updates the transformation matrix. If you are wondering why it has some weird structure like this.AddChange - the code is Double Buffered (this also works). The transformation matrix is formed as follows:
```
// First get the position we will be looking at. Zoom is normally 32
Single x = (Single)Math.Round((newPosition.X + newShakeOffset.X) *
this.Zoom) / this.Zoom;
Single y = (Single)Math.Round((newPosition.Y + newShakeOffset.Y) *
this.Zoom) / this.Zoom;
// Translation
Matrix translation = Matrix.CreateTranslation(-x, -y, 0);
// Projection
Matrix obliqueProjection = new Matrix(1, 0, 0, 0,
0, 1, 1, 0,
0, -1, 0, 0,
0, 0, 0, 1);
Matrix taper = Matrix.Identity;
// Base it of center screen
Matrix orthographic = Matrix.CreateOrthographicOffCenter(
-_resolution.X / this.Zoom / 2,
_resolution.X / this.Zoom / 2,
_resolution.Y / this.Zoom / 2,
-_resolution.Y / this.Zoom / 2,
-10000, 10000);
// Shake rotation. This works fine
Matrix shakeRotation = Matrix.CreateRotationZ(
newShakeOffset.Z > 0.01 ? newShakeOffset.Z / 20 : 0);
// Projection is used in Draw/Render
this.AddChange(() => {
this.Projection = translation * obliqueProjection *
orthographic * taper * shakeRotation; });
```
# Reasoning and Flow
There are 3 layers of tile data. Each tile is defined by `IsSemiTransparent`. When a tile is `IsSemiTransparent`, it needs to be drawn after something not `IsSemiTransparent`. Tile data is stacked when loaded on a `SplattedTile` instance. So, even if layer one of tile data is empty, layer one of the `SplattedTile` will have tile data in the first layer, (given that at least one layer has tile data). The reason is that the `Z-buffer` doesn't know what to blend with if they are drawn in order, since there might be no solid pixels behind it.
The layers do NOT have a z value, individual tile data has. When it is a ground tile, it has `Priority = 0`. So tiles with the same `Priority` we be ordered on layer (draw order) and opaqueness (semi-transparent, after opaque). Tiles with different priority will be drawn according to their priority.
The first solid layer has no destination pixels, so I set it to `DestinationBlend.Zero`. It also doesn't need `AlphaBlending`, since there is nothing to alphablend with. The other layers (5, 2 solid, 3 transparent) might be drawn when there is already color data and need to blend accordingly.
Before iterating through the 6 passes, the `projection matrix` is set. When using no taper, this works. When using a taper, it doesn't.
# The Problem
We want to mimic some more depth by applying the taper, using the some matrix. We tried several values but this is an example:
```
new Matrix(1, 0, 0, 0,
0, 1, 0, 0.1f,
0, 0, 1, 0,
0, 0, 0, 1);
```
The screen (everything with height value 0, all flat stuff) will be squeezed. The lower the y (higher on the screen), the more it's squeezed. This actually works, but now random black lines appear almost everywhere. It seems to exclude a few tiles, but I don't see what's the correlation. We think it might had something to do with interpolation or mipmaps.
And here is an image to show you what I am talking about:
.
The tiles not affected seem to be static tiles NOT on the bottom layer. I marked this text because I think it is a hint to what's happening. The lines appear if I put the `mip mag and minfilter` to `Linear`.
Here is an image zoomed in (in game zoom), showing the artifact on tiles on layer 2 or 3

# We already tried
- `mipfilter``Point``Linear`- `GenerateMipMaps`- `GenerateMipMaps``RenderTarget`- [mipmapping a spritesheet](http://blogs.msdn.com/b/shawnhar/archive/2009/09/08/texture-filtering.aspx)- - `DepthBufferEnable = false`- `SrcBlend = One;``DestBlend = Zero;`- `ScrBlend = SrcAlpha;``DestBlend = InvSrcAlpha;`- - `clip(opacity)``shader`-
Does anyone recognize this problem? On a final note, we do call the `SpriteBatch` AFTER drawing the tiles, and use another `Shader` for avatars (show no problems, because they have height > 0). Does this undo our `sampler state`? Or...?
|
When transforming textures (drawn as flat 3D objects) to mimic depth, black lines appear randomly
|
CC BY-SA 3.0
| 0 |
2011-05-09T21:07:58.147
|
2012-05-09T04:26:49.320
|
2017-02-08T14:32:09.387
| -1 | 715,669 |
[
"c#",
"graphics",
"xna",
"shader"
] |
5,942,804 | 1 | 5,943,133 | null | 0 | 866 |
I am getting this error while implementing SMS sending in android. Attaching the image as the error is too long :)
|
The method getActivity in the type PendingIntent is not applicable for the arguements
|
CC BY-SA 3.0
| null |
2011-05-09T21:40:01.233
|
2011-05-09T22:14:57.650
| null | null | 667,851 |
[
"java",
"android",
"sms"
] |
5,942,941 | 1 | 5,943,353 | null | 1 | 111 |
I need to write a trigger that will create a record in another table.
In my user table when a registering user responds to an activation email their status in that table changes from 0 to 1. When this change occurs I need it create a record in another table that has an auto-incrementing int primary id (Party).
Since the user status can be of three different states (not active (0), active (1), and banned (-1) I need this trigger to only set off when the status is changed from 0 to 1.
Can someone please help me with the SQL here?

|
MySQL Triggers: table to table
|
CC BY-SA 3.0
| null |
2011-05-09T21:53:05.497
|
2011-05-09T22:45:37.683
|
2011-05-09T22:39:11.963
| 672,315 | 672,315 |
[
"mysql",
"database",
"triggers"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.