PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,626,900 | 07/24/2012 08:21:57 | 1,296,127 | 03/27/2012 16:42:36 | 11 | 0 | install ioncube on windows server 2008 with plesk | I have a problem install ioncube on windows plesk control panel.
I used the thread-safe version of PHP and download Windows VC9 (x86) ioncube.
I Put the Loader files in C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext
I do Edit the file C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.ini and before any other zend_extension_ts lines ensure that the following is included:
zend_extension_ts = "C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\ioncube_loader_win_5.2.dll"
and Restart the IIS server software.
but not run ioncube. :(
Additional Information:
Loader is at: C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\ioncube_loader_win_5.2.dll
Loader OS code: win
Loader architecture: x86
Loader word size: 32
Loader PHP version: 5.2
Loader thread safety: Yes
Loader compiler: VC6
Loader version: 4.0r7
File size is: 475136 bytes.
MD5 sum is: a82aa4dc4ce18ff62ea8faaca97a31be
Loader file: Download loader file
Loader found in ini file: Yes
OS extra security: None
PHPRC is: EMPTY
INI DIR is: EMPTY
Additional INI files: (none)
Server type is: LOCAL
PHP uname: Windows NT EASYSOFT 6.1 build 7600
Server word size is: 32
Disabled functions: EMPTY
Writeable loader locations: C:\inetpub\vhosts\E-touch.ir\httpdocs, C:\inetpub\vhosts\E-touch.ir\cgi-bin | windows-server-2008 | iis-7.5 | plesk | ioncube | null | null | open | install ioncube on windows server 2008 with plesk
===
I have a problem install ioncube on windows plesk control panel.
I used the thread-safe version of PHP and download Windows VC9 (x86) ioncube.
I Put the Loader files in C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext
I do Edit the file C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\php.ini and before any other zend_extension_ts lines ensure that the following is included:
zend_extension_ts = "C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\ioncube_loader_win_5.2.dll"
and Restart the IIS server software.
but not run ioncube. :(
Additional Information:
Loader is at: C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\ioncube_loader_win_5.2.dll
Loader OS code: win
Loader architecture: x86
Loader word size: 32
Loader PHP version: 5.2
Loader thread safety: Yes
Loader compiler: VC6
Loader version: 4.0r7
File size is: 475136 bytes.
MD5 sum is: a82aa4dc4ce18ff62ea8faaca97a31be
Loader file: Download loader file
Loader found in ini file: Yes
OS extra security: None
PHPRC is: EMPTY
INI DIR is: EMPTY
Additional INI files: (none)
Server type is: LOCAL
PHP uname: Windows NT EASYSOFT 6.1 build 7600
Server word size is: 32
Disabled functions: EMPTY
Writeable loader locations: C:\inetpub\vhosts\E-touch.ir\httpdocs, C:\inetpub\vhosts\E-touch.ir\cgi-bin | 0 |
11,626,902 | 07/24/2012 08:22:04 | 1,547,936 | 07/24/2012 07:43:40 | 1 | 0 | How to disable blue shadow in scrolling (android apps). | it’s all does not working:
android:fadingEdge="none"
android:background="@null"
android:cacheColorHint="@null" | android | shadow | null | null | null | null | open | How to disable blue shadow in scrolling (android apps).
===
it’s all does not working:
android:fadingEdge="none"
android:background="@null"
android:cacheColorHint="@null" | 0 |
11,628,278 | 07/24/2012 09:49:29 | 419,005 | 08/12/2010 23:07:40 | 374 | 1 | Understanding symbol tables through Python | In reading [this](http://www.scribd.com/doc/1461552/A-technique-for-isolating-differences-between-files) paper, I have come across the term "symbol table". At first, I thought it was just another word for a dictionary, but I grow less certain, as I try implement the diff algorithm described in the paper.
I have scoured the internet for an intelligible explanation, but I have come up short.
Could someone explain what is meant by a symbol table in the paper, and perhaps offer a basic implementation of it (the data structure, not the algorithm) in Python? The relevant description in the paper is in heading 3 "The Algorithm"
John Resig (@john-resig) offers [an implementation of the algorithm in JavaScript](http://ejohn.org/projects/javascript-diff-algorithm/), but my proficiency in JavaScript is too limit to use his implementation to wrap my head around the data structure. | python | data-structures | null | null | null | null | open | Understanding symbol tables through Python
===
In reading [this](http://www.scribd.com/doc/1461552/A-technique-for-isolating-differences-between-files) paper, I have come across the term "symbol table". At first, I thought it was just another word for a dictionary, but I grow less certain, as I try implement the diff algorithm described in the paper.
I have scoured the internet for an intelligible explanation, but I have come up short.
Could someone explain what is meant by a symbol table in the paper, and perhaps offer a basic implementation of it (the data structure, not the algorithm) in Python? The relevant description in the paper is in heading 3 "The Algorithm"
John Resig (@john-resig) offers [an implementation of the algorithm in JavaScript](http://ejohn.org/projects/javascript-diff-algorithm/), but my proficiency in JavaScript is too limit to use his implementation to wrap my head around the data structure. | 0 |
11,628,282 | 07/24/2012 09:49:43 | 1,180,289 | 01/31/2012 12:15:43 | 1 | 0 | MySql trigger, identify direct database access | I have a BEFORE UPDATE trigger on one table. Now in that trigger, I want to identify whether the update query is sent from application (java) or it is direct from database access, like a query from MySql command prompt.
is it possible in MySql trigger ??
| mysql | triggers | null | null | null | null | open | MySql trigger, identify direct database access
===
I have a BEFORE UPDATE trigger on one table. Now in that trigger, I want to identify whether the update query is sent from application (java) or it is direct from database access, like a query from MySql command prompt.
is it possible in MySql trigger ??
| 0 |
11,628,137 | 07/24/2012 09:40:59 | 414,967 | 08/09/2010 10:37:30 | 427 | 1 | CTabFolder layout controls not rendering | I have created two expand bars under TabFolder in SWT. And I set the layout for the tab foloder as FillLayout(SWT.HORIZONTAL). It is showing two expand bars in the tabfolder.
But when I changed the tab folder into CTabFolder with the same layout it does not show me
any expandbars under the CTabFolder. What could be the issue? Do I need to set any parameter for that? Please see my below code for TabFolder and CTabFolder.
**Code for TabFolder:**
public class Snippet223 {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("ExpandBar Example");
final TabFolder folder = new TabFolder(shell, SWT.BORDER);
folder.setLayout(new FillLayout(SWT.HORIZONTAL));
ExpandBar bar = new ExpandBar(folder, SWT.V_SCROLL);
ExpandBar bar1 = new ExpandBar(folder, SWT.V_SCROLL);
Image image = display.getSystemImage(SWT.ICON_QUESTION);
// First item
createContentsForExpandableBar(bar, image);
createContentsForExpandableBar(bar1, image);
shell.setSize(400, 350);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
private static void createContentsForExpandableBar(ExpandBar bar,
Image image) {
Composite composite = new Composite(bar, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginLeft = layout.marginTop = layout.marginRight = layout.marginBottom = 10;
layout.verticalSpacing = 10;
composite.setLayout(layout);
Button button = new Button(composite, SWT.PUSH);
button.setText("SWT.PUSH");
button = new Button(composite, SWT.RADIO);
button.setText("SWT.RADIO");
button = new Button(composite, SWT.CHECK);
button.setText("SWT.CHECK");
button = new Button(composite, SWT.TOGGLE);
button.setText("SWT.TOGGLE");
ExpandItem item0 = new ExpandItem(bar, SWT.NONE, 0);
item0.setText("What is your favorite button");
item0.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
item0.setControl(composite);
item0.setImage(image);
}
}
**Code for CTabFolder:**
public class Snippet223 {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("ExpandBar Example");
final CTabFolder folder = new CTabFolder(shell, SWT.BORDER);
folder.setLayout(new FillLayout(SWT.HORIZONTAL));
ExpandBar bar = new ExpandBar(folder, SWT.V_SCROLL);
ExpandBar bar1 = new ExpandBar(folder, SWT.V_SCROLL);
Image image = display.getSystemImage(SWT.ICON_QUESTION);
// First item
createContentsForExpandableBar(bar, image);
createContentsForExpandableBar(bar1, image);
shell.setSize(400, 350);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
private static void createContentsForExpandableBar(ExpandBar bar,
Image image) {
Composite composite = new Composite(bar, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginLeft = layout.marginTop = layout.marginRight = layout.marginBottom = 10;
layout.verticalSpacing = 10;
composite.setLayout(layout);
Button button = new Button(composite, SWT.PUSH);
button.setText("SWT.PUSH");
button = new Button(composite, SWT.RADIO);
button.setText("SWT.RADIO");
button = new Button(composite, SWT.CHECK);
button.setText("SWT.CHECK");
button = new Button(composite, SWT.TOGGLE);
button.setText("SWT.TOGGLE");
ExpandItem item0 = new ExpandItem(bar, SWT.NONE, 0);
item0.setText("What is your favorite button");
item0.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
item0.setControl(composite);
item0.setImage(image);
}
} | eclipse-plugin | swt | eclipse-rcp | null | null | null | open | CTabFolder layout controls not rendering
===
I have created two expand bars under TabFolder in SWT. And I set the layout for the tab foloder as FillLayout(SWT.HORIZONTAL). It is showing two expand bars in the tabfolder.
But when I changed the tab folder into CTabFolder with the same layout it does not show me
any expandbars under the CTabFolder. What could be the issue? Do I need to set any parameter for that? Please see my below code for TabFolder and CTabFolder.
**Code for TabFolder:**
public class Snippet223 {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("ExpandBar Example");
final TabFolder folder = new TabFolder(shell, SWT.BORDER);
folder.setLayout(new FillLayout(SWT.HORIZONTAL));
ExpandBar bar = new ExpandBar(folder, SWT.V_SCROLL);
ExpandBar bar1 = new ExpandBar(folder, SWT.V_SCROLL);
Image image = display.getSystemImage(SWT.ICON_QUESTION);
// First item
createContentsForExpandableBar(bar, image);
createContentsForExpandableBar(bar1, image);
shell.setSize(400, 350);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
private static void createContentsForExpandableBar(ExpandBar bar,
Image image) {
Composite composite = new Composite(bar, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginLeft = layout.marginTop = layout.marginRight = layout.marginBottom = 10;
layout.verticalSpacing = 10;
composite.setLayout(layout);
Button button = new Button(composite, SWT.PUSH);
button.setText("SWT.PUSH");
button = new Button(composite, SWT.RADIO);
button.setText("SWT.RADIO");
button = new Button(composite, SWT.CHECK);
button.setText("SWT.CHECK");
button = new Button(composite, SWT.TOGGLE);
button.setText("SWT.TOGGLE");
ExpandItem item0 = new ExpandItem(bar, SWT.NONE, 0);
item0.setText("What is your favorite button");
item0.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
item0.setControl(composite);
item0.setImage(image);
}
}
**Code for CTabFolder:**
public class Snippet223 {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("ExpandBar Example");
final CTabFolder folder = new CTabFolder(shell, SWT.BORDER);
folder.setLayout(new FillLayout(SWT.HORIZONTAL));
ExpandBar bar = new ExpandBar(folder, SWT.V_SCROLL);
ExpandBar bar1 = new ExpandBar(folder, SWT.V_SCROLL);
Image image = display.getSystemImage(SWT.ICON_QUESTION);
// First item
createContentsForExpandableBar(bar, image);
createContentsForExpandableBar(bar1, image);
shell.setSize(400, 350);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
private static void createContentsForExpandableBar(ExpandBar bar,
Image image) {
Composite composite = new Composite(bar, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginLeft = layout.marginTop = layout.marginRight = layout.marginBottom = 10;
layout.verticalSpacing = 10;
composite.setLayout(layout);
Button button = new Button(composite, SWT.PUSH);
button.setText("SWT.PUSH");
button = new Button(composite, SWT.RADIO);
button.setText("SWT.RADIO");
button = new Button(composite, SWT.CHECK);
button.setText("SWT.CHECK");
button = new Button(composite, SWT.TOGGLE);
button.setText("SWT.TOGGLE");
ExpandItem item0 = new ExpandItem(bar, SWT.NONE, 0);
item0.setText("What is your favorite button");
item0.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
item0.setControl(composite);
item0.setImage(image);
}
} | 0 |
11,628,287 | 07/24/2012 09:50:00 | 1,471,101 | 06/21/2012 05:21:40 | 63 | 1 | how to relate data with function in uml class diagram | I have two private data structures and five functions in my class, How can I represent the relation between the functions and the data structures in class. Eg: Two of those functions uses the First data structure and three other functions uses the second data structure.
Also How can I represent relation between the functions in the class. eg : among the 5 functions two are public and three are private, one public function in the class calls the other three private functions.
If this is not relevant in class diagram then what is the best solution to represent this in UML. | class | uml | null | null | null | null | open | how to relate data with function in uml class diagram
===
I have two private data structures and five functions in my class, How can I represent the relation between the functions and the data structures in class. Eg: Two of those functions uses the First data structure and three other functions uses the second data structure.
Also How can I represent relation between the functions in the class. eg : among the 5 functions two are public and three are private, one public function in the class calls the other three private functions.
If this is not relevant in class diagram then what is the best solution to represent this in UML. | 0 |
11,628,291 | 07/24/2012 09:50:05 | 83,950 | 03/28/2009 08:09:17 | 339 | 8 | rails carmen country_select helper without a form object | my form is not tied to a particular model and looks like this:
<%= form_tag(:controller => 'orders' , :action => 'process_credit_card') do %>
... bunch of fields ...
<% end %>
[carmen-rails](https://github.com/jim/carmen-rails)' `country_select` helper looks like this
<%= f.country_select :country_code, {priority: %w(US CA)}, prompt: 'Please select a country' %>
however I do not have a form object `f`, I use helpers like `<%= text_field_tag 'billing_address[phone]' %>` to create my form, is there a way I can still use carmen in this form? | ruby-on-rails | null | null | null | null | null | open | rails carmen country_select helper without a form object
===
my form is not tied to a particular model and looks like this:
<%= form_tag(:controller => 'orders' , :action => 'process_credit_card') do %>
... bunch of fields ...
<% end %>
[carmen-rails](https://github.com/jim/carmen-rails)' `country_select` helper looks like this
<%= f.country_select :country_code, {priority: %w(US CA)}, prompt: 'Please select a country' %>
however I do not have a form object `f`, I use helpers like `<%= text_field_tag 'billing_address[phone]' %>` to create my form, is there a way I can still use carmen in this form? | 0 |
11,628,294 | 07/24/2012 09:50:14 | 1,143,563 | 01/11/2012 15:57:52 | 16 | 0 | Using Excel Macro to connect to website | Does anyone know how i can connect to a website using Excel Macros? - e.g. www.yahoo.com
I would like to create accounts on the website with this macros. But first I would like to connect to the website, get the list of accounts (spreadsheet) and then upload these accounts in mass.
Please advise.
Thanks | macros | null | null | null | null | 07/24/2012 16:35:21 | not a real question | Using Excel Macro to connect to website
===
Does anyone know how i can connect to a website using Excel Macros? - e.g. www.yahoo.com
I would like to create accounts on the website with this macros. But first I would like to connect to the website, get the list of accounts (spreadsheet) and then upload these accounts in mass.
Please advise.
Thanks | 1 |
11,628,297 | 07/24/2012 09:50:16 | 970,399 | 09/29/2011 05:08:40 | 18 | 0 | how to draw text on a memory buffer | I want to draw some text on a memory buffer, but don't know how to. please help, many thanks!
Code:
widht = 640;
height = 480;
pBuf = malloc( width * 3 * height );
memset( pBuf, 0, width * 3 * height );
//DrawText is the function that needs to be implemented, and I don't know how to do it.
DrawText( "this is the text that i want to draw on the buffer", pBuf, width, height, 3 );
//now there is text on the memory buffer pointed to by pBuf.
| winapi | window | null | null | null | null | open | how to draw text on a memory buffer
===
I want to draw some text on a memory buffer, but don't know how to. please help, many thanks!
Code:
widht = 640;
height = 480;
pBuf = malloc( width * 3 * height );
memset( pBuf, 0, width * 3 * height );
//DrawText is the function that needs to be implemented, and I don't know how to do it.
DrawText( "this is the text that i want to draw on the buffer", pBuf, width, height, 3 );
//now there is text on the memory buffer pointed to by pBuf.
| 0 |
11,628,299 | 07/24/2012 09:50:23 | 1,416,619 | 05/25/2012 05:37:36 | 25 | 0 | Clustering in windows azure | Is clustering possible in windows azure? can we transfer azure vms to hyper v or any other hypervisors and vice varsa?if any one have idea regarding this please let me know.
please give me some clear information on clustering
waiting for the reply. | azure | cloud | cluster-analysis | hyper-v | hypervisor | null | open | Clustering in windows azure
===
Is clustering possible in windows azure? can we transfer azure vms to hyper v or any other hypervisors and vice varsa?if any one have idea regarding this please let me know.
please give me some clear information on clustering
waiting for the reply. | 0 |
11,472,239 | 07/13/2012 14:13:56 | 116,906 | 06/03/2009 20:59:59 | 545 | 18 | Why does float('3') apparently return a TypeError in Python 2.6.8? | I have (anonymized) a hash constructed from values in Python 2.6.8:
sys.stderr.write('#' + str(dictionary['Field 4']) + '#\n')
kpis_found.append(float(int(dictionary['Field 1']), 1) *
max(float(dictionary['Field 2']), 1) *
max(float(dictionary['Field 3']), 1) *
max(float(dictionary['Field 4']), 1) *
max(float(dictionary['Field 5']), 1))
The output I get is:
[Fri Jul 13 09:04:44 2012] [error] [client ::1] #3#
[Fri Jul 13 09:04:44 2012] [error] [client ::1] Traceback (most recent call last):
[Fri Jul 13 09:04:44 2012] [error] [client ::1] File "/Users/jonathan/mirror/civic/google_maps/index.cgi", line 357, in <module>
[Fri Jul 13 09:04:44 2012] [error] [client ::1] max(float(dictionary['Field 4']), 1) *
[Fri Jul 13 09:04:44 2012] [error] [client ::1] TypeError: float() takes at most 1 argument (2 given)
To the best of my knowledge, the CSV files yield (usually) strings convertible to ints, or (occasionally) strings convertible to floats. If I run into a NULL, that should be easier to diagnose. The debugging output appears to confirm that the field in question is '3'.
How is this getting a TypeError? I've run through parentheses to ensure that I'm not calculating
max(float(foo, bar))
but instead calculating
max(float(foo), bar)
Any insight would be welcome. | python | null | null | null | null | null | open | Why does float('3') apparently return a TypeError in Python 2.6.8?
===
I have (anonymized) a hash constructed from values in Python 2.6.8:
sys.stderr.write('#' + str(dictionary['Field 4']) + '#\n')
kpis_found.append(float(int(dictionary['Field 1']), 1) *
max(float(dictionary['Field 2']), 1) *
max(float(dictionary['Field 3']), 1) *
max(float(dictionary['Field 4']), 1) *
max(float(dictionary['Field 5']), 1))
The output I get is:
[Fri Jul 13 09:04:44 2012] [error] [client ::1] #3#
[Fri Jul 13 09:04:44 2012] [error] [client ::1] Traceback (most recent call last):
[Fri Jul 13 09:04:44 2012] [error] [client ::1] File "/Users/jonathan/mirror/civic/google_maps/index.cgi", line 357, in <module>
[Fri Jul 13 09:04:44 2012] [error] [client ::1] max(float(dictionary['Field 4']), 1) *
[Fri Jul 13 09:04:44 2012] [error] [client ::1] TypeError: float() takes at most 1 argument (2 given)
To the best of my knowledge, the CSV files yield (usually) strings convertible to ints, or (occasionally) strings convertible to floats. If I run into a NULL, that should be easier to diagnose. The debugging output appears to confirm that the field in question is '3'.
How is this getting a TypeError? I've run through parentheses to ensure that I'm not calculating
max(float(foo, bar))
but instead calculating
max(float(foo), bar)
Any insight would be welcome. | 0 |
11,472,241 | 07/13/2012 14:13:57 | 1,113,251 | 12/23/2011 10:36:38 | 118 | 2 | CASE STATEMENT TRICKERY REQUIRED | Table 1
Mail Special Quote ( Y/N)
[email protected] Blank
[email protected] Blank
[email protected] Blank
Table 2
Email Adress Dept
[email protected] Config
[email protected] Finance
[email protected] Marketing
Now I want Table 1 updated to Y where the matching email address in Table 2 is coming from Finacne or Marketing .
UPDATE TABLE 1
Set Special Quote to be Y
where in TABLE 2 the Dept is Finance or Marketing for the matching email address.
Probably just having a brain freeze and need some coffee .
Thinking left join on email address then throw in a bit of a case statement perhaps for the Y and N bit ?
| sql | sql-server | case | null | null | null | open | CASE STATEMENT TRICKERY REQUIRED
===
Table 1
Mail Special Quote ( Y/N)
[email protected] Blank
[email protected] Blank
[email protected] Blank
Table 2
Email Adress Dept
[email protected] Config
[email protected] Finance
[email protected] Marketing
Now I want Table 1 updated to Y where the matching email address in Table 2 is coming from Finacne or Marketing .
UPDATE TABLE 1
Set Special Quote to be Y
where in TABLE 2 the Dept is Finance or Marketing for the matching email address.
Probably just having a brain freeze and need some coffee .
Thinking left join on email address then throw in a bit of a case statement perhaps for the Y and N bit ?
| 0 |
11,472,214 | 07/13/2012 14:12:48 | 1,521,967 | 07/12/2012 20:24:19 | 1 | 0 | ImageList_WriteEx used format | Does anybody know where I can find details about format in which ms. function ImageList_WriteEx stores data into stream ?
My problem is related to delphi component TImageList. Under DelphiXE2 controls library ver. 6 is used and when that library stores data using ImageList_WriteEx, they each time differ in 3 bytes(in my environment). This will cause problems reported in delphi QC ([92769][1], [83992][2]).
For now I have fixed this by storing those 3 bytes and put them back when component writes data back to dfm, but of course knowledge about ms. used format will help me fix this better.
thanks, tvr
[1]: http://qc.embarcadero.com/wc/qcmain.aspx?d=92769
[2]: http://qc.embarcadero.com/wc/qcmain.aspx?d=83992 | controls | delphi-xe2 | imagelist | null | null | null | open | ImageList_WriteEx used format
===
Does anybody know where I can find details about format in which ms. function ImageList_WriteEx stores data into stream ?
My problem is related to delphi component TImageList. Under DelphiXE2 controls library ver. 6 is used and when that library stores data using ImageList_WriteEx, they each time differ in 3 bytes(in my environment). This will cause problems reported in delphi QC ([92769][1], [83992][2]).
For now I have fixed this by storing those 3 bytes and put them back when component writes data back to dfm, but of course knowledge about ms. used format will help me fix this better.
thanks, tvr
[1]: http://qc.embarcadero.com/wc/qcmain.aspx?d=92769
[2]: http://qc.embarcadero.com/wc/qcmain.aspx?d=83992 | 0 |
11,472,216 | 07/13/2012 14:12:55 | 1,523,777 | 07/13/2012 14:06:45 | 1 | 0 | wmi event active window/focus window | Trying to trawl through the WMI/WQL MS Reference Data and the WMI Code Creator Event Classes, but can't find anything to indicate:
A) If this is possible
B) How to do it
Ideally i'd like to be able to subscribe to WMI Events that are of the nature of the End User changing (UI) window (any Windows application). | wmi | wmi-query | wql | null | null | null | open | wmi event active window/focus window
===
Trying to trawl through the WMI/WQL MS Reference Data and the WMI Code Creator Event Classes, but can't find anything to indicate:
A) If this is possible
B) How to do it
Ideally i'd like to be able to subscribe to WMI Events that are of the nature of the End User changing (UI) window (any Windows application). | 0 |
11,472,217 | 07/13/2012 14:12:56 | 1,520,255 | 07/12/2012 09:08:37 | -1 | 0 | CentOS show tree folder | does anyone know how to show the tree folder in CentOS in the command line? I know it is the 'tree' command in Ubuntu for example, but how to do it in CentOS? Otherwise, how I get/install this command?
Thanks a lot! | centos | null | null | null | null | 07/23/2012 05:52:42 | off topic | CentOS show tree folder
===
does anyone know how to show the tree folder in CentOS in the command line? I know it is the 'tree' command in Ubuntu for example, but how to do it in CentOS? Otherwise, how I get/install this command?
Thanks a lot! | 2 |
11,472,225 | 07/13/2012 14:13:23 | 1,427,033 | 05/30/2012 20:55:14 | 36 | 5 | Repercussions of trying to kill a program before closing OutputStreamWriter | This is part of larger graphing program (JavaPlot specifically). In a nut shell, I would try to graph something; the graph would appear at
out.write(comms);
but then close once it hit
out.close()
I know you need to close OutputStreamWriter, so instead of removing that line, I created a Scanner that waits until the user presses 'Q' and then the program continues as normal, closes the graph, the OutputStreamWriter, and the Scanner
OutputStreamWriter out = new OutputStreamWriter(proc.getOutputStream());
out.write(comms);
out.flush();
//added from here
//waiting until input is given
Scanner timeKiller = new Scanner(System.in);
String check = timeKiller.nextLine();
if(check != "q"){
check = timeKiller.nextLine(); //<---waiting here.
}
timeKiller.close();
//to here
out.close();
Is what I'm doing dangerous? If someone closes the graph by closing the window, this won't kill the program, correct? This won't cause a memory leak (right?) but if the process is still running and they run this program several times, it will eventually start to be an issue. How can I fix this? Just off the top of my head, maybe add a listener to the window that breaks the loop if the window is closed? Or am I mistaken and this is isn't an issue at all? | java | close | java-util-scanner | outputstream | javaplot | null | open | Repercussions of trying to kill a program before closing OutputStreamWriter
===
This is part of larger graphing program (JavaPlot specifically). In a nut shell, I would try to graph something; the graph would appear at
out.write(comms);
but then close once it hit
out.close()
I know you need to close OutputStreamWriter, so instead of removing that line, I created a Scanner that waits until the user presses 'Q' and then the program continues as normal, closes the graph, the OutputStreamWriter, and the Scanner
OutputStreamWriter out = new OutputStreamWriter(proc.getOutputStream());
out.write(comms);
out.flush();
//added from here
//waiting until input is given
Scanner timeKiller = new Scanner(System.in);
String check = timeKiller.nextLine();
if(check != "q"){
check = timeKiller.nextLine(); //<---waiting here.
}
timeKiller.close();
//to here
out.close();
Is what I'm doing dangerous? If someone closes the graph by closing the window, this won't kill the program, correct? This won't cause a memory leak (right?) but if the process is still running and they run this program several times, it will eventually start to be an issue. How can I fix this? Just off the top of my head, maybe add a listener to the window that breaks the loop if the window is closed? Or am I mistaken and this is isn't an issue at all? | 0 |
11,472,250 | 07/13/2012 14:14:30 | 637,142 | 02/28/2011 04:31:33 | 1,548 | 117 | .net regex match line | Why does `^.*$` does not match a line in:
> This is some sample text
> this is another line
> this is the third line
how can I create a regular expression that will match an entire line so that when finding the next match it will return me the next line.
**In other words I will like to have** a regex so that the first match = `This is some sample text` , next match = `this is another line` etc...
| c# | .net | regex | null | null | null | open | .net regex match line
===
Why does `^.*$` does not match a line in:
> This is some sample text
> this is another line
> this is the third line
how can I create a regular expression that will match an entire line so that when finding the next match it will return me the next line.
**In other words I will like to have** a regex so that the first match = `This is some sample text` , next match = `this is another line` etc...
| 0 |
11,472,196 | 07/13/2012 14:11:55 | 1,511,579 | 07/09/2012 09:30:59 | 12 | 0 | Jquery Javascript Property Undefined | function dadosFormularios(){
var dadosFormulario={};
var iterador=countForms;
var i=0;
while(i<iterador){
dadosFormulario[i]={};
dadosFormulario[i]['a']=$('#field\\['+i +'\\]\\[a\\]').val();
dadosFormulario[i]['b']=$('#field\\['+i +'\\]\\[b\\]').val();
//alert(dadosFormulario[i]['a']);
//alert(dadosFormulario[i]['b']);
i++;
}
var qstring = '';
var tmp_qstring = [];
var temp1, temp2;
var a ="a";
for ( var j = 0; j <=i; j++ )
{
temp1=dadosFormulario[j]['a'];
alert(temp1);
temp2=dadosFormulario[j]['b'];
//alert(temp1);
tmp_qstring[j] = 'a' + j + '=' + temp1 + '&' + 'b' + j + '=' + temp2;
}
qstring = tmp_qstring.join('&');
alert(qstring);
window.location = 'dup1.php?'+qstring;
}
When i clik on a button i call the above function and now i'm triyng to send the data of the array of objets to another page as you can see in the code.
My problem is that i'm getting trouble when i set "dadosFormulario[j]['a'];" or "dadosFormulario[j]['b'];" to a var or set them directly in the tmp_qstring i.e. "tmp_qstring[j]=dadosFormulario[j]['b'];". In chrome console i get the error:
"Uncaught TypeError: Cannot read property 'a' of undefined " | php | javascript | jquery | get | null | 07/16/2012 02:38:54 | too localized | Jquery Javascript Property Undefined
===
function dadosFormularios(){
var dadosFormulario={};
var iterador=countForms;
var i=0;
while(i<iterador){
dadosFormulario[i]={};
dadosFormulario[i]['a']=$('#field\\['+i +'\\]\\[a\\]').val();
dadosFormulario[i]['b']=$('#field\\['+i +'\\]\\[b\\]').val();
//alert(dadosFormulario[i]['a']);
//alert(dadosFormulario[i]['b']);
i++;
}
var qstring = '';
var tmp_qstring = [];
var temp1, temp2;
var a ="a";
for ( var j = 0; j <=i; j++ )
{
temp1=dadosFormulario[j]['a'];
alert(temp1);
temp2=dadosFormulario[j]['b'];
//alert(temp1);
tmp_qstring[j] = 'a' + j + '=' + temp1 + '&' + 'b' + j + '=' + temp2;
}
qstring = tmp_qstring.join('&');
alert(qstring);
window.location = 'dup1.php?'+qstring;
}
When i clik on a button i call the above function and now i'm triyng to send the data of the array of objets to another page as you can see in the code.
My problem is that i'm getting trouble when i set "dadosFormulario[j]['a'];" or "dadosFormulario[j]['b'];" to a var or set them directly in the tmp_qstring i.e. "tmp_qstring[j]=dadosFormulario[j]['b'];". In chrome console i get the error:
"Uncaught TypeError: Cannot read property 'a' of undefined " | 3 |
11,410,731 | 07/10/2012 09:52:45 | 1,514,351 | 07/10/2012 09:38:32 | 1 | 0 | Ajax 3.5 in Visual Studio 2010 | I had convert my web application from visual studio 2003(framework 1.1) to visual studio 2010(framework 4.0).
After converted, I have pug-in Ajax 3.5 and test my web application.
The web application run well but the Ajax doesn't work.
There are not error appear in the application also.
What can I do in other to make the Ajax work???
Please advice...Thanks in advance. | asp.net | ajax | asp.net-ajax | null | null | null | open | Ajax 3.5 in Visual Studio 2010
===
I had convert my web application from visual studio 2003(framework 1.1) to visual studio 2010(framework 4.0).
After converted, I have pug-in Ajax 3.5 and test my web application.
The web application run well but the Ajax doesn't work.
There are not error appear in the application also.
What can I do in other to make the Ajax work???
Please advice...Thanks in advance. | 0 |
11,410,733 | 07/10/2012 09:52:51 | 408,565 | 08/02/2010 11:02:24 | 11 | 2 | SqlTrackingService 4.0 not tracking workflow instances created in 3.5 Framework | We have a few workflows developed under the 3.5 framework. We use tracking in it works just fine.
We are trying to change our code's build to the 4.0 framework and we didn't have problems with that. The workflows were converted as is.
When creating a new workflow after the moving to 4.0 and tracking it, it works fine.
But when trying to continue a workflow instance that was previously created with the 3.5 build of the application, the workflow runs as expected but the SqlTrackingService does not write tracking data.
I tried to debug the assembly and I noticed the the runtime does not see that there is a tracking service associated or cannot find the tracking profile.
I noticed that a new type was added to the [Type] table for the SqlTrackingService with the 4.0.0.0 version.
Did anyone run into this situation where you need to move to the 4.0 framework bu still continue old workflows ?
| workflow-foundation-4 | null | null | null | null | null | open | SqlTrackingService 4.0 not tracking workflow instances created in 3.5 Framework
===
We have a few workflows developed under the 3.5 framework. We use tracking in it works just fine.
We are trying to change our code's build to the 4.0 framework and we didn't have problems with that. The workflows were converted as is.
When creating a new workflow after the moving to 4.0 and tracking it, it works fine.
But when trying to continue a workflow instance that was previously created with the 3.5 build of the application, the workflow runs as expected but the SqlTrackingService does not write tracking data.
I tried to debug the assembly and I noticed the the runtime does not see that there is a tracking service associated or cannot find the tracking profile.
I noticed that a new type was added to the [Type] table for the SqlTrackingService with the 4.0.0.0 version.
Did anyone run into this situation where you need to move to the 4.0 framework bu still continue old workflows ?
| 0 |
11,410,738 | 07/10/2012 09:53:02 | 1,021,935 | 10/31/2011 12:13:49 | 11 | 0 | Is it possible to construct an irregularly shaped button that would be an overlay on a map? | The idea is as follows: the view contains a map (can be a zoomable image), map is divided into regions, each region is touchable and takes you to a more detailed view (not a map).
I'm not asking for solutions I'm asking for a general direction, of course if something like this is possible at all. | ios | map | null | null | null | null | open | Is it possible to construct an irregularly shaped button that would be an overlay on a map?
===
The idea is as follows: the view contains a map (can be a zoomable image), map is divided into regions, each region is touchable and takes you to a more detailed view (not a map).
I'm not asking for solutions I'm asking for a general direction, of course if something like this is possible at all. | 0 |
11,410,741 | 07/10/2012 09:53:12 | 38,325 | 11/17/2008 19:06:05 | 1,389 | 47 | AppCode and Mercurial integration issue | When trying to access Mercurial commands in AppCode, I get the following error message:
abort: repository /src/project/subfolder1 not found!
This is indeed correct, the repository is /src/project, not /src/project/subfolder1.
However, the project file resides in /src/project/subfolder1/.
I have tried with "Run hg as bash -c" and without in AppCode, but with no luck.
| version-control | mercurial | ide | jetbrains | appcode | null | open | AppCode and Mercurial integration issue
===
When trying to access Mercurial commands in AppCode, I get the following error message:
abort: repository /src/project/subfolder1 not found!
This is indeed correct, the repository is /src/project, not /src/project/subfolder1.
However, the project file resides in /src/project/subfolder1/.
I have tried with "Run hg as bash -c" and without in AppCode, but with no luck.
| 0 |
11,410,742 | 07/10/2012 09:53:16 | 1,514,337 | 07/10/2012 09:33:05 | 1 | 0 | How to use Existing .SO file in another project and also access the functions inside on .SO | I've come across this "NDK - How to use a generated .so library in another project" question that posted here. My question is also be the same .
When i follow those steps it doesn't work properly. I mean the .so file can't copy to the libs folder. Can anyone please suggest me the best answer to come out.
Thanks in Advance.
| ndk | null | null | null | null | null | open | How to use Existing .SO file in another project and also access the functions inside on .SO
===
I've come across this "NDK - How to use a generated .so library in another project" question that posted here. My question is also be the same .
When i follow those steps it doesn't work properly. I mean the .so file can't copy to the libs folder. Can anyone please suggest me the best answer to come out.
Thanks in Advance.
| 0 |
11,410,743 | 07/10/2012 09:53:18 | 1,448,159 | 06/11/2012 04:43:31 | 20 | 0 | c# BlockingCollection having issues with byte arrays | I am having an issue where an object with a byte[12] is being passed into a BlockingCollection on one thread and another thread returning the object with a byte[0] using BlockingCollection.Take(). I know this is a threading issue but I do not know where or why this is happening considering that BlockingCollection is a concurrent collection.
Example Code:
Class class1
{
public byte[] mybytes = new byte[12];
}
BlockingCollection<class1> classes = new BlockingCollection<class1>();
On thread1:
while (true)
{
class1 myclass = new class1();
if (myclass.mybytes.Length == 12)
{
classes.Add(myclass);
}
}
on thread2:
while (true)
{
class1 myclass2 = classes.Take();
//Do something with myclass2.mybytes
}
Sometimes on thread2, myclass2.mybytes equals byte[0]. Any information on how to fix this is greatly appreciated. | c# | multithreading | blockingcollection | null | null | null | open | c# BlockingCollection having issues with byte arrays
===
I am having an issue where an object with a byte[12] is being passed into a BlockingCollection on one thread and another thread returning the object with a byte[0] using BlockingCollection.Take(). I know this is a threading issue but I do not know where or why this is happening considering that BlockingCollection is a concurrent collection.
Example Code:
Class class1
{
public byte[] mybytes = new byte[12];
}
BlockingCollection<class1> classes = new BlockingCollection<class1>();
On thread1:
while (true)
{
class1 myclass = new class1();
if (myclass.mybytes.Length == 12)
{
classes.Add(myclass);
}
}
on thread2:
while (true)
{
class1 myclass2 = classes.Take();
//Do something with myclass2.mybytes
}
Sometimes on thread2, myclass2.mybytes equals byte[0]. Any information on how to fix this is greatly appreciated. | 0 |
11,410,744 | 07/10/2012 09:53:19 | 954,626 | 09/20/2011 11:23:44 | 6 | 0 | Spring mvc: Change response object in postHandle in HandlerInterceptor | I am trying to save the latest time in the cookie. So after every controller call I have intercepting the call using a postHandle of HandlerInterceptor. In that I am updating the value in the cookie. But the values is not updating. Anyone have any idea why it is not working.
The code:
@Override
public void postHandle(HttpServletRequest request,
HttpServletResponse response, Object handler, ModelAndView ex)
throws Exception {
boolean isSet = true;
if (request.getSession().getAttribute("userId") != null){
for (Cookie cookies: request.getCookies()) {
if ("RequestTime".equals(cookies.getName())) {
isSet = false;
cookies.setValue(Long.toString(System.currentTimeMillis()));
response.addCookie(cookies);
}
}
if(isSet){
Cookie cookie = new Cookie("RequestTime", Long.toString(System.currentTimeMillis()));
response.addCookie(cookie);
}
}
} | java | cookies | spring-mvc | interceptor | null | null | open | Spring mvc: Change response object in postHandle in HandlerInterceptor
===
I am trying to save the latest time in the cookie. So after every controller call I have intercepting the call using a postHandle of HandlerInterceptor. In that I am updating the value in the cookie. But the values is not updating. Anyone have any idea why it is not working.
The code:
@Override
public void postHandle(HttpServletRequest request,
HttpServletResponse response, Object handler, ModelAndView ex)
throws Exception {
boolean isSet = true;
if (request.getSession().getAttribute("userId") != null){
for (Cookie cookies: request.getCookies()) {
if ("RequestTime".equals(cookies.getName())) {
isSet = false;
cookies.setValue(Long.toString(System.currentTimeMillis()));
response.addCookie(cookies);
}
}
if(isSet){
Cookie cookie = new Cookie("RequestTime", Long.toString(System.currentTimeMillis()));
response.addCookie(cookie);
}
}
} | 0 |
11,410,753 | 07/10/2012 09:53:41 | 1,407,363 | 05/21/2012 08:10:10 | 5 | 3 | Javascript and asp.net + css class changing | i made a website and it has a menu bar in Masterpage(in asp.net).
When i click on any menu button
> <ul> <li><asp:HyperLink id="home" class="current" onclick="home();"
> runat="server">Home</asp:HyperLink></li> <li><asp:HyperLink
> id="showtalent" onclick="return showtalent();"
> runat="server">Solution</asp:HyperLink></li> <li><asp:HyperLink
> id="contact" onclick="contact();"
> runat="server">Contact</asp:HyperLink></li> </ul>
> function showtalent() {
> alert('show the talent');
> document.location = "talentpage.aspx";
> $("#home").removeClass("current");
> $("#showtalent").addClass("current");
> $("#contact").removeClass("current");
> }
The problem is that when my page navigate from home to showtalent page....css class changes for the while and then render back as configured in the master page...i.e. home 'a' tag get css current while showtalent 'a' doesn't......
How to fix it... | asp.net | null | null | null | null | null | open | Javascript and asp.net + css class changing
===
i made a website and it has a menu bar in Masterpage(in asp.net).
When i click on any menu button
> <ul> <li><asp:HyperLink id="home" class="current" onclick="home();"
> runat="server">Home</asp:HyperLink></li> <li><asp:HyperLink
> id="showtalent" onclick="return showtalent();"
> runat="server">Solution</asp:HyperLink></li> <li><asp:HyperLink
> id="contact" onclick="contact();"
> runat="server">Contact</asp:HyperLink></li> </ul>
> function showtalent() {
> alert('show the talent');
> document.location = "talentpage.aspx";
> $("#home").removeClass("current");
> $("#showtalent").addClass("current");
> $("#contact").removeClass("current");
> }
The problem is that when my page navigate from home to showtalent page....css class changes for the while and then render back as configured in the master page...i.e. home 'a' tag get css current while showtalent 'a' doesn't......
How to fix it... | 0 |
11,410,754 | 07/10/2012 09:53:43 | 1,310,793 | 04/03/2012 15:14:44 | 1 | 1 | RST packet sent from application when TCP connection not getting closed properly | I have a Web service based application, where the web server is running in the application on a prticular port. Recently in the production environment, I have noticed that application is sending a RST packet to the client side resetting the connection. After analyzing the TCP dump, I have observed that the TCP 4 way connection closure is not happening properly. After sending a response from application web server to the client, the application is sending a FIN packet to the client and receiving an ACK, but there is no FIN packet initiation from the client side to the application, instead some request packet is received. At this point, the application sends a RST packet to the client as the application was expecting a FIN packet initiation from the client. This reults in loss of the request packet. I belive this is a normal/expected behavior of the web server application and needs to be fixed in the client side.
Please comment on the above scenario. your cooments will be much appreciated.
Thanks in advance
Chandan
| tcp | null | null | null | null | null | open | RST packet sent from application when TCP connection not getting closed properly
===
I have a Web service based application, where the web server is running in the application on a prticular port. Recently in the production environment, I have noticed that application is sending a RST packet to the client side resetting the connection. After analyzing the TCP dump, I have observed that the TCP 4 way connection closure is not happening properly. After sending a response from application web server to the client, the application is sending a FIN packet to the client and receiving an ACK, but there is no FIN packet initiation from the client side to the application, instead some request packet is received. At this point, the application sends a RST packet to the client as the application was expecting a FIN packet initiation from the client. This reults in loss of the request packet. I belive this is a normal/expected behavior of the web server application and needs to be fixed in the client side.
Please comment on the above scenario. your cooments will be much appreciated.
Thanks in advance
Chandan
| 0 |
11,410,756 | 07/10/2012 09:53:51 | 1,514,336 | 07/10/2012 09:32:31 | 1 | 0 | Histogram matching of 3D datasets using L2 norm minimisation (Matlab) | I need to perform some elementary histogram matching on 2 sets of 3D data. This is part of a larger algorithm.
My goal is to perform this by minimising the following cost function:
|| cumpdf(f(A)) - cumpdf(B) || .^2
where:
cumpdf is the cumulative histogram
f() is linear transformation a*I + b where a/b are affine coefficients to be
determined
A is the image to be transformed and J is the image to be matched
B am using lsqcurvefit however I have run into some trouble and therefore really need some help.
A(maskA==0)=0;
B(maskB==0)=0;
[na,~] = hist(A(maskA~=0),500);
na = na ./ numel(A(maskA~=0));
x_data = cumsum(na);
[nb,~] = hist(B(maskB~=0),500);
nb = nb ./ numel(B(maskB~=0));
y_data = cumsum(nb);
xo = [1.5 -200];
[coeff,~] = lsqcurvefit(@cost,xo,x_data,y_data);
function F = cost(x,xc)
F = x(1).*A + x(2);
[nc,~] = hist(C(maskA~=0),500);
nc = nc / numel(C(maskA~=0));
xc = cumsum(nc);
Amask and Bmask just represent some indexing I need to do.
My question is: I know that the above is wrong. However, I think it represents best what I want to do, regarding the cost function and the goal. Some help would me much appreciated!
| image-processing | 3d | histogram | matching | least-squares | null | open | Histogram matching of 3D datasets using L2 norm minimisation (Matlab)
===
I need to perform some elementary histogram matching on 2 sets of 3D data. This is part of a larger algorithm.
My goal is to perform this by minimising the following cost function:
|| cumpdf(f(A)) - cumpdf(B) || .^2
where:
cumpdf is the cumulative histogram
f() is linear transformation a*I + b where a/b are affine coefficients to be
determined
A is the image to be transformed and J is the image to be matched
B am using lsqcurvefit however I have run into some trouble and therefore really need some help.
A(maskA==0)=0;
B(maskB==0)=0;
[na,~] = hist(A(maskA~=0),500);
na = na ./ numel(A(maskA~=0));
x_data = cumsum(na);
[nb,~] = hist(B(maskB~=0),500);
nb = nb ./ numel(B(maskB~=0));
y_data = cumsum(nb);
xo = [1.5 -200];
[coeff,~] = lsqcurvefit(@cost,xo,x_data,y_data);
function F = cost(x,xc)
F = x(1).*A + x(2);
[nc,~] = hist(C(maskA~=0),500);
nc = nc / numel(C(maskA~=0));
xc = cumsum(nc);
Amask and Bmask just represent some indexing I need to do.
My question is: I know that the above is wrong. However, I think it represents best what I want to do, regarding the cost function and the goal. Some help would me much appreciated!
| 0 |
11,499,960 | 07/16/2012 07:38:23 | 816,109 | 06/26/2011 12:04:19 | 110 | 6 | Do I need to do lua_pop each time after I do lua_setglobal? | Just as the title mentioned, do I need to pop the value from the stack after I store it in the global space? | lua | null | null | null | null | null | open | Do I need to do lua_pop each time after I do lua_setglobal?
===
Just as the title mentioned, do I need to pop the value from the stack after I store it in the global space? | 0 |
11,499,962 | 07/16/2012 07:38:31 | 863,510 | 07/26/2011 13:14:14 | 53 | 1 | jQuery Draggable div sticks to mouse | I am using a div as a popup which is draggable as follows
$("#popup").draggable();
The problem is if we mouseclick on this div and leave the click, then the div sticks to the mouse in some IE versions, especially on Windows 7. The div moves with the mouse even if its not click & drag action (its just a mouseover action). Please let me know if this is jQuery bug or some OS/browser bug with proper solution?
I am using jquery-ui-1.8.6 js with jquery-1.4.2 js.
Thanks in advance. | javascript | jquery | jquery-ui | null | null | null | open | jQuery Draggable div sticks to mouse
===
I am using a div as a popup which is draggable as follows
$("#popup").draggable();
The problem is if we mouseclick on this div and leave the click, then the div sticks to the mouse in some IE versions, especially on Windows 7. The div moves with the mouse even if its not click & drag action (its just a mouseover action). Please let me know if this is jQuery bug or some OS/browser bug with proper solution?
I am using jquery-ui-1.8.6 js with jquery-1.4.2 js.
Thanks in advance. | 0 |
11,499,929 | 07/16/2012 07:36:06 | 1,503,130 | 07/05/2012 06:46:54 | 166 | 9 | API or code : Difference between Hibernate 3 and 4 ? | I have pasted **Hibernate 3** configuration file , SessionFactory class to configure this config.xml and a bean with JPA annotations. I want to know if I were using **Hibernate 4** then what would have been the changes in the context at code level or very broad differences or advancements in layman language.
> hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.2.144:1521:xe</property>
<property name="hibernate.connection.username">prateek</property>
<property name="connection.password">prateek</property>
<property name="connection.pool_size">1</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">create</property>
<mapping class="com.vaannila.domain.User1" />
</session-factory>
</hibernate-configuration>
> Static java class to establish connection (SessionFactory Helper)
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class SessionFactoryHelper {
private static final SessionFactory sessionFactory;
static {
try {
/*
* Build a SessionFactory object from session-factory configuration
* defined in the hibernate.cfg.xml file. In this file we register
* the JDBC connection information, connection pool, the hibernate
* dialect that we used and the mapping to our hbm.xml file for each
* POJO (Plain Old Java Object).
*
*/
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable e) {
System.err.println("Error in creating SessionFactory object."
+ e.getMessage());
throw new ExceptionInInitializerError(e);
}
}
/*
* A static method for other application to get SessionFactory object
* initialized in this helper class.
*
*/
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}
> Bean class
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="USER1")
public class User1 {
private Long id;
private String name;
private String gender;
private String country;
private String aboutYou;
private Boolean mailingList;
@Id
@GeneratedValue
@Column(name="USER_ID")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name="USER_NAME")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Column(name="USER_GENDER")
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
@Column(name="USER_COUNTRY")
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
@Column(name="USER_ABOUT_YOU")
public String getAboutYou() {
return aboutYou;
}
public void setAboutYou(String aboutYou) {
this.aboutYou = aboutYou;
}
@Column(name="USER_MAILING_LIST")
public Boolean getMailingList() {
return mailingList;
}
public void setMailingList(Boolean mailingList) {
this.mailingList = mailingList;
}
} | java | database | hibernate | open-source | struts2 | null | open | API or code : Difference between Hibernate 3 and 4 ?
===
I have pasted **Hibernate 3** configuration file , SessionFactory class to configure this config.xml and a bean with JPA annotations. I want to know if I were using **Hibernate 4** then what would have been the changes in the context at code level or very broad differences or advancements in layman language.
> hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.2.144:1521:xe</property>
<property name="hibernate.connection.username">prateek</property>
<property name="connection.password">prateek</property>
<property name="connection.pool_size">1</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">create</property>
<mapping class="com.vaannila.domain.User1" />
</session-factory>
</hibernate-configuration>
> Static java class to establish connection (SessionFactory Helper)
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class SessionFactoryHelper {
private static final SessionFactory sessionFactory;
static {
try {
/*
* Build a SessionFactory object from session-factory configuration
* defined in the hibernate.cfg.xml file. In this file we register
* the JDBC connection information, connection pool, the hibernate
* dialect that we used and the mapping to our hbm.xml file for each
* POJO (Plain Old Java Object).
*
*/
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable e) {
System.err.println("Error in creating SessionFactory object."
+ e.getMessage());
throw new ExceptionInInitializerError(e);
}
}
/*
* A static method for other application to get SessionFactory object
* initialized in this helper class.
*
*/
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}
> Bean class
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="USER1")
public class User1 {
private Long id;
private String name;
private String gender;
private String country;
private String aboutYou;
private Boolean mailingList;
@Id
@GeneratedValue
@Column(name="USER_ID")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name="USER_NAME")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Column(name="USER_GENDER")
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
@Column(name="USER_COUNTRY")
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
@Column(name="USER_ABOUT_YOU")
public String getAboutYou() {
return aboutYou;
}
public void setAboutYou(String aboutYou) {
this.aboutYou = aboutYou;
}
@Column(name="USER_MAILING_LIST")
public Boolean getMailingList() {
return mailingList;
}
public void setMailingList(Boolean mailingList) {
this.mailingList = mailingList;
}
} | 0 |
11,499,931 | 07/16/2012 07:36:12 | 1,184,215 | 02/02/2012 03:28:36 | 81 | 7 | JSF Custom Component for jQueryUI Drag / Drop | I'm learning to build JSF Custom Components and I thought I could try and build an implementation of jQuery's Drag & Drop.. So I read most of what's out there and could actually build a simple enough Draggable and Droppable component that basically generate the right amount of jQuery js to support Drag & Drop up until I can associate the "draggable" object and the "droppable" container and pretty much drag / drop things around..
This was fairly simple, my problem is how to get the "data" of what's being dropped, or how to bind to the drop event that jQuery Generates... I know it should be easy enough, so if anyone could point me in the right direction (documentations / code sample) I would very much appreciate it...
I will paste as little code as I think I have to.. just so you can see what I did.. I can share the lot (it's not much more that what's pasted really..) if anyone needs it...
(As you can see I can bind an ajax event.. I just can't figure out how to call it.. ).
TIA..
Components...
@FacesComponent(Draggable.COMPONENT_TYPE)
public class Draggable extends UIComponentBase {
public static final String COMPONENT_TYPE = "ar.com.easytech.Draggable";
public static final String DEFAULT_RENDERER_TYPE = "ar.com.easytech.DraggableRenderer";
public static final String COMPONENT_FAMILY = "javax.faces.Output";
public String getFamily() {
return COMPONENT_FAMILY;
}
public String getFor() {
return (String) getStateHelper().eval(PropertyKeys.forVal);
}
...
protected enum PropertyKeys {
forVal("for"), draggableSelector, revert, containTo;
String c;
PropertyKeys() {
}
PropertyKeys(String c) {
this.c = c;
}
public String toString() {
return ((this.c != null) ? this.c : super.toString());
}
}
@Override
public void encodeEnd(FacesContext facesContext) throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
String clientId = getClientId(facesContext);
UIComponent targetComponent = findComponent(getFor());
if(targetComponent == null)
throw new FacesException("Cannot find component \"" + getFor());
String target = targetComponent.getClientId();
writer.startElement("script", null);
writer.writeAttribute("id", clientId + "_s", null);
writer.writeAttribute("type", "text/javascript", null);
writer.write("$(function() {");
writer.write("$( '#" + target.replace(":", "\\\\:") + "').draggable({");
if (getRevert() != null) writer.write(" revert: '" + getRevert() + "', ");
if (getContainTo() != null) writer.write(" containment: '" + getContainTo() + "',");
writer.write("});");
writer.write("});");
writer.endElement("script");
}
}
Droppable.java
@FacesComponent(Droppable.COMPONENT_TYPE)
public class Droppable extends UIComponentBase implements ClientBehaviorHolder {
public static final String COMPONENT_TYPE = "ar.com.easytech.Droppable";
public static final String DEFAULT_RENDERER_TYPE = "ar.com.easytech.DroppableRenderer";
public static final String COMPONENT_FAMILY = "javax.faces.Output";
private final static String DEFAULT_EVENT = "drop";
private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(Arrays.asList(DEFAULT_EVENT));
public String getFamily() {
return COMPONENT_FAMILY;
}
// Property: for
public String getFor() {
return (String) getStateHelper().eval(PropertyKeys.forVal);
}
...
protected enum PropertyKeys {
forVal("for"), droppableSelector, activeClass, hoverClass, accept, tolerance, source;
String c;
PropertyKeys() {
}
// Constructor needed by "for" property
PropertyKeys(String c) {
this.c = c;
}
public String toString() {
return ((this.c != null) ? this.c : super.toString());
}
}
@Override
public void queueEvent(FacesEvent event) {
FacesContext context = FacesContext.getCurrentInstance();
if (isRequestSource(context)) {
Map<String, String> params = context.getExternalContext()
.getRequestParameterMap();
String eventName = params.get("javax.faces.behavior.event");
String clientId = getClientId(context);
AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;
if (eventName.equals("drop")) {
String dragId = params.get(clientId + "_sourceId");
String dropId = params.get(clientId + "_targetId");
DragDropEvent dndEvent = null;
String datasourceId = getSource();
if (datasourceId != null) {
UIData datasource = (UIData) findComponent(datasourceId);
String[] idTokens = dragId.split(String
.valueOf(UINamingContainer
.getSeparatorChar(context)));
int rowIndex = Integer
.parseInt(idTokens[idTokens.length - 2]);
datasource.setRowIndex(rowIndex);
Object data = datasource.getRowData();
datasource.setRowIndex(-1);
dndEvent = new DragDropEvent(this,
behaviorEvent.getBehavior(), dragId, dropId, data);
} else {
dndEvent = new DragDropEvent(this,
behaviorEvent.getBehavior(), dragId, dropId);
}
super.queueEvent(dndEvent);
}
} else {
super.queueEvent(event);
}
}
@Override
public Collection<String> getEventNames() {
return EVENT_NAMES;
}
@Override
public String getDefaultEventName() {
return DEFAULT_EVENT;
}
@Override
public void decode(FacesContext context) {
if (context == null ) {
throw new NullPointerException();
}
String clientId = getClientId(context);
Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
String value = (String) requestParameterMap.get(clientId);
if (value == null || value.equals("") || !clientId.equals(value))
return;
ActionEvent actionEvent = new ActionEvent(this);
queueEvent(actionEvent);
}
@Override
public void encodeEnd(FacesContext context) throws IOException {
ClientBehaviorContext behaviorContext =
ClientBehaviorContext.createClientBehaviorContext(context,this, DEFAULT_EVENT, getClientId(context), null);
ResponseWriter writer = context.getResponseWriter();
String clientId = getClientId(context);
UIComponent targetComponent = findComponent(getFor());
if(targetComponent == null)
throw new FacesException("Cannot find component \"" + getFor());
String target = targetComponent.getClientId();
writer.startElement("script", null);
writer.writeAttribute("id", clientId + "_s", null);
writer.writeAttribute("type", "text/javascript", null);
writer.write("$(function() {");
writer.write("$( '#" + target.replace(":", "\\\\:") + "').droppable({");
if (getActiveClass() != null) writer.write(" activeClass: '" + getActiveClass() + "',");
if (getHoverClass() != null) writer.write(" hoverClass: '" + getHoverClass() + "',");
if (getAccept() != null) writer.write(" accept: '" + getAccept() + "',");
if (getTolerance() != null) writer.write(" tolerance: '" + getTolerance() + "',");
Map<String,List<ClientBehavior>> behaviors = getClientBehaviors();
if (behaviors.containsKey(DEFAULT_EVENT) ) {
String drop = behaviors.get(DEFAULT_EVENT).get(0).getScript(behaviorContext);
writer.writeAttribute("drop:", drop, null);
}
writer.write("});");
writer.write("});");
writer.endElement("script");
}
// Private
private boolean isRequestSource(FacesContext context) {
return this.getClientId(context).equals(context.getExternalContext().getRequestParameterMap() .get("javax.faces.source"));
}
}
And the usage for this would be something like..
<h:form id="frm">
<div id="container" class="container">
<ui:repeat var="row" value="#{homeBean.data}" id="dnd" >
<h:panelGroup layout="block" id="draggable" styleClass="draggable">
<h:outputText value="#{row}" />
</h:panelGroup>
<et:draggable for="draggable" draggableSelector=".draggable" containTo="parent" revert="invalid" />
</ui:repeat>
<h:panelGroup layout="block" id="droppable" styleClass="droppable">
<p>Drop Here!</p>
</h:panelGroup>
</div>
<h:dataTable id="selectedItems" var="data" value="#{homeBean.selectedRows}">
<h:column>
<h:outputText value="#{data.name}" />
</h:column>
</h:dataTable>
<et:droppable for="droppable" droppableSelector=".droppable" hoverClass="ui-state-hover" activeClass="ui-state-active" >
<f:ajax listener="#{homeBean.objectDropped}" render="@form" event="drop" />
</et:droppable>
</h:form>
HomeBean.java
@ManagedBean
public class HomeBean {
private List<String> data = new ArrayList<String>();
private List<String> selectedRows = new ArrayList<String>();
@PostConstruct
public void init() {
data.add("Value 1");
data.add("Value 2");
}
public void objectDropped(DragDropEvent event) {
selectedRows.add(event.getSourceId());
}
public List<String> getData() {
return data;
}
public void setData(List<String> data) {
this.data = data;
}
public List<String> getSelectedRows() {
return selectedRows;
}
public void setSelectedRows(List<String> selectedRows) {
this.selectedRows = selectedRows;
}
} | jsf-2.0 | custom-component | null | null | null | null | open | JSF Custom Component for jQueryUI Drag / Drop
===
I'm learning to build JSF Custom Components and I thought I could try and build an implementation of jQuery's Drag & Drop.. So I read most of what's out there and could actually build a simple enough Draggable and Droppable component that basically generate the right amount of jQuery js to support Drag & Drop up until I can associate the "draggable" object and the "droppable" container and pretty much drag / drop things around..
This was fairly simple, my problem is how to get the "data" of what's being dropped, or how to bind to the drop event that jQuery Generates... I know it should be easy enough, so if anyone could point me in the right direction (documentations / code sample) I would very much appreciate it...
I will paste as little code as I think I have to.. just so you can see what I did.. I can share the lot (it's not much more that what's pasted really..) if anyone needs it...
(As you can see I can bind an ajax event.. I just can't figure out how to call it.. ).
TIA..
Components...
@FacesComponent(Draggable.COMPONENT_TYPE)
public class Draggable extends UIComponentBase {
public static final String COMPONENT_TYPE = "ar.com.easytech.Draggable";
public static final String DEFAULT_RENDERER_TYPE = "ar.com.easytech.DraggableRenderer";
public static final String COMPONENT_FAMILY = "javax.faces.Output";
public String getFamily() {
return COMPONENT_FAMILY;
}
public String getFor() {
return (String) getStateHelper().eval(PropertyKeys.forVal);
}
...
protected enum PropertyKeys {
forVal("for"), draggableSelector, revert, containTo;
String c;
PropertyKeys() {
}
PropertyKeys(String c) {
this.c = c;
}
public String toString() {
return ((this.c != null) ? this.c : super.toString());
}
}
@Override
public void encodeEnd(FacesContext facesContext) throws IOException {
ResponseWriter writer = facesContext.getResponseWriter();
String clientId = getClientId(facesContext);
UIComponent targetComponent = findComponent(getFor());
if(targetComponent == null)
throw new FacesException("Cannot find component \"" + getFor());
String target = targetComponent.getClientId();
writer.startElement("script", null);
writer.writeAttribute("id", clientId + "_s", null);
writer.writeAttribute("type", "text/javascript", null);
writer.write("$(function() {");
writer.write("$( '#" + target.replace(":", "\\\\:") + "').draggable({");
if (getRevert() != null) writer.write(" revert: '" + getRevert() + "', ");
if (getContainTo() != null) writer.write(" containment: '" + getContainTo() + "',");
writer.write("});");
writer.write("});");
writer.endElement("script");
}
}
Droppable.java
@FacesComponent(Droppable.COMPONENT_TYPE)
public class Droppable extends UIComponentBase implements ClientBehaviorHolder {
public static final String COMPONENT_TYPE = "ar.com.easytech.Droppable";
public static final String DEFAULT_RENDERER_TYPE = "ar.com.easytech.DroppableRenderer";
public static final String COMPONENT_FAMILY = "javax.faces.Output";
private final static String DEFAULT_EVENT = "drop";
private static final Collection<String> EVENT_NAMES = Collections.unmodifiableCollection(Arrays.asList(DEFAULT_EVENT));
public String getFamily() {
return COMPONENT_FAMILY;
}
// Property: for
public String getFor() {
return (String) getStateHelper().eval(PropertyKeys.forVal);
}
...
protected enum PropertyKeys {
forVal("for"), droppableSelector, activeClass, hoverClass, accept, tolerance, source;
String c;
PropertyKeys() {
}
// Constructor needed by "for" property
PropertyKeys(String c) {
this.c = c;
}
public String toString() {
return ((this.c != null) ? this.c : super.toString());
}
}
@Override
public void queueEvent(FacesEvent event) {
FacesContext context = FacesContext.getCurrentInstance();
if (isRequestSource(context)) {
Map<String, String> params = context.getExternalContext()
.getRequestParameterMap();
String eventName = params.get("javax.faces.behavior.event");
String clientId = getClientId(context);
AjaxBehaviorEvent behaviorEvent = (AjaxBehaviorEvent) event;
if (eventName.equals("drop")) {
String dragId = params.get(clientId + "_sourceId");
String dropId = params.get(clientId + "_targetId");
DragDropEvent dndEvent = null;
String datasourceId = getSource();
if (datasourceId != null) {
UIData datasource = (UIData) findComponent(datasourceId);
String[] idTokens = dragId.split(String
.valueOf(UINamingContainer
.getSeparatorChar(context)));
int rowIndex = Integer
.parseInt(idTokens[idTokens.length - 2]);
datasource.setRowIndex(rowIndex);
Object data = datasource.getRowData();
datasource.setRowIndex(-1);
dndEvent = new DragDropEvent(this,
behaviorEvent.getBehavior(), dragId, dropId, data);
} else {
dndEvent = new DragDropEvent(this,
behaviorEvent.getBehavior(), dragId, dropId);
}
super.queueEvent(dndEvent);
}
} else {
super.queueEvent(event);
}
}
@Override
public Collection<String> getEventNames() {
return EVENT_NAMES;
}
@Override
public String getDefaultEventName() {
return DEFAULT_EVENT;
}
@Override
public void decode(FacesContext context) {
if (context == null ) {
throw new NullPointerException();
}
String clientId = getClientId(context);
Map<String, String> requestParameterMap = context.getExternalContext().getRequestParameterMap();
String value = (String) requestParameterMap.get(clientId);
if (value == null || value.equals("") || !clientId.equals(value))
return;
ActionEvent actionEvent = new ActionEvent(this);
queueEvent(actionEvent);
}
@Override
public void encodeEnd(FacesContext context) throws IOException {
ClientBehaviorContext behaviorContext =
ClientBehaviorContext.createClientBehaviorContext(context,this, DEFAULT_EVENT, getClientId(context), null);
ResponseWriter writer = context.getResponseWriter();
String clientId = getClientId(context);
UIComponent targetComponent = findComponent(getFor());
if(targetComponent == null)
throw new FacesException("Cannot find component \"" + getFor());
String target = targetComponent.getClientId();
writer.startElement("script", null);
writer.writeAttribute("id", clientId + "_s", null);
writer.writeAttribute("type", "text/javascript", null);
writer.write("$(function() {");
writer.write("$( '#" + target.replace(":", "\\\\:") + "').droppable({");
if (getActiveClass() != null) writer.write(" activeClass: '" + getActiveClass() + "',");
if (getHoverClass() != null) writer.write(" hoverClass: '" + getHoverClass() + "',");
if (getAccept() != null) writer.write(" accept: '" + getAccept() + "',");
if (getTolerance() != null) writer.write(" tolerance: '" + getTolerance() + "',");
Map<String,List<ClientBehavior>> behaviors = getClientBehaviors();
if (behaviors.containsKey(DEFAULT_EVENT) ) {
String drop = behaviors.get(DEFAULT_EVENT).get(0).getScript(behaviorContext);
writer.writeAttribute("drop:", drop, null);
}
writer.write("});");
writer.write("});");
writer.endElement("script");
}
// Private
private boolean isRequestSource(FacesContext context) {
return this.getClientId(context).equals(context.getExternalContext().getRequestParameterMap() .get("javax.faces.source"));
}
}
And the usage for this would be something like..
<h:form id="frm">
<div id="container" class="container">
<ui:repeat var="row" value="#{homeBean.data}" id="dnd" >
<h:panelGroup layout="block" id="draggable" styleClass="draggable">
<h:outputText value="#{row}" />
</h:panelGroup>
<et:draggable for="draggable" draggableSelector=".draggable" containTo="parent" revert="invalid" />
</ui:repeat>
<h:panelGroup layout="block" id="droppable" styleClass="droppable">
<p>Drop Here!</p>
</h:panelGroup>
</div>
<h:dataTable id="selectedItems" var="data" value="#{homeBean.selectedRows}">
<h:column>
<h:outputText value="#{data.name}" />
</h:column>
</h:dataTable>
<et:droppable for="droppable" droppableSelector=".droppable" hoverClass="ui-state-hover" activeClass="ui-state-active" >
<f:ajax listener="#{homeBean.objectDropped}" render="@form" event="drop" />
</et:droppable>
</h:form>
HomeBean.java
@ManagedBean
public class HomeBean {
private List<String> data = new ArrayList<String>();
private List<String> selectedRows = new ArrayList<String>();
@PostConstruct
public void init() {
data.add("Value 1");
data.add("Value 2");
}
public void objectDropped(DragDropEvent event) {
selectedRows.add(event.getSourceId());
}
public List<String> getData() {
return data;
}
public void setData(List<String> data) {
this.data = data;
}
public List<String> getSelectedRows() {
return selectedRows;
}
public void setSelectedRows(List<String> selectedRows) {
this.selectedRows = selectedRows;
}
} | 0 |
11,499,963 | 07/16/2012 07:38:35 | 1,197,024 | 02/08/2012 11:20:27 | 16 | 1 | Something similar to map tag in css? | So, I need two small parts of my header to be clickable. The problem is that I can't use map tag because my image is set in css as a background of a div. And I'm not allowed to change that (to use img src instead). How can I do that, without using absolute positioning of two divs behind the image.
css:
#bg_top { /*the design for the header*/
background:url(../images/header_bg_new.png) center top no-repeat;
min-height: 100%; /*stick footer to bottom of the page*/
text-align:left;
width:100%; | html | css | image | null | null | null | open | Something similar to map tag in css?
===
So, I need two small parts of my header to be clickable. The problem is that I can't use map tag because my image is set in css as a background of a div. And I'm not allowed to change that (to use img src instead). How can I do that, without using absolute positioning of two divs behind the image.
css:
#bg_top { /*the design for the header*/
background:url(../images/header_bg_new.png) center top no-repeat;
min-height: 100%; /*stick footer to bottom of the page*/
text-align:left;
width:100%; | 0 |
11,499,964 | 07/16/2012 07:39:09 | 1,356,336 | 04/25/2012 13:31:06 | 18 | 0 | Height of 100% and Doctype | I have a little problem with IE, doctype and height 100%.
In fact, I have a page container with a height of 100% but I think my doctype line is bad it don't run on IE and only run on chrome etc. if I delete the doctype line. What is the good doctype for use this things?
I have test all the doctype possible, the problem can come of something other?
Thx | css | internet-explorer | height | doctype | null | null | open | Height of 100% and Doctype
===
I have a little problem with IE, doctype and height 100%.
In fact, I have a page container with a height of 100% but I think my doctype line is bad it don't run on IE and only run on chrome etc. if I delete the doctype line. What is the good doctype for use this things?
I have test all the doctype possible, the problem can come of something other?
Thx | 0 |
11,499,909 | 07/16/2012 07:33:54 | 525,563 | 11/30/2010 18:32:21 | 279 | 3 | R flip XY axis on a plot | This seems like a trivial `R` question, but I didn't find any convincing solution. I would like to flip my plot where the X axis become Y, and vice-versa. In boxplot there is an `horiz="T"` option, but not in `plot()`.
This is what I plot :
plot(rm, type="l", main="CpG - running window 100")
> str(rm)
num [1:43631] 0.667 0.673 0.679 0.685 0.691 ...
![This is what I have][1]
And I would like to obtain this :
![enter image description here][2]
[1]: http://i.stack.imgur.com/wXdVz.png
[2]: http://i.stack.imgur.com/hyEKv.png
Thanks for the feedback. | r | plot | axis | flip | null | null | open | R flip XY axis on a plot
===
This seems like a trivial `R` question, but I didn't find any convincing solution. I would like to flip my plot where the X axis become Y, and vice-versa. In boxplot there is an `horiz="T"` option, but not in `plot()`.
This is what I plot :
plot(rm, type="l", main="CpG - running window 100")
> str(rm)
num [1:43631] 0.667 0.673 0.679 0.685 0.691 ...
![This is what I have][1]
And I would like to obtain this :
![enter image description here][2]
[1]: http://i.stack.imgur.com/wXdVz.png
[2]: http://i.stack.imgur.com/hyEKv.png
Thanks for the feedback. | 0 |
11,499,925 | 07/16/2012 07:35:43 | 784,318 | 06/04/2011 22:13:13 | 2,332 | 90 | UIImage imageNamed: does not find image within blue referenced Xcode-folder | In my Xcode project I have a blue referenced folder which points to a folder with images.
The benefit of the blue folder is that I don't have to add the files to Xcode manually.
So when I add a new image to the folder it automatically shows up in Xcode, however, when I try to reference the file from code using
[UIImage imageNamed:@"myFileFromTheBlueFolder"];
it does not find the image although the top-level folder is added to the target. :-(
Do I have to reference the image differently when I is coming from a blue folder, which would IMHO defeat the purpose of having such a folder at all. | iphone | ios | xcode | cocoa-touch | null | null | open | UIImage imageNamed: does not find image within blue referenced Xcode-folder
===
In my Xcode project I have a blue referenced folder which points to a folder with images.
The benefit of the blue folder is that I don't have to add the files to Xcode manually.
So when I add a new image to the folder it automatically shows up in Xcode, however, when I try to reference the file from code using
[UIImage imageNamed:@"myFileFromTheBlueFolder"];
it does not find the image although the top-level folder is added to the target. :-(
Do I have to reference the image differently when I is coming from a blue folder, which would IMHO defeat the purpose of having such a folder at all. | 0 |
11,499,971 | 07/16/2012 07:40:00 | 1,528,181 | 07/16/2012 07:35:43 | 1 | 0 | Error sending database from xCode | I am trying to send a sqlite database attached to a mail from my iphone app, I receive the email but not the database file, sorry about my grammar,I am from Spain, here is my code.
-(IBAction)mandar:(id)sender
{
MFMailComposeViewController *composer=[[MFMailComposeViewController alloc]init];
[composer setMailComposeDelegate:self];
if ([MFMailComposeViewController canSendMail])
{
[composer setToRecipients:[NSArray arrayWithObjects:@"Introducir direccion",nil]];
[composer setSubject:@"Base de datos"];
[composer setMessageBody:@"Mensage" isHTML:YES];
[composer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *file = [documentsDirectory stringByAppendingPathComponent:@"capturas.sqlite"];
NSData *data=[NSData dataWithContentsOfFile:file];
[composer addAttachmentData:data mimeType:@"application/sqlite" fileName:@"capturas.sqlite"];
[self presentModalViewController:composer animated:YES];
}
else {
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Error" message:@"No se a podido mandar el mensage" delegate:self cancelButtonTitle:@"dismis" otherButtonTitles:nil, nil];
[alert show];
}
}
| iphone | xcode | ipad | sqlite | email | null | open | Error sending database from xCode
===
I am trying to send a sqlite database attached to a mail from my iphone app, I receive the email but not the database file, sorry about my grammar,I am from Spain, here is my code.
-(IBAction)mandar:(id)sender
{
MFMailComposeViewController *composer=[[MFMailComposeViewController alloc]init];
[composer setMailComposeDelegate:self];
if ([MFMailComposeViewController canSendMail])
{
[composer setToRecipients:[NSArray arrayWithObjects:@"Introducir direccion",nil]];
[composer setSubject:@"Base de datos"];
[composer setMessageBody:@"Mensage" isHTML:YES];
[composer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *file = [documentsDirectory stringByAppendingPathComponent:@"capturas.sqlite"];
NSData *data=[NSData dataWithContentsOfFile:file];
[composer addAttachmentData:data mimeType:@"application/sqlite" fileName:@"capturas.sqlite"];
[self presentModalViewController:composer animated:YES];
}
else {
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Error" message:@"No se a podido mandar el mensage" delegate:self cancelButtonTitle:@"dismis" otherButtonTitles:nil, nil];
[alert show];
}
}
| 0 |
11,350,382 | 07/05/2012 18:30:38 | 1,044,326 | 11/13/2011 16:06:28 | 15 | 3 | resize parent if child has css and get child index using Jquery | I am trying to change the height the multiple parents dynamically if the child height changes... been pulling my hair for a while bit lost now
There is only one child per parent with z-index style...
This is what I've tried to do based on what I've found
HTML
<div class="parent">
<div class="child"></div>
<div class="child2"></div>
<div class="child3"></div>
</div>
<br>
<div class="parent">
<div class="child" style="z-index:1;"></div>
<div class="child2"></div>
</div>
<br>
<div class="parent">
<div class="child" ></div>
<div class="child2" style="z-index:1;"></div>
</div>
JQUERY
$(".parent").each(function() {
var divIndex = ;
var divHeight = ;
if ($('this').children().css('z-index') == '1')
{
// Get height and index of the single specific element with z-index css
}
$('this').resize();
$('this').delegate();
});
JSFiddle is here
http://jsfiddle.net/shavindra/EgbLk/1/
help is much appreciated... | jquery | css | manipulation | null | null | null | open | resize parent if child has css and get child index using Jquery
===
I am trying to change the height the multiple parents dynamically if the child height changes... been pulling my hair for a while bit lost now
There is only one child per parent with z-index style...
This is what I've tried to do based on what I've found
HTML
<div class="parent">
<div class="child"></div>
<div class="child2"></div>
<div class="child3"></div>
</div>
<br>
<div class="parent">
<div class="child" style="z-index:1;"></div>
<div class="child2"></div>
</div>
<br>
<div class="parent">
<div class="child" ></div>
<div class="child2" style="z-index:1;"></div>
</div>
JQUERY
$(".parent").each(function() {
var divIndex = ;
var divHeight = ;
if ($('this').children().css('z-index') == '1')
{
// Get height and index of the single specific element with z-index css
}
$('this').resize();
$('this').delegate();
});
JSFiddle is here
http://jsfiddle.net/shavindra/EgbLk/1/
help is much appreciated... | 0 |
11,350,388 | 07/05/2012 18:31:00 | 207,605 | 11/10/2009 08:31:45 | 705 | 15 | Grails: Passing a javascript variable to a template | I am new to ajax so maybe this is obvious. I've tried many different not-working approaches. I have javascript that when you click on a button:
1. an ajax call that grabs some data from a controller - returns an object
2. display that data in a template that I will show on the page
Here is the javascript/ajax:
<script type="text/javascript">
$("#show").click(function () {
$.ajax({ url: '/Myproject/result/index',
type: "POST",
data: { id: id},
success: function(result) {
alert("Success:" + result); // Can see getting object back.
}});
$(".resulttable").show();
});
Here is the key line in grails view template:
<g:each in="${allResults}" status="i" var="result">
1. How do I get the data from the javascript to the gsp code (ie allResults)?
2. Do I have to "refresh" this template to display new data?
thanks. | ajax | grails | gsp | null | null | null | open | Grails: Passing a javascript variable to a template
===
I am new to ajax so maybe this is obvious. I've tried many different not-working approaches. I have javascript that when you click on a button:
1. an ajax call that grabs some data from a controller - returns an object
2. display that data in a template that I will show on the page
Here is the javascript/ajax:
<script type="text/javascript">
$("#show").click(function () {
$.ajax({ url: '/Myproject/result/index',
type: "POST",
data: { id: id},
success: function(result) {
alert("Success:" + result); // Can see getting object back.
}});
$(".resulttable").show();
});
Here is the key line in grails view template:
<g:each in="${allResults}" status="i" var="result">
1. How do I get the data from the javascript to the gsp code (ie allResults)?
2. Do I have to "refresh" this template to display new data?
thanks. | 0 |
11,350,420 | 07/05/2012 18:32:55 | 1,174,762 | 01/28/2012 03:54:00 | 145 | 2 | Overlapping CSS elements | I would like to make the blue element sit halfway up the green circle and behind it. How can I do that? Also, why is there a random marginal-space between the green circle and the blue element?
http://jsfiddle.net/LqJ79/ | html | css | null | null | null | null | open | Overlapping CSS elements
===
I would like to make the blue element sit halfway up the green circle and behind it. How can I do that? Also, why is there a random marginal-space between the green circle and the blue element?
http://jsfiddle.net/LqJ79/ | 0 |
11,350,422 | 07/05/2012 18:33:04 | 1,504,877 | 07/05/2012 18:26:54 | 1 | 0 | Is there a way to search for Facebook Offers? | [Facebook Offers][1] is a new feature coming out soon that allows businesses to offer deals to their fans. Is there a way to search for offers using the Graph API (or any other way)?
[1]: https://www.facebook.com/help/offers/ | facebook-graph-api | full-text-search | null | null | null | null | open | Is there a way to search for Facebook Offers?
===
[Facebook Offers][1] is a new feature coming out soon that allows businesses to offer deals to their fans. Is there a way to search for offers using the Graph API (or any other way)?
[1]: https://www.facebook.com/help/offers/ | 0 |
11,350,423 | 07/05/2012 18:33:05 | 187,812 | 10/10/2009 22:29:26 | 630 | 24 | terminology of Class "attribute" vs "member" vs "variable" vs "field" | It seems that developers often use these terms interchangeably when referring to a piece of data stored in an instance of a Class. Is there any technical difference between each term, or is it fine to use them interchangeably? | java | oop | terminology | null | null | null | open | terminology of Class "attribute" vs "member" vs "variable" vs "field"
===
It seems that developers often use these terms interchangeably when referring to a piece of data stored in an instance of a Class. Is there any technical difference between each term, or is it fine to use them interchangeably? | 0 |
11,348,459 | 07/05/2012 16:16:37 | 734,558 | 05/02/2011 13:54:28 | 39 | 0 | Payza (Formerly AlertPay) SendMoney API Script - Where to Start? | I downloaded the Payza SendMoney API PHP script from their website:
https://dev.payza.com/sdks-and-sample-codes/php/api/SendMoneyClient.txt
My idea is to incorporate this into my Alert URL so that I can automatically send payments to people as dictated by the logic in my script.
So when my script sends money, should I basically call the send() function as my first step? | php | api | null | null | null | null | open | Payza (Formerly AlertPay) SendMoney API Script - Where to Start?
===
I downloaded the Payza SendMoney API PHP script from their website:
https://dev.payza.com/sdks-and-sample-codes/php/api/SendMoneyClient.txt
My idea is to incorporate this into my Alert URL so that I can automatically send payments to people as dictated by the logic in my script.
So when my script sends money, should I basically call the send() function as my first step? | 0 |
11,350,429 | 07/05/2012 18:33:24 | 1,504,812 | 07/05/2012 17:55:35 | 1 | 0 | python ctypes failed my when importing a dll file | I'm a green hand in python and now facing a problem when importing dll in python. By refering some hints found online, i tried using ctypes as below with error prompt.
>>> import ctypes
>>> dl=ctypes.WinDll('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
dl=ctypes.WinDll('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
AttributeError: 'module' object has no attribute 'WinDll'
>>> dl=ctypes.cdll.LoadLibrary('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
dl=ctypes.cdll.LoadLibrary('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
File "C:\Python27\lib\ctypes\__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126]
Am I doing something wrong or this dll was not scripted complied with python standard? I have uploaded to [MediaFire][1] for your analysis. Any help is highly appreciated!
[1]: http://www.mediafire.com/?9o55s5he13llhgi | python | dll | ctypes | null | null | null | open | python ctypes failed my when importing a dll file
===
I'm a green hand in python and now facing a problem when importing dll in python. By refering some hints found online, i tried using ctypes as below with error prompt.
>>> import ctypes
>>> dl=ctypes.WinDll('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
dl=ctypes.WinDll('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
AttributeError: 'module' object has no attribute 'WinDll'
>>> dl=ctypes.cdll.LoadLibrary('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
dl=ctypes.cdll.LoadLibrary('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
File "C:\Python27\lib\ctypes\__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126]
Am I doing something wrong or this dll was not scripted complied with python standard? I have uploaded to [MediaFire][1] for your analysis. Any help is highly appreciated!
[1]: http://www.mediafire.com/?9o55s5he13llhgi | 0 |
11,659,732 | 07/25/2012 22:38:13 | 758,323 | 05/17/2011 23:55:30 | 175 | 12 | php timestamp utc | I have a PHP MySQL query that inserts some data into a MySQL database and it includes a timestamp.
Currently the `INSERT` query uses `NOW()` for the the timestamp column and it is saved in the database in the following format: `2012-07-24 13:13:02`
Unfortunately for me the Server is not in my time zone and it is listed as America/Los_Angeles as shown `print date_default_timezone_get();`
I was hoping to do the following:
date_default_timezone_set('Europe/London');
$timefordbLondonEU = date('Y-m-d H:i:s', time());
and simply save into the database the `$timefordbLondonEU` in place of the `NOW()`;
Is this a good way to save such data ?
Many Thanks,
Richard | php | mysql | timestamp | null | null | null | open | php timestamp utc
===
I have a PHP MySQL query that inserts some data into a MySQL database and it includes a timestamp.
Currently the `INSERT` query uses `NOW()` for the the timestamp column and it is saved in the database in the following format: `2012-07-24 13:13:02`
Unfortunately for me the Server is not in my time zone and it is listed as America/Los_Angeles as shown `print date_default_timezone_get();`
I was hoping to do the following:
date_default_timezone_set('Europe/London');
$timefordbLondonEU = date('Y-m-d H:i:s', time());
and simply save into the database the `$timefordbLondonEU` in place of the `NOW()`;
Is this a good way to save such data ?
Many Thanks,
Richard | 0 |
11,660,507 | 07/26/2012 00:04:34 | 1,459,849 | 06/15/2012 22:06:20 | 1 | 0 | how to use font-faces in css file within spring 3 | I'm trying to use font-faces inside a style.css file. I have put my style font .ttf file into resources with Spring 3. When use font-faces i need to put the path to the .ttf file like this:
<pre><code>` @font-face{
font-family: NosiferCaps-Regular;
src: url('../fonts/1942/1942.ttf');}
.myClass{
font:39px/1.2 NosiferCaps-Regular, verdana ;
text-shadow:2px 2px 9px gray;
}
`
So, how do I refer to "src: url('../fonts/1942/1942.ttf')" inside a style.css file with Spring? | css | spring-mvc | font-face | null | null | null | open | how to use font-faces in css file within spring 3
===
I'm trying to use font-faces inside a style.css file. I have put my style font .ttf file into resources with Spring 3. When use font-faces i need to put the path to the .ttf file like this:
<pre><code>` @font-face{
font-family: NosiferCaps-Regular;
src: url('../fonts/1942/1942.ttf');}
.myClass{
font:39px/1.2 NosiferCaps-Regular, verdana ;
text-shadow:2px 2px 9px gray;
}
`
So, how do I refer to "src: url('../fonts/1942/1942.ttf')" inside a style.css file with Spring? | 0 |
11,660,539 | 07/26/2012 00:08:56 | 1,279,173 | 03/19/2012 17:29:04 | 14 | 0 | SecurityContext.Current not working, nullexception | im using a WCF service with the users and roles being kept in the database. In my service im trying to identify whose calling the service. So i type in my WCF service
string user = ServiceSecurityContext.Current.PrimaryIdentity.Name;
but i get i nullexception object not sent to an reference, ive tried googleing it all day but cant seem to find whats wrong. Any suggestions ? | wcf | security | authentication | null | null | null | open | SecurityContext.Current not working, nullexception
===
im using a WCF service with the users and roles being kept in the database. In my service im trying to identify whose calling the service. So i type in my WCF service
string user = ServiceSecurityContext.Current.PrimaryIdentity.Name;
but i get i nullexception object not sent to an reference, ive tried googleing it all day but cant seem to find whats wrong. Any suggestions ? | 0 |
11,660,540 | 07/26/2012 00:08:58 | 1,553,121 | 07/25/2012 23:56:46 | 1 | 0 | Daily List View in SharePoint? | I am developing a Daily list view ('Todays Support List') that displays support coverage for my company. Certain people are on-call for certain periods of time (days, or weeks)
I need to have a list that displays any events that are occuring on a particular day (today), which will show people who is on-call for that day.
The logic I have developed bases it's calculation on the begin and end date. If the begin date is later than yesterday, and before tomorrow, it shows in the list view. This works great if the appointment begins today and ends today, but if it begins last week and ends next week, it won't show up at all.
What I wish Sharepoint had built in, is the option to filter events that have [Today] anywhere between the Begin or End date.
I figured I would give it a shot from Sharepoint Designer and create a workflow (as the workflows have more options than the front-end) but I am stumped as to how to go about this. Many ideas have shot into my mind, but none of them have panned out due to ONE missing feature...
Has anyone ever tried to do anything remotely similar to this? | sharepoint | null | null | null | null | null | open | Daily List View in SharePoint?
===
I am developing a Daily list view ('Todays Support List') that displays support coverage for my company. Certain people are on-call for certain periods of time (days, or weeks)
I need to have a list that displays any events that are occuring on a particular day (today), which will show people who is on-call for that day.
The logic I have developed bases it's calculation on the begin and end date. If the begin date is later than yesterday, and before tomorrow, it shows in the list view. This works great if the appointment begins today and ends today, but if it begins last week and ends next week, it won't show up at all.
What I wish Sharepoint had built in, is the option to filter events that have [Today] anywhere between the Begin or End date.
I figured I would give it a shot from Sharepoint Designer and create a workflow (as the workflows have more options than the front-end) but I am stumped as to how to go about this. Many ideas have shot into my mind, but none of them have panned out due to ONE missing feature...
Has anyone ever tried to do anything remotely similar to this? | 0 |
11,660,542 | 07/26/2012 00:09:05 | 86,638 | 04/03/2009 08:27:26 | 2,438 | 119 | Extending an embedded python interpreter with global instance of a c++ object | I have a class
class A {
A(SomeClass* ptr);
do_something();
};
Which I want to use in an embedded python interpreter using boost-python
I have gotten so far that I have managed to create an python module through `BOOST_PYTHON_MODULE` and created a `class_<A>` with an constructor that accept a SomeClass pointer.
Now I want extend the interpreter so that there is an instance of this class (named `an_a`) whenever some python code is invoked so that the following python code is valid:
#preferably no imports here.
an_a.do_something()
My problem is two fold, I need to construct this object either in python or in C++ before the interpreter is used, and I need to make the object available for the writer of the script. I am having some problems finding exactly how to do this in the documentation I can find. | c++ | python | boost-python | null | null | null | open | Extending an embedded python interpreter with global instance of a c++ object
===
I have a class
class A {
A(SomeClass* ptr);
do_something();
};
Which I want to use in an embedded python interpreter using boost-python
I have gotten so far that I have managed to create an python module through `BOOST_PYTHON_MODULE` and created a `class_<A>` with an constructor that accept a SomeClass pointer.
Now I want extend the interpreter so that there is an instance of this class (named `an_a`) whenever some python code is invoked so that the following python code is valid:
#preferably no imports here.
an_a.do_something()
My problem is two fold, I need to construct this object either in python or in C++ before the interpreter is used, and I need to make the object available for the writer of the script. I am having some problems finding exactly how to do this in the documentation I can find. | 0 |
11,660,543 | 07/26/2012 00:09:13 | 843,734 | 07/14/2011 01:20:30 | 85 | 1 | Async loading of Typekit :: is it worth it, or better not to use it at all? | Trying to get page-load time down.
I followed the third example outlined [here][1] to asynchronously load the typekit javascript.
To make it work you have to add a .wf-loading #some-element {visibility: hidden;} to each element that uses the font, and after either 1) it loads or 2) after a set time (1 sec), the font becomes visible.
The thing is, the CSS i'm working with has the font assigned to about 200 elements, so thats 200 elements of .wf-loading{ } (note: I did not write this CSS).
I feel this would slow the load time down more than just letting it load regularly, DOM traversing that much stuff. If this is the case, I will just axe Typekit altogether and go with a regular font.
Are there any tools I can use to run performance tests on this kind of stuff? Or has anyone tested these things out?
Appreciate any input! Thanks.
[1]: http://blog.typekit.com/2011/05/25/loading-typekit-fonts-asynchronously/ | javascript | asynchronous | typekit | null | null | null | open | Async loading of Typekit :: is it worth it, or better not to use it at all?
===
Trying to get page-load time down.
I followed the third example outlined [here][1] to asynchronously load the typekit javascript.
To make it work you have to add a .wf-loading #some-element {visibility: hidden;} to each element that uses the font, and after either 1) it loads or 2) after a set time (1 sec), the font becomes visible.
The thing is, the CSS i'm working with has the font assigned to about 200 elements, so thats 200 elements of .wf-loading{ } (note: I did not write this CSS).
I feel this would slow the load time down more than just letting it load regularly, DOM traversing that much stuff. If this is the case, I will just axe Typekit altogether and go with a regular font.
Are there any tools I can use to run performance tests on this kind of stuff? Or has anyone tested these things out?
Appreciate any input! Thanks.
[1]: http://blog.typekit.com/2011/05/25/loading-typekit-fonts-asynchronously/ | 0 |
11,660,552 | 07/26/2012 00:11:11 | 1,516,425 | 07/11/2012 02:10:15 | 61 | 0 | Having multiple 'sub-repositories' in one git repository? | I was fortunate enough to obtain a free micro-plan Github account to use for my schoolwork through Github's EDU program. However, I am not sure how best to structure this for my CS classes. Ideally, I would have a different repository for each class -- CS101, CS102, etc. However, the micro-plan only allows up to 5 repositories, and I will be taking more than 5 classes within the next year or two. So, is there a way to structure one repository to keep commits 'separate' for each folder, i.e. have one repository with multiple 'sub'-repositories (basically a submodule).
Any advice is appreciated.
Thanks!
| git | github | null | null | null | null | open | Having multiple 'sub-repositories' in one git repository?
===
I was fortunate enough to obtain a free micro-plan Github account to use for my schoolwork through Github's EDU program. However, I am not sure how best to structure this for my CS classes. Ideally, I would have a different repository for each class -- CS101, CS102, etc. However, the micro-plan only allows up to 5 repositories, and I will be taking more than 5 classes within the next year or two. So, is there a way to structure one repository to keep commits 'separate' for each folder, i.e. have one repository with multiple 'sub'-repositories (basically a submodule).
Any advice is appreciated.
Thanks!
| 0 |
11,660,554 | 07/26/2012 00:11:18 | 939,743 | 09/12/2011 01:24:50 | 1 | 0 | How can I change the icon of the %SystemRoot% folder (C:\Windows)? | I am trying to change the icon that shows for the System Root, C:\Windows. I can't customize it like you normally would a Windows folder. I have looked for a registry entry I could add a DefaultIcon key too, but I haven't found anything.
I have tried using a desktop.ini file to do it, but it won't work:
[.ShellClassInfo]
IconResource=icon.ico,-0
The desktop.ini file and that icon were both in the Windows directory and it didn't change it, but those same pieces worked fine in the Downloads folder, so the code works.
Whatever the solution, I would like to avoid using any program to accomplish this.
I also would like to add a custom Icon to the "Program Files" folder and encounter the same issues.
| windows | icons | customization | null | null | null | open | How can I change the icon of the %SystemRoot% folder (C:\Windows)?
===
I am trying to change the icon that shows for the System Root, C:\Windows. I can't customize it like you normally would a Windows folder. I have looked for a registry entry I could add a DefaultIcon key too, but I haven't found anything.
I have tried using a desktop.ini file to do it, but it won't work:
[.ShellClassInfo]
IconResource=icon.ico,-0
The desktop.ini file and that icon were both in the Windows directory and it didn't change it, but those same pieces worked fine in the Downloads folder, so the code works.
Whatever the solution, I would like to avoid using any program to accomplish this.
I also would like to add a custom Icon to the "Program Files" folder and encounter the same issues.
| 0 |
11,660,561 | 07/26/2012 00:12:17 | 191,290 | 10/16/2009 15:36:24 | 16 | 0 | Thrift Default Enum values | Using Apache Thrift and generating code in Java, I'm trying to figure if there is a way to have one of the enumerations be returned as default. <br>
For e.g using the following definition:<br>
enum STATE {
UNKNOWN,
AVAILABLE,
UNAVAILABLE
}
I want UNKNOWN to be returned as the default and not a NULL value so that additions to the enum do not affect existing clients. <br>
Is it possible to do that? What are the other options available in this case? | thrift | null | null | null | null | null | open | Thrift Default Enum values
===
Using Apache Thrift and generating code in Java, I'm trying to figure if there is a way to have one of the enumerations be returned as default. <br>
For e.g using the following definition:<br>
enum STATE {
UNKNOWN,
AVAILABLE,
UNAVAILABLE
}
I want UNKNOWN to be returned as the default and not a NULL value so that additions to the enum do not affect existing clients. <br>
Is it possible to do that? What are the other options available in this case? | 0 |
11,660,562 | 07/26/2012 00:12:24 | 1,549,784 | 07/24/2012 20:06:34 | 1 | 0 | Java Array Integer manipulation | Cant seem to figure out why my array isnt outputting the correct value. The sum prints out as the first integer in the array. I wanted the sum of all the integers in the array. Any ideas what could be wrong? I attempted to convert the int to a string to be sent out.
'
//Add values of Integers
int i; int sum = 0;
for(i = 0; i < intarray.length; i++){
sum = sum + intarray[i]; }
String sumOut = Integer.toString(sum);
System.out.println( "to Client: " + sumOut);
toclient.writeBytes("Sum = " +sumOut+'\n');
' | java | arrays | type-conversion | null | null | null | open | Java Array Integer manipulation
===
Cant seem to figure out why my array isnt outputting the correct value. The sum prints out as the first integer in the array. I wanted the sum of all the integers in the array. Any ideas what could be wrong? I attempted to convert the int to a string to be sent out.
'
//Add values of Integers
int i; int sum = 0;
for(i = 0; i < intarray.length; i++){
sum = sum + intarray[i]; }
String sumOut = Integer.toString(sum);
System.out.println( "to Client: " + sumOut);
toclient.writeBytes("Sum = " +sumOut+'\n');
' | 0 |
11,693,190 | 07/27/2012 18:00:39 | 1,552,498 | 07/25/2012 18:08:24 | 6 | 0 | Select all rows in a table using JTable | How do I select all rows in a table without the user selecting them with mouse? For example, I have at a table called "InputTable". Using ActionListener/TableModelListener, I can get the selected rows (when the user clicks on them) in a table somewhat in this way -
int[] rows = inputTable.getSelectedRows();
I would now like to select all the rows in the Input table and assign it to say,
int [] rows1. Is there a command like "getSelectedRows()" where I can select all the rows without the user interaction? I know that there is a "SelectAll()" but I want something specifics to the rows alone. | swing | null | null | null | null | null | open | Select all rows in a table using JTable
===
How do I select all rows in a table without the user selecting them with mouse? For example, I have at a table called "InputTable". Using ActionListener/TableModelListener, I can get the selected rows (when the user clicks on them) in a table somewhat in this way -
int[] rows = inputTable.getSelectedRows();
I would now like to select all the rows in the Input table and assign it to say,
int [] rows1. Is there a command like "getSelectedRows()" where I can select all the rows without the user interaction? I know that there is a "SelectAll()" but I want something specifics to the rows alone. | 0 |
11,693,193 | 07/27/2012 18:00:56 | 1,558,392 | 07/27/2012 17:46:16 | 1 | 0 | VB.NET multiple MDI child forms: Is it possible to have some maximized and others not? | anybody use .NET MDI containers much?
I've got an MDI Parent form that creates a bunch of smaller MDI child forms within it after a user clicks a toolbar. The child forms are all set to have the maximize button, and when clicked, they fill the parent container. But here's my problem:
Once you maximize one child, all of the subsequent child forms you open are maximized as well. Likewise, if you have several child forms open and maximized, clicking the shrink window button shrinks all of them.
Anyway to get around this?
Thanks,
Elliot | vb.net | forms | resize | mdi | null | null | open | VB.NET multiple MDI child forms: Is it possible to have some maximized and others not?
===
anybody use .NET MDI containers much?
I've got an MDI Parent form that creates a bunch of smaller MDI child forms within it after a user clicks a toolbar. The child forms are all set to have the maximize button, and when clicked, they fill the parent container. But here's my problem:
Once you maximize one child, all of the subsequent child forms you open are maximized as well. Likewise, if you have several child forms open and maximized, clicking the shrink window button shrinks all of them.
Anyway to get around this?
Thanks,
Elliot | 0 |
11,693,194 | 07/27/2012 18:01:00 | 165,988 | 08/31/2009 12:32:49 | 3,112 | 150 | Convert ordinary 'like' to OpenGraph object | I've been working on a small project with Facebook like buttons and I've run into a small problem.
Suppose I have a web page and I do the following:
* Put a 'like' button on that page ([as described in the documentation](http://developers.facebook.com/docs/reference/plugins/like/))
* ...Without including the OpenGraph tags
* I 'like' the page
* I examine the associated OpenGraph object (via http://graph.facebook.com/?id=SITE_NAME).
In this case, I get something like this:
{
"id": "http://my-page/path",
"shares": 1
}
However, if I later add the OpenGraph tags, I still get the same result, even though it should look like an actual OpenGraph object. E.g.
{
"id": "100559863426647",
"name": "Page",
"picture": "http://path-to-image.jpg",
"link": "http://my-url/path",
"likes": 1,
"app_id": 392482400810748,
"category": "Product/service",
"is_published": true,
"description": "Some Description",
"about": " Llama #2"
}
**What way is there to take an existing 'liked' URL and convert/correct it into an OpenGraph object, if any?** | facebook | facebook-like | opengraph | null | null | null | open | Convert ordinary 'like' to OpenGraph object
===
I've been working on a small project with Facebook like buttons and I've run into a small problem.
Suppose I have a web page and I do the following:
* Put a 'like' button on that page ([as described in the documentation](http://developers.facebook.com/docs/reference/plugins/like/))
* ...Without including the OpenGraph tags
* I 'like' the page
* I examine the associated OpenGraph object (via http://graph.facebook.com/?id=SITE_NAME).
In this case, I get something like this:
{
"id": "http://my-page/path",
"shares": 1
}
However, if I later add the OpenGraph tags, I still get the same result, even though it should look like an actual OpenGraph object. E.g.
{
"id": "100559863426647",
"name": "Page",
"picture": "http://path-to-image.jpg",
"link": "http://my-url/path",
"likes": 1,
"app_id": 392482400810748,
"category": "Product/service",
"is_published": true,
"description": "Some Description",
"about": " Llama #2"
}
**What way is there to take an existing 'liked' URL and convert/correct it into an OpenGraph object, if any?** | 0 |
11,693,197 | 07/27/2012 18:01:19 | 1,558,411 | 07/27/2012 17:58:34 | 1 | 0 | Is there a way to pull user information like user's photo, name, and location from whoever liked your business page on facebook? | Is there a way to pull user information like user's photo, name, and location from whoever liked your business page on facebook?
I'm trying to pull the last 13 users who have liked or who have access to | facebook | facebook-graph-api | interface | null | null | null | open | Is there a way to pull user information like user's photo, name, and location from whoever liked your business page on facebook?
===
Is there a way to pull user information like user's photo, name, and location from whoever liked your business page on facebook?
I'm trying to pull the last 13 users who have liked or who have access to | 0 |
11,693,198 | 07/27/2012 18:01:23 | 1,394,412 | 05/14/2012 18:22:31 | 43 | 4 | HTML/CSS float left issue | I have been recently designing some content which needs to be side by side and have autosizing height, but the height doesn't resize.
This is what it looks like:
![enter image description here][1]
And this is what I want it to look like:
![enter image description here][2]
[1]: http://i.stack.imgur.com/gc04Q.png
[2]: http://i.stack.imgur.com/5wRyI.png
Here is the code:
**CSS**:
* {
padding: 0px;
margin: 0px;
}
body {
font-family: 'Metrophobic', sans-serif;
background-color: #c5c5c5;
background-image: url('../images/noise.png');
}
#container {
width:900px;
background-color: #dbdbdb;
margin-top: 20px;
margin-left: auto;
margin-right: auto;
margin-bottom: 20px;
box-shadow: 0px 0px 5px black;
}
.center_align {
display: inline-block;
margin-left: auto;
margin-right: auto;
}
#header {
height:80px;
font-size: 60px;
padding: 10px;
text-align: center;
}
#menu {
width:900px;
height:50px;
margin-top: 10px;
margin-bottom: 10px;
background-color: #cacaca;
}
.menu_link {
width:224px;
height:50px;
text-align: center;
font-size: 35px;
float: left;
opacity: 0.3;
background-color: #cacaca;
}
.menu_divider {
width: 1px;
height: 50px;
background-color: #dbdbdb;
float:left;
}
#content {
width: 900px;
height: auto;
padding: 10px;
font-size: 20px;
height: auto;
}
.line_container {
margin-top:5px;
margin-bottom:5px;
}
#footer {
width:900px;
height:22px;
padding-top:2px;
text-align: center;
font-size: 14px;
color:black;
}
a:link {
color:black;
text-decoration: none;
}
a:visited {
color:black;
text-decoration: none;
}
a:hover {
color:black;
text-decoration: none;
}
a:active {
color:black;
text-decoration: none;
}
a.link:link {
color:#21525e;
}
a.link:visited {
color:#21525e;
}
a.link:hover {
color:#307f91;
text-decoration: underline;
}
a.link:active {
color:#307f91;
text-decoration: underline;
}
**HTML**:
<html>
<head>
<title>Home</title>
<link rel="shortcut icon" href="../images/favicon.ico" />
<link href="http://fonts.googleapis.com/css?family=Metrophobic" rel="stylesheet" type="text/css" />
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.icon {
width:100px;
height:100px;
border: 3px solid white;
border-radius:25px;
margin-left:10px;
margin-right:10px;
background-position: center center;
background-size: 100px 100px;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<div class="center_align">
<img src="../images/header_icon.png" alt="header_icon" width="80" height="80" style="margin-right:20px;float:left;" />
<div style="height:80px;float:left;">Title</div>
</div>
</div>
<div id="menu">
<a href="../home" class="menu_link">Home</a>
<div class="menu_divider"></div>
<a href="../tutorials" class="menu_link">Tutorials</a>
<div class="menu_divider"></div>
<a href="../about" class="menu_link">About</a>
<div class="menu_divider"></div>
<a href="../contact" class="menu_link">Contact</a>
</div>
<div id="content">
<div style="width:900px;">
<div class="icon" style="background-image:url('image.jpg');float:left;"></div><div style="float:left;margin-top:20px;">I'm a freelance Web, Iphone, and Game developer.</div>
</div>
</div>
<div id="footer">
© Cameron
</div>
</div>
</body>
</html> | html | css | resize | css-float | auto | null | open | HTML/CSS float left issue
===
I have been recently designing some content which needs to be side by side and have autosizing height, but the height doesn't resize.
This is what it looks like:
![enter image description here][1]
And this is what I want it to look like:
![enter image description here][2]
[1]: http://i.stack.imgur.com/gc04Q.png
[2]: http://i.stack.imgur.com/5wRyI.png
Here is the code:
**CSS**:
* {
padding: 0px;
margin: 0px;
}
body {
font-family: 'Metrophobic', sans-serif;
background-color: #c5c5c5;
background-image: url('../images/noise.png');
}
#container {
width:900px;
background-color: #dbdbdb;
margin-top: 20px;
margin-left: auto;
margin-right: auto;
margin-bottom: 20px;
box-shadow: 0px 0px 5px black;
}
.center_align {
display: inline-block;
margin-left: auto;
margin-right: auto;
}
#header {
height:80px;
font-size: 60px;
padding: 10px;
text-align: center;
}
#menu {
width:900px;
height:50px;
margin-top: 10px;
margin-bottom: 10px;
background-color: #cacaca;
}
.menu_link {
width:224px;
height:50px;
text-align: center;
font-size: 35px;
float: left;
opacity: 0.3;
background-color: #cacaca;
}
.menu_divider {
width: 1px;
height: 50px;
background-color: #dbdbdb;
float:left;
}
#content {
width: 900px;
height: auto;
padding: 10px;
font-size: 20px;
height: auto;
}
.line_container {
margin-top:5px;
margin-bottom:5px;
}
#footer {
width:900px;
height:22px;
padding-top:2px;
text-align: center;
font-size: 14px;
color:black;
}
a:link {
color:black;
text-decoration: none;
}
a:visited {
color:black;
text-decoration: none;
}
a:hover {
color:black;
text-decoration: none;
}
a:active {
color:black;
text-decoration: none;
}
a.link:link {
color:#21525e;
}
a.link:visited {
color:#21525e;
}
a.link:hover {
color:#307f91;
text-decoration: underline;
}
a.link:active {
color:#307f91;
text-decoration: underline;
}
**HTML**:
<html>
<head>
<title>Home</title>
<link rel="shortcut icon" href="../images/favicon.ico" />
<link href="http://fonts.googleapis.com/css?family=Metrophobic" rel="stylesheet" type="text/css" />
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.icon {
width:100px;
height:100px;
border: 3px solid white;
border-radius:25px;
margin-left:10px;
margin-right:10px;
background-position: center center;
background-size: 100px 100px;
}
</style>
</head>
<body>
<div id="container">
<div id="header">
<div class="center_align">
<img src="../images/header_icon.png" alt="header_icon" width="80" height="80" style="margin-right:20px;float:left;" />
<div style="height:80px;float:left;">Title</div>
</div>
</div>
<div id="menu">
<a href="../home" class="menu_link">Home</a>
<div class="menu_divider"></div>
<a href="../tutorials" class="menu_link">Tutorials</a>
<div class="menu_divider"></div>
<a href="../about" class="menu_link">About</a>
<div class="menu_divider"></div>
<a href="../contact" class="menu_link">Contact</a>
</div>
<div id="content">
<div style="width:900px;">
<div class="icon" style="background-image:url('image.jpg');float:left;"></div><div style="float:left;margin-top:20px;">I'm a freelance Web, Iphone, and Game developer.</div>
</div>
</div>
<div id="footer">
© Cameron
</div>
</div>
</body>
</html> | 0 |
11,693,205 | 07/27/2012 18:01:57 | 1,311,286 | 04/03/2012 19:43:29 | 225 | 0 | Haskell, loading and is this merge function correct? | First off I am using ghci under unbuntu 11.10 to run the haskell code. 2nd this is my first attempts at haskell. Third, how might I load a file into ghci and where does it need to be located and what should its extension be? I know ":l "file.haskelxtnsn"" is how to load a file, but thats my best guess so far.
Seeing as I can do the above, how does this code look for merging two list of possibly infinite size in ascending order. (I can't put this in the prelude> prompt because of indentation???) Given [1, 2, 3] and [4, 5, 6] I should get [1, 2, 3, 4, 5, 6], and I think the usage would be "take 10 (merge listx listy)"
let merge x y = (min (head x) (head y)) :
case (min (head x) (head y)) of
head x -> merge (drop 1 x) y
head y -> merge x (drop 1 y)
psuedo:
- output the min of the heads of the lists
- if the first lists head was output call merge
with the rest of the first list and the second
- else call merge with the first list and the rest
of the second list
| haskell | null | null | null | null | null | open | Haskell, loading and is this merge function correct?
===
First off I am using ghci under unbuntu 11.10 to run the haskell code. 2nd this is my first attempts at haskell. Third, how might I load a file into ghci and where does it need to be located and what should its extension be? I know ":l "file.haskelxtnsn"" is how to load a file, but thats my best guess so far.
Seeing as I can do the above, how does this code look for merging two list of possibly infinite size in ascending order. (I can't put this in the prelude> prompt because of indentation???) Given [1, 2, 3] and [4, 5, 6] I should get [1, 2, 3, 4, 5, 6], and I think the usage would be "take 10 (merge listx listy)"
let merge x y = (min (head x) (head y)) :
case (min (head x) (head y)) of
head x -> merge (drop 1 x) y
head y -> merge x (drop 1 y)
psuedo:
- output the min of the heads of the lists
- if the first lists head was output call merge
with the rest of the first list and the second
- else call merge with the first list and the rest
of the second list
| 0 |
11,693,163 | 07/27/2012 17:58:55 | 333,390 | 05/05/2010 11:48:51 | 1,835 | 0 | Using components to minimize coupling in a system | Guys I've read somewhere that using components can help minimize coupling within a system. Is it true? If so, why? Could anyone explain that? | java | components | null | null | null | 07/28/2012 09:59:33 | not a real question | Using components to minimize coupling in a system
===
Guys I've read somewhere that using components can help minimize coupling within a system. Is it true? If so, why? Could anyone explain that? | 1 |
11,693,164 | 07/27/2012 17:58:57 | 1,490,330 | 06/29/2012 05:28:22 | 18 | 0 | Simultaneous NSNotification Alerts On Mountain Lion | I'm attempting to create New Email alerts (via AppleScript and a Cocoa app) for Outlook 2011 that display through the ML Notification Center.
It's 90% there, the only issue is that when more than 1 email arrives at a time, the second alert quickly overwrites the first one.
I'm getting the feeling that this is by design and that the Notification Center doesn't permit more than one alert on the screen at a time (unlike Growl which will send an array of alerts down your screen) because the code seems rather straightforward.
If anyone has any insight on this please let me know.
Thanks. | nsnotificationcenter | osx-mountain-lion | null | null | null | null | open | Simultaneous NSNotification Alerts On Mountain Lion
===
I'm attempting to create New Email alerts (via AppleScript and a Cocoa app) for Outlook 2011 that display through the ML Notification Center.
It's 90% there, the only issue is that when more than 1 email arrives at a time, the second alert quickly overwrites the first one.
I'm getting the feeling that this is by design and that the Notification Center doesn't permit more than one alert on the screen at a time (unlike Growl which will send an array of alerts down your screen) because the code seems rather straightforward.
If anyone has any insight on this please let me know.
Thanks. | 0 |
11,693,214 | 07/27/2012 18:02:43 | 167,454 | 09/02/2009 19:40:01 | 3,763 | 1 | How I can assign the result of a query to multiple variables at once without use a cursor? | When I need to store the result of a SQL sentence in a variable I can use a code like so
declare @Max as int
set @Max=(select max(field_name) from table_name)
But now i wondering if is possible do the same for multiple variables for example for a sentence like
select max(field_name), min(field_name) from table_name
how i can store the result in two variables called @Max and @Min?
I know which this can be done using cursors
DECLARE @Max as int, @Min as int
DECLARE cursor_minmax CURSOR FOR
Select max(field_name), min(field_name) from table_name
OPEN cursor_minmax
FETCH NEXT FROM cursor_minmax INTO @Max,@Min
CLOSE cursor_minmax
DEALLOCATE cursor_minmax
but i want to know if is possible assign that values wihout use cursors. | sql | sql-server | sql-server-2005 | null | null | null | open | How I can assign the result of a query to multiple variables at once without use a cursor?
===
When I need to store the result of a SQL sentence in a variable I can use a code like so
declare @Max as int
set @Max=(select max(field_name) from table_name)
But now i wondering if is possible do the same for multiple variables for example for a sentence like
select max(field_name), min(field_name) from table_name
how i can store the result in two variables called @Max and @Min?
I know which this can be done using cursors
DECLARE @Max as int, @Min as int
DECLARE cursor_minmax CURSOR FOR
Select max(field_name), min(field_name) from table_name
OPEN cursor_minmax
FETCH NEXT FROM cursor_minmax INTO @Max,@Min
CLOSE cursor_minmax
DEALLOCATE cursor_minmax
but i want to know if is possible assign that values wihout use cursors. | 0 |
11,571,800 | 07/20/2012 01:52:42 | 737,297 | 05/04/2011 04:04:32 | 544 | 4 | Sound matching library/algorithm | I am looking for a C# or java library (preferably C#) for computing a percent-similarity between two different sounds.
My intention is to create an android app that matches a pre-recorded sound to a live sound stream.
I am using `Mono Android` to create the app in C#, so a C# library is preferred.
I assume this library would probably need to use FFT and DTW to calculate the similarity. | c# | android | pattern-matching | audio-processing | null | null | open | Sound matching library/algorithm
===
I am looking for a C# or java library (preferably C#) for computing a percent-similarity between two different sounds.
My intention is to create an android app that matches a pre-recorded sound to a live sound stream.
I am using `Mono Android` to create the app in C#, so a C# library is preferred.
I assume this library would probably need to use FFT and DTW to calculate the similarity. | 0 |
11,571,801 | 07/20/2012 01:52:57 | 337,446 | 05/10/2010 16:11:25 | 334 | 7 | Rails console 'y' helper returns NameError rather than yaml-formatting output | I'm trying to use `y object` in Rails 3.2.6/Ruby 1.9.3 console to get nicely formatted yaml output for an ActiveRecord object, but for some reason it isn't working for me. I've used it in the past, but somewhere along the way it broke. I get the following output when I try:
```
NameError: undefined local variable or method `yaml' for main:Object
``` | ruby-on-rails | ruby-on-rails-3 | ruby-on-rails-3.2 | rails-console | to-yaml | null | open | Rails console 'y' helper returns NameError rather than yaml-formatting output
===
I'm trying to use `y object` in Rails 3.2.6/Ruby 1.9.3 console to get nicely formatted yaml output for an ActiveRecord object, but for some reason it isn't working for me. I've used it in the past, but somewhere along the way it broke. I get the following output when I try:
```
NameError: undefined local variable or method `yaml' for main:Object
``` | 0 |
11,571,803 | 07/20/2012 01:53:24 | 1,502,740 | 07/05/2012 01:39:56 | 42 | 0 | Backend server does not respond to HTML request | I have set up a backend server to respond to the HTML request sending by my android app. I should have corrected all the bugs in my app however, the server still does not give response to the request, I think probably it is because the request cannot be received by the server. Here is the situation, the backend server is placed in a virtual machine, my mobile device and the virtual machine are connecting to the same Wifi network. As the app seems cannot connect to the server, so I have done an simple experiment in another desktop, to access a simple webpage build in that server, but not success.
Here is part of my android app about sending the request
private class GrabURL extends AsyncTask<String, Void, Void>{
ArrayList<NameValuePair> nameValuePairs;
//private ProgressDialog Dialog;
public GrabURL() {
nameValuePairs = new ArrayList<NameValuePair>();
//Dialog = new ProgressDialog(Reader.this);
}
protected void onPreExecute(String key, String value) {
mTest.append("PreExecute");
//Dialog.setMessage("Sending value..");
//Dialog.show();
nameValuePairs.add(new BasicNameValuePair(key,value));
}
@Override
protected Void doInBackground(String... urls) {
// TODO Auto-generated method stub
try{
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(urls[0]);
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(nameValuePairs,HTTP.UTF_8);
post.setEntity(ent);
client.execute(post);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
protected void onPostExecute(Void unused) {
mTest.append("PostExecute");
//Dialog.dismiss();
Toast.makeText(getApplicationContext(), "Value updated", Toast.LENGTH_SHORT).show();
}
}
And below is my php program to response to request:
<?php
$file = "C:/wamp/www/myapp/file.txt";
$data = "AID:".$_POST['AID']." BID:".$_POST['BID'];
file_put_contents($file, $data);
?> | php | android | webserver | virtual-machine | null | null | open | Backend server does not respond to HTML request
===
I have set up a backend server to respond to the HTML request sending by my android app. I should have corrected all the bugs in my app however, the server still does not give response to the request, I think probably it is because the request cannot be received by the server. Here is the situation, the backend server is placed in a virtual machine, my mobile device and the virtual machine are connecting to the same Wifi network. As the app seems cannot connect to the server, so I have done an simple experiment in another desktop, to access a simple webpage build in that server, but not success.
Here is part of my android app about sending the request
private class GrabURL extends AsyncTask<String, Void, Void>{
ArrayList<NameValuePair> nameValuePairs;
//private ProgressDialog Dialog;
public GrabURL() {
nameValuePairs = new ArrayList<NameValuePair>();
//Dialog = new ProgressDialog(Reader.this);
}
protected void onPreExecute(String key, String value) {
mTest.append("PreExecute");
//Dialog.setMessage("Sending value..");
//Dialog.show();
nameValuePairs.add(new BasicNameValuePair(key,value));
}
@Override
protected Void doInBackground(String... urls) {
// TODO Auto-generated method stub
try{
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(urls[0]);
UrlEncodedFormEntity ent = new UrlEncodedFormEntity(nameValuePairs,HTTP.UTF_8);
post.setEntity(ent);
client.execute(post);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
protected void onPostExecute(Void unused) {
mTest.append("PostExecute");
//Dialog.dismiss();
Toast.makeText(getApplicationContext(), "Value updated", Toast.LENGTH_SHORT).show();
}
}
And below is my php program to response to request:
<?php
$file = "C:/wamp/www/myapp/file.txt";
$data = "AID:".$_POST['AID']." BID:".$_POST['BID'];
file_put_contents($file, $data);
?> | 0 |
10,454,090 | 05/04/2012 18:18:01 | 310,429 | 04/06/2010 21:47:34 | 879 | 8 | which line break for Macs and Windows email apps? \r\n or \n\n | i've read a few other post on here regarding this topic. I understand that `\r\n` is for Windows and `\n` is for Unix so which is recommended for all users? I'm sending out an email and want both Mac and Windows users to have the line break | php | null | null | null | null | null | open | which line break for Macs and Windows email apps? \r\n or \n\n
===
i've read a few other post on here regarding this topic. I understand that `\r\n` is for Windows and `\n` is for Unix so which is recommended for all users? I'm sending out an email and want both Mac and Windows users to have the line break | 0 |
11,571,811 | 07/20/2012 01:54:26 | 845,584 | 07/14/2011 23:43:02 | 46 | 9 | Debug Mode - LINQ NullReferenceException on Collection Constructor | I think I've found a bug in Visual Studio when you drag-and-drop the break-point to a different branch and you're using a certain type of LINQ query. If you place a breakpoint on the "if (x)" below and drag the executing line to the else branch, the code will fail on the initialisation/constructor for the "test2" collection.
I've used this "double from" syntax in LINQ before to do joins and I assume it's a accepted practice - not sure if there's a term for it.
Anyway can anyone else confirm this strange debug behaviour?
public class TestEntity
{
public int TestID { get; set; }
public string Test { get; set; }
}
public class Test2Entity
{
public int Test2ID { get; set; }
public string Test2 { get; set; }
}
private void button1_Click(object sender, EventArgs e)
{
bool x = Calc();
if (x) //breakpoint here
{
int y = 1;
}
else
{
System.Collections.ObjectModel.Collection<TestEntity> test = new System.Collections.ObjectModel.Collection<TestEntity>();
System.Collections.ObjectModel.Collection<Test2Entity> test2 = new System.Collections.ObjectModel.Collection<Test2Entity>(); // fails here
var z = from t in test
from t2 in test2
select t.TestID;
}
}
private bool Calc()
{
return true;
}
| linq | debugging | collections | nullreferenceexception | null | null | open | Debug Mode - LINQ NullReferenceException on Collection Constructor
===
I think I've found a bug in Visual Studio when you drag-and-drop the break-point to a different branch and you're using a certain type of LINQ query. If you place a breakpoint on the "if (x)" below and drag the executing line to the else branch, the code will fail on the initialisation/constructor for the "test2" collection.
I've used this "double from" syntax in LINQ before to do joins and I assume it's a accepted practice - not sure if there's a term for it.
Anyway can anyone else confirm this strange debug behaviour?
public class TestEntity
{
public int TestID { get; set; }
public string Test { get; set; }
}
public class Test2Entity
{
public int Test2ID { get; set; }
public string Test2 { get; set; }
}
private void button1_Click(object sender, EventArgs e)
{
bool x = Calc();
if (x) //breakpoint here
{
int y = 1;
}
else
{
System.Collections.ObjectModel.Collection<TestEntity> test = new System.Collections.ObjectModel.Collection<TestEntity>();
System.Collections.ObjectModel.Collection<Test2Entity> test2 = new System.Collections.ObjectModel.Collection<Test2Entity>(); // fails here
var z = from t in test
from t2 in test2
select t.TestID;
}
}
private bool Calc()
{
return true;
}
| 0 |
11,571,813 | 07/20/2012 01:54:31 | 686,800 | 04/01/2011 01:37:24 | 151 | 2 | MOSS 2007: jquery can't access web methods from custom web parts | I have custom web parts on MOSS 2007 that has jquery that calls web methods. I have been checking my MOSS 2007 Web Application on Firefox with Firebug and on the Console Tab it says 401 errors for my web methods.
Any links or ideas that could allow my web methods to be accessed?
Thanks | jquery-ajax | sharepoint2007 | webmethod | null | null | 07/20/2012 13:04:53 | off topic | MOSS 2007: jquery can't access web methods from custom web parts
===
I have custom web parts on MOSS 2007 that has jquery that calls web methods. I have been checking my MOSS 2007 Web Application on Firefox with Firebug and on the Console Tab it says 401 errors for my web methods.
Any links or ideas that could allow my web methods to be accessed?
Thanks | 2 |
11,571,814 | 07/20/2012 01:54:47 | 1,460,205 | 06/16/2012 05:40:14 | 1 | 0 | Which NodeJS framework to use: ExpressJS vs RailswayJS vs TowerJS vs GeddyJS vs RESTify for REST API server application | Client will be using BackboneJS. All is needed is REST API on server.
I've tried RESTify but it doesn't have session manager or build-in database (MongoDB) validation like Railsway.
There is no need for templates because I'll be using BackboneJS to render templates on the client side.
Will Express with it's Connect middleware do the trick?
| node.js | express | towerjs | geddy | restify | 07/20/2012 15:00:02 | not constructive | Which NodeJS framework to use: ExpressJS vs RailswayJS vs TowerJS vs GeddyJS vs RESTify for REST API server application
===
Client will be using BackboneJS. All is needed is REST API on server.
I've tried RESTify but it doesn't have session manager or build-in database (MongoDB) validation like Railsway.
There is no need for templates because I'll be using BackboneJS to render templates on the client side.
Will Express with it's Connect middleware do the trick?
| 4 |
11,571,798 | 07/20/2012 01:52:25 | 1,539,497 | 07/20/2012 01:40:39 | 1 | 0 | Char data type in C/C++ | I am trying to call a C++ DLL in Java. In its C++ head file, there are following lines:
#define a '102001'
#define b '102002'
#define c '202001'
#define d '202002'
What kind of data type are for a, b, c, and d? are they char or char array? and what are the correpsonding data type in Java that I should convert to? | c++ | c | arrays | string | char | null | open | Char data type in C/C++
===
I am trying to call a C++ DLL in Java. In its C++ head file, there are following lines:
#define a '102001'
#define b '102002'
#define c '202001'
#define d '202002'
What kind of data type are for a, b, c, and d? are they char or char array? and what are the correpsonding data type in Java that I should convert to? | 0 |
11,373,265 | 07/07/2012 07:47:16 | 1,425,400 | 05/30/2012 07:18:05 | 33 | 0 | how to ignore "," while rounding off decimals using javascript? | <html>
<head></head>
<body>
<label class="xyz">
<span class="aaaa">Rs. </span>
1,399.00
</label>
<label class="xyz">
<span class="aaaa">Rs. </span>
199.00
</label>
<script>
function deciremove(){
var all = document.getElementsByClassName('xyz');
for(var i=0; i< all.length; i++)
{
var x = all[i].childNodes[2].nodeValue;
x= Math.round(x);
all[i].childNodes[2].nodeValue = x;
}
}
deciremove();
</script>
</body>
</html>
in above code i want Rounding Off Decimals two values, when a value is 199.00 it works well n gives 199 but when 1,399.00 it gives NaN. and this is because of ",". so how do i ignore or delete ",". | javascript | null | null | null | null | null | open | how to ignore "," while rounding off decimals using javascript?
===
<html>
<head></head>
<body>
<label class="xyz">
<span class="aaaa">Rs. </span>
1,399.00
</label>
<label class="xyz">
<span class="aaaa">Rs. </span>
199.00
</label>
<script>
function deciremove(){
var all = document.getElementsByClassName('xyz');
for(var i=0; i< all.length; i++)
{
var x = all[i].childNodes[2].nodeValue;
x= Math.round(x);
all[i].childNodes[2].nodeValue = x;
}
}
deciremove();
</script>
</body>
</html>
in above code i want Rounding Off Decimals two values, when a value is 199.00 it works well n gives 199 but when 1,399.00 it gives NaN. and this is because of ",". so how do i ignore or delete ",". | 0 |
11,373,274 | 07/07/2012 07:48:38 | 1,497,640 | 07/03/2012 03:49:25 | 1 | 0 | ActivityNotFoundException: No Activity found to handle Intent { act=splashscreen.app.test.CLEARSCREEN }? | i m getng this problem..basically this is a simple for creating splash screen but aftr loading splash screen i want to load main form but here m getng this problem............i hav added the activity to manifest as well....
here is my java code
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread logotimer=new Thread(){
public void run()
{
try
{
int timer=0;
while(timer<5000)
{
sleep(100);
timer=timer+100;
}
startActivity(new Intent("splashscreen.app.test.CLEARSCREEN"));
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally
{
finish();
}
}
};
logotimer.start();
}
}
and here is manifest activty i hav included
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".SplashscreenActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".menu"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.CLEARSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application> | android | android-intent | null | null | null | null | open | ActivityNotFoundException: No Activity found to handle Intent { act=splashscreen.app.test.CLEARSCREEN }?
===
i m getng this problem..basically this is a simple for creating splash screen but aftr loading splash screen i want to load main form but here m getng this problem............i hav added the activity to manifest as well....
here is my java code
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread logotimer=new Thread(){
public void run()
{
try
{
int timer=0;
while(timer<5000)
{
sleep(100);
timer=timer+100;
}
startActivity(new Intent("splashscreen.app.test.CLEARSCREEN"));
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally
{
finish();
}
}
};
logotimer.start();
}
}
and here is manifest activty i hav included
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".SplashscreenActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".menu"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.CLEARSCREEN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application> | 0 |
11,373,276 | 07/07/2012 07:48:39 | 403,398 | 07/27/2010 12:52:55 | 41 | 0 | Understanding threads and synchronization on a class that spawns the thread | Ok, so can some one explain to me the gap in my knowledge here?
Initially the example below was trying to synchronize an instance method, but then realised that I spawn a new instance and therefore a lock wouldn't happen.
So I decided to make a lock on a static method of the class in the hope that the thread would then run in order but still no luck. Can any explain the error of my ways? ( Bear with me there are probably better ways to do this its just getting the understanding right, I'm a PHP developer going into Java, I love it - but I'm only 2 days in ;-) )
So at this time the numbers print out in a random order.
Class 1
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package learningjava;
/**
*
* @author tiz
*/
public class LearningJava {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
threadCaller ob1 = new threadCaller("This is a test string 1");
threadCaller ob2 = new threadCaller("This is a test string 2");
threadCaller ob3 = new threadCaller("This is a test string 3");
threadCaller ob4 = new threadCaller("This is a test string 4");
threadCaller ob5 = new threadCaller("This is a test string 5");
try {
ob1.t.join();
ob2.t.join();
ob3.t.join();
ob4.t.join();
ob5.t.join();
} catch (InterruptedException e) {
System.out.println(e);
}
}
}
Class 2
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package learningjava;
/**
*
* @author tiz
*/
public class threadCaller implements Runnable {
private String message;
public Thread t;
public threadCaller(String text) {
message = text;
t = new Thread(this);
t.start();
}
public static synchronized void echo(String message) {
System.out.println(message);
}
public void run(){
threadCaller.echo(this.message);
}
}
| java | multithreading | static | synchronization | null | null | open | Understanding threads and synchronization on a class that spawns the thread
===
Ok, so can some one explain to me the gap in my knowledge here?
Initially the example below was trying to synchronize an instance method, but then realised that I spawn a new instance and therefore a lock wouldn't happen.
So I decided to make a lock on a static method of the class in the hope that the thread would then run in order but still no luck. Can any explain the error of my ways? ( Bear with me there are probably better ways to do this its just getting the understanding right, I'm a PHP developer going into Java, I love it - but I'm only 2 days in ;-) )
So at this time the numbers print out in a random order.
Class 1
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package learningjava;
/**
*
* @author tiz
*/
public class LearningJava {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
threadCaller ob1 = new threadCaller("This is a test string 1");
threadCaller ob2 = new threadCaller("This is a test string 2");
threadCaller ob3 = new threadCaller("This is a test string 3");
threadCaller ob4 = new threadCaller("This is a test string 4");
threadCaller ob5 = new threadCaller("This is a test string 5");
try {
ob1.t.join();
ob2.t.join();
ob3.t.join();
ob4.t.join();
ob5.t.join();
} catch (InterruptedException e) {
System.out.println(e);
}
}
}
Class 2
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package learningjava;
/**
*
* @author tiz
*/
public class threadCaller implements Runnable {
private String message;
public Thread t;
public threadCaller(String text) {
message = text;
t = new Thread(this);
t.start();
}
public static synchronized void echo(String message) {
System.out.println(message);
}
public void run(){
threadCaller.echo(this.message);
}
}
| 0 |
11,367,018 | 07/06/2012 17:29:56 | 1,499,617 | 07/03/2012 18:05:50 | 1 | 0 | Hard Coding a button to an IBAction in xcode | when I google the title of my question I get another stackoverflow question that was answered that has been really helpful and explains most of what I need to do with hard coding a button. The problem is that when it is tied to an action it resembles this...
[btnDetail setImage:[UIImage imageNamed:@"btn-detail.png"] forState:UIControlStateNormal];
Im looking to tie the button directly to an IBAction that I've already created called exitMovie so I was hoping to do something like this...
[button setAction: [IBAction.exitMovie] forState:UIControlStateNormal];
or something like that but nothing I have tried has worked. How do I do this correctly?
below is the link to the the aforementioned hardcode that I used for the most part.
http://stackoverflow.com/questions/2544279/can-you-hard-code-ibactions-and-iboutlets-in-xcode-rather-then-drag-them-manuall | xcode | button | ibaction | hardcode | null | null | open | Hard Coding a button to an IBAction in xcode
===
when I google the title of my question I get another stackoverflow question that was answered that has been really helpful and explains most of what I need to do with hard coding a button. The problem is that when it is tied to an action it resembles this...
[btnDetail setImage:[UIImage imageNamed:@"btn-detail.png"] forState:UIControlStateNormal];
Im looking to tie the button directly to an IBAction that I've already created called exitMovie so I was hoping to do something like this...
[button setAction: [IBAction.exitMovie] forState:UIControlStateNormal];
or something like that but nothing I have tried has worked. How do I do this correctly?
below is the link to the the aforementioned hardcode that I used for the most part.
http://stackoverflow.com/questions/2544279/can-you-hard-code-ibactions-and-iboutlets-in-xcode-rather-then-drag-them-manuall | 0 |
11,472,261 | 07/13/2012 14:15:06 | 365,266 | 06/12/2010 14:20:48 | 583 | 7 | Nodejs module exports usage | In a sample application I saw a module with a code like this:
exports = mongoose = require('mongoose')
mongoose.connect(config.db.uri)
exports = Schema = mongoose.Schema
Can someone explain what this means? After these three lines I can see that mongoose and Schema functions can be called from anywhere in the application but I can't get the logic behind this.
| node.js | null | null | null | null | null | open | Nodejs module exports usage
===
In a sample application I saw a module with a code like this:
exports = mongoose = require('mongoose')
mongoose.connect(config.db.uri)
exports = Schema = mongoose.Schema
Can someone explain what this means? After these three lines I can see that mongoose and Schema functions can be called from anywhere in the application but I can't get the logic behind this.
| 0 |
11,472,262 | 07/13/2012 14:15:11 | 1,033,507 | 11/07/2011 09:52:26 | 154 | 7 | Get tag a id inside listitem id | I'm quite to new to JQueryMobile javascript and HTML. In my screen I have a list of elements that are creates dynamically and when you click on each element it should get you to another screen depending on the name of the list item you clicked.
I have tried to get the a tag id, value, name... but it doesn't work... here is my code for each line:
<li style='height:30px;' id='$object'><a class='resume' id='$object' href='javascript:loadGraph(this);'><span class='name' style='font-size:10pt;height:5px;' value='$object'>$object </span><span class='data' style='background:$alarmColor;font-size:10pt;color:$alarmText;height:15px;'>$debitPrevMax</span> </a><a class='info' id='$object' href='javascript:threshold(this)'>Alarm Info</a></li>
The list have split buttons.
Thanks! | javascript | html | jquery-mobile | null | null | null | open | Get tag a id inside listitem id
===
I'm quite to new to JQueryMobile javascript and HTML. In my screen I have a list of elements that are creates dynamically and when you click on each element it should get you to another screen depending on the name of the list item you clicked.
I have tried to get the a tag id, value, name... but it doesn't work... here is my code for each line:
<li style='height:30px;' id='$object'><a class='resume' id='$object' href='javascript:loadGraph(this);'><span class='name' style='font-size:10pt;height:5px;' value='$object'>$object </span><span class='data' style='background:$alarmColor;font-size:10pt;color:$alarmText;height:15px;'>$debitPrevMax</span> </a><a class='info' id='$object' href='javascript:threshold(this)'>Alarm Info</a></li>
The list have split buttons.
Thanks! | 0 |
11,472,268 | 07/13/2012 14:15:26 | 1,369,711 | 05/02/2012 10:00:43 | 1 | 0 | Concat a xml node with a variable in xsl | Hi I need to concat a xsl node path with a variable to have a dinamic node path in xslt.
I have this node:
<PRODOTTI>
<ITEM STATO="2">
</PRODOTTI>
<STATI>
<COD0>Errore</COD0>
<COD1>In spedizione entro le prossime 12-24 ore</COD1>
<COD2>In spedizione entro le prossime 24-48 ore</COD2>
</STATI>
and in xsl I have
<xsl:variable name="stato_ordine" select="@STATO"/>
<xsl:variable name="ordine" select="concat(../../../TRADUZIONI/STATI/COD, $stato_ordine)" />
<xsl:value-of select="$ordine"></xsl:value-of>
but in output I only get the "stato_ordine" value, instead i'd need the complete path to get the node value.
Is there anyway to have this?
Thank you. | xml | xslt | path | concat | null | null | open | Concat a xml node with a variable in xsl
===
Hi I need to concat a xsl node path with a variable to have a dinamic node path in xslt.
I have this node:
<PRODOTTI>
<ITEM STATO="2">
</PRODOTTI>
<STATI>
<COD0>Errore</COD0>
<COD1>In spedizione entro le prossime 12-24 ore</COD1>
<COD2>In spedizione entro le prossime 24-48 ore</COD2>
</STATI>
and in xsl I have
<xsl:variable name="stato_ordine" select="@STATO"/>
<xsl:variable name="ordine" select="concat(../../../TRADUZIONI/STATI/COD, $stato_ordine)" />
<xsl:value-of select="$ordine"></xsl:value-of>
but in output I only get the "stato_ordine" value, instead i'd need the complete path to get the node value.
Is there anyway to have this?
Thank you. | 0 |
11,472,271 | 07/13/2012 14:15:28 | 1,493,386 | 06/30/2012 18:07:10 | 3 | 1 | IPhone dev: CoreLocation object, can't assign langtitude | Oke so I'm building an app that works with mapkit and I need to get coordinates from googlemaps, I made a function that does this (and through debugging I know I get the good coordinates, but it then crashes when I try to assign it to my event object's coordinates, below is the code, I've clearly commented with // <---------------- where it fails..
AppDelegate.h
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
#import "MapViewController.h"
#import "Event.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, MKMapViewDelegate, CLLocationManagerDelegate>{
CLLocationManager *locationManager;
}
//-(void)makeTestData:(int)amount;
-(void) addressLocation:(NSString*)adres:(Event*)event;
@property (strong, nonatomic) UIWindow *window;
//@property (strong, nonatomic) NSMutableArray *events;
@end
AppDelegate.m
#import "AppDelegate.h"
#import "ListViewController.h"
#import "Event.h"
#import <RestKit/RestKit.h>
@implementation AppDelegate{
NSMutableArray *events;
/* for test data */
NSMutableArray *titles;
}
@synthesize window = _window;
//@synthesize events;
-(void) addressLocation:(NSString*)adres: (Event*)event {
NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv&key=MYKEY",
[adres stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString]];
NSArray *listItems = [locationString componentsSeparatedByString:@","];
double latitude = 0.0;
double longitude = 0.0;
if([listItems count] >= 4 && [[listItems objectAtIndex:0] isEqualToString:@"200"]) {
latitude = [[listItems objectAtIndex:2] doubleValue];
longitude = [[listItems objectAtIndex:3] doubleValue];
}
else {
//Show error
}
CLLocationCoordinate2D location;
location.latitude = latitude;
location.longitude = longitude; // <----- Checked in debugging, coords are good
event.coordinate.latitude = latitude; // <----- can't assign the latitude here =/
event.coordinate.longitude = longitude; // <----- can't assign the longitude here =/
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// START COMMUNICATOIN WITH REST INTERFACE
//RKClient* client = [RKClient clientWithBaseURL:@"link"];
//NSLog(@"I am your RKClient singleton : %@", [RKClient sharedClient]);
// -------------------TEST OBJECTS
//makeTestData(3);
events = [NSMutableArray arrayWithCapacity:3];
titles = [NSMutableArray arrayWithCapacity:3];
[titles addObject:@"Gent Jazz Festival"];
[titles addObject:@"Over blauw bloed en witte billenbijters - zoektocht in het Prinsenhof (zonder gids)"];
[titles addObject:@"DuveltTent"];
Event *event = [[Event alloc] init];
event.title = [titles objectAtIndex:(rand()*100)%3];
event.description = @"omminommie!!!";
event.zone = @"fzfzefez";
event.gemeente = @"Gent";
event.plaats = @"";
event.straat = @"Sint-Veerleplein";
NSString *adres = [NSString stringWithFormat:@"%@, %@", event.gemeente, event.straat];
[self addressLocation:adres:event]; //<---- This function fails, see above for def
event.zone = @"blub";
[events addObject:event];
...
| objective-c | ios | xcode | null | null | null | open | IPhone dev: CoreLocation object, can't assign langtitude
===
Oke so I'm building an app that works with mapkit and I need to get coordinates from googlemaps, I made a function that does this (and through debugging I know I get the good coordinates, but it then crashes when I try to assign it to my event object's coordinates, below is the code, I've clearly commented with // <---------------- where it fails..
AppDelegate.h
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>
#import "MapViewController.h"
#import "Event.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate, MKMapViewDelegate, CLLocationManagerDelegate>{
CLLocationManager *locationManager;
}
//-(void)makeTestData:(int)amount;
-(void) addressLocation:(NSString*)adres:(Event*)event;
@property (strong, nonatomic) UIWindow *window;
//@property (strong, nonatomic) NSMutableArray *events;
@end
AppDelegate.m
#import "AppDelegate.h"
#import "ListViewController.h"
#import "Event.h"
#import <RestKit/RestKit.h>
@implementation AppDelegate{
NSMutableArray *events;
/* for test data */
NSMutableArray *titles;
}
@synthesize window = _window;
//@synthesize events;
-(void) addressLocation:(NSString*)adres: (Event*)event {
NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv&key=MYKEY",
[adres stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSString *locationString = [NSString stringWithContentsOfURL:[NSURL URLWithString:urlString]];
NSArray *listItems = [locationString componentsSeparatedByString:@","];
double latitude = 0.0;
double longitude = 0.0;
if([listItems count] >= 4 && [[listItems objectAtIndex:0] isEqualToString:@"200"]) {
latitude = [[listItems objectAtIndex:2] doubleValue];
longitude = [[listItems objectAtIndex:3] doubleValue];
}
else {
//Show error
}
CLLocationCoordinate2D location;
location.latitude = latitude;
location.longitude = longitude; // <----- Checked in debugging, coords are good
event.coordinate.latitude = latitude; // <----- can't assign the latitude here =/
event.coordinate.longitude = longitude; // <----- can't assign the longitude here =/
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// START COMMUNICATOIN WITH REST INTERFACE
//RKClient* client = [RKClient clientWithBaseURL:@"link"];
//NSLog(@"I am your RKClient singleton : %@", [RKClient sharedClient]);
// -------------------TEST OBJECTS
//makeTestData(3);
events = [NSMutableArray arrayWithCapacity:3];
titles = [NSMutableArray arrayWithCapacity:3];
[titles addObject:@"Gent Jazz Festival"];
[titles addObject:@"Over blauw bloed en witte billenbijters - zoektocht in het Prinsenhof (zonder gids)"];
[titles addObject:@"DuveltTent"];
Event *event = [[Event alloc] init];
event.title = [titles objectAtIndex:(rand()*100)%3];
event.description = @"omminommie!!!";
event.zone = @"fzfzefez";
event.gemeente = @"Gent";
event.plaats = @"";
event.straat = @"Sint-Veerleplein";
NSString *adres = [NSString stringWithFormat:@"%@, %@", event.gemeente, event.straat];
[self addressLocation:adres:event]; //<---- This function fails, see above for def
event.zone = @"blub";
[events addObject:event];
...
| 0 |
11,472,273 | 07/13/2012 14:15:43 | 1,497,454 | 07/03/2012 00:59:43 | 4 | 0 | how to edit pixels and remove white background in a canvas image in html5 and javascript | If I load an image, how can I loop through all its pixels and turn the white ones (or which ever color I specify) to be turned transparent?
I have an idea on how to do this, but the looping process should be like a 2d array, so it would involve two for loops.
I was thinking I would start on the top row first pixel, iterating to the right, if its a white pixel, then i turn it transparent, and move 1 pixel to the right, if its not white, then I stop. Then in the same row, I start from the left most pixel, and check, if white, I turn it transparent, then move 1 pixel to the left, etc, etc...
Then I move 1 row down and repeat the whole process..
This way I don't remove any white pixels in the actual image. | javascript | html5 | canvas | pixel | white | null | open | how to edit pixels and remove white background in a canvas image in html5 and javascript
===
If I load an image, how can I loop through all its pixels and turn the white ones (or which ever color I specify) to be turned transparent?
I have an idea on how to do this, but the looping process should be like a 2d array, so it would involve two for loops.
I was thinking I would start on the top row first pixel, iterating to the right, if its a white pixel, then i turn it transparent, and move 1 pixel to the right, if its not white, then I stop. Then in the same row, I start from the left most pixel, and check, if white, I turn it transparent, then move 1 pixel to the left, etc, etc...
Then I move 1 row down and repeat the whole process..
This way I don't remove any white pixels in the actual image. | 0 |
11,471,165 | 07/13/2012 13:08:58 | 844,039 | 07/14/2011 07:24:36 | 134 | 5 | simple loading bar with asyn Task | I just want to do simple loading bar in asyn task that to do some work on background, the bar needs to be without %, just loading bar when its comes to 100 just go from 0 to 100 again until finish that task on the background.
I dont know how match it can take to do the background task.
If you can give me a simple code.
Thanks!
| android-asynctask | progress-bar | null | null | null | 07/13/2012 23:33:04 | not a real question | simple loading bar with asyn Task
===
I just want to do simple loading bar in asyn task that to do some work on background, the bar needs to be without %, just loading bar when its comes to 100 just go from 0 to 100 again until finish that task on the background.
I dont know how match it can take to do the background task.
If you can give me a simple code.
Thanks!
| 1 |
11,472,284 | 07/13/2012 14:16:12 | 706,031 | 04/13/2011 12:29:35 | 37 | 1 | How to set a "read-only checkbox" in PySide/PyQt | I am trying to display the value of a Boolean variable using a `QCheckBox` widget, and render the user unable to change the displayed value. I don't want to disable it, as the resulting graying doesn't look good. I have tried to approximate the effect by changing the new value back to its previous value when the user clicks the `QCheckBox`. However, the problem is compounded by the fact that the state of the widget is described by the "checked" properties of the `QAbstractButton` parent class, and the "state" properties of the `QCheckBox` class itself. This gives rise to a combinatorial exercise of signals and slots, of which I have been unable to obtain any good result.
var_ctrl = QtGui.QCheckBox( 'some name' )
def rdslot1(state):
if state == QtCore.Qt.Checked:
var_ctrl.setCheckState( QtCore.Qt.Unchecked )
else:
var_ctrl.setCheckState( QtCore.Qt.Checked )
def rdslot2(state):
if var_ctrl.isChecked():
var_ctrl.setChecked(False)
else:
var_ctrl.setChecked(True)
# Signal/Slot combinations (only one should be active)
var_ctrl.stateChanged.connect( rdslot1 )
var_ctrl.toggled.connect( rdslot2 )
var_ctrl.stateChanged.connect( rdslot2 )
var_ctrl.toggled.connect( rdslot1 ) | python | qt | pyqt | pyqt4 | pyside | null | open | How to set a "read-only checkbox" in PySide/PyQt
===
I am trying to display the value of a Boolean variable using a `QCheckBox` widget, and render the user unable to change the displayed value. I don't want to disable it, as the resulting graying doesn't look good. I have tried to approximate the effect by changing the new value back to its previous value when the user clicks the `QCheckBox`. However, the problem is compounded by the fact that the state of the widget is described by the "checked" properties of the `QAbstractButton` parent class, and the "state" properties of the `QCheckBox` class itself. This gives rise to a combinatorial exercise of signals and slots, of which I have been unable to obtain any good result.
var_ctrl = QtGui.QCheckBox( 'some name' )
def rdslot1(state):
if state == QtCore.Qt.Checked:
var_ctrl.setCheckState( QtCore.Qt.Unchecked )
else:
var_ctrl.setCheckState( QtCore.Qt.Checked )
def rdslot2(state):
if var_ctrl.isChecked():
var_ctrl.setChecked(False)
else:
var_ctrl.setChecked(True)
# Signal/Slot combinations (only one should be active)
var_ctrl.stateChanged.connect( rdslot1 )
var_ctrl.toggled.connect( rdslot2 )
var_ctrl.stateChanged.connect( rdslot2 )
var_ctrl.toggled.connect( rdslot1 ) | 0 |
11,542,113 | 07/18/2012 13:05:55 | 1,410,081 | 05/22/2012 11:27:53 | 24 | 3 | java asterisk right triangle | I'd like to try a right triangle asterisk. But I only got this
**output:**
*
**
***
what I want is this:
*
**
***
Here's the code that I programmed:
public class triangles {
public static void main( String[] args ) {
for( int i = 9; i >= 0; i-- ){
for( int j = 0; j < i; j++ ){
System.out.print("*");
}
System.out.println();
}
}
}
Any ideas to share are greatly appreciated. I'm a java newbie. thanks. | java | null | null | null | null | null | open | java asterisk right triangle
===
I'd like to try a right triangle asterisk. But I only got this
**output:**
*
**
***
what I want is this:
*
**
***
Here's the code that I programmed:
public class triangles {
public static void main( String[] args ) {
for( int i = 9; i >= 0; i-- ){
for( int j = 0; j < i; j++ ){
System.out.print("*");
}
System.out.println();
}
}
}
Any ideas to share are greatly appreciated. I'm a java newbie. thanks. | 0 |
11,542,114 | 07/18/2012 13:06:02 | 1,511,432 | 07/09/2012 08:37:56 | 1 | 0 | Element visibility inside tooltip | I've a tooltip which contains miscellaneous textblocks and I want to hide or display them dynamically. I've already done dynamic visibility with other tags outside tooltips and it worked perfectly (using an appropriate converter of course), but inside no one wants to work.
UserControl :
<ToolTip x:Key="directoriesTooltip">
...
<TextBlock Grid.Row="1" Text="{x:Static Internationalization:Resources.PROPERTY_NAME}" HorizontalAlignment="Left" FontWeight="Bold"
Visibility="{Binding Path=IsMyTooltipVariableVisible, Source=myUC, Converter={StaticResource booleanToVisibilityCollapsedConverter}}"/>
<TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Text="{Binding Nom}"
Visibility="{Binding Path=IsMyTooltipVariableVisible, Source=myUC, Converter={StaticResource booleanToVisibilityCollapsedConverter}}"/>
</Tooltip>
MainWindow :
<MyUserControl:myUC
IsMyTooltipVariableVisible="{Binding Application.IsMyTooltipVariableVisible, ElementName=Window}"
/>
| wpf | tooltip | null | null | null | null | open | Element visibility inside tooltip
===
I've a tooltip which contains miscellaneous textblocks and I want to hide or display them dynamically. I've already done dynamic visibility with other tags outside tooltips and it worked perfectly (using an appropriate converter of course), but inside no one wants to work.
UserControl :
<ToolTip x:Key="directoriesTooltip">
...
<TextBlock Grid.Row="1" Text="{x:Static Internationalization:Resources.PROPERTY_NAME}" HorizontalAlignment="Left" FontWeight="Bold"
Visibility="{Binding Path=IsMyTooltipVariableVisible, Source=myUC, Converter={StaticResource booleanToVisibilityCollapsedConverter}}"/>
<TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Text="{Binding Nom}"
Visibility="{Binding Path=IsMyTooltipVariableVisible, Source=myUC, Converter={StaticResource booleanToVisibilityCollapsedConverter}}"/>
</Tooltip>
MainWindow :
<MyUserControl:myUC
IsMyTooltipVariableVisible="{Binding Application.IsMyTooltipVariableVisible, ElementName=Window}"
/>
| 0 |
11,542,130 | 07/18/2012 13:06:34 | 1,531,142 | 07/17/2012 08:28:08 | 1 | 0 | mvc3 mixed with web form iis6 | ihave this path on my site:
d:\Sites\MySite\MyFolder\default.aspx
when browsing in webForms app to
"http://mySite/MyFolde"
the default.aspx automaticly being executed
but on my mvc3n(mixed with webForms) i get 404
any ideas? | c# | asp.net-mvc | null | null | null | 07/19/2012 13:35:41 | not a real question | mvc3 mixed with web form iis6
===
ihave this path on my site:
d:\Sites\MySite\MyFolder\default.aspx
when browsing in webForms app to
"http://mySite/MyFolde"
the default.aspx automaticly being executed
but on my mvc3n(mixed with webForms) i get 404
any ideas? | 1 |
11,542,047 | 07/18/2012 13:02:51 | 399,658 | 07/22/2010 21:31:48 | 440 | 8 | Making different groups/layers for with markers on Google Maps | I just started using the Google Maps API, but I am using it through a asp.net control http://googlemap.codeplex.com/
But I am a bit in doubt, is it possible for me create categories / layers (Some sort of collection) where I can put markers on, and then have a Checkbox for each category to show/hide it or should I do that in code behind | asp.net | google-maps | null | null | null | null | open | Making different groups/layers for with markers on Google Maps
===
I just started using the Google Maps API, but I am using it through a asp.net control http://googlemap.codeplex.com/
But I am a bit in doubt, is it possible for me create categories / layers (Some sort of collection) where I can put markers on, and then have a Checkbox for each category to show/hide it or should I do that in code behind | 0 |
11,542,048 | 07/18/2012 13:02:52 | 1,534,518 | 07/18/2012 10:57:15 | 1 | 0 | Native alarm clock notification on iOS | I'm currently deploying an app for iPhone and I was wondering if the app could receive a notification (while it is suspended in the background) when the alarm of the native clock rings so the app can be triggered to the foreground.
If this is not possible is there any way to retrieve information about the shceduled time and date of the native alarm clock.
I have been searching this on internet a lot but I couldn't find any answer on this question.
Your help is appreciated!
| ios | application | native | clock | alarm | null | open | Native alarm clock notification on iOS
===
I'm currently deploying an app for iPhone and I was wondering if the app could receive a notification (while it is suspended in the background) when the alarm of the native clock rings so the app can be triggered to the foreground.
If this is not possible is there any way to retrieve information about the shceduled time and date of the native alarm clock.
I have been searching this on internet a lot but I couldn't find any answer on this question.
Your help is appreciated!
| 0 |
11,542,165 | 07/18/2012 13:08:41 | 1,227,895 | 02/23/2012 09:05:04 | 655 | 33 | Are new Charts Service features added recently? | I mentioned that the GAS Chart Service contains a few methods which are not described in the [Documentation][1]. Does anyone know which purpose do they have? Where is possible to find documentation for them? The methods are
- `Charts.newDashboardPanel()`
- `Charts.newDataViewDefinition()`
- `Charts.newCategoryFilter()`
- `Charts.newNumberRangeFilter()`
- `Charts.newStringFilter()`
[1]: https://developers.google.com/apps-script/class_charts | google-apps-script | null | null | null | null | null | open | Are new Charts Service features added recently?
===
I mentioned that the GAS Chart Service contains a few methods which are not described in the [Documentation][1]. Does anyone know which purpose do they have? Where is possible to find documentation for them? The methods are
- `Charts.newDashboardPanel()`
- `Charts.newDataViewDefinition()`
- `Charts.newCategoryFilter()`
- `Charts.newNumberRangeFilter()`
- `Charts.newStringFilter()`
[1]: https://developers.google.com/apps-script/class_charts | 0 |
11,542,168 | 07/18/2012 13:08:52 | 1,531,782 | 07/17/2012 12:32:17 | 1 | 0 | How to auomate Image buttons using Pywinauto in python | I have window, In window contains to image buttons a and b, So how to automate using pywinauto | python | null | null | null | null | 07/19/2012 11:39:49 | not a real question | How to auomate Image buttons using Pywinauto in python
===
I have window, In window contains to image buttons a and b, So how to automate using pywinauto | 1 |
11,542,169 | 07/18/2012 13:09:01 | 1,349,435 | 04/22/2012 11:27:43 | 1 | 0 | Why I can't remove and draw the same java object? | I try to do homework, and I write breakout game. Now,I write the basic function of this game finish.but I want to increase Bonus When ball crash the bonusbricks,I write method to check them and get the color form object that ball crash.
`} else if(color == Color.BLACK){
double xBonus = ball.getX() +20;
double yBonus = ball.getY() +20;
remove(ball);
ball = new GOval(xBonus, yBonus, BALL_RADIUS+20, BALL_RADIUS+20);
ball.setFilled(true);
ball.setFillColor(Color.RED);
add(ball);`
`GObject collider = getCollidingObject();`
I use collider to detect the object that ball crash
but when the ball crash the bonus brick. The ball has increase size but collider is detect new ball object to be the bricks and bounce ball though game edge.
Please help me .. Sorry,for my wrong grammatically. | java | breakout | null | null | null | null | open | Why I can't remove and draw the same java object?
===
I try to do homework, and I write breakout game. Now,I write the basic function of this game finish.but I want to increase Bonus When ball crash the bonusbricks,I write method to check them and get the color form object that ball crash.
`} else if(color == Color.BLACK){
double xBonus = ball.getX() +20;
double yBonus = ball.getY() +20;
remove(ball);
ball = new GOval(xBonus, yBonus, BALL_RADIUS+20, BALL_RADIUS+20);
ball.setFilled(true);
ball.setFillColor(Color.RED);
add(ball);`
`GObject collider = getCollidingObject();`
I use collider to detect the object that ball crash
but when the ball crash the bonus brick. The ball has increase size but collider is detect new ball object to be the bricks and bounce ball though game edge.
Please help me .. Sorry,for my wrong grammatically. | 0 |
11,542,172 | 07/18/2012 13:09:06 | 340,457 | 05/13/2010 16:03:06 | 4,071 | 604 | php array function without a right operator assignment? | I saw this in a php script about reading a csv file:
array($mydata);
What does it make? An array from $mydata? | php | arrays | null | null | null | null | open | php array function without a right operator assignment?
===
I saw this in a php script about reading a csv file:
array($mydata);
What does it make? An array from $mydata? | 0 |
11,542,151 | 07/18/2012 13:07:40 | 1,363,730 | 04/29/2012 03:59:57 | 223 | 0 | How to center the view when I zoom it | When I touch a UIScrollView, I zoom the view to a large scale. But the view is not centered to the place where I have touched. I want to know how to make the view center when I touch it, can someone give me some example code.
Or if the scrollview have had the function? | iphone | ipad | uiscrollview | null | null | null | open | How to center the view when I zoom it
===
When I touch a UIScrollView, I zoom the view to a large scale. But the view is not centered to the place where I have touched. I want to know how to make the view center when I touch it, can someone give me some example code.
Or if the scrollview have had the function? | 0 |
11,542,152 | 07/18/2012 13:07:42 | 673,730 | 03/23/2011 19:21:18 | 51,705 | 2,084 | Code analysis tool for optimal member layout | As you know, re-arranging class members can increase or decrease the size of a class due to padding and alignment.
**Is there any tool that analyses a codebase and lets you know where sub-optimal member layout occurs?** For example, it should flag
struct X
{
char a;
int b;
char c;
};
//sizeof = 12
and possibly recommend:
struct X
{
int b;
char a;
char c;
};
//sizeof = 8
This is a narrowed-down example obviously, the task is much more complex when classes have other classes as members and so on, and manual analysis is a time-waster. I'd like to try existing solutions before trying my hand at writing the tool myself.
I know reordering is not always a good thing, but I'd like to analyse this on a case-by-case basis myself. | c++ | code-analysis | software-tools | null | null | null | open | Code analysis tool for optimal member layout
===
As you know, re-arranging class members can increase or decrease the size of a class due to padding and alignment.
**Is there any tool that analyses a codebase and lets you know where sub-optimal member layout occurs?** For example, it should flag
struct X
{
char a;
int b;
char c;
};
//sizeof = 12
and possibly recommend:
struct X
{
int b;
char a;
char c;
};
//sizeof = 8
This is a narrowed-down example obviously, the task is much more complex when classes have other classes as members and so on, and manual analysis is a time-waster. I'd like to try existing solutions before trying my hand at writing the tool myself.
I know reordering is not always a good thing, but I'd like to analyse this on a case-by-case basis myself. | 0 |
11,410,760 | 07/10/2012 09:54:00 | 1,453,253 | 06/13/2012 09:17:41 | 20 | 0 | let 2 classes work togheter with HAS_RELATION | Hello I made a Cookie class with a CookieStorage class etc.. and it seems they can not work togheter I don't know what I am doing wrong.
my setup is as followed: I've got a Cookie.php ( cookie class ), I've got a CookieStorage.php ( CookieStorage class ) and the idea behind it is to use it in this way:
$cookie = new Cookie();
// Set cookie name
$cookie->setName('Login');
// Set cookie value
$cookie->setValue("testing cookie value");
// Set cookie expiration time
$cookie->setTime("+1 years");
// Create the cookie
$cookieStorage = new CookieStorage();
$cookieStorage->set($cookie);
but i keep the following error when i try to use it:
Fatal error: Call to undefined method CookieStorage::getName() in /Applications/MAMP/htdocs/library/lib/CookieStorage.php on line 27
below you can find a link to both the classes:
<a href="http://pastebin.com/j4NyS5AD">CookieStorage Class</a>
and
<a href="http://pastebin.com/zih03Y4G">Cookie Class</a>
| cookies | null | null | null | null | null | open | let 2 classes work togheter with HAS_RELATION
===
Hello I made a Cookie class with a CookieStorage class etc.. and it seems they can not work togheter I don't know what I am doing wrong.
my setup is as followed: I've got a Cookie.php ( cookie class ), I've got a CookieStorage.php ( CookieStorage class ) and the idea behind it is to use it in this way:
$cookie = new Cookie();
// Set cookie name
$cookie->setName('Login');
// Set cookie value
$cookie->setValue("testing cookie value");
// Set cookie expiration time
$cookie->setTime("+1 years");
// Create the cookie
$cookieStorage = new CookieStorage();
$cookieStorage->set($cookie);
but i keep the following error when i try to use it:
Fatal error: Call to undefined method CookieStorage::getName() in /Applications/MAMP/htdocs/library/lib/CookieStorage.php on line 27
below you can find a link to both the classes:
<a href="http://pastebin.com/j4NyS5AD">CookieStorage Class</a>
and
<a href="http://pastebin.com/zih03Y4G">Cookie Class</a>
| 0 |
11,410,764 | 07/10/2012 09:54:06 | 124,319 | 06/17/2009 13:12:44 | 99 | 8 | How to produce a relationship matrix from a dataset? | I would like to use R to produce a relationship matrix from a list of known relations.
For example, with the following dataset :
John Green
Mary Blue
Mary Red
John Blue
I would like to have :
Green Blue Red
John 1 1 0
Mary 0 1 1
I didn't found how to do this.
Thanks in advance for any suggestion.
| r | null | null | null | null | null | open | How to produce a relationship matrix from a dataset?
===
I would like to use R to produce a relationship matrix from a list of known relations.
For example, with the following dataset :
John Green
Mary Blue
Mary Red
John Blue
I would like to have :
Green Blue Red
John 1 1 0
Mary 0 1 1
I didn't found how to do this.
Thanks in advance for any suggestion.
| 0 |
11,410,765 | 07/10/2012 09:54:09 | 1,420,108 | 05/27/2012 12:11:04 | 29 | 0 | Submit button without refresh | That is my jquery code:
$(function() {
$("#edit_union").click(function() {
var tuzove = $("#tuzove").val();
var description = $("#description").val();
var union_owner = $("#union_owner").val();
var union_name = $("#union_name").val();
var uid = $("#uid").val();
var dataString = 'tuzove='+ tuzove + '&description=' + description + '&union_owner=' + union_owner + '&union_name=' + union_name + '&uid=' + uid;
$.ajax({
type: "POST",
url: "ajax/admp_ajax.php",
data: dataString,
success: function() {
$(".adm_panel_serach_user").append("<br/><span style=' color: #0099ff; font-weight: bold;'>Success.</span>");
}
});
return false;
});
});
That is ajax/admp_ajax.php page:
include_once 'classes/admin_panel.php';
$admpanel = new adminPanal();
if ($_POST['tuzove'] && $_POST['description'] && $_POST['union_owner'] && $_POST['union_owner'] && $_POST['uid'])
$admpanel->editUnion($_POST['tuzove'], $_POST['description'], $_POST['union_owner'], $_POST['union_name'], $_POST['uid']);
That is editUnion function:
public function editUnion($tyzove, $description, $ownerName, $unionName, $unionId) {
mysql_query("UPDATE `union` SET tuzove = '" . $tyzove . "', description = '" . mysql_real_escape_string($description) . "', owner_id = '" . $this->getUserId($ownerName) . "' WHERE name = '" . $unionName . "'");
if ($ownerName == $ownerName)
mysql_query("UPDATE users SET union_rank = '0', union_id = '0' WHERE username = '" . $ownerName . "'");
mysql_query("UPDATE users SET union_rank = '1', union_id = '" . $unionId . "' WHERE username = '" . $ownerName . "'");
}
Problem is that, when I click edit_union button write Success, but don't update union :(. | php | jquery | ajax | null | null | null | open | Submit button without refresh
===
That is my jquery code:
$(function() {
$("#edit_union").click(function() {
var tuzove = $("#tuzove").val();
var description = $("#description").val();
var union_owner = $("#union_owner").val();
var union_name = $("#union_name").val();
var uid = $("#uid").val();
var dataString = 'tuzove='+ tuzove + '&description=' + description + '&union_owner=' + union_owner + '&union_name=' + union_name + '&uid=' + uid;
$.ajax({
type: "POST",
url: "ajax/admp_ajax.php",
data: dataString,
success: function() {
$(".adm_panel_serach_user").append("<br/><span style=' color: #0099ff; font-weight: bold;'>Success.</span>");
}
});
return false;
});
});
That is ajax/admp_ajax.php page:
include_once 'classes/admin_panel.php';
$admpanel = new adminPanal();
if ($_POST['tuzove'] && $_POST['description'] && $_POST['union_owner'] && $_POST['union_owner'] && $_POST['uid'])
$admpanel->editUnion($_POST['tuzove'], $_POST['description'], $_POST['union_owner'], $_POST['union_name'], $_POST['uid']);
That is editUnion function:
public function editUnion($tyzove, $description, $ownerName, $unionName, $unionId) {
mysql_query("UPDATE `union` SET tuzove = '" . $tyzove . "', description = '" . mysql_real_escape_string($description) . "', owner_id = '" . $this->getUserId($ownerName) . "' WHERE name = '" . $unionName . "'");
if ($ownerName == $ownerName)
mysql_query("UPDATE users SET union_rank = '0', union_id = '0' WHERE username = '" . $ownerName . "'");
mysql_query("UPDATE users SET union_rank = '1', union_id = '" . $unionId . "' WHERE username = '" . $ownerName . "'");
}
Problem is that, when I click edit_union button write Success, but don't update union :(. | 0 |
11,410,770 | 07/10/2012 09:54:27 | 1,514,323 | 07/10/2012 09:23:57 | 1 | 0 | java - load RSA public Key From File | I'm generated private key with:
openssl genrsa [-out file] –des3
After this I'm generated public key with:
openssl rsa –pubout -in private.key [-out file]
I'm want to sign some messages with my private key, and verify another messages with my public key.
public String sign(String message) throws SignatureException{
try {
Signature sign = Signature.getInstance(“SHA1withRSA”);
sign.initSign(privateKey);
sign.update(message.getBytes(“UTF-8”));
return new String(Base64.encodeBase64(sign.sign()),“UTF-8”);
} catch (Exception ex) {
throw new SignatureException(ex);
}
}
public boolean verify(String message, String signature) throws SignatureException{
try {
Signature sign = Signature.getInstance(“SHA1withRSA”);
sign.initVerify(publicKey);
sign.update(message.getBytes(“UTF-8”));
return sign.verify(Base64.decodeBase64(signature.getBytes(“UTF-8”)));
} catch (Exception ex) {
throw new SignatureException(ex);
}
}
I'm find solution to convert my private key to PKCS8 format and load. It's works with some code like:
public PrivateKey getPrivateKey(String filename) throws Exception {
File f = new File(filename);
FileInputStream fis = new FileInputStream(f);
DataInputStream dis = new DataInputStream(fis);
byte[] keyBytes = new byte[(int) f.length()];
dis.readFully(keyBytes);
dis.close();
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(keyBytes);
KeyFactory kf =
KeyFactory.getInstance("RSA");
return kf.generatePrivate(spec);
}
**And finally my question is: How to Load RSA Public Key From File?**
I'm think may be I need to convert my Public key file to x509 format, and use X509EncodedKeySpec. But how can I do this? | java | rsa | null | null | null | null | open | java - load RSA public Key From File
===
I'm generated private key with:
openssl genrsa [-out file] –des3
After this I'm generated public key with:
openssl rsa –pubout -in private.key [-out file]
I'm want to sign some messages with my private key, and verify another messages with my public key.
public String sign(String message) throws SignatureException{
try {
Signature sign = Signature.getInstance(“SHA1withRSA”);
sign.initSign(privateKey);
sign.update(message.getBytes(“UTF-8”));
return new String(Base64.encodeBase64(sign.sign()),“UTF-8”);
} catch (Exception ex) {
throw new SignatureException(ex);
}
}
public boolean verify(String message, String signature) throws SignatureException{
try {
Signature sign = Signature.getInstance(“SHA1withRSA”);
sign.initVerify(publicKey);
sign.update(message.getBytes(“UTF-8”));
return sign.verify(Base64.decodeBase64(signature.getBytes(“UTF-8”)));
} catch (Exception ex) {
throw new SignatureException(ex);
}
}
I'm find solution to convert my private key to PKCS8 format and load. It's works with some code like:
public PrivateKey getPrivateKey(String filename) throws Exception {
File f = new File(filename);
FileInputStream fis = new FileInputStream(f);
DataInputStream dis = new DataInputStream(fis);
byte[] keyBytes = new byte[(int) f.length()];
dis.readFully(keyBytes);
dis.close();
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(keyBytes);
KeyFactory kf =
KeyFactory.getInstance("RSA");
return kf.generatePrivate(spec);
}
**And finally my question is: How to Load RSA Public Key From File?**
I'm think may be I need to convert my Public key file to x509 format, and use X509EncodedKeySpec. But how can I do this? | 0 |
11,395,032 | 07/09/2012 12:29:56 | 418,084 | 08/12/2010 07:09:06 | 109 | 1 | Most performant way to display a downloaded image in a ListView? | I am currently using a custom adapter to display an ImageView and two TextViews per row in a ListView.
Within the overridden getView for the adapter, I have this code for the ImageView:
final ImageView img = (ImageView) view.findViewById(R.id.rowImg);
new Thread(new Runnable() {
public void run() {
final BitmapDrawable b = downloadAvatar(urlToDownload);
img.post(new Runnable() {
public void run() {
img.setImageDrawable(b);
}
});
}
}).start();
The downloadAvatar method basically just uses AndroidHttpClient and HttpGet. The above method works, but my question is how do I optimize it? Scrolling is choppy; I know it's probably calling getView() and downloading the image each and every time it enters the viewable area. Any tips? | java | android | performance | android-performance | null | null | open | Most performant way to display a downloaded image in a ListView?
===
I am currently using a custom adapter to display an ImageView and two TextViews per row in a ListView.
Within the overridden getView for the adapter, I have this code for the ImageView:
final ImageView img = (ImageView) view.findViewById(R.id.rowImg);
new Thread(new Runnable() {
public void run() {
final BitmapDrawable b = downloadAvatar(urlToDownload);
img.post(new Runnable() {
public void run() {
img.setImageDrawable(b);
}
});
}
}).start();
The downloadAvatar method basically just uses AndroidHttpClient and HttpGet. The above method works, but my question is how do I optimize it? Scrolling is choppy; I know it's probably calling getView() and downloading the image each and every time it enters the viewable area. Any tips? | 0 |
11,410,702 | 07/10/2012 09:50:48 | 692,377 | 04/05/2011 07:17:09 | 30 | 1 | How to get Site Map of ASP.NET page from where I am navigated to current page | I want Site Map of Web from where I am navigated to current page and want to add an extra node to it
e.g.
I was here
A > B > C > D > E (E has a link to Z)
now I am here
A > H > I > J > Z
On Page Z I want SiteMap of web from where i navigated which should be (A > B > C > D > E) so that I can make it look like this (A > B > C > D > E > I will add this node)
I am using ASP.NET in SharePoint 2007. | c# | asp.net | xml | usercontrols | sharepoint2007 | 07/11/2012 09:25:31 | off topic | How to get Site Map of ASP.NET page from where I am navigated to current page
===
I want Site Map of Web from where I am navigated to current page and want to add an extra node to it
e.g.
I was here
A > B > C > D > E (E has a link to Z)
now I am here
A > H > I > J > Z
On Page Z I want SiteMap of web from where i navigated which should be (A > B > C > D > E) so that I can make it look like this (A > B > C > D > E > I will add this node)
I am using ASP.NET in SharePoint 2007. | 2 |
11,410,783 | 07/10/2012 09:55:06 | 205,347 | 11/07/2009 00:15:25 | 157 | 13 | Why do I need a reinterpret_cast to convert Fred ** const to void ** const? | I have a const pointer to a pointer to a Fred and I don't understand why a static_cast isn't sufficient.
typedef struct {
int n;
} Fred;
Fred *pFred;
Fred **const ppFred = &Fred;
void **const ppVoid = static_cast<void ** const>(ppFred);
Please could someone explain why a reinterpret_cast is needed to convert a pointer to Fred* to a pointer to void* but static_cast is fine to convert pointer to Fred to a pointer to void.
| c++ | void-pointers | reinterpret-cast | static-cast | null | null | open | Why do I need a reinterpret_cast to convert Fred ** const to void ** const?
===
I have a const pointer to a pointer to a Fred and I don't understand why a static_cast isn't sufficient.
typedef struct {
int n;
} Fred;
Fred *pFred;
Fred **const ppFred = &Fred;
void **const ppVoid = static_cast<void ** const>(ppFred);
Please could someone explain why a reinterpret_cast is needed to convert a pointer to Fred* to a pointer to void* but static_cast is fine to convert pointer to Fred to a pointer to void.
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.