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,298,358
07/02/2012 17:28:44
1,315,692
04/05/2012 15:30:57
29
1
Method...Must Override a Superclass Method (Latest SDK)
I recently installed the latest Android SDK in a new eclipse set up on a new machine. When I brought over an old project in several places I got a syntax error concerning @Override stating "method suchandsuch of type suchandsuch must override a superclass method". These items were fixed by removing @Override (which I don't think is correct). I just made my first new project with my new setup and the initial untouched code is giving this error which has me confused. package com.geeksonhugs.whenimclose; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.view.MenuItem; public class ItemListActivity extends FragmentActivity implements ItemListFragment.Callbacks { private boolean mTwoPane; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_list); if (findViewById(R.id.item_detail_container) != null) { mTwoPane = true; ((ItemListFragment) getSupportFragmentManager() .findFragmentById(R.id.item_list)) .setActivateOnItemClick(true); } } @Override public void onItemSelected(String id) { if (mTwoPane) { Bundle arguments = new Bundle(); arguments.putString(ItemDetailFragment.ARG_ITEM_ID, id); ItemDetailFragment fragment = new ItemDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction() .replace(R.id.item_detail_container, fragment) .commit(); } else { Intent detailIntent = new Intent(this, ItemDetailActivity.class); detailIntent.putExtra(ItemDetailFragment.ARG_ITEM_ID, id); startActivity(detailIntent); } } } The compiler accepts @Override before onCreate but gives the error with onItemSelected. Can someone please clarify what is going on for me please? Again this syntax error does not occur in prior versions?
java
android
null
null
null
null
open
Method...Must Override a Superclass Method (Latest SDK) === I recently installed the latest Android SDK in a new eclipse set up on a new machine. When I brought over an old project in several places I got a syntax error concerning @Override stating "method suchandsuch of type suchandsuch must override a superclass method". These items were fixed by removing @Override (which I don't think is correct). I just made my first new project with my new setup and the initial untouched code is giving this error which has me confused. package com.geeksonhugs.whenimclose; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.view.MenuItem; public class ItemListActivity extends FragmentActivity implements ItemListFragment.Callbacks { private boolean mTwoPane; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_list); if (findViewById(R.id.item_detail_container) != null) { mTwoPane = true; ((ItemListFragment) getSupportFragmentManager() .findFragmentById(R.id.item_list)) .setActivateOnItemClick(true); } } @Override public void onItemSelected(String id) { if (mTwoPane) { Bundle arguments = new Bundle(); arguments.putString(ItemDetailFragment.ARG_ITEM_ID, id); ItemDetailFragment fragment = new ItemDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction() .replace(R.id.item_detail_container, fragment) .commit(); } else { Intent detailIntent = new Intent(this, ItemDetailActivity.class); detailIntent.putExtra(ItemDetailFragment.ARG_ITEM_ID, id); startActivity(detailIntent); } } } The compiler accepts @Override before onCreate but gives the error with onItemSelected. Can someone please clarify what is going on for me please? Again this syntax error does not occur in prior versions?
0
11,298,365
07/02/2012 17:28:56
1,486,782
06/27/2012 19:49:47
1
0
BASH: If statement needed to run if number of files in directory is 2 or greater
I have the following BASH script: http://pastebin.com/CX4RN1QW There are two sections within the script that I want to run only if the number of files in the directory are 2 or greater. They are marked by "## Begin file test here" and "## End file test." I am very sensitive about the script, I don't want anything else to change, even if it simplifies it. I have tried: if [ "$(ls -b | wc -l)" -gt 1 ]; But that didn't work.
linux
bash
if-statement
count
directory
null
open
BASH: If statement needed to run if number of files in directory is 2 or greater === I have the following BASH script: http://pastebin.com/CX4RN1QW There are two sections within the script that I want to run only if the number of files in the directory are 2 or greater. They are marked by "## Begin file test here" and "## End file test." I am very sensitive about the script, I don't want anything else to change, even if it simplifies it. I have tried: if [ "$(ls -b | wc -l)" -gt 1 ]; But that didn't work.
0
11,298,368
07/02/2012 17:29:14
1,124,541
12/31/2011 17:33:16
4
0
Pyserial not working after install on python3
This is the error that I get after typing import serial. I'm running osx snow leopard, python3.2 and there were no errors when I installed pyserial. import serial Traceback (most recent call last): File "<stdin>", line 1, in <module> File "serial/__init__.py", line 21, in <module> from serial.serialposix import * File "serial/serialposix.py", line 64 50: 0000001, ^
python
null
null
null
null
null
open
Pyserial not working after install on python3 === This is the error that I get after typing import serial. I'm running osx snow leopard, python3.2 and there were no errors when I installed pyserial. import serial Traceback (most recent call last): File "<stdin>", line 1, in <module> File "serial/__init__.py", line 21, in <module> from serial.serialposix import * File "serial/serialposix.py", line 64 50: 0000001, ^
0
11,298,370
07/02/2012 17:29:38
1,444,246
06/08/2012 09:54:55
49
3
Run Command to open NotePad ++
By any chance, Is there any RUN command to open Notepad++ ??? If yes Please do let me know for the gods sake. Thanks in advance.
notepad++
null
null
null
null
07/02/2012 17:48:16
off topic
Run Command to open NotePad ++ === By any chance, Is there any RUN command to open Notepad++ ??? If yes Please do let me know for the gods sake. Thanks in advance.
2
11,298,372
07/02/2012 17:29:57
1,454,428
06/13/2012 18:06:45
3
0
Postgres Stored Procedure issue - how do I solve this?
I am creating a stored procedure that looks like this: CREATE FUNCTION get_components(_given_user_id integer) RETURNS TABLE (id integer, name varchar, active boolean, parent integer, type smallint, description varchar, email varchar, user_id integer, component_id integer, flag smallint) AS $body$ BEGIN RETURN QUERY SELECT s.* FROM st_components s LEFT JOIN (SELECT a.* FROM st_users_components_perms a WHERE a.user_id=_given_user_id) ON a.component_id=s.id ORDER BY name; END; $body$ LANGUAGE plpgsql; The problem is, ON a.component_id=s.id ORDER BY name doesn't work because a.component_id is out of scope at this point. Is there a way to declare "a" as st_users_components_perms outside of the query? How is this solved? Thank you very much for any insight!
postgresql
stored-procedures
null
null
null
null
open
Postgres Stored Procedure issue - how do I solve this? === I am creating a stored procedure that looks like this: CREATE FUNCTION get_components(_given_user_id integer) RETURNS TABLE (id integer, name varchar, active boolean, parent integer, type smallint, description varchar, email varchar, user_id integer, component_id integer, flag smallint) AS $body$ BEGIN RETURN QUERY SELECT s.* FROM st_components s LEFT JOIN (SELECT a.* FROM st_users_components_perms a WHERE a.user_id=_given_user_id) ON a.component_id=s.id ORDER BY name; END; $body$ LANGUAGE plpgsql; The problem is, ON a.component_id=s.id ORDER BY name doesn't work because a.component_id is out of scope at this point. Is there a way to declare "a" as st_users_components_perms outside of the query? How is this solved? Thank you very much for any insight!
0
11,298,373
07/02/2012 17:30:00
560,204
12/29/2010 15:07:45
949
6
Android: Publish app without verifying bank account
I recently set up a merchant account for getting revenues from a paid app I developed. However, I got the message below. > Recently, you specified a new bank account to receive your payouts. > However, before you can be eligible to receive any payouts, you must > verify your bank account information. Now the verification process takes a long time because Google first deposits an amount into the specified account, etc. My question is- can I release my paid app, without verifying the bank account, or should I wait? I cannot find the answer to this question anywhere online, and what better place than SO. Thanks!
android
null
null
null
null
null
open
Android: Publish app without verifying bank account === I recently set up a merchant account for getting revenues from a paid app I developed. However, I got the message below. > Recently, you specified a new bank account to receive your payouts. > However, before you can be eligible to receive any payouts, you must > verify your bank account information. Now the verification process takes a long time because Google first deposits an amount into the specified account, etc. My question is- can I release my paid app, without verifying the bank account, or should I wait? I cannot find the answer to this question anywhere online, and what better place than SO. Thanks!
0
11,298,380
07/02/2012 17:30:25
1,496,691
07/02/2012 17:08:33
1
0
read pdf document headings using c#?
Hi I want to read the headings list of a PDF using c# I searched so may forums but did not get the answer which is providing a free api to do this task. please provide a sample code to accomplish this task. Thanks in advance
c#
pdf
using
headings
null
null
open
read pdf document headings using c#? === Hi I want to read the headings list of a PDF using c# I searched so may forums but did not get the answer which is providing a free api to do this task. please provide a sample code to accomplish this task. Thanks in advance
0
11,349,630
07/05/2012 17:40:29
1,348,768
04/21/2012 20:17:04
1
1
Can't find Support Package in Android SDK Manager
I want to install support Compability Package but my SDK Manager doesn't see it. What should i fix? Here is my screen: [http://imageshack.us/photo/my-images/20/clipboard01sj.jpg/][1] But it should be like this: [http://imageshack.us/photo/my-images/209/clipboard02wm.jpg/][2] [1]: http://imageshack.us/photo/my-images/20/clipboard01sj.jpg [2]: http://imageshack.us/photo/my-images/209/clipboard02wm.jpg/
android
sdk
package
support
null
null
open
Can't find Support Package in Android SDK Manager === I want to install support Compability Package but my SDK Manager doesn't see it. What should i fix? Here is my screen: [http://imageshack.us/photo/my-images/20/clipboard01sj.jpg/][1] But it should be like this: [http://imageshack.us/photo/my-images/209/clipboard02wm.jpg/][2] [1]: http://imageshack.us/photo/my-images/20/clipboard01sj.jpg [2]: http://imageshack.us/photo/my-images/209/clipboard02wm.jpg/
0
11,349,631
07/05/2012 17:40:31
1,504,729
07/05/2012 17:09:32
1
0
CakePHP: how do I order a model from the values in another?
This is the scenario: I have a `Posts` Model and each post has a `Meta` attached though `$hasOne`. The meta model contains a view counter, a download counter, etc. This is done this way to avoid updating the Post every time a user visits a post, and because I'll have another index where the most recently modified posts will reside, so changing a Post on every visit defeats the purpose of the "recently modified" index so the `views` and `downloads` are saved in Meta. __How can I order the Posts index view with pagination using the data from the Meta model like downloads so the Posts are sorted by downloads?__ I hope that's clear enough, if you need more data please leave a comment below.
cakephp
model
pagination
associations
null
null
open
CakePHP: how do I order a model from the values in another? === This is the scenario: I have a `Posts` Model and each post has a `Meta` attached though `$hasOne`. The meta model contains a view counter, a download counter, etc. This is done this way to avoid updating the Post every time a user visits a post, and because I'll have another index where the most recently modified posts will reside, so changing a Post on every visit defeats the purpose of the "recently modified" index so the `views` and `downloads` are saved in Meta. __How can I order the Posts index view with pagination using the data from the Meta model like downloads so the Posts are sorted by downloads?__ I hope that's clear enough, if you need more data please leave a comment below.
0
11,349,542
07/05/2012 17:34:53
1,504,759
07/05/2012 17:29:08
1
0
handle barcode scanenr value via android device
i'm trying to handle value from a barcode scanner usb via my android 3.2 tablet ,the scanner is succefuly working in the OS but i want to get the value in the programme without a edittext,usbmanager host and accessory did not list it with the connected devices via USB.thx!
android
null
null
null
null
null
open
handle barcode scanenr value via android device === i'm trying to handle value from a barcode scanner usb via my android 3.2 tablet ,the scanner is succefuly working in the OS but i want to get the value in the programme without a edittext,usbmanager host and accessory did not list it with the connected devices via USB.thx!
0
11,349,634
07/05/2012 17:40:45
478,102
10/16/2010 18:59:15
19
0
Trying to get MySQL-python working for django using apache/FastCGI with no root access
My overall goal is to get django running on a server for which I don't have root access. I have convinced the admin to install mod_fcgid on the main apache server, but that is basically all I can do from the root side. After a lot of struggling, my current setup is to create a virtualenv, install django, flup and MySQLdb-python in the virtualenv and make a "mysite.fcgi" script in a web accessible directory for which the .htaccess file uses fastcgid for .fcgi files. This all works and when I use a browser to load mysite.fcgi, then my django project is successfully reached - I know this because I get a django error page (instead of the countless "premature end of script headers" 500 pages I was getting while trying to figure out all the paths). So, the django error page I am getting says: ImproperlyConfigured at / Error loading MySQLdb module: libmysqlclient.so.18: cannot open shared object file: No such file or directory However, I know that everything basically works, since I can do "python manage.py runserver" as long as I add this line to my bash shell before running: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/alternate_versions/mysql-5.5.11/lib Thus, I tried adding this to my .htaccess file: SetEnv LD_LIBRARY_PATH /opt/alternate_versions/mysql-5.5.11/lib But, that does not affect my django error message (other than showing the correctly set environment variable in the bottom of the django debug screen). I don't know why this doesn't work. This leads me back to the MySQLdb-python package. I built that by downloading the source and running "python setup.py build" and "python setup.py install" from within my virtualenv. However, **THIS IS MAYBE THE KEY PROBLEM**: *I need to use a mysql installation which is not the system default!* So, in the site.cfg file for MySQLdb-python I had to specify the mysql_config variable to point at the alternate mysql installation: mysql_config = /opt/alternate_versions/mysql-5.5.11-src/scripts/mysql_config When I run mysql_config using the --libs option, it is (correctly?) pointing to the directory in which the libmysqlclient.so.18 file lives: -L/var/alternate_versions/mysql-5.5.11/lib -lmysqlclient -lpthread -lz -lm -lrt -ldl Ideas for moving forward: Is there an alternate way to build the MySQLdb libraries? I tried the various options in the site.cfg file (static=True, embedded=True), but this doesn't work either. I didn't try all combinations of those options, since I don't really know what they are doing. Can I manually add the path to the MySQLdb library? I think it is in an egg file, which I have no idea how to modify. If MySQLdb was installed as root, would that make a difference? I want to be confident in this option before asking the admin to try it. We still have the problem of needing the alternate mysql installation. Is there a different way to specify the LD_LIBRARY_PATH for apache? Thanks for any suggestions.
django
apache
virtualenv
fastcgi
null
null
open
Trying to get MySQL-python working for django using apache/FastCGI with no root access === My overall goal is to get django running on a server for which I don't have root access. I have convinced the admin to install mod_fcgid on the main apache server, but that is basically all I can do from the root side. After a lot of struggling, my current setup is to create a virtualenv, install django, flup and MySQLdb-python in the virtualenv and make a "mysite.fcgi" script in a web accessible directory for which the .htaccess file uses fastcgid for .fcgi files. This all works and when I use a browser to load mysite.fcgi, then my django project is successfully reached - I know this because I get a django error page (instead of the countless "premature end of script headers" 500 pages I was getting while trying to figure out all the paths). So, the django error page I am getting says: ImproperlyConfigured at / Error loading MySQLdb module: libmysqlclient.so.18: cannot open shared object file: No such file or directory However, I know that everything basically works, since I can do "python manage.py runserver" as long as I add this line to my bash shell before running: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/alternate_versions/mysql-5.5.11/lib Thus, I tried adding this to my .htaccess file: SetEnv LD_LIBRARY_PATH /opt/alternate_versions/mysql-5.5.11/lib But, that does not affect my django error message (other than showing the correctly set environment variable in the bottom of the django debug screen). I don't know why this doesn't work. This leads me back to the MySQLdb-python package. I built that by downloading the source and running "python setup.py build" and "python setup.py install" from within my virtualenv. However, **THIS IS MAYBE THE KEY PROBLEM**: *I need to use a mysql installation which is not the system default!* So, in the site.cfg file for MySQLdb-python I had to specify the mysql_config variable to point at the alternate mysql installation: mysql_config = /opt/alternate_versions/mysql-5.5.11-src/scripts/mysql_config When I run mysql_config using the --libs option, it is (correctly?) pointing to the directory in which the libmysqlclient.so.18 file lives: -L/var/alternate_versions/mysql-5.5.11/lib -lmysqlclient -lpthread -lz -lm -lrt -ldl Ideas for moving forward: Is there an alternate way to build the MySQLdb libraries? I tried the various options in the site.cfg file (static=True, embedded=True), but this doesn't work either. I didn't try all combinations of those options, since I don't really know what they are doing. Can I manually add the path to the MySQLdb library? I think it is in an egg file, which I have no idea how to modify. If MySQLdb was installed as root, would that make a difference? I want to be confident in this option before asking the admin to try it. We still have the problem of needing the alternate mysql installation. Is there a different way to specify the LD_LIBRARY_PATH for apache? Thanks for any suggestions.
0
11,349,638
07/05/2012 17:41:22
1,504,579
07/05/2012 16:07:04
1
0
Ordering two histograms in the same plot with ggplot
I have a problem that I have not been able to find a solution for. I have a data frame with different adjectives that are found in two different grammatical patterns. ID PATTERN NODE AMS_1554_01 THAT_EXT clear A30_671_03 THAT_POST clear I want to plot the adjectives of these two patterns in decreasing frequency using two histograms in the same plot. The problem is that there is some overlap between the two (i.e. some adjectives are found in both patterns) but I just want each histogram to start with the most frequent adjective. Here is the code that I have been using for the sorting when producing individual histograms: THAT_EXT_COMBINED <- within(THAT_EXT_COMBINED, NODE <- factor(NODE, levels=names(sort(table(NODE), decreasing=TRUE)))) I understand why this doesn't work since it combines the frequency of the two patterns but I still don't know how to solve it. I've been trying reorder() without any luck. Any ideas? Here is the code I'm using for the plot: graph<-ggplot(THAT_EXT_COMBINED, aes(x=NODE, fill=PATTERN)) + geom_histogram(binwidth=.5, position="dodge") graph + opts(axis.text.x = theme_blank()) + #removes text labels on x-axis scale_y_continuous("Frequency") + scale_x_discrete("Adjectives",breaks=NULL)+ opts(title = expression("Distribution of Adjectives")) The problem with the resulting plot(I was not allowed to include a picture since I am a new user) is that the adjectives are not strictly ordered by their respective frequency in the two patterns. Can anyone help with this?
r
ggplot2
null
null
null
null
open
Ordering two histograms in the same plot with ggplot === I have a problem that I have not been able to find a solution for. I have a data frame with different adjectives that are found in two different grammatical patterns. ID PATTERN NODE AMS_1554_01 THAT_EXT clear A30_671_03 THAT_POST clear I want to plot the adjectives of these two patterns in decreasing frequency using two histograms in the same plot. The problem is that there is some overlap between the two (i.e. some adjectives are found in both patterns) but I just want each histogram to start with the most frequent adjective. Here is the code that I have been using for the sorting when producing individual histograms: THAT_EXT_COMBINED <- within(THAT_EXT_COMBINED, NODE <- factor(NODE, levels=names(sort(table(NODE), decreasing=TRUE)))) I understand why this doesn't work since it combines the frequency of the two patterns but I still don't know how to solve it. I've been trying reorder() without any luck. Any ideas? Here is the code I'm using for the plot: graph<-ggplot(THAT_EXT_COMBINED, aes(x=NODE, fill=PATTERN)) + geom_histogram(binwidth=.5, position="dodge") graph + opts(axis.text.x = theme_blank()) + #removes text labels on x-axis scale_y_continuous("Frequency") + scale_x_discrete("Adjectives",breaks=NULL)+ opts(title = expression("Distribution of Adjectives")) The problem with the resulting plot(I was not allowed to include a picture since I am a new user) is that the adjectives are not strictly ordered by their respective frequency in the two patterns. Can anyone help with this?
0
11,349,134
07/05/2012 17:06:16
1,109,519
12/21/2011 09:19:51
201
4
Stateless ejb not getting destroyed
I have a REST interface for development purposes which sports a stateless EJB. It in turn injects another stateless EJB. It was my understanding that a stateless EJB is destroyed instead of passivated and reconstructed every time an instance is needed. Using this logic I added a @PostConstruct (to both the REST and the other stateless ejb) but both are only called once (deduced from logging). Repeated calls to the REST layer will reuse the same bean (and its state!) instead of creating a new one. What are the possible reasons that the stateless beans are not getting destroyed? Or have I misinterpreted the lifecycle of a stateless ejb?
java
java-ee
null
null
null
null
open
Stateless ejb not getting destroyed === I have a REST interface for development purposes which sports a stateless EJB. It in turn injects another stateless EJB. It was my understanding that a stateless EJB is destroyed instead of passivated and reconstructed every time an instance is needed. Using this logic I added a @PostConstruct (to both the REST and the other stateless ejb) but both are only called once (deduced from logging). Repeated calls to the REST layer will reuse the same bean (and its state!) instead of creating a new one. What are the possible reasons that the stateless beans are not getting destroyed? Or have I misinterpreted the lifecycle of a stateless ejb?
0
11,349,135
07/05/2012 17:06:19
83,181
03/26/2009 15:24:53
775
8
.Net event action with interface
I have the following code where the action parameters are all interfaces. I am wondering if it is possible to do what i have in code 2, basically i would like my concrete implementation of IConsumer to use a concrete implementation of IDetal<T> in the OnDetailRecevied action parameter instead of an interface. What i was trying to achieve is to have the user of CustomConsumer to not case the IDetail<T> but can use ConcreteIDetail<T> directly thanks public interface IConsumer<T> : IDisposable { /// <summary> /// When a message arrives on the queue. /// </summary> event Action<IConsumer<T>, IDetail<T>> OnDetailReceiver; } public class CustomConsumer<T> : IConsumer<T> { public event Action<IConsumer<T>, IDetail<T>> OnDetailReceived; } **(code2)** public class CustomConsumer<T> : IConsumer<T> { public event Action<IConsumer<T>, ConcreteIDetail<T>> OnDetailReceived; } public class ConcreteIDetail<T> : IDetail<T> { // some code here }
events
delegates
action
null
null
null
open
.Net event action with interface === I have the following code where the action parameters are all interfaces. I am wondering if it is possible to do what i have in code 2, basically i would like my concrete implementation of IConsumer to use a concrete implementation of IDetal<T> in the OnDetailRecevied action parameter instead of an interface. What i was trying to achieve is to have the user of CustomConsumer to not case the IDetail<T> but can use ConcreteIDetail<T> directly thanks public interface IConsumer<T> : IDisposable { /// <summary> /// When a message arrives on the queue. /// </summary> event Action<IConsumer<T>, IDetail<T>> OnDetailReceiver; } public class CustomConsumer<T> : IConsumer<T> { public event Action<IConsumer<T>, IDetail<T>> OnDetailReceived; } **(code2)** public class CustomConsumer<T> : IConsumer<T> { public event Action<IConsumer<T>, ConcreteIDetail<T>> OnDetailReceived; } public class ConcreteIDetail<T> : IDetail<T> { // some code here }
0
11,349,204
07/05/2012 17:10:26
1,460,773
06/16/2012 14:47:58
3
0
Android SimpleCursorAdapter getView how to put previous value back
I have a simple Listactivity that uses the simplecursoradapter. I allow users to change one of the values using an edittext. I perform simple validation to make sure that the number entered is less than 100. If the user entered value fails validation, I want to put the old value back. I've tried a few different ways. My current approach is to requery it out of the database, but this isn't working. I'm always getting the value associated with the last entry in the listactivity, regardless of which one was actually changed. I noticed in LogCat that onTextChanged and afterTextChanged are firing multiple times for each row in the listactivity and not just the one that changed. Here's the code: public class MySimpleCursorAdapter extends SimpleCursorAdapter { Context lcontext; boolean changed; String lastval; private PortfolioData pfdata; public MySimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) { super(context, layout, c, from, to); lcontext = context; } @Override public View getView(final int pos, View v, ViewGroup parent) { v = super.getView(pos, v, parent); final EditText et = (EditText) v.findViewById(R.id.classpercentage); final TextView tv = (TextView) v.findViewById(R.id._id); et.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Editable s) { Log.d("TEST", "In afterTextChanged s=" + s.toString() + " " + tv.getText() + " POS = " + Integer.toString(pos)); lastval = tv.getText().toString(); if (changed == true) { String enteredValue = s.toString(); if (checkNullValues(enteredValue)) { if (Float.parseFloat(enteredValue.trim()) > 100.0f) { AlertDialog.Builder builder = new AlertDialog.Builder( lcontext); builder.setMessage("Percentage Value should be Less than 100"); builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick( DialogInterface arg0, int arg1) { String sql = "select c.percentage as PERCENTAGE " + "from asset_classes c WHERE c._id = " + lastval + ";"; pfdata = new PortfolioData(lcontext); SQLiteDatabase db = pfdata.getReadableDatabase(); Cursor cursor = db.rawQuery(sql, null); if (cursor != null) { cursor.moveToFirst(); et.setText(cursor.getString(0)); } cursor.close(); pfdata.close(); } }); // End of the Alert if (changed == true) { builder.show(); } } } changed = false; } } public void beforeTextChanged(CharSequence s, int start, int count, int after) { // Log.d("TEST", "In beforeTextChanged start=" + // Integer.toString(start) +" count="+ Integer.toString(count) + // " after=" + Integer.toString(after) + " s=" + s + " " + tv); } public void onTextChanged(CharSequence s, int start, int before, int count) { Log.d("TEST", "In onTextChanged start=" + Integer.toString(start) + " count=" + Integer.toString(count) + " before=" + Integer.toString(before) + " s=" + s + " " + tv); changed = true; } }); return v; } I would really appreciate a fresh perspective on this. As always, thanks in advance.
android
listactivity
simplecursoradapter
null
null
null
open
Android SimpleCursorAdapter getView how to put previous value back === I have a simple Listactivity that uses the simplecursoradapter. I allow users to change one of the values using an edittext. I perform simple validation to make sure that the number entered is less than 100. If the user entered value fails validation, I want to put the old value back. I've tried a few different ways. My current approach is to requery it out of the database, but this isn't working. I'm always getting the value associated with the last entry in the listactivity, regardless of which one was actually changed. I noticed in LogCat that onTextChanged and afterTextChanged are firing multiple times for each row in the listactivity and not just the one that changed. Here's the code: public class MySimpleCursorAdapter extends SimpleCursorAdapter { Context lcontext; boolean changed; String lastval; private PortfolioData pfdata; public MySimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) { super(context, layout, c, from, to); lcontext = context; } @Override public View getView(final int pos, View v, ViewGroup parent) { v = super.getView(pos, v, parent); final EditText et = (EditText) v.findViewById(R.id.classpercentage); final TextView tv = (TextView) v.findViewById(R.id._id); et.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Editable s) { Log.d("TEST", "In afterTextChanged s=" + s.toString() + " " + tv.getText() + " POS = " + Integer.toString(pos)); lastval = tv.getText().toString(); if (changed == true) { String enteredValue = s.toString(); if (checkNullValues(enteredValue)) { if (Float.parseFloat(enteredValue.trim()) > 100.0f) { AlertDialog.Builder builder = new AlertDialog.Builder( lcontext); builder.setMessage("Percentage Value should be Less than 100"); builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick( DialogInterface arg0, int arg1) { String sql = "select c.percentage as PERCENTAGE " + "from asset_classes c WHERE c._id = " + lastval + ";"; pfdata = new PortfolioData(lcontext); SQLiteDatabase db = pfdata.getReadableDatabase(); Cursor cursor = db.rawQuery(sql, null); if (cursor != null) { cursor.moveToFirst(); et.setText(cursor.getString(0)); } cursor.close(); pfdata.close(); } }); // End of the Alert if (changed == true) { builder.show(); } } } changed = false; } } public void beforeTextChanged(CharSequence s, int start, int count, int after) { // Log.d("TEST", "In beforeTextChanged start=" + // Integer.toString(start) +" count="+ Integer.toString(count) + // " after=" + Integer.toString(after) + " s=" + s + " " + tv); } public void onTextChanged(CharSequence s, int start, int before, int count) { Log.d("TEST", "In onTextChanged start=" + Integer.toString(start) + " count=" + Integer.toString(count) + " before=" + Integer.toString(before) + " s=" + s + " " + tv); changed = true; } }); return v; } I would really appreciate a fresh perspective on this. As always, thanks in advance.
0
11,349,205
07/05/2012 17:10:29
1,113,216
12/23/2011 10:10:28
258
0
jqueryUi autocomplete - custom data and display
I am looking to this example [jqueryUi autocomplete - custom data and display](http://jqueryui.com/demos/autocomplete/custom-data.html). Let's suppose the object projects is different and it looks like this: project = [ { name: 'bar', value: 'foo', imgage: 'img.png' } ] If I set `source = project` the autocomplete refers to `project.value` and not `project.name`. How should I change this behaviour?
javascript
jquery
jquery-ui
null
null
null
open
jqueryUi autocomplete - custom data and display === I am looking to this example [jqueryUi autocomplete - custom data and display](http://jqueryui.com/demos/autocomplete/custom-data.html). Let's suppose the object projects is different and it looks like this: project = [ { name: 'bar', value: 'foo', imgage: 'img.png' } ] If I set `source = project` the autocomplete refers to `project.value` and not `project.name`. How should I change this behaviour?
0
11,541,592
07/18/2012 12:38:47
1,480,179
06/25/2012 13:49:49
11
0
images in scrollview are not always displayed
in my application i load images from an album as assets and display them to a uiscrollview . I load the images to the viewdidload method using blocks and in the view did appear method i put them into a scrollview and display them . Everything was working fine , but yesterday suddenly i got a weird behavior of the scrollview . The most of the times it is not displayed . When i stop and run again , it is displayed but not always. Sometimes i have to stop and run the application many times to see it. I suppose it is because i put the following code inside the viewdidappear method . In the viewdidload i load the assets using blocks . If i put them both at the viewdidload the assets are 0. I must put them in different methods. I would appreciate any help. Thank you in advance. allImages=[[NSMutableArray alloc] init]; int iAsset; for (iAsset=0; iAsset<[assets count]; iAsset++) { ALAsset *lastPicture = [assets objectAtIndex:iAsset]; UIImage *image=[UIImage imageWithCGImage:[[lastPicture defaultRepresentation]fullScreenImage]]; [allImages addObject:image]; } CGRect fullScreenRect=[[UIScreen mainScreen] applicationFrame]; CGFloat pageWidth = scroll.frame.size.width; int page = floor((scroll.contentOffset.x - pageWidth / 2) / pageWidth) + 1; pageNumber=[NSNumber numberWithInt:page]; scroll.pagingEnabled=YES; scroll.scrollEnabled = YES; scroll.clipsToBounds = YES; NSInteger numberOfViews = [allImages count]; for (int i = 0; i < numberOfViews; i++) { CGFloat yOrigin = i * self.view.frame.size.width; UIView *awesomeView = [[UIView alloc] initWithFrame:CGRectMake(yOrigin, 0, scroll.frame.size.width,scroll.frame.size.height)]; UIImage *originalImage=[allImages objectAtIndex:i]; UIImageView *imagesView=[[UIImageView alloc] initWithImage:originalImage]; imagesView.frame=CGRectMake(0, 0, scroll.frame.size.width, scroll.frame.size. height); imagesView.userInteractionEnabled=YES; [awesomeView addSubview:imagesView]; [scroll addSubview:awesomeView]; } scroll.contentSize = CGSizeMake(self.view.frame.size.width * numberOfViews, self.view.frame.size. [self.view addSubview:scroll];
objective-c
ios
null
null
null
null
open
images in scrollview are not always displayed === in my application i load images from an album as assets and display them to a uiscrollview . I load the images to the viewdidload method using blocks and in the view did appear method i put them into a scrollview and display them . Everything was working fine , but yesterday suddenly i got a weird behavior of the scrollview . The most of the times it is not displayed . When i stop and run again , it is displayed but not always. Sometimes i have to stop and run the application many times to see it. I suppose it is because i put the following code inside the viewdidappear method . In the viewdidload i load the assets using blocks . If i put them both at the viewdidload the assets are 0. I must put them in different methods. I would appreciate any help. Thank you in advance. allImages=[[NSMutableArray alloc] init]; int iAsset; for (iAsset=0; iAsset<[assets count]; iAsset++) { ALAsset *lastPicture = [assets objectAtIndex:iAsset]; UIImage *image=[UIImage imageWithCGImage:[[lastPicture defaultRepresentation]fullScreenImage]]; [allImages addObject:image]; } CGRect fullScreenRect=[[UIScreen mainScreen] applicationFrame]; CGFloat pageWidth = scroll.frame.size.width; int page = floor((scroll.contentOffset.x - pageWidth / 2) / pageWidth) + 1; pageNumber=[NSNumber numberWithInt:page]; scroll.pagingEnabled=YES; scroll.scrollEnabled = YES; scroll.clipsToBounds = YES; NSInteger numberOfViews = [allImages count]; for (int i = 0; i < numberOfViews; i++) { CGFloat yOrigin = i * self.view.frame.size.width; UIView *awesomeView = [[UIView alloc] initWithFrame:CGRectMake(yOrigin, 0, scroll.frame.size.width,scroll.frame.size.height)]; UIImage *originalImage=[allImages objectAtIndex:i]; UIImageView *imagesView=[[UIImageView alloc] initWithImage:originalImage]; imagesView.frame=CGRectMake(0, 0, scroll.frame.size.width, scroll.frame.size. height); imagesView.userInteractionEnabled=YES; [awesomeView addSubview:imagesView]; [scroll addSubview:awesomeView]; } scroll.contentSize = CGSizeMake(self.view.frame.size.width * numberOfViews, self.view.frame.size. [self.view addSubview:scroll];
0
11,541,594
07/18/2012 12:38:57
1,268,459
03/14/2012 08:26:39
5
0
iPhone: record output sounds without mic
I am writing an app which needs to record output sounds without microphone. For example: If I have two sound files, first.mp3 and second.mp3, I want to press record button, then press playfirst button, then playsecond button then stoprecordbutton. After this i should have third.mp3 which includes recorded sounds of frst and second. Is it possible? Thanks and sorry for my bad english.
iphone
objective-c
xcode
audio
audio-recording
null
open
iPhone: record output sounds without mic === I am writing an app which needs to record output sounds without microphone. For example: If I have two sound files, first.mp3 and second.mp3, I want to press record button, then press playfirst button, then playsecond button then stoprecordbutton. After this i should have third.mp3 which includes recorded sounds of frst and second. Is it possible? Thanks and sorry for my bad english.
0
11,541,596
07/18/2012 12:39:01
1,534,744
07/18/2012 12:16:10
1
0
Get Counts from Multiple Text files and exporting in one excel Sheet in SSIS
I am kind of new to SSIS, i have a problem where i have to import 4 text files at the same time and get their counts printed in one excel sheet along with the date in one column. For example i should have 5 columns in Excel in DATE|count_FILE1|count_FILE2|count_FILE3|count_FILE4 i have tried every method but i get output like every count is stored in next row with rest of the fields having empty records e.g <pre>DATE FILE1 FILE2 FILE3 FILE4 <br><pre>07/17/2012 202 </br> <br><pre>07/17/2012 209 </br> <br><pre>07/17/2012 269 </br> <br><pre>07/17/2012 285</pre> </br> I am almost going mad as can't find any solution of this online. please please please somebody help me out.
excel
file
text
import
multiple
null
open
Get Counts from Multiple Text files and exporting in one excel Sheet in SSIS === I am kind of new to SSIS, i have a problem where i have to import 4 text files at the same time and get their counts printed in one excel sheet along with the date in one column. For example i should have 5 columns in Excel in DATE|count_FILE1|count_FILE2|count_FILE3|count_FILE4 i have tried every method but i get output like every count is stored in next row with rest of the fields having empty records e.g <pre>DATE FILE1 FILE2 FILE3 FILE4 <br><pre>07/17/2012 202 </br> <br><pre>07/17/2012 209 </br> <br><pre>07/17/2012 269 </br> <br><pre>07/17/2012 285</pre> </br> I am almost going mad as can't find any solution of this online. please please please somebody help me out.
0
11,541,600
07/18/2012 12:39:18
840,634
07/12/2011 11:52:50
181
11
c# reflection finding overloaded method wr to inheritance
I am trying to find via reflection the most appropriate method to invoke, when i have a type to pass to that method. The edge case that is worrying me is overloading with same number of parameters, like so: class UserClass {} class UserClassB : UserClass {} class SomeClass { void method(object x); void method(UserClass x); } in runtime i am interested in invoking `method`, while the type i have in hand is `UserClassB`. The most appropriate would be `method(UserClass)`. The problem is that when using `typeof(SomeClass).GetMethod("method", new Type[] { typeof(UserClass2) }));` it will return a null, cause i think it searched based on exact match for the passed types. Any ideas? Thanks.
c#
reflection
null
null
null
null
open
c# reflection finding overloaded method wr to inheritance === I am trying to find via reflection the most appropriate method to invoke, when i have a type to pass to that method. The edge case that is worrying me is overloading with same number of parameters, like so: class UserClass {} class UserClassB : UserClass {} class SomeClass { void method(object x); void method(UserClass x); } in runtime i am interested in invoking `method`, while the type i have in hand is `UserClassB`. The most appropriate would be `method(UserClass)`. The problem is that when using `typeof(SomeClass).GetMethod("method", new Type[] { typeof(UserClass2) }));` it will return a null, cause i think it searched based on exact match for the passed types. Any ideas? Thanks.
0
11,541,601
07/18/2012 12:39:21
1,534,784
07/18/2012 12:29:01
1
0
Need to pass Formvalues from View to Controller on AjaxSubmit of a Form
I have a Strongly typed View Model @model DbRepositories.User @using (Html.BeginForm("AddUser", "Home", FormMethod.Post, new { id = "frmuser" })) { Some Controls Goes here.. <div> <input id="btnsave" type="button" value="Save" onclick="SaveUser();" /></div> } This is my Javascript File var options = { success: showResponse // post-submit callback }; function SaveUser() { $('#frmuser').ajaxSubmit(options); } and MY Action Method accepting User Object [HttpPost] public ActionResult AddUser(User Obj) { UserHelper hlp = new UserHelper(); hlp.AddNewUser(obj); return null; } i am Not getting form field values in my User Obj. How Do i send the form Data to the Controller. Please help me where i am Going wrong.
javascript
asp.net
asp.net-mvc-3
jquery-ajax
null
null
open
Need to pass Formvalues from View to Controller on AjaxSubmit of a Form === I have a Strongly typed View Model @model DbRepositories.User @using (Html.BeginForm("AddUser", "Home", FormMethod.Post, new { id = "frmuser" })) { Some Controls Goes here.. <div> <input id="btnsave" type="button" value="Save" onclick="SaveUser();" /></div> } This is my Javascript File var options = { success: showResponse // post-submit callback }; function SaveUser() { $('#frmuser').ajaxSubmit(options); } and MY Action Method accepting User Object [HttpPost] public ActionResult AddUser(User Obj) { UserHelper hlp = new UserHelper(); hlp.AddNewUser(obj); return null; } i am Not getting form field values in my User Obj. How Do i send the form Data to the Controller. Please help me where i am Going wrong.
0
11,541,603
07/18/2012 12:39:24
1,304,678
03/31/2012 06:41:47
46
1
how to display hide and show select box?
I google a lot for my requirement.So i am posting this question. my requirement is when a user select a value from dropdown based on that value a div to be displayed. But in default all the divs with values to be displayed. here is my code: <select name="lab_1" id="title" > <option value="All" onclick="showAll();" >All</option> <option value="one" onclick="showOther();">One</option> <option value="two" onclick="showOther();">Two</option> </select> <div id="All" > hiihdhfhdf <div id="otherTitle" style="display:none;" > select </div> <div id="otherTitle2" style="display:none;" > ramsai </div> </div> <script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script> <script> $(function() { $('#title').change(function() { var all= $("#All").val(); alert('hi'); if(all==""){ $("#otherTitle").show(); $("#otherTitle2").show(); } else if (this.value == "one") { $("#otherTitle").show(); $("#otherTitle2").hide(); } else if (this.value=="two"){ $("#otherTitle2").show(); $("#otherTitle").hide(); } }); }); </script> </body> Here with above code when i click all my divs are not displaying but when i go to one or two options it is showing all the values. Thank you in advance Ramsai
php
jquery
null
null
null
null
open
how to display hide and show select box? === I google a lot for my requirement.So i am posting this question. my requirement is when a user select a value from dropdown based on that value a div to be displayed. But in default all the divs with values to be displayed. here is my code: <select name="lab_1" id="title" > <option value="All" onclick="showAll();" >All</option> <option value="one" onclick="showOther();">One</option> <option value="two" onclick="showOther();">Two</option> </select> <div id="All" > hiihdhfhdf <div id="otherTitle" style="display:none;" > select </div> <div id="otherTitle2" style="display:none;" > ramsai </div> </div> <script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script> <script> $(function() { $('#title').change(function() { var all= $("#All").val(); alert('hi'); if(all==""){ $("#otherTitle").show(); $("#otherTitle2").show(); } else if (this.value == "one") { $("#otherTitle").show(); $("#otherTitle2").hide(); } else if (this.value=="two"){ $("#otherTitle2").show(); $("#otherTitle").hide(); } }); }); </script> </body> Here with above code when i click all my divs are not displaying but when i go to one or two options it is showing all the values. Thank you in advance Ramsai
0
7,491,037
09/20/2011 19:57:28
793,400
06/10/2011 21:11:34
3
0
Load images to a TileList from Mysql using PHP and XML on Flash CS5
I have a mysql database with a table containing PATH's to images. I want to load al the images to a TileList. Now i have this in PHP: <?PHP mysql_connect("localhost", "root", "root"); mysql_select_db("prototipo"); $result = mysql_query("select entretenimiento_id, e_nombre, e_imagen from entretenimiento"); echo "<?xml version=\"1.0\" ?><entretenimiento>"; while($row = mysql_fetch_assoc($result)) { echo "<loc><entretenimiento_id>" . $row["entretenimiento_id"] . "</entretenimiento_id>"; echo "<e_nombre>" . $row["e_nombre"] . "</e_nombre>"; echo "<e_imagen>" . $row["e_imagen"] . "</e_imagen></loc>"; } echo "</entretenimiento>"; ?> </code> This is supposed to fetch me the PATH of the image, the name so it goes on the label of the tile that displays the image, and brings me also the id so i can launch another query when that image is clicked on. All this is set into a dynamically created XML. Now my question.... How do i load this??? What to do o AS3?? I already have the AS3 for the tilelist, i only need to load this dynamically created XML from PHP to it. Thanks in advance. And sorry if i messed up on english, its not my main language. Im South American.
php
flash
actionscript-3
flash-cs5
tilelist
null
open
Load images to a TileList from Mysql using PHP and XML on Flash CS5 === I have a mysql database with a table containing PATH's to images. I want to load al the images to a TileList. Now i have this in PHP: <?PHP mysql_connect("localhost", "root", "root"); mysql_select_db("prototipo"); $result = mysql_query("select entretenimiento_id, e_nombre, e_imagen from entretenimiento"); echo "<?xml version=\"1.0\" ?><entretenimiento>"; while($row = mysql_fetch_assoc($result)) { echo "<loc><entretenimiento_id>" . $row["entretenimiento_id"] . "</entretenimiento_id>"; echo "<e_nombre>" . $row["e_nombre"] . "</e_nombre>"; echo "<e_imagen>" . $row["e_imagen"] . "</e_imagen></loc>"; } echo "</entretenimiento>"; ?> </code> This is supposed to fetch me the PATH of the image, the name so it goes on the label of the tile that displays the image, and brings me also the id so i can launch another query when that image is clicked on. All this is set into a dynamically created XML. Now my question.... How do i load this??? What to do o AS3?? I already have the AS3 for the tilelist, i only need to load this dynamically created XML from PHP to it. Thanks in advance. And sorry if i messed up on english, its not my main language. Im South American.
0
7,491,038
09/20/2011 19:57:41
284,932
03/03/2010 02:26:55
302
7
Help to connect in Reporting Web Services 2008 R2 with PHP
I am trying using PHP with MSSQL Reporting Services, but without success... First, i tried using helloworld.php from SRSS SKD PHP, and returns this error: Failed to connect to Reporting Service: Make sure that the url (http://10.120.100.12/ReportServer/) and credentials are correct! And trying using pure **SoapClient**: Warning: SoapClient::SoapClient(http://10.120.100.12/ReportServer/ReportExecution2005.asmx) [function.SoapClient-SoapClient]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in C:\xampp\htdocs\estudos\index.php on line 5 Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity "http://10.120.100.12/ReportServer/ReportExecution2005.asmx" in C:\xampp\htdocs\estudos\index.php on line 5 Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://10.120.100.12/ReportServer/ReportExecution2005.asmx' in C:\xampp\htdocs\estudos\index.php:5 Stack trace: #0 C:\xampp\htdocs\estudos\index.php(5): SoapClient->SoapClient('http://10.120.1...', Array) #1 {main} thrown in C:\xampp\htdocs\estudos\index.php on line 5 - Have a extra IIS configuration to make? - i am sure that use the same login and password used in web browser version. Need something more? Thanks, Celso
php
sql-server-2008
soap
reporting-services
null
null
open
Help to connect in Reporting Web Services 2008 R2 with PHP === I am trying using PHP with MSSQL Reporting Services, but without success... First, i tried using helloworld.php from SRSS SKD PHP, and returns this error: Failed to connect to Reporting Service: Make sure that the url (http://10.120.100.12/ReportServer/) and credentials are correct! And trying using pure **SoapClient**: Warning: SoapClient::SoapClient(http://10.120.100.12/ReportServer/ReportExecution2005.asmx) [function.SoapClient-SoapClient]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized in C:\xampp\htdocs\estudos\index.php on line 5 Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity "http://10.120.100.12/ReportServer/ReportExecution2005.asmx" in C:\xampp\htdocs\estudos\index.php on line 5 Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://10.120.100.12/ReportServer/ReportExecution2005.asmx' in C:\xampp\htdocs\estudos\index.php:5 Stack trace: #0 C:\xampp\htdocs\estudos\index.php(5): SoapClient->SoapClient('http://10.120.1...', Array) #1 {main} thrown in C:\xampp\htdocs\estudos\index.php on line 5 - Have a extra IIS configuration to make? - i am sure that use the same login and password used in web browser version. Need something more? Thanks, Celso
0
11,541,572
07/18/2012 12:38:01
1,317,018
04/06/2012 07:56:21
23
3
Win 8 RP fails to show up Start screen after log in
I was using Windows 8 CP very well for a few weeks now. But now, while I was doing something, the screen simple blanked out and blinked randomly few times. So I just powered off my laptop, since nothing (Ctrl+Alt+Del etc) else worked. Now when I boot up, it shows the login screen, when I enter credentials, it log-ins but fails to show up the Start screen and keeps blinking randomly. Just before the problem I installed Office 2013 CP. But did not get much time ti try it since system failed soon. I have installed the Win 8 CP on VHD with Windows 7 side by side. Please help since I want to learn Metro app development on it, and I dont want to waste time in re-installing the system. Is system restore only the option? If yes, I think I will loose the Office 2013 installation. Any precise diagnostic? Thank you.
windows-8
null
null
null
null
07/19/2012 14:52:19
off topic
Win 8 RP fails to show up Start screen after log in === I was using Windows 8 CP very well for a few weeks now. But now, while I was doing something, the screen simple blanked out and blinked randomly few times. So I just powered off my laptop, since nothing (Ctrl+Alt+Del etc) else worked. Now when I boot up, it shows the login screen, when I enter credentials, it log-ins but fails to show up the Start screen and keeps blinking randomly. Just before the problem I installed Office 2013 CP. But did not get much time ti try it since system failed soon. I have installed the Win 8 CP on VHD with Windows 7 side by side. Please help since I want to learn Metro app development on it, and I dont want to waste time in re-installing the system. Is system restore only the option? If yes, I think I will loose the Office 2013 installation. Any precise diagnostic? Thank you.
2
11,541,475
07/18/2012 12:34:04
1,534,778
07/18/2012 12:27:22
1
0
VBA Powerpoint Textbox alignement
I am using Powerpoint 2007 and i want to program a macro which makes a textbox in a slide. However the text in the textbox is aligned to center by default. I want to align it left, but i don't know how to do. How can i change alignement of this textbox? Here is my code. Set objPPT = CreateObject("PowerPoint.Application") Set SQ = objPPT.Presentation ...... SQ.Slides(i + 6).Shapes.AddTextbox(msoTextOrientationHorizontal, 50, 100, 600, 100).Select objPPT.ActiveWindow.Selection.TextRange.Text = titre Thank you
vba
macros
textbox
powerpoint
powerpoint-vba
null
open
VBA Powerpoint Textbox alignement === I am using Powerpoint 2007 and i want to program a macro which makes a textbox in a slide. However the text in the textbox is aligned to center by default. I want to align it left, but i don't know how to do. How can i change alignement of this textbox? Here is my code. Set objPPT = CreateObject("PowerPoint.Application") Set SQ = objPPT.Presentation ...... SQ.Slides(i + 6).Shapes.AddTextbox(msoTextOrientationHorizontal, 50, 100, 600, 100).Select objPPT.ActiveWindow.Selection.TextRange.Text = titre Thank you
0
11,226,843
06/27/2012 13:02:43
479,415
10/18/2010 14:50:16
231
4
Data Binding in WPF User Controls
I am creating a UserControl for a series of controls shared by several windows. One of the controls is a Label which shows the flow of some other process in terms of "protocol numbers". I am trying to offer DataBinding with this Label so the Window automatically reflects the state of the process as the protocol number variable changes. This is the User control XAML: <UserControl Name="MainOptionsPanel" x:Class="ExperienceMainControls.MainControls" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" DataContext="{Binding RelativeSource={RelativeSource Self}}" > <Label Height="Auto" Name="numberLabel">Protocol:</Label> <Label Content="{Binding Path=ProtocolNumber}" Name="protocolNumberLabel"/> (...) </UserControl> And this is the Code-Behind: public partial class MainControls { public MainControls() { InitializeComponent(); } public int ProtocolNumber { get { return (int)GetValue(ProtocolNumberProperty); } set { SetValue(ProtocolNumberProperty, value); } } public static DependencyProperty ProtocolNumberProperty = DependencyProperty.Register("ProtocolNumber", typeof(int), typeof(MainControls)); } This seems to be working because if on the constructor I set ProtocolNumber to an arbitrary value, it is reflected in the user control. However, when using this usercontrol on the final window, the data binding breaks. XAML: <Window x:Class="UserControlTesting.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:expControl="clr-namespace:ExperienceMainControls;assembly=ExperienceMainControls" DataContext="{Binding RelativeSource={RelativeSource Self}}" > <StackPanel> <expControl:MainControls ProtocolNumber="{Binding Path=Number, Mode=TwoWay}" /> </StackPanel> </Window> Code-Behind for window: public partial class Window1 : Window { public Window1() { Number= 15; InitializeComponent(); } public int Number{ get; set; } } This sets the Protocol Number to zero, ignoring the value set to Number. I've read example
c#
wpf
wpf-usercontrols
null
null
null
open
Data Binding in WPF User Controls === I am creating a UserControl for a series of controls shared by several windows. One of the controls is a Label which shows the flow of some other process in terms of "protocol numbers". I am trying to offer DataBinding with this Label so the Window automatically reflects the state of the process as the protocol number variable changes. This is the User control XAML: <UserControl Name="MainOptionsPanel" x:Class="ExperienceMainControls.MainControls" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" DataContext="{Binding RelativeSource={RelativeSource Self}}" > <Label Height="Auto" Name="numberLabel">Protocol:</Label> <Label Content="{Binding Path=ProtocolNumber}" Name="protocolNumberLabel"/> (...) </UserControl> And this is the Code-Behind: public partial class MainControls { public MainControls() { InitializeComponent(); } public int ProtocolNumber { get { return (int)GetValue(ProtocolNumberProperty); } set { SetValue(ProtocolNumberProperty, value); } } public static DependencyProperty ProtocolNumberProperty = DependencyProperty.Register("ProtocolNumber", typeof(int), typeof(MainControls)); } This seems to be working because if on the constructor I set ProtocolNumber to an arbitrary value, it is reflected in the user control. However, when using this usercontrol on the final window, the data binding breaks. XAML: <Window x:Class="UserControlTesting.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:expControl="clr-namespace:ExperienceMainControls;assembly=ExperienceMainControls" DataContext="{Binding RelativeSource={RelativeSource Self}}" > <StackPanel> <expControl:MainControls ProtocolNumber="{Binding Path=Number, Mode=TwoWay}" /> </StackPanel> </Window> Code-Behind for window: public partial class Window1 : Window { public Window1() { Number= 15; InitializeComponent(); } public int Number{ get; set; } } This sets the Protocol Number to zero, ignoring the value set to Number. I've read example
0
11,226,844
06/27/2012 13:02:43
695,318
04/06/2011 17:25:34
371
14
Solr Lucene - Not sure how to index data so documents scored properly
Here's my goal. A user has a list of skill+proficiency tuples. We want to find users based on some skill/experience criteria: * java, novice * php, expert mysql, advanced Where the * skills are highly desired and all others are good to have. Users which meet or exceed (based on experience) would be ranked highest. But it should also degrade nicely. If no users have both java and php experience, but they have one of the highly desired skills they should be ranked at the top. Users with only one of the optional skills may appear at the bottom. An idea I had is to index a user's skills in fields like this: skill_novice: java skill_novice: php skill_advanced: php skill_expert: php skill_novice: mysql skill_advanced: mysql ...so that at minimal I can do a logical query to find people who meeting the highly desired skills: (skill_novice:java AND skill_expert:php) but this doesn't degrade nicely (if no matches found) nor does it find the optional skills. Perhaps instead I can do something like this: skill_novice:java AND (skill_novice:php^0.1 OR skill_advanced:php^0.2 OR skill_expert:php^0.3) Is there a better way to accomplish this?
solr
lucene
solrj
null
null
null
open
Solr Lucene - Not sure how to index data so documents scored properly === Here's my goal. A user has a list of skill+proficiency tuples. We want to find users based on some skill/experience criteria: * java, novice * php, expert mysql, advanced Where the * skills are highly desired and all others are good to have. Users which meet or exceed (based on experience) would be ranked highest. But it should also degrade nicely. If no users have both java and php experience, but they have one of the highly desired skills they should be ranked at the top. Users with only one of the optional skills may appear at the bottom. An idea I had is to index a user's skills in fields like this: skill_novice: java skill_novice: php skill_advanced: php skill_expert: php skill_novice: mysql skill_advanced: mysql ...so that at minimal I can do a logical query to find people who meeting the highly desired skills: (skill_novice:java AND skill_expert:php) but this doesn't degrade nicely (if no matches found) nor does it find the optional skills. Perhaps instead I can do something like this: skill_novice:java AND (skill_novice:php^0.1 OR skill_advanced:php^0.2 OR skill_expert:php^0.3) Is there a better way to accomplish this?
0
11,226,851
06/27/2012 13:03:00
431,769
08/26/2010 11:09:31
604
8
How to separate form with horizontal line
in my html page I have div with css: padding: 0px; color: rgb(51, 51, 51); background: none repeat scroll 0% 0% rgb(255, 255, 255); position: relative; overflow: visible; in this div I have form and horizontal line: <hr color="#424242" size="2"> How can I add this this line after form ? his example work on bigger display but when I see my page on the phone line is next to div
html
css
null
null
null
null
open
How to separate form with horizontal line === in my html page I have div with css: padding: 0px; color: rgb(51, 51, 51); background: none repeat scroll 0% 0% rgb(255, 255, 255); position: relative; overflow: visible; in this div I have form and horizontal line: <hr color="#424242" size="2"> How can I add this this line after form ? his example work on bigger display but when I see my page on the phone line is next to div
0
11,226,852
06/27/2012 13:03:05
709,837
04/15/2011 13:00:39
414
12
JSON Output for Google Candlestick Chart (AJAX Update)
I'm trying to implement the Candlestick Google Chart, but I want to be able to reload the chart with different data using AJAX. I copied some code from the samples Google provides but I'm missing something - I think it has to do with improperly formatted JSON. Here's my calling code: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title> Google Visualization API Sample </title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> // Load the Visualization API and the piechart package. google.load('visualization', '1', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); function drawChart() { var jsonData = $.ajax({ url: "http://www.mydomain.com/chart_data.php", dataType:"json", async: false }).responseText; // Create our data table out of JSON data loaded from server. var data = new google.visualization.DataTable(jsonData); // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div')); chart.draw(data, {width: 400, height: 240}); } </script> </head> <body> <div id="chart_div" style="width: 900px; height: 500px;"></div> <div style="width: 900px;"> <div style="float: right;">&gt;&gt;</div> <div style="float: left;">&lt;&lt;</div> </div> </body> </html> The chart_data.php looks like this: { "rows": [ {c:[{v: 'Mon'}, {v: 12634}, {v: 12818.9}, {v: 12695.3}, {v: 12818.9}]}, {c:[{v: 'Tue'}, {v: 12583.7}, {v: 12694.8}, {v: 12632}, {v: 12795.7}]}, {c:[{v: 'Wed'}, {v: 12559.6}, {v: 12617.4}, {v: 12598.5}, {v: 12764.7}]}, {c:[{v: 'Thu'}, {v: 12415.8}, {v: 12598.5}, {v: 12442.5}, {v: 12670.2}]}, {c:[{v: 'Fri'}, {v: 12309.6}, {v: 12442.9}, {v: 12369.4}, {v: 12539.5}]} ] } I'm guessing the JSON data is formatted wrong perhaps? But I didn't see any samples on how to populate it for a Candlestick chart. Any help on this would be GREATLY appreciated. Thank you!
json
google-charts
null
null
null
null
open
JSON Output for Google Candlestick Chart (AJAX Update) === I'm trying to implement the Candlestick Google Chart, but I want to be able to reload the chart with different data using AJAX. I copied some code from the samples Google provides but I'm missing something - I think it has to do with improperly formatted JSON. Here's my calling code: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title> Google Visualization API Sample </title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> // Load the Visualization API and the piechart package. google.load('visualization', '1', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(drawChart); function drawChart() { var jsonData = $.ajax({ url: "http://www.mydomain.com/chart_data.php", dataType:"json", async: false }).responseText; // Create our data table out of JSON data loaded from server. var data = new google.visualization.DataTable(jsonData); // Instantiate and draw our chart, passing in some options. var chart = new google.visualization.CandlestickChart(document.getElementById('chart_div')); chart.draw(data, {width: 400, height: 240}); } </script> </head> <body> <div id="chart_div" style="width: 900px; height: 500px;"></div> <div style="width: 900px;"> <div style="float: right;">&gt;&gt;</div> <div style="float: left;">&lt;&lt;</div> </div> </body> </html> The chart_data.php looks like this: { "rows": [ {c:[{v: 'Mon'}, {v: 12634}, {v: 12818.9}, {v: 12695.3}, {v: 12818.9}]}, {c:[{v: 'Tue'}, {v: 12583.7}, {v: 12694.8}, {v: 12632}, {v: 12795.7}]}, {c:[{v: 'Wed'}, {v: 12559.6}, {v: 12617.4}, {v: 12598.5}, {v: 12764.7}]}, {c:[{v: 'Thu'}, {v: 12415.8}, {v: 12598.5}, {v: 12442.5}, {v: 12670.2}]}, {c:[{v: 'Fri'}, {v: 12309.6}, {v: 12442.9}, {v: 12369.4}, {v: 12539.5}]} ] } I'm guessing the JSON data is formatted wrong perhaps? But I didn't see any samples on how to populate it for a Candlestick chart. Any help on this would be GREATLY appreciated. Thank you!
0
11,226,284
06/27/2012 12:32:19
797,257
06/14/2011 08:11:54
3,007
192
Print long list split into X colums
Is there a way to do this: (defvar long-list ((1 1 1 1) (2 2 2 2) (3 3 3 3) (4 4 4 4) (5 5 5 5) (6 6 6 6)) (format t "magic" long-list) To output something like: (1 1 1 1) (2 2 2 2) (3 3 3 3) (4 4 4 4) (5 5 5 5) (6 6 6 6) Where I would define the number of columns to print? I know about `(format t "~/my-function/" long-list)` option, but maybe there's something built-in? The reference is being highly unhelpful on this particular topic.
lisp
format
common-lisp
null
null
null
open
Print long list split into X colums === Is there a way to do this: (defvar long-list ((1 1 1 1) (2 2 2 2) (3 3 3 3) (4 4 4 4) (5 5 5 5) (6 6 6 6)) (format t "magic" long-list) To output something like: (1 1 1 1) (2 2 2 2) (3 3 3 3) (4 4 4 4) (5 5 5 5) (6 6 6 6) Where I would define the number of columns to print? I know about `(format t "~/my-function/" long-list)` option, but maybe there's something built-in? The reference is being highly unhelpful on this particular topic.
0
11,226,285
06/27/2012 12:32:26
644,987
03/04/2011 15:29:59
163
11
Beginners Tutorial for Zend Framework implementing model and call it from Controller
I'm quite new to ZF, and right now, i try to write a tiny app, based on ZF. It works more or less fine until now. I wanna access my db- data. For starters, i just want to use query-string, before I start messing araound with zend_db. So to keep a nice mvc-structure, I created application/modules/IndexMapper.php class Application_Models_IndexMapper{...} it just contains one function by now to see if it works public function test(){ return ('yay'); } In my IndexController, which is working, i try to access my model by $indexMapper = new Application_Models_IndexMapper(); $x = $indexMapper->test(); but the first line throws an Fatal error: Class 'Application_Models_IndexMapper' not found in /path/to/application/controllers/IndexController.php on line 31 As I'm new, I don't understand the more complex tutorials and they don't help me fix my problem. What am I doing wrong? Do I have to include it somehow? Thanks
mvc
zend-framework
model
null
null
null
open
Beginners Tutorial for Zend Framework implementing model and call it from Controller === I'm quite new to ZF, and right now, i try to write a tiny app, based on ZF. It works more or less fine until now. I wanna access my db- data. For starters, i just want to use query-string, before I start messing araound with zend_db. So to keep a nice mvc-structure, I created application/modules/IndexMapper.php class Application_Models_IndexMapper{...} it just contains one function by now to see if it works public function test(){ return ('yay'); } In my IndexController, which is working, i try to access my model by $indexMapper = new Application_Models_IndexMapper(); $x = $indexMapper->test(); but the first line throws an Fatal error: Class 'Application_Models_IndexMapper' not found in /path/to/application/controllers/IndexController.php on line 31 As I'm new, I don't understand the more complex tutorials and they don't help me fix my problem. What am I doing wrong? Do I have to include it somehow? Thanks
0
11,226,824
06/27/2012 13:01:47
1,482,426
06/26/2012 10:31:25
1
0
MVc3 connection establishment with sql server 2008 R2 database
How to connect to a sql server 2008 R2 database from a mvc3 application Thank in advance
asp.net-mvc-3
null
null
null
null
06/27/2012 20:23:55
not a real question
MVc3 connection establishment with sql server 2008 R2 database === How to connect to a sql server 2008 R2 database from a mvc3 application Thank in advance
1
11,225,277
06/27/2012 11:35:49
1,422,940
05/29/2012 06:04:30
52
0
How to pass child windows usercontrol page values to another page in windows phone 7?
I designed the usercontrol for forgot password page.Then i need to send some of the textbox values to another page when button click in child windows page.please help me ....
windows-phone-7
null
null
null
null
null
open
How to pass child windows usercontrol page values to another page in windows phone 7? === I designed the usercontrol for forgot password page.Then i need to send some of the textbox values to another page when button click in child windows page.please help me ....
0
11,225,278
06/27/2012 11:35:49
1,252,223
03/06/2012 12:51:16
1
0
Compile C++ file as objective-c++ using makefile
I'm trying to compile .cpp files as objective-c++ using makefile as few of my cpp file have objective code. I added -x objective-c++ as complier option and started getting stray /327 in program error( and lots of similar error with different numbers after /). The errors are around 200. But when I change the encoding of the file from unicode-8 to 16 the error reduces to 23. currently there is no objective-c++ code in the .cpp file but plan to add in future. When i remove -x objective-c++ from complier option ,everything complies fine. and .out is generated. I would be helpful if someone will tell me why this is happening and even a solution for the same Thanks in advance
c++
makefile
objective-c++
null
null
null
open
Compile C++ file as objective-c++ using makefile === I'm trying to compile .cpp files as objective-c++ using makefile as few of my cpp file have objective code. I added -x objective-c++ as complier option and started getting stray /327 in program error( and lots of similar error with different numbers after /). The errors are around 200. But when I change the encoding of the file from unicode-8 to 16 the error reduces to 23. currently there is no objective-c++ code in the .cpp file but plan to add in future. When i remove -x objective-c++ from complier option ,everything complies fine. and .out is generated. I would be helpful if someone will tell me why this is happening and even a solution for the same Thanks in advance
0
11,327,561
07/04/2012 10:47:36
1,501,281
07/04/2012 10:24:53
1
0
Unable to have Flash Component (SWC) access the library in live preview
I am building a set of Flash components with the ability to replace the skin of the component with another one in the library. Currently, I am able to access the library after running the application, but not during live preview and I'd like to know if it is possible for the component to access the library while running in live preview mode (the mode where you can drag the component around the stage and change its properties in the Component Parameters window) <code> Here is a simplified code that just looks to see if there is a symbol of the name specified and than instantiates it and adds it as a child. package { import fl.core.UIComponent; import flash.display.MovieClip; import flash.system.ApplicationDomain; /** * ... * @author Roy Lazarovich */ public class CompTest extends UIComponent { private var customfile :String; public function CompTest() { } override protected function configUI():void { } override protected function draw():void { super.draw(); } private function setCustomFile():void { if (ApplicationDomain.currentDomain.hasDefinition(customfile)) { var c:Class = Class(ApplicationDomain.currentDomain.getDefinition(customfile)); var mc:MovieClip = new c(); addChild(mc); } } [Inspectable(name = "_Custom File", defaultValue = "")] public function set _customfile(value:String):void { customfile = value; setCustomFile(); drawNow(); } } } </code> Thanks!
actionscript-3
flash
actionscript
components
null
null
open
Unable to have Flash Component (SWC) access the library in live preview === I am building a set of Flash components with the ability to replace the skin of the component with another one in the library. Currently, I am able to access the library after running the application, but not during live preview and I'd like to know if it is possible for the component to access the library while running in live preview mode (the mode where you can drag the component around the stage and change its properties in the Component Parameters window) <code> Here is a simplified code that just looks to see if there is a symbol of the name specified and than instantiates it and adds it as a child. package { import fl.core.UIComponent; import flash.display.MovieClip; import flash.system.ApplicationDomain; /** * ... * @author Roy Lazarovich */ public class CompTest extends UIComponent { private var customfile :String; public function CompTest() { } override protected function configUI():void { } override protected function draw():void { super.draw(); } private function setCustomFile():void { if (ApplicationDomain.currentDomain.hasDefinition(customfile)) { var c:Class = Class(ApplicationDomain.currentDomain.getDefinition(customfile)); var mc:MovieClip = new c(); addChild(mc); } } [Inspectable(name = "_Custom File", defaultValue = "")] public function set _customfile(value:String):void { customfile = value; setCustomFile(); drawNow(); } } } </code> Thanks!
0
11,327,563
07/04/2012 10:47:43
170,619
09/09/2009 06:41:56
405
35
node-expat causing npm to fail with node install soap
I am trying to install node js soap module via NPM on Mac OSX, tried hard enough to manually install and point to expat.h etc didn't work **npm install soap** npm http GET https://registry.npmjs.org/soap npm http 304 https://registry.npmjs.org/soap npm http GET https://registry.npmjs.org/node-expat npm http GET https://registry.npmjs.org/request npm http 304 https://registry.npmjs.org/node-expat npm http 304 https://registry.npmjs.org/request > [email protected] install /Users/test/test1/node_modules/soap/node_modules/node-expat > node-waf configure build Checking for program g++ or c++ : /usr/bin/g++ Checking for program cpp : /usr/bin/cpp Checking for program ar : /usr/bin/ar Checking for program ranlib : /usr/bin/ranlib Checking for g++ : ok Checking for node path : not found Checking for node prefix : ok /usr/local Checking for header expat.h : not installed /Users/test/test1/node_modules/soap/node_modules/node-expat/wscript:14: error: the configuration failed (see '/Users/test/test1/node_modules/soap/node_modules/node-expat/build/config.log') npm ERR! [email protected] install: `node-waf configure build` npm ERR! `sh "-c" "node-waf configure build"` failed with 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is most likely a problem with the node-expat package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-waf configure build npm ERR! You can get their info via: npm ERR! npm owner ls node-expat npm ERR! There is likely additional logging output above. npm ERR! System Darwin 11.3.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "soap" npm ERR! cwd /Users/test/test1 npm ERR! node -v v0.8.1 npm ERR! npm -v 1.1.33 npm ERR! code ELIFECYCLE npm ERR! message [email protected] install: `node-waf configure build` npm ERR! message `sh "-c" "node-waf configure build"` failed with 1 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/test/test1/npm-debug.log npm ERR! not ok code 0 Have googled it installed expat manually etc but no luck. Please note Xcode 4.3 is installed and also command line support is in place. I am really not sure how I can get rid of the following two messages. Please help. Checking for node path : not found Checking for header expat.h : not installed
osx
node.js
soap
osx-lion
npm
null
open
node-expat causing npm to fail with node install soap === I am trying to install node js soap module via NPM on Mac OSX, tried hard enough to manually install and point to expat.h etc didn't work **npm install soap** npm http GET https://registry.npmjs.org/soap npm http 304 https://registry.npmjs.org/soap npm http GET https://registry.npmjs.org/node-expat npm http GET https://registry.npmjs.org/request npm http 304 https://registry.npmjs.org/node-expat npm http 304 https://registry.npmjs.org/request > [email protected] install /Users/test/test1/node_modules/soap/node_modules/node-expat > node-waf configure build Checking for program g++ or c++ : /usr/bin/g++ Checking for program cpp : /usr/bin/cpp Checking for program ar : /usr/bin/ar Checking for program ranlib : /usr/bin/ranlib Checking for g++ : ok Checking for node path : not found Checking for node prefix : ok /usr/local Checking for header expat.h : not installed /Users/test/test1/node_modules/soap/node_modules/node-expat/wscript:14: error: the configuration failed (see '/Users/test/test1/node_modules/soap/node_modules/node-expat/build/config.log') npm ERR! [email protected] install: `node-waf configure build` npm ERR! `sh "-c" "node-waf configure build"` failed with 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is most likely a problem with the node-expat package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-waf configure build npm ERR! You can get their info via: npm ERR! npm owner ls node-expat npm ERR! There is likely additional logging output above. npm ERR! System Darwin 11.3.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "soap" npm ERR! cwd /Users/test/test1 npm ERR! node -v v0.8.1 npm ERR! npm -v 1.1.33 npm ERR! code ELIFECYCLE npm ERR! message [email protected] install: `node-waf configure build` npm ERR! message `sh "-c" "node-waf configure build"` failed with 1 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/test/test1/npm-debug.log npm ERR! not ok code 0 Have googled it installed expat manually etc but no luck. Please note Xcode 4.3 is installed and also command line support is in place. I am really not sure how I can get rid of the following two messages. Please help. Checking for node path : not found Checking for header expat.h : not installed
0
11,327,564
07/04/2012 10:47:45
346,587
05/20/2010 22:07:00
1,612
36
Web Development: Complex processes: Are state machines the (only?) way to go?
In web development there is a lot of focus on REST-style architectures, with the objectives of minimizing (or eliminating) state. The web frameworks that I have seen all emphasize this style (Django, Rails, flask, etc.). While I agree that this is a good fit for the web in general, there are also many cases where this is inadequate. In particular I am thinking of the case where you want the user to follow a process, i.e. you want to offer a number of steps and these steps should be completed in a certain order (possibly with optional steps, deviating paths, etc.) A good example of this might be a shopping cart: First you have to make your selection, then enter your address, choose shipment type, enter your payment details, finish. You don't want the user to skip any of these steps and the process can become a lot more complex. Ideally I would want this process to be defined in a separate place to separate this logic from the rest of the implementation. Now my questions: 1. Are finite state machines the way to go here? Do they still work well if these processes become complex and need to change a lot (e.g. this step should go here, this step should go into this process instead, etc)? 2. What options are offered by/for web frameworks (not any in particular I am interested in the best solutions)? 3. What are interesting / good examples of where such processes occur? Shopping carts are an obvious example but I am sure there are lots more.
rest
language-agnostic
web
statemachine
null
null
open
Web Development: Complex processes: Are state machines the (only?) way to go? === In web development there is a lot of focus on REST-style architectures, with the objectives of minimizing (or eliminating) state. The web frameworks that I have seen all emphasize this style (Django, Rails, flask, etc.). While I agree that this is a good fit for the web in general, there are also many cases where this is inadequate. In particular I am thinking of the case where you want the user to follow a process, i.e. you want to offer a number of steps and these steps should be completed in a certain order (possibly with optional steps, deviating paths, etc.) A good example of this might be a shopping cart: First you have to make your selection, then enter your address, choose shipment type, enter your payment details, finish. You don't want the user to skip any of these steps and the process can become a lot more complex. Ideally I would want this process to be defined in a separate place to separate this logic from the rest of the implementation. Now my questions: 1. Are finite state machines the way to go here? Do they still work well if these processes become complex and need to change a lot (e.g. this step should go here, this step should go into this process instead, etc)? 2. What options are offered by/for web frameworks (not any in particular I am interested in the best solutions)? 3. What are interesting / good examples of where such processes occur? Shopping carts are an obvious example but I am sure there are lots more.
0
11,327,566
07/04/2012 10:47:57
1,496,354
07/02/2012 14:43:53
8
0
how to pass modified table name in sql connection in ASP
I m using msSQLserver 2008 for sqlconnectivity in asp.net. And i m passing the table name while at the time of clicking the <a> tag to web form. So how can i achieve this thing that when i click any link it change its sql query according to the value it receive. for example: <li class="last"><a href="category.aspx?cat=Architect&sub=Architects">Item 1.1</a> </li> here cat contains the table name and sub contains the condition name. and at the other side i m doing: SqlConnection con=new SqlConnection("Data Source=ANURAG-PC;Initial Catalog=dbPortal;Persist Security Info=True;User ID=sa;Password=anurag"); SqlDataAdapter da; DataSet ds=new DataSet(); static DataTable dt=new DataTable(); protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { string s = Request.QueryString["cat"]; string s1 = Request.QueryString["sub"]; da = new SqlDataAdapter("select * from Architect where subcategory3='" + s1 + "'",con); da.Fill(ds,"tab"); dt = ds.Tables["tab"]; DataGrid1.DataSource = dt; DataGrid1.DataBind(); } } so i just want that insted of giving table name "Architect" i just want to pass s?? how can i acieve it. please help?
c#
asp.net
.net
sql-server-2008
sql-server-2008-r2
null
open
how to pass modified table name in sql connection in ASP === I m using msSQLserver 2008 for sqlconnectivity in asp.net. And i m passing the table name while at the time of clicking the <a> tag to web form. So how can i achieve this thing that when i click any link it change its sql query according to the value it receive. for example: <li class="last"><a href="category.aspx?cat=Architect&sub=Architects">Item 1.1</a> </li> here cat contains the table name and sub contains the condition name. and at the other side i m doing: SqlConnection con=new SqlConnection("Data Source=ANURAG-PC;Initial Catalog=dbPortal;Persist Security Info=True;User ID=sa;Password=anurag"); SqlDataAdapter da; DataSet ds=new DataSet(); static DataTable dt=new DataTable(); protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { string s = Request.QueryString["cat"]; string s1 = Request.QueryString["sub"]; da = new SqlDataAdapter("select * from Architect where subcategory3='" + s1 + "'",con); da.Fill(ds,"tab"); dt = ds.Tables["tab"]; DataGrid1.DataSource = dt; DataGrid1.DataBind(); } } so i just want that insted of giving table name "Architect" i just want to pass s?? how can i acieve it. please help?
0
11,327,568
07/04/2012 10:48:02
888,734
08/10/2011 20:54:22
27
4
Add blur event to TinyMCE after initialisation with jQuery plugin
I have a TinyMCE editor created using the TinyMCE jQuery plugin, initialised like $('textarea').tinymce(mceOptions); I want to add some behaviour to the blur event, and most solutions I've seen use something like tinyMCE.dom.Event.add(tinyMCE.getInstanceById("editor-id").getWin(), "blur", function(){ // Blur operations }); inside the options. I don't want to do this because the mceOptions are pulled from somewhere else, and this is all happening in the context of a backbone.js view. On the blur event I will be calling a method of the view, so I don't want to try to tell it to do that anywhere else than in the view itself.
jquery
backbone.js
tinymce
null
null
null
open
Add blur event to TinyMCE after initialisation with jQuery plugin === I have a TinyMCE editor created using the TinyMCE jQuery plugin, initialised like $('textarea').tinymce(mceOptions); I want to add some behaviour to the blur event, and most solutions I've seen use something like tinyMCE.dom.Event.add(tinyMCE.getInstanceById("editor-id").getWin(), "blur", function(){ // Blur operations }); inside the options. I don't want to do this because the mceOptions are pulled from somewhere else, and this is all happening in the context of a backbone.js view. On the blur event I will be calling a method of the view, so I don't want to try to tell it to do that anywhere else than in the view itself.
0
11,327,576
07/04/2012 10:48:27
1,488,693
06/28/2012 13:30:14
1
1
Sencha Touch 2: Loading pushed data into form
I got some problems loading data into a form which I pushed onSelect. (loading details for a specific list item) onProductSelect: function(_dataView, _record) { Ext.getCmp('products').push({ title: _record.data.name, data: _record.data, styleHtmlContent: true, xtype: 'productDetails' }); } I am pushing another view (productDetails) into my productView (which is a navigationView). The data (_record.data) is available in the new pushed view via tpl: '{someField}' Now I'd like to know how to get this data (the fields data) into a textfield or a button or sth like this. If someone has a better idea how to get the data into the view/form or how to change the views (from list to detail) please let me know :) Thx in advance.
forms
list
data
touch
sencha
null
open
Sencha Touch 2: Loading pushed data into form === I got some problems loading data into a form which I pushed onSelect. (loading details for a specific list item) onProductSelect: function(_dataView, _record) { Ext.getCmp('products').push({ title: _record.data.name, data: _record.data, styleHtmlContent: true, xtype: 'productDetails' }); } I am pushing another view (productDetails) into my productView (which is a navigationView). The data (_record.data) is available in the new pushed view via tpl: '{someField}' Now I'd like to know how to get this data (the fields data) into a textfield or a button or sth like this. If someone has a better idea how to get the data into the view/form or how to change the views (from list to detail) please let me know :) Thx in advance.
0
11,327,577
07/04/2012 10:48:30
1,240,076
02/29/2012 11:11:30
6
0
hmisc:latex output larger space between rows
Sorry for this possible silly question. But I havent found an option to specify/modify/enlarge the space between rows in the doc of hmisc:latex. After changing the size to tiny, I want to enlarge the the space between the rows. My basic latex command is: latex(my_table, file="", collabel.just='l', rowname=NULL, multicol=F, size="tiny") Is there any way to achieve this ? Thanks a lot in advance!
r
latex
null
null
null
null
open
hmisc:latex output larger space between rows === Sorry for this possible silly question. But I havent found an option to specify/modify/enlarge the space between rows in the doc of hmisc:latex. After changing the size to tiny, I want to enlarge the the space between the rows. My basic latex command is: latex(my_table, file="", collabel.just='l', rowname=NULL, multicol=F, size="tiny") Is there any way to achieve this ? Thanks a lot in advance!
0
11,327,570
07/04/2012 10:48:05
1,285,641
03/22/2012 10:26:34
1
2
is it possible to create an apk using dsplink library?
I have a dsplink application running successfully in android terminal.I have included the application and dsplink library in android ndk and I cant compile it using ndk, since dsplink library has posix headers sys/sem.h included. I need a communication between arm and dsp in omapl138 through android apk.Is it possible?
android-ndk
posix
apk
omap
ti-dsp
null
open
is it possible to create an apk using dsplink library? === I have a dsplink application running successfully in android terminal.I have included the application and dsplink library in android ndk and I cant compile it using ndk, since dsplink library has posix headers sys/sem.h included. I need a communication between arm and dsp in omapl138 through android apk.Is it possible?
0
11,327,580
07/04/2012 10:48:37
513,413
11/19/2010 11:31:30
1,005
32
Android, How to show what is my URL address (HttpPost) in logcat?
I have a login screen that when user clicks on login button, i need to add some information to URL address. This is my code for past data: private String postData() { HttpClient httpClient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(PropertyManager.getLoginURL()); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(4); nameValuePairs.add(new BasicNameValuePair("u", Uri.encode(PropertyManager.getUserId()))); nameValuePairs.add(new BasicNameValuePair("p", Encryption.encrypt(PropertyManager.getPassword()))); nameValuePairs.add(new BasicNameValuePair("v", PropertyManager.VER)); nameValuePairs.add(new BasicNameValuePair("t", "0")); try { httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpClient.execute(httppost); String responseBody = EntityUtils.toString(response.getEntity()); Log.i("Server Response 1: ", responseBody); if (response.containsHeader("Set-Cookie")) { PropertyManager.setSessionID(extractSessionId(response.getHeaders("Set-Cookie")[0].getValue())); } return responseBody; } catch(UnsupportedEncodingException usee) { usee.printStackTrace(); } catch(ClientProtocolException cpe) { cpe.printStackTrace(); } catch(IOException ioe) { ioe.printStackTrace(); } return null; } Actually this method is working fine when my device is connected to Internet through WiFi and 3G. But just for one device (Sony Ericson - Xperia) when it is connected to 3G (WiFi is ok) server sends nonsense response. I need to see my connection address with its detail parameter. I wrote this code: Log.i("Requestd Connection", httppost.getURI().toString()); However, I could see just my URL without any nameValuePairs parameters. Any suggestion would be appreciated.
android
http-post
tostring
logcat
null
null
open
Android, How to show what is my URL address (HttpPost) in logcat? === I have a login screen that when user clicks on login button, i need to add some information to URL address. This is my code for past data: private String postData() { HttpClient httpClient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(PropertyManager.getLoginURL()); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(4); nameValuePairs.add(new BasicNameValuePair("u", Uri.encode(PropertyManager.getUserId()))); nameValuePairs.add(new BasicNameValuePair("p", Encryption.encrypt(PropertyManager.getPassword()))); nameValuePairs.add(new BasicNameValuePair("v", PropertyManager.VER)); nameValuePairs.add(new BasicNameValuePair("t", "0")); try { httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpClient.execute(httppost); String responseBody = EntityUtils.toString(response.getEntity()); Log.i("Server Response 1: ", responseBody); if (response.containsHeader("Set-Cookie")) { PropertyManager.setSessionID(extractSessionId(response.getHeaders("Set-Cookie")[0].getValue())); } return responseBody; } catch(UnsupportedEncodingException usee) { usee.printStackTrace(); } catch(ClientProtocolException cpe) { cpe.printStackTrace(); } catch(IOException ioe) { ioe.printStackTrace(); } return null; } Actually this method is working fine when my device is connected to Internet through WiFi and 3G. But just for one device (Sony Ericson - Xperia) when it is connected to 3G (WiFi is ok) server sends nonsense response. I need to see my connection address with its detail parameter. I wrote this code: Log.i("Requestd Connection", httppost.getURI().toString()); However, I could see just my URL without any nameValuePairs parameters. Any suggestion would be appreciated.
0
11,327,585
07/04/2012 10:48:54
239,438
12/28/2009 07:16:36
11,784
493
ListFragment activated item background
I have a ListFragment with default layout and I use setItemChecked to check the items. On Honeycomb and ICS the checked rows automatically have the background color applied as I am using `simple_list_item_activated_1` layout. How do I achieve the same effect on pre-HoneyComb devices? Neither `state_activated` nor `activatedBackgroundIndicator` are available on older platforms.
android
android-listview
android-compat-lib
android-listfragment
null
null
open
ListFragment activated item background === I have a ListFragment with default layout and I use setItemChecked to check the items. On Honeycomb and ICS the checked rows automatically have the background color applied as I am using `simple_list_item_activated_1` layout. How do I achieve the same effect on pre-HoneyComb devices? Neither `state_activated` nor `activatedBackgroundIndicator` are available on older platforms.
0
11,471,665
07/13/2012 13:41:25
713,111
04/18/2011 09:17:59
55
4
Symfony2 & Doctrine2 pagination: KnpPaginatorBundle or WhiteOctoberPagerfantaBundle?
I started implementing pagination on my site earlier on and was trying to weigh the pros and cons between these 2 bundles. In the end I opted for KnpPaginatorBundle because of the way it integrates nicely with the Doctrine ORM, and I managed to get it set up, configured and deployed to production within the hour. Simples! However, I've just started to integrate a search feature using FOQElasticaBundle and here is where I'm starting to get confused. This bundle seems to provide a nice `$finder->findPaginated('query string...')` method, but here is what this does: /** * Gets a paginator wrapping the result of a search * * @return Pagerfanta **/ public function findPaginated($query) { $queryObject = Elastica_Query::create($query); $paginatorAdapter = $this->createPaginatorAdapter($queryObject); return new Pagerfanta($paginatorAdapter); } So the question is whether I should add another dependency and get Pagerfanta set up as well (I presume by using the WhiteOctoberPagerfantaBundle?) or whether I should change camp and ditch the code that uses the KnpPaginatorBundle? I can't seem to find anywhere that compares the two.
php
symfony-2.0
pagination
doctrine2
paginator
null
open
Symfony2 & Doctrine2 pagination: KnpPaginatorBundle or WhiteOctoberPagerfantaBundle? === I started implementing pagination on my site earlier on and was trying to weigh the pros and cons between these 2 bundles. In the end I opted for KnpPaginatorBundle because of the way it integrates nicely with the Doctrine ORM, and I managed to get it set up, configured and deployed to production within the hour. Simples! However, I've just started to integrate a search feature using FOQElasticaBundle and here is where I'm starting to get confused. This bundle seems to provide a nice `$finder->findPaginated('query string...')` method, but here is what this does: /** * Gets a paginator wrapping the result of a search * * @return Pagerfanta **/ public function findPaginated($query) { $queryObject = Elastica_Query::create($query); $paginatorAdapter = $this->createPaginatorAdapter($queryObject); return new Pagerfanta($paginatorAdapter); } So the question is whether I should add another dependency and get Pagerfanta set up as well (I presume by using the WhiteOctoberPagerfantaBundle?) or whether I should change camp and ditch the code that uses the KnpPaginatorBundle? I can't seem to find anywhere that compares the two.
0
11,471,542
07/13/2012 13:32:47
531,954
12/06/2010 08:00:20
2,801
158
WebService call with ClientAuth: recv failed on Tomcat, working on stand-alone app
I've turned on the SSL client authentication for the web services deployed on ServiceMix server. I have imported both client and server certificate. I've tested it with stand-alone application and everything was working fine. But when I try to call this web service from application deployed on the Tomcat, I get exception: Caused by: java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at sun.security.ssl.InputRecord.readFully(InputRecord.java:312) at sun.security.ssl.InputRecord.read(InputRecord.java:350) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893) at sun.security.ssl.SSLSocketImpl.waitForClose(SSLSocketImpl.java:1689) at sun.security.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:122) at sun.security.ssl.Handshaker.sendChangeCipherSpec(Handshaker.java:972) at sun.security.ssl.ClientHandshaker.sendChangeCipherAndFinish(ClientHandshaker.java:1083) at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1002) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:282) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868) at sun.security.ssl.Handshaker.process_record(Handshaker.java:804) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:998) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1294) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1321) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1305) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:523) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1087) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1916) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1871) at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42) at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1934) at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47) at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 107 more I've got `recv failed` message from stand-alone java app, when I failed to specify keyStore with client private key. The stack trace, however, was other: Exception in thread "main" com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException. java.net.SocketException: Software caused connection abort: recv failed java.net.SocketException: Software caused connection abort: recv failed at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:172) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:144) at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:263) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:226) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:174) at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104) at javax.xml.ws.Service.<init>(Service.java:56) I've failed to read WSDL in that case. But on Tomcat, WSDL is read, but the error is thrown when CXF try to send the message. What could cause that error on Tomcat? Is it the certificate problem? The Java variables pointing to both trustStore and keyStore are THE SAME in both cases: javax.net.ssl.keyStoreType=jks javax.net.ssl.trustStoreType=jks javax.net.ssl.keyStore=c:/cert/gen.keystore javax.net.ssl.trustStore=c:/cert/client.keystore javax.net.ssl.keyStorePassword=changeit javax.net.ssl.trustStorePassword=changeit Java: java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30-b12) Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing) Tomcat: 6.0.26
java
tomcat
ssl
client-authentication
null
null
open
WebService call with ClientAuth: recv failed on Tomcat, working on stand-alone app === I've turned on the SSL client authentication for the web services deployed on ServiceMix server. I have imported both client and server certificate. I've tested it with stand-alone application and everything was working fine. But when I try to call this web service from application deployed on the Tomcat, I get exception: Caused by: java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at sun.security.ssl.InputRecord.readFully(InputRecord.java:312) at sun.security.ssl.InputRecord.read(InputRecord.java:350) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893) at sun.security.ssl.SSLSocketImpl.waitForClose(SSLSocketImpl.java:1689) at sun.security.ssl.HandshakeOutStream.flush(HandshakeOutStream.java:122) at sun.security.ssl.Handshaker.sendChangeCipherSpec(Handshaker.java:972) at sun.security.ssl.ClientHandshaker.sendChangeCipherAndFinish(ClientHandshaker.java:1083) at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1002) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:282) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868) at sun.security.ssl.Handshaker.process_record(Handshaker.java:804) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:998) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1294) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1321) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1305) at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:523) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1087) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1916) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1871) at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42) at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1934) at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47) at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 107 more I've got `recv failed` message from stand-alone java app, when I failed to specify keyStore with client private key. The stack trace, however, was other: Exception in thread "main" com.sun.xml.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException. java.net.SocketException: Software caused connection abort: recv failed java.net.SocketException: Software caused connection abort: recv failed at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:172) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:144) at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:263) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:226) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:174) at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104) at javax.xml.ws.Service.<init>(Service.java:56) I've failed to read WSDL in that case. But on Tomcat, WSDL is read, but the error is thrown when CXF try to send the message. What could cause that error on Tomcat? Is it the certificate problem? The Java variables pointing to both trustStore and keyStore are THE SAME in both cases: javax.net.ssl.keyStoreType=jks javax.net.ssl.trustStoreType=jks javax.net.ssl.keyStore=c:/cert/gen.keystore javax.net.ssl.trustStore=c:/cert/client.keystore javax.net.ssl.keyStorePassword=changeit javax.net.ssl.trustStorePassword=changeit Java: java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30-b12) Java HotSpot(TM) Client VM (build 20.5-b03, mixed mode, sharing) Tomcat: 6.0.26
0
11,471,543
07/13/2012 13:32:56
93,995
03/15/2009 03:52:40
5,073
76
Rails 3.2.x: how to reload app/classes dir during development?
I have some Rails code that does not fit neatly into a model or controller box. So as per [this answer][1], I created a `app/classes` directory. Rails 3 seems to automatically add this to the "load path" in Rails, and my application correctly finds the classes I define in there without needing to use `require` statements. However the code in `app/classes` does not get reloaded in development mode; if I make a change, I need to restart the server in order to see that change. What's the proper way to make a given directory "reloadable" in Rails 3.2.x? A few answers here recommend doing: config.autoload_paths += %W(#{config.root}/app/classes) but I believe that this merely has the effect of adding `app/classes` to the initial set of directories to find code in; does not seem to make them reloadable for each request (and furthermore in 3.x it seems that `app/*` is automatically added). [1]: http://stackoverflow.com/a/1071510/93995
ruby
ruby-on-rails-3
null
null
null
null
open
Rails 3.2.x: how to reload app/classes dir during development? === I have some Rails code that does not fit neatly into a model or controller box. So as per [this answer][1], I created a `app/classes` directory. Rails 3 seems to automatically add this to the "load path" in Rails, and my application correctly finds the classes I define in there without needing to use `require` statements. However the code in `app/classes` does not get reloaded in development mode; if I make a change, I need to restart the server in order to see that change. What's the proper way to make a given directory "reloadable" in Rails 3.2.x? A few answers here recommend doing: config.autoload_paths += %W(#{config.root}/app/classes) but I believe that this merely has the effect of adding `app/classes` to the initial set of directories to find code in; does not seem to make them reloadable for each request (and furthermore in 3.x it seems that `app/*` is automatically added). [1]: http://stackoverflow.com/a/1071510/93995
0
11,471,670
07/13/2012 13:41:47
625,454
02/20/2011 17:45:27
491
0
How to initialize the domain class properties with the values of another Domain class properties in grails
I have grails 2.0.4 installed, I am stuck in setting the default values of domain classes I have a Domain Class ApplicationConfiguaration to store all the default values, I am initializing the property 'city' of Domain class City by using the dynamic finders, I have got a reply to my post that **"do not use dynamic finders to initialize a fields value. If you need this behavior use the beforeValidate() or beforeInsert() events"** But I need to show the default value to the user in create page, If I use beforeValidate() or beforeInsert() this will not be fulfilled, I have read that using **beans we can initialize the domain class.** I have tried settings plugin, Since it also uses **dynamic finders**, This also fails. And one more thing I am **not able to access any of the dynamic finders in domain classes and services except in controllers** I don't know how to implement it . Can anyone help me doing this
gorm
grails-2.0
null
null
null
null
open
How to initialize the domain class properties with the values of another Domain class properties in grails === I have grails 2.0.4 installed, I am stuck in setting the default values of domain classes I have a Domain Class ApplicationConfiguaration to store all the default values, I am initializing the property 'city' of Domain class City by using the dynamic finders, I have got a reply to my post that **"do not use dynamic finders to initialize a fields value. If you need this behavior use the beforeValidate() or beforeInsert() events"** But I need to show the default value to the user in create page, If I use beforeValidate() or beforeInsert() this will not be fulfilled, I have read that using **beans we can initialize the domain class.** I have tried settings plugin, Since it also uses **dynamic finders**, This also fails. And one more thing I am **not able to access any of the dynamic finders in domain classes and services except in controllers** I don't know how to implement it . Can anyone help me doing this
0
11,471,566
07/13/2012 13:34:33
21,240
09/23/2008 16:49:20
1,584
45
How to find a module in a virtualenv without activating said virtualenv?
Suppose I have the following setup: mkdir test && cd test virtualenv .venv source .venv/bin/activate pip install django mkdir mod1 touch mod1/__init__.py echo "a = 1" > mod1/mod2.py Which gives me: test/.venv test/mod1/__init__.py test/mod1/mod2.py How would I write this function: def get_module(module_name, root_path, virtualenv_path=None) In order for this to work: project_root_path = "./test" project_virtualenv_path = "./test/.venv" get_module("mod1.mod2", project_root_path, project_virtualenv_path) get_module("django.contrib.auth", project_root_path, project_virtualenv_path) Assuming I don't have `./test/.venv` activated. The reason I want to do this, is because I'm working on a vim plugin which would implement `gf` functionality in a python file on an import statement. I'm trying to support virtualenvs as well.
python
null
null
null
null
null
open
How to find a module in a virtualenv without activating said virtualenv? === Suppose I have the following setup: mkdir test && cd test virtualenv .venv source .venv/bin/activate pip install django mkdir mod1 touch mod1/__init__.py echo "a = 1" > mod1/mod2.py Which gives me: test/.venv test/mod1/__init__.py test/mod1/mod2.py How would I write this function: def get_module(module_name, root_path, virtualenv_path=None) In order for this to work: project_root_path = "./test" project_virtualenv_path = "./test/.venv" get_module("mod1.mod2", project_root_path, project_virtualenv_path) get_module("django.contrib.auth", project_root_path, project_virtualenv_path) Assuming I don't have `./test/.venv` activated. The reason I want to do this, is because I'm working on a vim plugin which would implement `gf` functionality in a python file on an import statement. I'm trying to support virtualenvs as well.
0
11,471,679
07/13/2012 13:42:08
358,163
06/04/2010 06:14:59
2,539
209
Spring, configure the DataSource through JNDI having remote JBoss Server
I want to make `DataSource` in `Spring` through JNDI. All the configuration are given. Can someone tell me what is wrong with the configuration. One thing I would like to mention here is that JNDI DS is hosted on JBoss server which does not host the `Spring` application. Configuration ------------- **datasource-ds.xml** <?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>jdbc/wc-mysql</jndi-name> <connection-url>jdbc:mysql://xx.xx.xx.xx:3306/club</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>club</user-name> <password>club</password> <exception-sorter-class-name> org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter </exception-sorter-class-name> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <use-java-context>false</use-java-context> <metadata><type-mapping>mySQL</type-mapping></metadata> </local-tx-datasource> </datasources> **configContext.xml** <bean id="wcDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/wc-mysql" /> <property name="jndiEnvironment"> <props> <prop key="java.naming.provider.url">jnp://yy.yy.yy.yy:1099</prop> <!-- <prop key="java.naming.factory.initial"> org.springframework.mock.jndi.SimpleNamingContextBuilder </prop> <prop key="java.naming.factory.url.pkgs">yourPackagePrefixesGoHere</prop> --> <!-- other key=values here --> </props> </property> <!-- other properties here--> </bean> **Exception** Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
java
spring
java-ee
datasource
jndi
null
open
Spring, configure the DataSource through JNDI having remote JBoss Server === I want to make `DataSource` in `Spring` through JNDI. All the configuration are given. Can someone tell me what is wrong with the configuration. One thing I would like to mention here is that JNDI DS is hosted on JBoss server which does not host the `Spring` application. Configuration ------------- **datasource-ds.xml** <?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>jdbc/wc-mysql</jndi-name> <connection-url>jdbc:mysql://xx.xx.xx.xx:3306/club</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>club</user-name> <password>club</password> <exception-sorter-class-name> org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter </exception-sorter-class-name> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <use-java-context>false</use-java-context> <metadata><type-mapping>mySQL</type-mapping></metadata> </local-tx-datasource> </datasources> **configContext.xml** <bean id="wcDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/wc-mysql" /> <property name="jndiEnvironment"> <props> <prop key="java.naming.provider.url">jnp://yy.yy.yy.yy:1099</prop> <!-- <prop key="java.naming.factory.initial"> org.springframework.mock.jndi.SimpleNamingContextBuilder </prop> <prop key="java.naming.factory.url.pkgs">yourPackagePrefixesGoHere</prop> --> <!-- other key=values here --> </props> </property> <!-- other properties here--> </bean> **Exception** Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
0
11,471,681
07/13/2012 13:42:19
289,246
03/08/2010 23:30:38
2,864
88
structuremap named configuration
I configure structuremap like this: ObjectFactory.Configure(x => { x.For<IA>().Use<A>().Named(CommonModule.ModuleName); x.For<IB>().Use<B>().Named(CommonModule.ModuleName); x.For<IC>().Use<C>().Named(CommonModule.ModuleName); x.For<ID>().Use<D>().Named(CommonModule.ModuleName); ... ... ... }); Can I make this shorter by telling somehow that ALL the settings in this configuration call are named after CommonModule.ModuleName (instead of one by one)? Something like: ObjectFactory.Configure(x => { x.For<IA>().Use<A>(); x.For<IB>().Use<B>(); x.For<IC>().Use<C>() x.For<ID>().Use<D>(); ... ... ... }).Named(CommonModule.ModuleName);
c#
.net
structuremap
null
null
null
open
structuremap named configuration === I configure structuremap like this: ObjectFactory.Configure(x => { x.For<IA>().Use<A>().Named(CommonModule.ModuleName); x.For<IB>().Use<B>().Named(CommonModule.ModuleName); x.For<IC>().Use<C>().Named(CommonModule.ModuleName); x.For<ID>().Use<D>().Named(CommonModule.ModuleName); ... ... ... }); Can I make this shorter by telling somehow that ALL the settings in this configuration call are named after CommonModule.ModuleName (instead of one by one)? Something like: ObjectFactory.Configure(x => { x.For<IA>().Use<A>(); x.For<IB>().Use<B>(); x.For<IC>().Use<C>() x.For<ID>().Use<D>(); ... ... ... }).Named(CommonModule.ModuleName);
0
11,471,684
07/13/2012 13:42:26
702,937
04/06/2011 00:25:53
438
14
query Wikipedia data page
I have trouble understanding wikipedia API. I have **isolated** a link, by processing json that I got as a response after sending a request to **[http://en.wikipedia.org/w/api.php][1]** Assuming that I got the following [link][2], how do I get access to information like date of birth, etc. I'm using python. I tried doing a import urllib2,simplejson search_req = urllib2.Request(direct_url_to_required_wikipedia_page) response = urllib2.urlopen(search_req) I have tried reading the api. But, I can't figure out how to extract data from specific pages. [1]: http://en.wikipedia.org/w/api.php [2]: http://en.wikipedia.org/wiki/Jennifer_Aniston
python
data
web-crawler
wikipedia
null
null
open
query Wikipedia data page === I have trouble understanding wikipedia API. I have **isolated** a link, by processing json that I got as a response after sending a request to **[http://en.wikipedia.org/w/api.php][1]** Assuming that I got the following [link][2], how do I get access to information like date of birth, etc. I'm using python. I tried doing a import urllib2,simplejson search_req = urllib2.Request(direct_url_to_required_wikipedia_page) response = urllib2.urlopen(search_req) I have tried reading the api. But, I can't figure out how to extract data from specific pages. [1]: http://en.wikipedia.org/w/api.php [2]: http://en.wikipedia.org/wiki/Jennifer_Aniston
0
11,471,690
07/13/2012 13:42:45
1,518,451
07/11/2012 16:28:49
13
0
curl.h no such file or directory
i installed curl this command (i use Ubuntu): sudo apt-get install curl When i test simple program: g++ test.cpp #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } return 0; } g++ show me fatal error: curl/curl.h: No such file or directory compilation terminated. Can anyone help me ?
c++
curl
null
null
null
null
open
curl.h no such file or directory === i installed curl this command (i use Ubuntu): sudo apt-get install curl When i test simple program: g++ test.cpp #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* Perform the request, res will get the return code */ res = curl_easy_perform(curl); /* Check for errors */ if(res != CURLE_OK) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* always cleanup */ curl_easy_cleanup(curl); } return 0; } g++ show me fatal error: curl/curl.h: No such file or directory compilation terminated. Can anyone help me ?
0
11,594,262
07/21/2012 17:17:17
1,455,028
06/14/2012 00:06:39
64
4
VB.NET - MessageBox, is this a function?
I've been researching this, but i wanted some input from the community in regards to the MessageBox "class" provided in VB.NET. From my point of view and current understanding, i see MessageBox as a Class, mainly because in VS2010 shows it as a class. I see that we have methods within this class and properties. How come many websites, tutorials, books call this a Function?? Even MSDN calls it the "MessageBox" function. Is it simply because this is part of the WINAPI? Another question that arises now that i look at the MessageBox class in VB.NET a bit closer, how come we don't have to create an object of type Messagebox prior to using it. It appears that we can just call the Messagebox class and bring up the "Show"method... I'm still in the beginner stages of fully understanding the OOP Concept and i wouldn't mind technical explanations in regards to this particular topic. I was reading over the MSDN page for the MessageBox Function which is what originally triggered me to asked this question. http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx **In Conclusion, my question:** *Why is "MessageBox" considered a function in VB.NET when VS2010 intellisense shows it as a Class?*
.net
vb.net
winapi
messagebox
null
null
open
VB.NET - MessageBox, is this a function? === I've been researching this, but i wanted some input from the community in regards to the MessageBox "class" provided in VB.NET. From my point of view and current understanding, i see MessageBox as a Class, mainly because in VS2010 shows it as a class. I see that we have methods within this class and properties. How come many websites, tutorials, books call this a Function?? Even MSDN calls it the "MessageBox" function. Is it simply because this is part of the WINAPI? Another question that arises now that i look at the MessageBox class in VB.NET a bit closer, how come we don't have to create an object of type Messagebox prior to using it. It appears that we can just call the Messagebox class and bring up the "Show"method... I'm still in the beginner stages of fully understanding the OOP Concept and i wouldn't mind technical explanations in regards to this particular topic. I was reading over the MSDN page for the MessageBox Function which is what originally triggered me to asked this question. http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx **In Conclusion, my question:** *Why is "MessageBox" considered a function in VB.NET when VS2010 intellisense shows it as a Class?*
0
11,594,263
07/21/2012 17:17:21
1,542,955
07/21/2012 16:54:13
1
0
Using TextArea in TabbedPane
i have added a JTabbedPane with a JPanel in each tab. and a JText area within each JPanel. the tabs can be dynamically created in the same template. There is also a menu bar with a menu. it has options to replace an occurance of a string (eg replace "&lt;" with "<") it worked perfectly when i just used a JPanel and textArea. Now that i hav added the tabbedPane,... i dont know how to replace the content of the active tab alone,.. i have tried getting the selected component(getSelectedComponent() method and getComponentAt() method) and replacing the text,.. i didnt work can some one help me
swing
tabbed
pane
null
null
null
open
Using TextArea in TabbedPane === i have added a JTabbedPane with a JPanel in each tab. and a JText area within each JPanel. the tabs can be dynamically created in the same template. There is also a menu bar with a menu. it has options to replace an occurance of a string (eg replace "&lt;" with "<") it worked perfectly when i just used a JPanel and textArea. Now that i hav added the tabbedPane,... i dont know how to replace the content of the active tab alone,.. i have tried getting the selected component(getSelectedComponent() method and getComponentAt() method) and replacing the text,.. i didnt work can some one help me
0
11,594,266
07/21/2012 17:17:44
717,051
04/20/2011 11:42:39
16
1
Average working set size for a process
I am running an executable in linux (c++ code). I want to calculate 'average' working set size of this executable? I have no clue in how to proceed. Can some one help me out? Is there any command in linux to do so? Thanks in advance
c++
linux
memory
process
linux-kernel
null
open
Average working set size for a process === I am running an executable in linux (c++ code). I want to calculate 'average' working set size of this executable? I have no clue in how to proceed. Can some one help me out? Is there any command in linux to do so? Thanks in advance
0
11,594,270
07/21/2012 17:18:35
872,501
08/01/2011 09:11:04
311
19
How can write a oracle query as generic alternative way of union
I have a table `attach` with huge data sets, it is a temp table and created by sql: id number name 1 X1 name1 2 X2 name2 3 X3 name3 4 X4 name4 table `attachment_map` id item attach_id file_id versionid 1 X1 1 100 0 2 X2 0 0 1 table `version` id attach_id 1 2 I want to have query to get: id number name item 1 X1 name1 X1 2 X2 name2 X2 3 X3 name3 4 X4 name4 As you can see, the return rows added new column which actually got from table `attachment_map`, there have three impossibles: 1).`attach` don't have item. 2).Have item, by connecting to column `attach_id` of `attachment_map`. 2).Have item, by connecting to column `attach_id` of `version`. I wrote a query but having poor performance, executed it slowly and it seems because of union. can everybody tell another way or how I can improvee it? thanks WITH tb AS (SELECT t.*, i.item FROM attach t, attachment_map am, version v WHERE (am.attach_id = t.attachid OR (am.file_id = 0 AND am.version_id = v.id)) ) SELECT * FROM tb UNION SELECT tb.*, NULL FROM tb, attach WHERE tp.id NOT IN (attach.id);
java
performance
oracle
oracle10g
null
null
open
How can write a oracle query as generic alternative way of union === I have a table `attach` with huge data sets, it is a temp table and created by sql: id number name 1 X1 name1 2 X2 name2 3 X3 name3 4 X4 name4 table `attachment_map` id item attach_id file_id versionid 1 X1 1 100 0 2 X2 0 0 1 table `version` id attach_id 1 2 I want to have query to get: id number name item 1 X1 name1 X1 2 X2 name2 X2 3 X3 name3 4 X4 name4 As you can see, the return rows added new column which actually got from table `attachment_map`, there have three impossibles: 1).`attach` don't have item. 2).Have item, by connecting to column `attach_id` of `attachment_map`. 2).Have item, by connecting to column `attach_id` of `version`. I wrote a query but having poor performance, executed it slowly and it seems because of union. can everybody tell another way or how I can improvee it? thanks WITH tb AS (SELECT t.*, i.item FROM attach t, attachment_map am, version v WHERE (am.attach_id = t.attachid OR (am.file_id = 0 AND am.version_id = v.id)) ) SELECT * FROM tb UNION SELECT tb.*, NULL FROM tb, attach WHERE tp.id NOT IN (attach.id);
0
11,594,272
07/21/2012 17:18:44
1,000,039
10/17/2011 21:53:29
19
0
Continue to accept input in a command line tool (like the say command)
In terminal on OS X, if you type "say" and hit return the command doesn't exit and any subsequent things typed in (followed by return) are said by the system. How can this kind of effect be achieved?
c
osx
command-line
null
null
null
open
Continue to accept input in a command line tool (like the say command) === In terminal on OS X, if you type "say" and hit return the command doesn't exit and any subsequent things typed in (followed by return) are said by the system. How can this kind of effect be achieved?
0
11,594,273
07/21/2012 17:18:49
1,542,953
07/21/2012 16:53:30
1
0
Horizontal submenu ie 9
I am designing a webpage with an horizontal submenu. It works perfectly in all browsers except ie (i'm interested in a correct display in ie8 and ie9). The problem seems to be that the submenu is correctly shown when the mouse is over its parent li, but when go to the links of the submenu, it dissapears. The submenu seems not to reconize the block display I've puted. I'm doing it with css in a wordpress theme. I've tried changing the displays, margins, paddings... I'm lost, I don't know what to do. This is the page if someone wants to help me: http://charocalvo.org/ Thanks
css
wordpress
submenu
null
null
null
open
Horizontal submenu ie 9 === I am designing a webpage with an horizontal submenu. It works perfectly in all browsers except ie (i'm interested in a correct display in ie8 and ie9). The problem seems to be that the submenu is correctly shown when the mouse is over its parent li, but when go to the links of the submenu, it dissapears. The submenu seems not to reconize the block display I've puted. I'm doing it with css in a wordpress theme. I've tried changing the displays, margins, paddings... I'm lost, I don't know what to do. This is the page if someone wants to help me: http://charocalvo.org/ Thanks
0
11,594,274
07/21/2012 17:18:54
1,525,011
07/14/2012 03:15:17
1
0
java udp packet shows malformed packet
i am trying to send the udp packet to the online server but wireshark shows the malformed packet. I am using java socket programming and getting errors. I need the help on this.
java
null
null
null
null
07/22/2012 15:32:09
not a real question
java udp packet shows malformed packet === i am trying to send the udp packet to the online server but wireshark shows the malformed packet. I am using java socket programming and getting errors. I need the help on this.
1
11,594,257
07/21/2012 17:16:31
489,762
10/28/2010 06:47:51
854
17
live audio streaming in android
I am facing problem to play a audio url using MediaPlayer as well as native Android audio player. Here is my url http://live.politiafm.com:8500/politiafm.mp3 Here is my code Using native audio player Intent intent = new Intent(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(STREAM_URL), "audio/*"); StartActivity(intent); Using Media Player MediaPlayer mp = new MediaPlayer(); mp.setAudioStreamType(AudioManager.STREAM_MUSIC); mp.create(Landing.this, Uri.parse(STREAM_URL)); mp.prepareAsync(); mp.start(); In both the cases audio is not playing. Can some body help me out from this trouble. Thanks & Regards
android
null
null
null
null
null
open
live audio streaming in android === I am facing problem to play a audio url using MediaPlayer as well as native Android audio player. Here is my url http://live.politiafm.com:8500/politiafm.mp3 Here is my code Using native audio player Intent intent = new Intent(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(STREAM_URL), "audio/*"); StartActivity(intent); Using Media Player MediaPlayer mp = new MediaPlayer(); mp.setAudioStreamType(AudioManager.STREAM_MUSIC); mp.create(Landing.this, Uri.parse(STREAM_URL)); mp.prepareAsync(); mp.start(); In both the cases audio is not playing. Can some body help me out from this trouble. Thanks & Regards
0
11,594,259
07/21/2012 17:16:40
1,130,289
01/04/2012 15:53:28
945
41
How can I pass a variable from a ASP website to a desktop application?
I am trying to pass a variable from an asp project (written in c#) to a desktop c# application. I know using Javascript you can use a [`JavaScriptSerializer`](http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CGUQFjAA&url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.web.script.serialization.javascriptserializer.aspx&ei=l-MKUNadA5OwqQHbnonACg&usg=AFQjCNGMTMT3jhFYETV1ayJ_ym7Xqz5gBw&sig2=uFKXU8j4sYCa9NshrCdigg), but is there an equivalent for asp?
c#
asp.net
variables
serialization
null
null
open
How can I pass a variable from a ASP website to a desktop application? === I am trying to pass a variable from an asp project (written in c#) to a desktop c# application. I know using Javascript you can use a [`JavaScriptSerializer`](http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CGUQFjAA&url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.web.script.serialization.javascriptserializer.aspx&ei=l-MKUNadA5OwqQHbnonACg&usg=AFQjCNGMTMT3jhFYETV1ayJ_ym7Xqz5gBw&sig2=uFKXU8j4sYCa9NshrCdigg), but is there an equivalent for asp?
0
11,594,260
07/21/2012 17:16:58
1,179,807
01/31/2012 08:01:32
5
0
Android Activity / GlSurfaceView flow
When a GlSurfaceView is set as ContentView in Activity.onStart(), is it possible, that Renderer.onSurfaceCreatet() is called before Activity.start() or Actvity.onResume()?
android
activity
glsurfaceview
null
null
null
open
Android Activity / GlSurfaceView flow === When a GlSurfaceView is set as ContentView in Activity.onStart(), is it possible, that Renderer.onSurfaceCreatet() is called before Activity.start() or Actvity.onResume()?
0
11,594,283
07/21/2012 17:20:13
852,499
07/19/2011 17:13:48
696
20
Keytool does not ask password (using Facebook lib with android)
I run the script below like Facebook said. There is no problem. But the problem is it never gives me a password question and according to facebook documentation it means my keystore path is incorrect. But debug.keystore file is in correct path! C:\Users\KSM45\.android Please let me know where do I make mistake? I just want to login with facebook! (From documentation page: Also make sure you are using the correct password - for the debug keystore, use 'android' to generate the keyhash. General Rule: If the tool does not ask for password, your keystore path is incorrect.) keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
android
facebook
keytool
null
null
null
open
Keytool does not ask password (using Facebook lib with android) === I run the script below like Facebook said. There is no problem. But the problem is it never gives me a password question and according to facebook documentation it means my keystore path is incorrect. But debug.keystore file is in correct path! C:\Users\KSM45\.android Please let me know where do I make mistake? I just want to login with facebook! (From documentation page: Also make sure you are using the correct password - for the debug keystore, use 'android' to generate the keyhash. General Rule: If the tool does not ask for password, your keystore path is incorrect.) keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
0
11,594,284
07/21/2012 17:20:15
278,842
02/22/2010 16:36:10
2,100
98
Finding length of period in time domain data
I have a series of measurements of a signal source, which emits a periodic signal at an unknown interval time of `p` seconds. Detecting the signal is not easy so I am missing quite a few signals in the data. Data is also noisy so there are errors in the data of up to +/- 10% per signal. Example measurements `x` might look like this: 72.3, 185.1, 364.2, 570.2, 679.2, 1060.7 The result I am looking for, is the period hidden in the measurments, `p = ~100` in this example case and possibly the best offset `c = ~70`. Typically I have 4-7 measurements in a series I would like to analyse, so it seems an analytic answer is more appropriate than a sound analysis (FFT). Ideas I have considered: * Non-linear optimization such that we optimize for `x = n * p + c`. Levenberg-Marquart should do the trick. * Building a histogram of difference between consecutive measurements and picking the average of the fullest bin. * Floating point GCD http://stackoverflow.com/questions/445113/approximate-greatest-common-divisor But I am very unsure whether I might have missed an obvious solution from the sound analysis camp (autocorrelation, Harmonic Spectrum Product, DFT, e.g. http://stackoverflow.com/questions/4716620/algorithm-to-determine-fundamental-frequency-from-potential-harmonics). So I am turning to the wisdom of SO. How would you go about solving this problem most elegantly? Library suggestions are fine (C++).
optimization
language-agnostic
signal-processing
frequency-analysis
null
07/22/2012 15:15:02
off topic
Finding length of period in time domain data === I have a series of measurements of a signal source, which emits a periodic signal at an unknown interval time of `p` seconds. Detecting the signal is not easy so I am missing quite a few signals in the data. Data is also noisy so there are errors in the data of up to +/- 10% per signal. Example measurements `x` might look like this: 72.3, 185.1, 364.2, 570.2, 679.2, 1060.7 The result I am looking for, is the period hidden in the measurments, `p = ~100` in this example case and possibly the best offset `c = ~70`. Typically I have 4-7 measurements in a series I would like to analyse, so it seems an analytic answer is more appropriate than a sound analysis (FFT). Ideas I have considered: * Non-linear optimization such that we optimize for `x = n * p + c`. Levenberg-Marquart should do the trick. * Building a histogram of difference between consecutive measurements and picking the average of the fullest bin. * Floating point GCD http://stackoverflow.com/questions/445113/approximate-greatest-common-divisor But I am very unsure whether I might have missed an obvious solution from the sound analysis camp (autocorrelation, Harmonic Spectrum Product, DFT, e.g. http://stackoverflow.com/questions/4716620/algorithm-to-determine-fundamental-frequency-from-potential-harmonics). So I am turning to the wisdom of SO. How would you go about solving this problem most elegantly? Library suggestions are fine (C++).
2
5,930,920
05/08/2011 22:52:30
1,389,844
02/18/2011 06:02:40
21
0
attr_protected only for updates?
I want to be able to protect the email field of an Account from being updated, but not when the Account record is first created. I tried the following: validate :email_is_unchanged, :on => :update def email_is_unchanged errors.add :email, "can only be changed through confirmation" if email_changed? end but when I try to do the following (with an existing record in the database): > a = Account.first > a.update_attributes({:email => > "[email protected]")} It returns true but doesn't save the record. Inspection of the errors shows that the error from the validation method was added. Is there a better way to do this?
ruby-on-rails
null
null
null
null
null
open
attr_protected only for updates? === I want to be able to protect the email field of an Account from being updated, but not when the Account record is first created. I tried the following: validate :email_is_unchanged, :on => :update def email_is_unchanged errors.add :email, "can only be changed through confirmation" if email_changed? end but when I try to do the following (with an existing record in the database): > a = Account.first > a.update_attributes({:email => > "[email protected]")} It returns true but doesn't save the record. Inspection of the errors shows that the error from the validation method was added. Is there a better way to do this?
0
11,713,595
07/29/2012 22:36:55
568,266
01/08/2011 19:21:50
1,250
64
Excel CodeModule doesn't save new code
I have hundreds of excel files that need to be extended with code and new sheets. When I add the code first, it saves correctly. Unfortunately the code contains references to the sheets that needs to be added. So I have to add the sheet before... But then the problem occurs, that the added code is not saved within the workbook. Even if added the sheet manually... I'm not able to add code in any way.
c#
excel
excel-interop
null
null
null
open
Excel CodeModule doesn't save new code === I have hundreds of excel files that need to be extended with code and new sheets. When I add the code first, it saves correctly. Unfortunately the code contains references to the sheets that needs to be added. So I have to add the sheet before... But then the problem occurs, that the added code is not saved within the workbook. Even if added the sheet manually... I'm not able to add code in any way.
0
11,713,602
07/29/2012 22:38:28
359,987
06/07/2010 01:58:23
53
0
Error received when testing for element attribute using jquery
I am trying to test for an attribute in a dynamic php photo gallery that loads images from a folder into a gallery. The gallery uses lightbox to display the photo once clicked. This is what I'm using to test: if( $('#lightboxImage').attr('src') !== 'undefined'){ do something here } I'm getting an initial error (Cannot call method 'attr' of null) in debug I think because the #lightboxImage only has a 'src' attribute when an image from the gallery is clicked. Nothing is obviously clicked when the page first loads. Any ideas on how to solve this? Thanks
php
jquery
lightbox
null
null
null
open
Error received when testing for element attribute using jquery === I am trying to test for an attribute in a dynamic php photo gallery that loads images from a folder into a gallery. The gallery uses lightbox to display the photo once clicked. This is what I'm using to test: if( $('#lightboxImage').attr('src') !== 'undefined'){ do something here } I'm getting an initial error (Cannot call method 'attr' of null) in debug I think because the #lightboxImage only has a 'src' attribute when an image from the gallery is clicked. Nothing is obviously clicked when the page first loads. Any ideas on how to solve this? Thanks
0
11,713,604
07/29/2012 22:39:30
1,059,933
11/22/2011 14:06:00
48
0
Can't fine item Icon files in <projct_name>-Info.plist
or should I just add row and name it as "Icon files"? Thanks.
iphone
ios5
xcode4
null
null
null
open
Can't fine item Icon files in <projct_name>-Info.plist === or should I just add row and name it as "Icon files"? Thanks.
0
11,713,614
07/29/2012 22:41:24
1,432,894
06/02/2012 21:23:55
65
8
didSelectViewController in AppDelegate is not called
This is how I tell didFinishLaunchingWithOptions about the Tab Bar Controller created in storyboard. It now displays the iAd banner in the main tab. But nothing happens when I tap the other tabs. didSelectViewController is never being called. How can I connect didSelectViewController to my TabBarController and assign currentController property to current/active tab? #import "AppDelegate.h" @interface AppDelegate() @property (nonatomic, retain) ADBannerView *bannerView; @property (nonatomic, assign) UIViewController<BannerViewContainer> *currentController; @end @implementation AppDelegate @synthesize window = _window; @synthesize bannerView; @synthesize currentController; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch CGRect screenBounds = [[UIScreen mainScreen] bounds]; // bannerView was here // This is the reference to the tab bar controller and first tab from storyboard. UITabBarController *tabController = (UITabBarController *)self.window.rootViewController; self.currentController = [[tabController viewControllers] objectAtIndex:0]; NSLog(@"Root: %@", self.window.rootViewController); NSLog(@"Tab with banner: %@", self.currentController); return YES; } //and this isn't called: - (void)tabController:(UITabBarController *)tabController didSelectViewController: (UIViewController *)viewController { // If called for selection of the same tab, do nothing if (currentController == viewController) { return; } if (bannerView.bannerLoaded) { // If we have a bannerView atm, tell old view controller to hide and new to show. [currentController hideBannerView:bannerView]; [(UIViewController<BannerViewContainer>*)viewController showBannerView:bannerView]; } // And remember this viewcontroller for the future. self.currentController = (UIViewController<BannerViewContainer> *)viewController; }
iphone
objective-c
xcode
delegates
uitabbarcontroller
null
open
didSelectViewController in AppDelegate is not called === This is how I tell didFinishLaunchingWithOptions about the Tab Bar Controller created in storyboard. It now displays the iAd banner in the main tab. But nothing happens when I tap the other tabs. didSelectViewController is never being called. How can I connect didSelectViewController to my TabBarController and assign currentController property to current/active tab? #import "AppDelegate.h" @interface AppDelegate() @property (nonatomic, retain) ADBannerView *bannerView; @property (nonatomic, assign) UIViewController<BannerViewContainer> *currentController; @end @implementation AppDelegate @synthesize window = _window; @synthesize bannerView; @synthesize currentController; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch CGRect screenBounds = [[UIScreen mainScreen] bounds]; // bannerView was here // This is the reference to the tab bar controller and first tab from storyboard. UITabBarController *tabController = (UITabBarController *)self.window.rootViewController; self.currentController = [[tabController viewControllers] objectAtIndex:0]; NSLog(@"Root: %@", self.window.rootViewController); NSLog(@"Tab with banner: %@", self.currentController); return YES; } //and this isn't called: - (void)tabController:(UITabBarController *)tabController didSelectViewController: (UIViewController *)viewController { // If called for selection of the same tab, do nothing if (currentController == viewController) { return; } if (bannerView.bannerLoaded) { // If we have a bannerView atm, tell old view controller to hide and new to show. [currentController hideBannerView:bannerView]; [(UIViewController<BannerViewContainer>*)viewController showBannerView:bannerView]; } // And remember this viewcontroller for the future. self.currentController = (UIViewController<BannerViewContainer> *)viewController; }
0
11,713,618
07/29/2012 22:42:38
730,009
04/28/2011 19:53:03
18
0
$.ajax with jsonp causes IE8 to throw security warning
I have a https site. I'm running LifeRay on Tomcat. I'm using the following url: http://gdata.youtube.com/feeds/api/videos/ID?v=2&alt=jsonc and jQuery.ajax({ url: URL, dataType: 'jsonp', async: false, success: function (obj) {processData(obj); } }); to get the data and then processing it. It works on all the browsers. The only problem is that I get a security warning in IE8. Question1: Is there any way to get the JSON data securely and processing the data without IE throwing any warning messages? Question2: How and where can I set this: Access-Control-Allow-Origin: http://youtube.com, so that maybe IE won't throw any warning messages?
ajax
internet-explorer-8
youtube
jsonp
null
null
open
$.ajax with jsonp causes IE8 to throw security warning === I have a https site. I'm running LifeRay on Tomcat. I'm using the following url: http://gdata.youtube.com/feeds/api/videos/ID?v=2&alt=jsonc and jQuery.ajax({ url: URL, dataType: 'jsonp', async: false, success: function (obj) {processData(obj); } }); to get the data and then processing it. It works on all the browsers. The only problem is that I get a security warning in IE8. Question1: Is there any way to get the JSON data securely and processing the data without IE throwing any warning messages? Question2: How and where can I set this: Access-Control-Allow-Origin: http://youtube.com, so that maybe IE won't throw any warning messages?
0
11,713,619
07/29/2012 22:43:04
177,883
09/23/2009 15:35:15
5,341
200
Register HttpHandler under a path/folder
Why cant i register a HttpModule under a directory? </system.web> <httpHandlers> <add verb="*" path="/home/facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" /> </httpHandlers> </system.web> <system.webServer> <handlers> <add name="facebookredirect.axd" verb="*" path="/home/facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" /> </handlers> when the request comes to `/home/facebookredirect.axd` i m getting a 404. why this is not working? I want the `facebookredirect.axd` to work under `/home/` Below is frm, global.asx `routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); ` Essentially. `home` doesnt exist, there is a home controller. But i want to use this path.
c#
asp.net-mvc-3
web-config
httphandler
null
null
open
Register HttpHandler under a path/folder === Why cant i register a HttpModule under a directory? </system.web> <httpHandlers> <add verb="*" path="/home/facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" /> </httpHandlers> </system.web> <system.webServer> <handlers> <add name="facebookredirect.axd" verb="*" path="/home/facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" /> </handlers> when the request comes to `/home/facebookredirect.axd` i m getting a 404. why this is not working? I want the `facebookredirect.axd` to work under `/home/` Below is frm, global.asx `routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); ` Essentially. `home` doesnt exist, there is a home controller. But i want to use this path.
0
11,713,625
07/29/2012 22:43:58
1,324,936
04/10/2012 19:36:57
89
9
Android: Handler for AsyncTask
I use AsyncTask in combination with a ProgressDialog. See my code, I have a problem in onPostExecute. If the task is running for the first time it get a Null Poiter Exception for progressDialog in handleMessage but calling dismiss() direct would work. When I turn the phone before onPostExecute is reached, progressDialog.dismiss() does not work. why does the handler not always work? public class UpdateTask extends AsyncTask<Void, Void, Void> { private ProgressDialog progressDialog; private Handler handler; public UpdateTask(Act activity) { progressDialog = ProgressDialog.show(Activity.this, "Wait", "Wait"); progressDialog.dismiss(); handler = new Handler(){ @Override public void handleMessage(Message msg) { //run on UI Thread switch( msg.what ){ case MSG: progressDialog.show(); break; case DETACH: progressDialog.dismiss(); break; } } }; } void detach() { activity=null; //problematic //progressDialog.dismiss(); //handler.sendEmptyMessage(DETACH); } @Override protected Void doInBackground(Void... params) { handler.sendEmptyMessage(MSG);; return null; } protected void onPostExecute(Void result) { if (activity==null) { Log.w("RotationAsync", "onPostExecute() skipped -- no activity"); } else { //problematic // progressDialog.dismiss(); handler.sendEmptyMessage(MSG); progressDialog = null; } } };
android
null
null
null
null
null
open
Android: Handler for AsyncTask === I use AsyncTask in combination with a ProgressDialog. See my code, I have a problem in onPostExecute. If the task is running for the first time it get a Null Poiter Exception for progressDialog in handleMessage but calling dismiss() direct would work. When I turn the phone before onPostExecute is reached, progressDialog.dismiss() does not work. why does the handler not always work? public class UpdateTask extends AsyncTask<Void, Void, Void> { private ProgressDialog progressDialog; private Handler handler; public UpdateTask(Act activity) { progressDialog = ProgressDialog.show(Activity.this, "Wait", "Wait"); progressDialog.dismiss(); handler = new Handler(){ @Override public void handleMessage(Message msg) { //run on UI Thread switch( msg.what ){ case MSG: progressDialog.show(); break; case DETACH: progressDialog.dismiss(); break; } } }; } void detach() { activity=null; //problematic //progressDialog.dismiss(); //handler.sendEmptyMessage(DETACH); } @Override protected Void doInBackground(Void... params) { handler.sendEmptyMessage(MSG);; return null; } protected void onPostExecute(Void result) { if (activity==null) { Log.w("RotationAsync", "onPostExecute() skipped -- no activity"); } else { //problematic // progressDialog.dismiss(); handler.sendEmptyMessage(MSG); progressDialog = null; } } };
0
11,713,626
07/29/2012 22:44:10
100,426
05/03/2009 18:40:05
436
27
Soundcloud iFrame Embed Leaking Memory
I'm currently building a single-page backbone app that embeds up to 10 separate Soundcloud iFrames on a single page. Users can then view other pages, each of which contain their own set of iFrames. I've noticed that each time a new set of iframes is loaded the memory consumption for the tab increases roughly 80-100MB (according to the Chrome Task Manager). This memory is never relinquished, so after a few clicks the tab easily reaches 300MB and becomes intolerably slow. This slowness occurs in both Chrome 20 and Firefox 13. After each page change I've tried .remove()'ing all the iframes as well as clearing out the container element via .html('') and neither stems the memory growth. Provided in this gist is sample code that exhibits the same behavior as described above. On each load the individual iFrame consumes roughly 10MB of additional memory. https://gist.github.com/3202151 Is the Soundcloud embed code doing something to maintain a handle to the iframe and preventing it from being GC'd? Is there another way I can remove the elements from the DOM to avoid the memory bloat? Note: I cannot add all the tracks to a single set which can be loaded once since tracks being embedded are not my own.
iframe
memory-leaks
embed
soundcloud
null
null
open
Soundcloud iFrame Embed Leaking Memory === I'm currently building a single-page backbone app that embeds up to 10 separate Soundcloud iFrames on a single page. Users can then view other pages, each of which contain their own set of iFrames. I've noticed that each time a new set of iframes is loaded the memory consumption for the tab increases roughly 80-100MB (according to the Chrome Task Manager). This memory is never relinquished, so after a few clicks the tab easily reaches 300MB and becomes intolerably slow. This slowness occurs in both Chrome 20 and Firefox 13. After each page change I've tried .remove()'ing all the iframes as well as clearing out the container element via .html('') and neither stems the memory growth. Provided in this gist is sample code that exhibits the same behavior as described above. On each load the individual iFrame consumes roughly 10MB of additional memory. https://gist.github.com/3202151 Is the Soundcloud embed code doing something to maintain a handle to the iframe and preventing it from being GC'd? Is there another way I can remove the elements from the DOM to avoid the memory bloat? Note: I cannot add all the tracks to a single set which can be loaded once since tracks being embedded are not my own.
0
8,447,087
12/09/2011 14:41:23
1,072,213
11/29/2011 21:24:53
41
0
Using custom objects in a view model Knockout
I am coming from Silverlight to Knockout.js. When I would create ViewModels in Silverlight, I would often times have something like this: public class MyViewModel : ViewModel { private MyCustomClass custom = null; public MyCustomClass Custom { get { return custom; } set { custom = value; NotifyPropertyChanged("MyCustomClass"); } } } <TextBox Text="{Binding Path=Custom.PropertyName, Mode=TwoWay}" /> However, I'm not sure how to do the same kind of thing in Knockout.js. Currently, I have: <input type="text" data-bind="value:propertyName" /> var viewModel = { custom: { propertyName:"" } }
knockout.js
null
null
null
null
null
open
Using custom objects in a view model Knockout === I am coming from Silverlight to Knockout.js. When I would create ViewModels in Silverlight, I would often times have something like this: public class MyViewModel : ViewModel { private MyCustomClass custom = null; public MyCustomClass Custom { get { return custom; } set { custom = value; NotifyPropertyChanged("MyCustomClass"); } } } <TextBox Text="{Binding Path=Custom.PropertyName, Mode=TwoWay}" /> However, I'm not sure how to do the same kind of thing in Knockout.js. Currently, I have: <input type="text" data-bind="value:propertyName" /> var viewModel = { custom: { propertyName:"" } }
0
11,633,874
07/24/2012 15:10:26
497,180
11/04/2010 13:04:42
399
4
Numpy: use bins with infinite range
In my Python script I have floats that I want to bin. Right now I'm doing: min_val = 0.0 max_val = 1.0 num_bins = 20 my_bins = numpy.linspace(min_val, max_val, num_bins) hist,my_bins = numpy.histogram(myValues, bins=my_bins) But now I want to add two more bins to account for values that are < 0.0 and for those that are > 1.0. One bin should thus include all values in ( -inf, 0), the other one all in [1, inf) Is there any straightforward way to do this while still using numpy's `histogram` function?
python
numpy
range
infinite
bin
null
open
Numpy: use bins with infinite range === In my Python script I have floats that I want to bin. Right now I'm doing: min_val = 0.0 max_val = 1.0 num_bins = 20 my_bins = numpy.linspace(min_val, max_val, num_bins) hist,my_bins = numpy.histogram(myValues, bins=my_bins) But now I want to add two more bins to account for values that are < 0.0 and for those that are > 1.0. One bin should thus include all values in ( -inf, 0), the other one all in [1, inf) Is there any straightforward way to do this while still using numpy's `histogram` function?
0
11,206,490
06/26/2012 11:37:18
741,542
05/06/2011 10:10:40
549
31
Issue By Adding NON ARC Files to ARC iPhone Appliation?
I am trying to add some .h .m files which are in NON ARC to ARC iphone Application. I set in build phases to these files -fno-objc-arc as compilerflag. But When i am trying to run this application after added by these files i am getting problem. Appliacation does not give any error is just shows failed once and stop the process of building. I am confused try to understand what is the problem in this. After i delete these files non arc it is running normolly. Please help me any one in this issue. Thanks in advance.
iphone
objective-c
ios5
xcode4.2
arc
null
open
Issue By Adding NON ARC Files to ARC iPhone Appliation? === I am trying to add some .h .m files which are in NON ARC to ARC iphone Application. I set in build phases to these files -fno-objc-arc as compilerflag. But When i am trying to run this application after added by these files i am getting problem. Appliacation does not give any error is just shows failed once and stop the process of building. I am confused try to understand what is the problem in this. After i delete these files non arc it is running normolly. Please help me any one in this issue. Thanks in advance.
0
11,206,493
06/26/2012 11:37:25
1,031,474
11/05/2011 19:14:21
97
0
UIWebView transparency breaks my code
I am setting the background color of a UIWebView to clearColor and am also setting the opaque property to false. In my html file I have set the background to transparent. However for some weird reason my web view doesn't interpret the body of my HTML file correctly, I see tags like <b><i> as soon as I remove the setBackgroundColor: call things return to normal. This happens on the iOS 5 simulator.
iphone
objective-c
ios
uiwebview
null
null
open
UIWebView transparency breaks my code === I am setting the background color of a UIWebView to clearColor and am also setting the opaque property to false. In my html file I have set the background to transparent. However for some weird reason my web view doesn't interpret the body of my HTML file correctly, I see tags like <b><i> as soon as I remove the setBackgroundColor: call things return to normal. This happens on the iOS 5 simulator.
0
11,650,444
07/25/2012 13:08:42
1,551,482
07/25/2012 11:45:19
16
0
fading in hidden text using jquery on click event?
im trying to fade in the `.example` element which is hidden using: .example { display: none; } the javascript: $('.clickme').click( function() { ..... .... $el.html(html).children().hide().each(function(i, e){ if($(this).hasClass('special')){ $(this).delay(i*600).show(0); animateDiv(e.id); } else{ $(this).delay(i*600).fadeIn(900); // the problem is here its not fading in } working example is here: http://jsfiddle.net/6czap/19/ i cnt seem to find out what the problem is, i have tried this without the click event, and it works.
javascript
jquery
null
null
null
null
open
fading in hidden text using jquery on click event? === im trying to fade in the `.example` element which is hidden using: .example { display: none; } the javascript: $('.clickme').click( function() { ..... .... $el.html(html).children().hide().each(function(i, e){ if($(this).hasClass('special')){ $(this).delay(i*600).show(0); animateDiv(e.id); } else{ $(this).delay(i*600).fadeIn(900); // the problem is here its not fading in } working example is here: http://jsfiddle.net/6czap/19/ i cnt seem to find out what the problem is, i have tried this without the click event, and it works.
0
11,650,448
07/25/2012 13:08:57
1,461,038
06/16/2012 19:26:22
62
9
Infinite scroll plugin debug messages
I have Paul Irish's infinite scroll plugin on my site and it's running perfectly in Firefox, but in Chrome it seems to be detecting height incorrectly. In Firefox I'm consistently getting messages like `["math:", 2005, 110]`. It always gives the same 110 on every page. The documentation is rather sparse, so I couldn't find anything about the debug messaging. From what I can tell the first coordinate is the current height of the window, and the second is the height of the bottom of the container, to which bufferPx is added to determine when to scroll. I never measured everything out, but Firefox is scrolling in about the right place. In Chrome I'm getting messages like `["math:", 2005, 4264]` where the second coordinate is just ridiculously high. Sometimes it's around 4000, sometimes around 3000, the lowest I've seen it in Chrome is 1264, and now that page has jumped up to 4264. IE's console doesn't seem to support the messages, but it also seems to be loading ridiculously high. Why might Chrome and IE be coming up with such high values, and why might they be so inconsistent?
jquery
jquery-plugins
cross-browser
infinite-scroll
null
null
open
Infinite scroll plugin debug messages === I have Paul Irish's infinite scroll plugin on my site and it's running perfectly in Firefox, but in Chrome it seems to be detecting height incorrectly. In Firefox I'm consistently getting messages like `["math:", 2005, 110]`. It always gives the same 110 on every page. The documentation is rather sparse, so I couldn't find anything about the debug messaging. From what I can tell the first coordinate is the current height of the window, and the second is the height of the bottom of the container, to which bufferPx is added to determine when to scroll. I never measured everything out, but Firefox is scrolling in about the right place. In Chrome I'm getting messages like `["math:", 2005, 4264]` where the second coordinate is just ridiculously high. Sometimes it's around 4000, sometimes around 3000, the lowest I've seen it in Chrome is 1264, and now that page has jumped up to 4264. IE's console doesn't seem to support the messages, but it also seems to be loading ridiculously high. Why might Chrome and IE be coming up with such high values, and why might they be so inconsistent?
0
11,650,449
07/25/2012 13:09:01
1,551,668
07/25/2012 12:54:31
1
0
c++ only allow certain parameters to placed in argv[1]
Im trying to write some code that will only let one of four letters be entered in the argv[1] parameter. if it is another character the letter q should come up. so ive written `#include <iostream>` `#include <cstdlib>` `char D, A , R, B;` if(argv[1] != D||A||R||B) { `cout << "Q" << endl;` `return(0);` } can anyone please help me
c++
argv
argc
null
null
07/25/2012 13:46:39
too localized
c++ only allow certain parameters to placed in argv[1] === Im trying to write some code that will only let one of four letters be entered in the argv[1] parameter. if it is another character the letter q should come up. so ive written `#include <iostream>` `#include <cstdlib>` `char D, A , R, B;` if(argv[1] != D||A||R||B) { `cout << "Q" << endl;` `return(0);` } can anyone please help me
3
11,650,431
07/25/2012 13:07:35
1,342,844
04/19/2012 02:18:11
3
0
Sencha Touch 2.0 - How to set scrolling inside a textarea for Mobile Safari?
In my mobile safari project, i need to create a message posting feature. it is requires scrolling inside a textarea when lines of texts exceed the max rows of the text area. i couldn't find 'scrollable' property in Ext.field.textarea, any idea how??????? Cheers!
mobile
safari
scrolling
textarea
sencha
null
open
Sencha Touch 2.0 - How to set scrolling inside a textarea for Mobile Safari? === In my mobile safari project, i need to create a message posting feature. it is requires scrolling inside a textarea when lines of texts exceed the max rows of the text area. i couldn't find 'scrollable' property in Ext.field.textarea, any idea how??????? Cheers!
0
11,410,369
07/10/2012 09:29:41
1,425,114
05/30/2012 03:40:12
8
0
login form on navigation bar in rails
I have created this form for my navigation bar: `<form action="/sessions" method="post" class="well form-inline"> <input id="user_email" name="user[email]" type="text" placeholder="Email"> <input id="user_password" name="user[password]" type="password" placeholder="Password"> <label class="checkbox"> <input type="checkbox"> Remember me </label> <button name="commit" type="submit" class="btn">Sign in</button> </form>` The form is located on the navigation bar, and I have to tell it to go into the `sessions controller` and use the `create` action. How is that done? I searched for days!
ruby-on-rails
ruby-on-rails-3
forms
null
null
null
open
login form on navigation bar in rails === I have created this form for my navigation bar: `<form action="/sessions" method="post" class="well form-inline"> <input id="user_email" name="user[email]" type="text" placeholder="Email"> <input id="user_password" name="user[password]" type="password" placeholder="Password"> <label class="checkbox"> <input type="checkbox"> Remember me </label> <button name="commit" type="submit" class="btn">Sign in</button> </form>` The form is located on the navigation bar, and I have to tell it to go into the `sessions controller` and use the `create` action. How is that done? I searched for days!
0
11,410,371
07/10/2012 09:29:46
999,320
10/17/2011 14:13:13
55
3
jqGrid navigator reload
I have a jqgrid navigator which export the grid into a csv. $('#jqgEndYear').jqGrid('navGrid', '#jqgpEndYear', { excel: true, add: false, del: false, edit: false, search: false }, {}, {}, {}); $("#jqgEndYear").jqGrid('navButtonAdd', '#jqgpEndYear', { caption: "", onClickButton: function () { alert(mapping); $.post('@Url.Action("ExportEndYearSummaryToCsv")', { clientId: '@Model.Division.Client.ClientID', globalId: '@Model.GlobalId', firstName: '@Model.FirstName', lastName: '@Model.LastName', mapping: mapping, yearEnd: year }, function (data) { window.location.href = data; }); } }); My jqGrid is populate when a form is submitted. $('#reviewButton').click(function () { var year = $('#YearList').val(); var mapping = $.trim($('#MappingList').val()); if (!firstClick) { var postdata = $("#jqgEndYear").jqGrid('getGridParam', 'postData'); postdata.yearEnd = year; postdata.mapping = mapping; $("#jqgEndYear").trigger("reloadGrid"); } else { firstClick = false; $('#jqgEndYear').jqGrid({ //url from wich data should be requested url: '@Url.Action("YearEndReview")', //type of data datatype: 'json', //url access method type mtype: 'POST', postData: { mapping: mapping, yearEnd: year, clientId: '@Model.Division.Client.ClientID', globalId: '@Model.GlobalId' }, .... } Since the navigator is define on the first click, if I submit the form again the value of "mapping" and "year" are still the old one in the post for the export. How can I solve this problem? Thanks in advance
jquery
jqgrid
null
null
null
null
open
jqGrid navigator reload === I have a jqgrid navigator which export the grid into a csv. $('#jqgEndYear').jqGrid('navGrid', '#jqgpEndYear', { excel: true, add: false, del: false, edit: false, search: false }, {}, {}, {}); $("#jqgEndYear").jqGrid('navButtonAdd', '#jqgpEndYear', { caption: "", onClickButton: function () { alert(mapping); $.post('@Url.Action("ExportEndYearSummaryToCsv")', { clientId: '@Model.Division.Client.ClientID', globalId: '@Model.GlobalId', firstName: '@Model.FirstName', lastName: '@Model.LastName', mapping: mapping, yearEnd: year }, function (data) { window.location.href = data; }); } }); My jqGrid is populate when a form is submitted. $('#reviewButton').click(function () { var year = $('#YearList').val(); var mapping = $.trim($('#MappingList').val()); if (!firstClick) { var postdata = $("#jqgEndYear").jqGrid('getGridParam', 'postData'); postdata.yearEnd = year; postdata.mapping = mapping; $("#jqgEndYear").trigger("reloadGrid"); } else { firstClick = false; $('#jqgEndYear').jqGrid({ //url from wich data should be requested url: '@Url.Action("YearEndReview")', //type of data datatype: 'json', //url access method type mtype: 'POST', postData: { mapping: mapping, yearEnd: year, clientId: '@Model.Division.Client.ClientID', globalId: '@Model.GlobalId' }, .... } Since the navigator is define on the first click, if I submit the form again the value of "mapping" and "year" are still the old one in the post for the export. How can I solve this problem? Thanks in advance
0
11,410,372
07/10/2012 09:29:48
1,430,046
06/01/2012 06:42:11
1
0
Removing Share Links in Flash
Is there an easy way to remove the share/embed/info links from a flash object? Like these: http://i.imgur.com/AXYVv.png The Code: <script type="text/javascript"> var flashvars = { file:'<?=base_url() . "narratives/narrative_" . $_GET['n'] . ".mp3";?>',autostart:'true' }; var params = { allowfullscreen:'true', allowscriptaccess:'always', menu:'false' }; var attributes = { id:'player1', name:'player1' }; swfobject.embedSWF('<?=base_url();?>player.swf','mediaplayer','930','24','9.0.115','false', flashvars, params, attributes); </script>
flash
embed
null
null
null
null
open
Removing Share Links in Flash === Is there an easy way to remove the share/embed/info links from a flash object? Like these: http://i.imgur.com/AXYVv.png The Code: <script type="text/javascript"> var flashvars = { file:'<?=base_url() . "narratives/narrative_" . $_GET['n'] . ".mp3";?>',autostart:'true' }; var params = { allowfullscreen:'true', allowscriptaccess:'always', menu:'false' }; var attributes = { id:'player1', name:'player1' }; swfobject.embedSWF('<?=base_url();?>player.swf','mediaplayer','930','24','9.0.115','false', flashvars, params, attributes); </script>
0
11,410,374
07/10/2012 09:29:55
488,658
10/27/2010 10:05:19
209
4
Increase the Maximum string length of Excel PrintArea
I asked a question a while back about the Maximum string length of Excel Print Area : http://stackoverflow.com/questions/6014807/maximum-string-length-of-printarea-in-excel Print Area is set at 255, for Excel 2010. I think this is a read-only property but (clutching at straws here), is there any way to *Increase* the Print Area length? Excel plug-in maybe? If not, I'll have to programmatically set a new print area, once the maximum 255 has been reached. Thanks very much.
excel
vba
excel-vba
null
null
null
open
Increase the Maximum string length of Excel PrintArea === I asked a question a while back about the Maximum string length of Excel Print Area : http://stackoverflow.com/questions/6014807/maximum-string-length-of-printarea-in-excel Print Area is set at 255, for Excel 2010. I think this is a read-only property but (clutching at straws here), is there any way to *Increase* the Print Area length? Excel plug-in maybe? If not, I'll have to programmatically set a new print area, once the maximum 255 has been reached. Thanks very much.
0
11,410,375
07/10/2012 09:29:58
1,400,574
05/17/2012 09:13:08
15
0
Width of string in Pixels
Can anyone tell how can I calculate width of a string in pixels,provided font size in pixels? I have to do it in C under linux?
c
linux
string
fonts
pixel
null
open
Width of string in Pixels === Can anyone tell how can I calculate width of a string in pixels,provided font size in pixels? I have to do it in C under linux?
0
11,409,979
07/10/2012 09:03:45
1,513,935
07/10/2012 07:02:40
1
0
how to set the number format for an EditText
I want the number being displayed in my EditText upto 1 decimal place with no leading zeroes e.g. 25.0 not like 025.0 how can i do this? this is in android
android
numbers
format
null
null
null
open
how to set the number format for an EditText === I want the number being displayed in my EditText upto 1 decimal place with no leading zeroes e.g. 25.0 not like 025.0 how can i do this? this is in android
0
11,409,981
07/10/2012 09:03:46
1,425,114
05/30/2012 03:40:12
8
0
sign_in form and sign_up form on homepage using form_tag
This is a basic and common problem, and I'd like to clear it once and for all. (tried for days) I have two forms, which are on the homepage (whos controller is `static_pages_controller`). One form is for signing in, the other for signin up. The `sign_in` form uses the `sessions_controller` using the `create` action. The `sign_up` form uses the `users_controller` using the `create` action. When using `form_tag` how can you specify which controller it should go to and what action it should take? The following code is for the signup page: ` <%= form_tag(users_path) do%> <%= label_tag :name %> <%= text_field_tag :name %> <%= label_tag :email %> <%= text_field_tag :email %> <%= label_tag :password %> <%= password_field_tag :password %> <%= label_tag :password_confirmation, "Confirmation" %> <%= password_field_tag :password_confirmation %> <%= submit_tag "Create my account" , class: "btn btn-large btn-primary" %> <% end %>` I know there are options like `form_tag({:controller => "user", :action => "create"}, :method => "post", :class => "nifty_form")` but none seems to work. Same for sign_in. Please help!
ruby-on-rails
forms
null
null
null
null
open
sign_in form and sign_up form on homepage using form_tag === This is a basic and common problem, and I'd like to clear it once and for all. (tried for days) I have two forms, which are on the homepage (whos controller is `static_pages_controller`). One form is for signing in, the other for signin up. The `sign_in` form uses the `sessions_controller` using the `create` action. The `sign_up` form uses the `users_controller` using the `create` action. When using `form_tag` how can you specify which controller it should go to and what action it should take? The following code is for the signup page: ` <%= form_tag(users_path) do%> <%= label_tag :name %> <%= text_field_tag :name %> <%= label_tag :email %> <%= text_field_tag :email %> <%= label_tag :password %> <%= password_field_tag :password %> <%= label_tag :password_confirmation, "Confirmation" %> <%= password_field_tag :password_confirmation %> <%= submit_tag "Create my account" , class: "btn btn-large btn-primary" %> <% end %>` I know there are options like `form_tag({:controller => "user", :action => "create"}, :method => "post", :class => "nifty_form")` but none seems to work. Same for sign_in. Please help!
0
4,397,555
12/09/2010 11:11:02
498,355
11/05/2010 13:33:22
6
0
TreeNode ForeColor change SelectedNode.ForeColor
I set the ForeColor on a TreeNode object. And later when I click this nodes the SelectedNode.ForeColor isn't changed until after I release the mouse. TreeNode.ForeColor = Color.Black; All TreeNodes with ForeColor == Color.Empty get the proper SelectedNode.ForeColor immediately on mouse click. If I move selection using the keyboard it work as expected. But not on mouse click. How to I set the ForeColor of nodes to e.g. Color.Black and get the correct SelectedNode.ForeColor on the first mouse click?
c#
treeview
treenode
null
null
null
open
TreeNode ForeColor change SelectedNode.ForeColor === I set the ForeColor on a TreeNode object. And later when I click this nodes the SelectedNode.ForeColor isn't changed until after I release the mouse. TreeNode.ForeColor = Color.Black; All TreeNodes with ForeColor == Color.Empty get the proper SelectedNode.ForeColor immediately on mouse click. If I move selection using the keyboard it work as expected. But not on mouse click. How to I set the ForeColor of nodes to e.g. Color.Black and get the correct SelectedNode.ForeColor on the first mouse click?
0
11,410,393
07/10/2012 09:31:36
1,201,577
02/10/2012 08:03:42
31
2
Eclipse and internet connection
To test apps that use internet connections i need something to configure the quality of it, is there any way to do this in Eclipse? Thanks.
android
eclipse
internet
null
null
null
open
Eclipse and internet connection === To test apps that use internet connections i need something to configure the quality of it, is there any way to do this in Eclipse? Thanks.
0
11,410,395
07/10/2012 09:31:54
588,077
01/24/2011 20:13:52
816
60
1:1 entity mapping in Orchard CMS
I'm wondering if its is possible to create 1:1 mapping in Orchard CMS where I would have PK on one entity and PFK on other entity as keys. Im quite aware how to do this in NHibernate, but its not qite clear to me if there is a way how to do this in Orchard. Should I perhaps extend `SchemaBuilder` used in `DataMigrationImpl`, but then I also need a way to override NHibernate convention based mapping?
c#
nhibernate
orchardcms
null
null
null
open
1:1 entity mapping in Orchard CMS === I'm wondering if its is possible to create 1:1 mapping in Orchard CMS where I would have PK on one entity and PFK on other entity as keys. Im quite aware how to do this in NHibernate, but its not qite clear to me if there is a way how to do this in Orchard. Should I perhaps extend `SchemaBuilder` used in `DataMigrationImpl`, but then I also need a way to override NHibernate convention based mapping?
0
11,401,221
07/09/2012 18:50:51
318,663
04/16/2010 15:58:31
131
2
UPDATE sql query from two table values
I have 2 tables with values stored as below. **Table1** ReferranceID StatusNumber ServiceType T2OpenDt T1OpenDT 162987 399519 Orthopaedic Surgery NULL 2011-08-19 162987 399525 Acupuncture NULL 2011-08-19 162987 413405 Anesthesiology NULL 2011-09-28 162987 517174 Chiropractic NULL 2012-04-26 **Table2** ReferranceID StatusNumber Status T2OpenDate 162987 256033 Closed 2010-11-17 162987 488518 ReOpen 2012-02-22 The first table should be updated as below from the 2nd table. (i.e the Result values) ReferranceID StatusNumber ServiceType T2OpenDt T1OpenDT 162987 399519 Orthopaedic Surgery 2010-11-17 2011-08-19 162987 399525 Acupuncture 2010-11-17 2011-08-19 162987 413405 Anesthesiology 2010-11-17 2011-09-28 162987 517174 Chiropractic 2012-02-22 2012-04-26 **'2010-11-17'** will be updated in **3 rows** since the T2OpenDate is less than T1Opendate and there is only one occurance of **2012-02-22** since this date is slightly greater than other 3 top T1OpenDate and less than the 4th T1OpenDate. Could anybody suggest me the UPDATE sqlquery for the above. Thank you so very much for helping me.
sql
sql-server
tsql
sql-server-2005
null
null
open
UPDATE sql query from two table values === I have 2 tables with values stored as below. **Table1** ReferranceID StatusNumber ServiceType T2OpenDt T1OpenDT 162987 399519 Orthopaedic Surgery NULL 2011-08-19 162987 399525 Acupuncture NULL 2011-08-19 162987 413405 Anesthesiology NULL 2011-09-28 162987 517174 Chiropractic NULL 2012-04-26 **Table2** ReferranceID StatusNumber Status T2OpenDate 162987 256033 Closed 2010-11-17 162987 488518 ReOpen 2012-02-22 The first table should be updated as below from the 2nd table. (i.e the Result values) ReferranceID StatusNumber ServiceType T2OpenDt T1OpenDT 162987 399519 Orthopaedic Surgery 2010-11-17 2011-08-19 162987 399525 Acupuncture 2010-11-17 2011-08-19 162987 413405 Anesthesiology 2010-11-17 2011-09-28 162987 517174 Chiropractic 2012-02-22 2012-04-26 **'2010-11-17'** will be updated in **3 rows** since the T2OpenDate is less than T1Opendate and there is only one occurance of **2012-02-22** since this date is slightly greater than other 3 top T1OpenDate and less than the 4th T1OpenDate. Could anybody suggest me the UPDATE sqlquery for the above. Thank you so very much for helping me.
0
11,401,223
07/09/2012 18:50:54
1,354,442
04/24/2012 17:59:53
8
0
Grid Walking Game
There is an interesting game named one person game. It is played via a m*n grids. There is an non-negative integer in each grid. At first your score is 0. You cannot enter a grid with integer 0. You can start and end the game at any grid you want (of course the number in the grid cannot be 0). At each step you can go up, down,left and right to the adjacent grid. The score you can get at last is the sum of the grids on your path. But you can enter each grid at most once.<br/> The aim of the game is to get your score as high as possible. Input:<br/> The first line of input is an integer T the number of test cases. The first line of each test case is a single line containing 2 integers m and n which is the number of rows and columns of the grids. Each of next the m lines contains n space-separated integers D indicating the number in the corresponding grid<br/> Output:<br/> For each test case output an integer in a single line which is maximum score you can get at last.<br/> Constraints:<br/> T is less than 7.<br/> D is less than 60001.<br/> m and n are less than 8.<br/> Sample Input: 4<br/> 1 1<br/> 5911<br/> 1 2<br/> 10832 0<br/> 1 1<br/> 0<br/> 4 1<br/> 0<br/> 8955<br/> 0<br/> 11493<br/> Sample Output:<br/> 5911<br/> 10832<br/> 0<br/> 11493<br/> I tried it but my approach is working very slow for a 8x8 grid.I am trying to access every possible path of the grid recursively and comparing the sum of every path.Below is my code #include<iostream> #include <algorithm> #include <stdio.h> using namespace std; int max(int a,int b,int c, int d) { int max = a; if(b>max) max = b; if(c>max) max = c; if(d>max) max = d; return max; } int Visit_Component( int (*A)[8], int Visit[8][8], int m,int n , int row, int col) { if ( ( row >= m ) || (col >= n ) || (col < 0) || (row < 0) || A[row][col] == 0 || Visit[row][col] == 1 ) { return 0; } else { Visit[row][col] = 1; int a= 0,b=0,c=0,d=0,result =0; a = Visit_Component( A, Visit,m,n, row+1, col); b = Visit_Component( A, Visit,m,n, row, col +1); c = Visit_Component( A, Visit,m,n, row, col -1); d = Visit_Component( A, Visit,m,n, row-1, col ); Visit[row][col] = 0; result = A[row][col] + max(a,b,c,d); return result; } } int main(){ int T; scanf("%d",&T); for(int k =0; k<T;k++) { int N ; int M; int count = 0; int maxcount = 0; scanf("%d %d",&M,&N); int C[8][8]; int visit[8][8]; for(int i = 0; i < M; i++) for(int j = 0; j < N; j++) { scanf("%d",&C[i][j]); visit[i][j] = 0; } for( int i= 0 ; i< M ; i++ ) { for( int j =0; j< N ; j++ ) { count = Visit_Component( C, visit,M,N, i, j); if(count > maxcount) { maxcount = count; } } } printf("%d\n",maxcount); } return 0; } Please suggest me how to optimize this approach or a better algorithm.
algorithm
null
null
null
null
null
open
Grid Walking Game === There is an interesting game named one person game. It is played via a m*n grids. There is an non-negative integer in each grid. At first your score is 0. You cannot enter a grid with integer 0. You can start and end the game at any grid you want (of course the number in the grid cannot be 0). At each step you can go up, down,left and right to the adjacent grid. The score you can get at last is the sum of the grids on your path. But you can enter each grid at most once.<br/> The aim of the game is to get your score as high as possible. Input:<br/> The first line of input is an integer T the number of test cases. The first line of each test case is a single line containing 2 integers m and n which is the number of rows and columns of the grids. Each of next the m lines contains n space-separated integers D indicating the number in the corresponding grid<br/> Output:<br/> For each test case output an integer in a single line which is maximum score you can get at last.<br/> Constraints:<br/> T is less than 7.<br/> D is less than 60001.<br/> m and n are less than 8.<br/> Sample Input: 4<br/> 1 1<br/> 5911<br/> 1 2<br/> 10832 0<br/> 1 1<br/> 0<br/> 4 1<br/> 0<br/> 8955<br/> 0<br/> 11493<br/> Sample Output:<br/> 5911<br/> 10832<br/> 0<br/> 11493<br/> I tried it but my approach is working very slow for a 8x8 grid.I am trying to access every possible path of the grid recursively and comparing the sum of every path.Below is my code #include<iostream> #include <algorithm> #include <stdio.h> using namespace std; int max(int a,int b,int c, int d) { int max = a; if(b>max) max = b; if(c>max) max = c; if(d>max) max = d; return max; } int Visit_Component( int (*A)[8], int Visit[8][8], int m,int n , int row, int col) { if ( ( row >= m ) || (col >= n ) || (col < 0) || (row < 0) || A[row][col] == 0 || Visit[row][col] == 1 ) { return 0; } else { Visit[row][col] = 1; int a= 0,b=0,c=0,d=0,result =0; a = Visit_Component( A, Visit,m,n, row+1, col); b = Visit_Component( A, Visit,m,n, row, col +1); c = Visit_Component( A, Visit,m,n, row, col -1); d = Visit_Component( A, Visit,m,n, row-1, col ); Visit[row][col] = 0; result = A[row][col] + max(a,b,c,d); return result; } } int main(){ int T; scanf("%d",&T); for(int k =0; k<T;k++) { int N ; int M; int count = 0; int maxcount = 0; scanf("%d %d",&M,&N); int C[8][8]; int visit[8][8]; for(int i = 0; i < M; i++) for(int j = 0; j < N; j++) { scanf("%d",&C[i][j]); visit[i][j] = 0; } for( int i= 0 ; i< M ; i++ ) { for( int j =0; j< N ; j++ ) { count = Visit_Component( C, visit,M,N, i, j); if(count > maxcount) { maxcount = count; } } } printf("%d\n",maxcount); } return 0; } Please suggest me how to optimize this approach or a better algorithm.
0
11,398,436
07/09/2012 15:38:43
1,185,422
02/02/2012 14:59:30
415
4
Reading particular line in a file for a particular word in PHP
I am new to php, I need to read a text file's 5th line and see if it contains a particular string what would be the most efficient way to do it ? I understand I can ready all lines using this method, should I put a counter here and break the loop if it is 5 ? or is there a better way to it .. $file = fopen($fileName,'r'); while(!feof($file)) { $name = fgets($file); } fclose($file);
php
null
null
null
null
null
open
Reading particular line in a file for a particular word in PHP === I am new to php, I need to read a text file's 5th line and see if it contains a particular string what would be the most efficient way to do it ? I understand I can ready all lines using this method, should I put a counter here and break the loop if it is 5 ? or is there a better way to it .. $file = fopen($fileName,'r'); while(!feof($file)) { $name = fgets($file); } fclose($file);
0
11,401,232
07/09/2012 18:51:19
1,512,785
07/09/2012 18:11:59
1
0
Calculate eigenvalues/eigenvectors of hundreds of small matrices using CUDA
I have a question on the eigen-decomposition of hundreds of small matrices using CUDA. I need to calculate the eigenvalues and eigenvectors of hundreds (e.g. 500) of small (64-by-64) real symmetric matrices concurrently. I tried to implement it by the Jacobi method using chess tournament ordering (see the attached paper). In this algorithm, 32 threads are defined in each block, while each block handles one small matrix, and the 32 threads work together to inflate 32 off-diagonal elements until convergence. However, I am not very satisfied with its performance. I am wondering where there is any better algorithm for my question, i.e. the eigen-decomposition of many 64-by-64 real symmetric matrices. I guess the householder's method may be a better choice but not sure whether it can be efficiently implemented in CUDA. There are not a lot of useful information online, since most of other programmers are more interested in using CUDA/OpenCL to decompose one large matrix instead of a lot of small matrices. Any help is greatly appreciated. Reference: http://saahpc.ncsa.illinois.edu/10/papers/paper_19.pdf
matrix
cuda
opencl
linear-algebra
numerical-methods
null
open
Calculate eigenvalues/eigenvectors of hundreds of small matrices using CUDA === I have a question on the eigen-decomposition of hundreds of small matrices using CUDA. I need to calculate the eigenvalues and eigenvectors of hundreds (e.g. 500) of small (64-by-64) real symmetric matrices concurrently. I tried to implement it by the Jacobi method using chess tournament ordering (see the attached paper). In this algorithm, 32 threads are defined in each block, while each block handles one small matrix, and the 32 threads work together to inflate 32 off-diagonal elements until convergence. However, I am not very satisfied with its performance. I am wondering where there is any better algorithm for my question, i.e. the eigen-decomposition of many 64-by-64 real symmetric matrices. I guess the householder's method may be a better choice but not sure whether it can be efficiently implemented in CUDA. There are not a lot of useful information online, since most of other programmers are more interested in using CUDA/OpenCL to decompose one large matrix instead of a lot of small matrices. Any help is greatly appreciated. Reference: http://saahpc.ncsa.illinois.edu/10/papers/paper_19.pdf
0
11,401,233
07/09/2012 18:51:25
72,423
03/01/2009 08:26:34
143
2
Compiling ClojureScript inside Clojure
I would like to do something like this (def x '(map (fn [n] (* n n n)) [1 2 3 4])) (cljs->js x) where `cljs->js` returns JavaScript code. I guess [Himera][1] does something similar (first reading ClojureScript from a string), but I don't know enough about ClojureScript to figure it out. Is there are simple solution to this? [1]: http://himera.herokuapp.com/index.html
clojure
clojurescript
null
null
null
null
open
Compiling ClojureScript inside Clojure === I would like to do something like this (def x '(map (fn [n] (* n n n)) [1 2 3 4])) (cljs->js x) where `cljs->js` returns JavaScript code. I guess [Himera][1] does something similar (first reading ClojureScript from a string), but I don't know enough about ClojureScript to figure it out. Is there are simple solution to this? [1]: http://himera.herokuapp.com/index.html
0
11,401,235
07/09/2012 18:51:29
1,512,847
07/09/2012 18:40:31
1
0
access localhost from mobile phone
I am working on a Mobile website using jquery mobile and would like to test it using my android Phone browser. My Windows 7 machine and android phone are on the same wireless network. I normally access the mobile site: "**http://localhost/index.php/doctor**" from my machine I tried to accessing it using th IP address of the wireless network from my mobile: "**http://192.168.1.3/index.php/doctor**" but, I get web page not available error. How do I access localhost from my android phone?!
mobile
jquery-mobile
localhost
null
null
07/10/2012 19:14:27
too localized
access localhost from mobile phone === I am working on a Mobile website using jquery mobile and would like to test it using my android Phone browser. My Windows 7 machine and android phone are on the same wireless network. I normally access the mobile site: "**http://localhost/index.php/doctor**" from my machine I tried to accessing it using th IP address of the wireless network from my mobile: "**http://192.168.1.3/index.php/doctor**" but, I get web page not available error. How do I access localhost from my android phone?!
3
11,387,087
07/08/2012 22:02:46
231,125
12/14/2009 09:36:28
1,439
109
can I send "low priority" xmlhttprequest request that doesn't swamp the broadband?
I have a script which uploads a lot of POST data using jQuery, but this interferes with all other requests as the outgoing data swamps any other requests the browser (and other things, like ssh clients) might make. is it possible (unlikely, yes) to tell the connection to slow down a bit as it's not a priority, and let other connections through? jQuery is tagged, because that's the major library I'm using, but I can work on a lower level if the answer needs it.
javascript
jquery
xmlhttprequest
null
null
null
open
can I send "low priority" xmlhttprequest request that doesn't swamp the broadband? === I have a script which uploads a lot of POST data using jQuery, but this interferes with all other requests as the outgoing data swamps any other requests the browser (and other things, like ssh clients) might make. is it possible (unlikely, yes) to tell the connection to slow down a bit as it's not a priority, and let other connections through? jQuery is tagged, because that's the major library I'm using, but I can work on a lower level if the answer needs it.
0