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,472,123 | 07/13/2012 14:07:35 | 996,894 | 10/15/2011 13:51:07 | 3 | 0 | Convert AS3 to PHP Encryption | I would like to know if someone could convert this little code from as3 to php.
function hashActiveLoginKey($password)
{
var _loc_2:* = new MD5();
var _loc_3:* = new ByteArray();
_loc_3.writeUTFBytes("(LHny:TyGynR" + param1);
var _loc_4:* = _loc_2.hash(_loc_3);
var _loc_5:* = Hex.fromArray(_loc_4);
return Hex.fromArray(_loc_4);
}// end function
Thanks | php | actionscript-3 | convert | null | null | 07/14/2012 14:01:27 | too localized | Convert AS3 to PHP Encryption
===
I would like to know if someone could convert this little code from as3 to php.
function hashActiveLoginKey($password)
{
var _loc_2:* = new MD5();
var _loc_3:* = new ByteArray();
_loc_3.writeUTFBytes("(LHny:TyGynR" + param1);
var _loc_4:* = _loc_2.hash(_loc_3);
var _loc_5:* = Hex.fromArray(_loc_4);
return Hex.fromArray(_loc_4);
}// end function
Thanks | 3 |
11,468,827 | 07/13/2012 10:36:49 | 798,735 | 06/15/2011 01:05:57 | 66 | 3 | Is QtWebkit needed to fetch data from websites that need login? | As the title implies,
I need to fetch data from certain website which need logins to use.
The login procedure might need cookies, or sessions.
Do I need QtWebkit, or can I get away with just QNetworkAccessManager?
I have no experience at both, and will start learning as I go.
So please save me a bit of time of comparing both ^^
Thank you in advance,
Evan | qt | qtwebkit | qtnetwork | null | null | null | open | Is QtWebkit needed to fetch data from websites that need login?
===
As the title implies,
I need to fetch data from certain website which need logins to use.
The login procedure might need cookies, or sessions.
Do I need QtWebkit, or can I get away with just QNetworkAccessManager?
I have no experience at both, and will start learning as I go.
So please save me a bit of time of comparing both ^^
Thank you in advance,
Evan | 0 |
11,470,011 | 07/13/2012 11:55:04 | 1,523,465 | 07/13/2012 11:51:37 | 1 | 0 | ActiveRecord::SubclassNotFound | I'm trying to upgrade my redmine from 1.3.0 to 2.0.0, but i have problems with the database migration, when i run the command : rake db:migrate RAILS_ENV=production
its showing an error like
rake aborted!
uninitialized constant RAILS_ENV
MY ERROR LOG IS:
ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'GoogleAppsAuthSource'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite AuthSource.inheritance_column to use another column for that information.):
app/models/user.rb:139:in `try_to_login'
app/controllers/account_controller.rb:143:in `password_authentication'
app/controllers/account_controller.rb:138:in `authenticate_user'
app/controllers/account_controller.rb:30:in `login'
Here is the list of plugin that i am using in my old redmine:
1)Google Apps plugin
2)Redmine Code Review plugin
3)Redmine Hudson plugin
Please help me | ruby | null | null | null | null | null | open | ActiveRecord::SubclassNotFound
===
I'm trying to upgrade my redmine from 1.3.0 to 2.0.0, but i have problems with the database migration, when i run the command : rake db:migrate RAILS_ENV=production
its showing an error like
rake aborted!
uninitialized constant RAILS_ENV
MY ERROR LOG IS:
ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'GoogleAppsAuthSource'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite AuthSource.inheritance_column to use another column for that information.):
app/models/user.rb:139:in `try_to_login'
app/controllers/account_controller.rb:143:in `password_authentication'
app/controllers/account_controller.rb:138:in `authenticate_user'
app/controllers/account_controller.rb:30:in `login'
Here is the list of plugin that i am using in my old redmine:
1)Google Apps plugin
2)Redmine Code Review plugin
3)Redmine Hudson plugin
Please help me | 0 |
11,470,012 | 07/13/2012 11:55:04 | 1,523,454 | 07/13/2012 11:47:55 | 1 | 0 | ios phonegap disable auto lock with turn off the screen | im working with phonegap and im trying to disable the autolock but allow the phone to turnoff the screen.
So the phone is not locked but has the screen off.
this is for save energy and allow my application to continue his work.
Thanks
| ios | phonegap | null | null | null | null | open | ios phonegap disable auto lock with turn off the screen
===
im working with phonegap and im trying to disable the autolock but allow the phone to turnoff the screen.
So the phone is not locked but has the screen off.
this is for save energy and allow my application to continue his work.
Thanks
| 0 |
11,472,129 | 07/13/2012 14:08:08 | 598,420 | 02/01/2011 13:16:56 | 321 | 17 | difference between lang attribute and meta tags charset attribute | What is the difference between these declaration
<meta charset="language-code">
and
<html lang="language-code">
**NOTE**
The w3c points out the use of lang attribute as
> Assisting search engines
>
> Assisting speech synthesizers
>
> Helping a user agent select glyph variants for high quality typography
>
> Helping a user agent choose a set of quotation marks
>
> Helping a user agent make decisions about hyphenation, ligatures, and
> spacing
>
> Assisting spell checkers and grammar checkers
But I found nothing useful for `charset` attribute of `meta` tag | html | html5 | web | null | null | null | open | difference between lang attribute and meta tags charset attribute
===
What is the difference between these declaration
<meta charset="language-code">
and
<html lang="language-code">
**NOTE**
The w3c points out the use of lang attribute as
> Assisting search engines
>
> Assisting speech synthesizers
>
> Helping a user agent select glyph variants for high quality typography
>
> Helping a user agent choose a set of quotation marks
>
> Helping a user agent make decisions about hyphenation, ligatures, and
> spacing
>
> Assisting spell checkers and grammar checkers
But I found nothing useful for `charset` attribute of `meta` tag | 0 |
11,472,130 | 07/13/2012 14:08:08 | 1,523,746 | 07/13/2012 13:53:32 | 1 | 0 | Mobile Safari rendering CSS differently - any fix? | I have a two column layout (data on left and nav on right). Renders correctly on Safari desktop but on iPhone the right column is rendered at the bottom of the page.
Basic code template is:
<div class="colmask rightmenu">
<div class="colleft">
<div class="col1">
<!-- Column 1 start -->
<div class="ui-body ui-body-e">
<div data-role="collapsible" data-collapsed="true" data-theme="e" data-content-theme="b">
some data here </div>
<!-- Column 1 end -->
</div>
</div>
<div class="col2">
<!-- Column 2 start -->
<div class="ui-body ui-body-b">
nav stuff here
</div>
<!-- Column 2 end -->
</div>
</div>
</div>
</body>
Problem is the same whatever the viewport width is set at (currently 100&%) | css | mobile | safari | null | null | null | open | Mobile Safari rendering CSS differently - any fix?
===
I have a two column layout (data on left and nav on right). Renders correctly on Safari desktop but on iPhone the right column is rendered at the bottom of the page.
Basic code template is:
<div class="colmask rightmenu">
<div class="colleft">
<div class="col1">
<!-- Column 1 start -->
<div class="ui-body ui-body-e">
<div data-role="collapsible" data-collapsed="true" data-theme="e" data-content-theme="b">
some data here </div>
<!-- Column 1 end -->
</div>
</div>
<div class="col2">
<!-- Column 2 start -->
<div class="ui-body ui-body-b">
nav stuff here
</div>
<!-- Column 2 end -->
</div>
</div>
</div>
</body>
Problem is the same whatever the viewport width is set at (currently 100&%) | 0 |
11,472,132 | 07/13/2012 14:08:12 | 1,099,228 | 12/15/2011 06:04:59 | 6 | 0 | Running cosole app with parameters through NSIS installer | I am creating one installer for my project. Deployment of project needs some changes that are too complex with NSIS.
So for making it easy I have written one console app in C#. This app will do all the complex changes required with use of some parameters.
I just want to ask what is the way to call this console app with some parameters from my installer?
Is it possible by creating some batch file or what?
Please help me out. Thanks in advance.
| batch-file | nsis | null | null | null | null | open | Running cosole app with parameters through NSIS installer
===
I am creating one installer for my project. Deployment of project needs some changes that are too complex with NSIS.
So for making it easy I have written one console app in C#. This app will do all the complex changes required with use of some parameters.
I just want to ask what is the way to call this console app with some parameters from my installer?
Is it possible by creating some batch file or what?
Please help me out. Thanks in advance.
| 0 |
11,472,133 | 07/13/2012 14:08:15 | 1,467,584 | 06/19/2012 21:03:40 | 5 | 0 | Sencha Touch - Cross Domain (CORS) Issue | I am attempting to load datapoints from a cross domain URL. Unfortunately I can't get this to work. I have set up my Apache Linux server to support CORS as far as I can tell. I added the following to the header of the configuration file:
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,POST"
Header set Access-Control-Allow-Headers "X-Requested-With"
This is the current setup of my store:
var myStore = Ext.create('Ext.data.Store',
{
fields: [{name: 'xTime', type: 'int'}, {name: 'yData', type: 'float'}, {name: 'target', type: 'string'}],
proxy:
{
type: 'ajax',
url: 'http://test.com/datapoints.json',
useDefaultXhrHeader: false,
reader: 'points'
},
autoLoad: true
});
I'm just trying to find what am I missing here? I'm testing it using Safari and so far, I'm still getting the "Access-Control-Allow-Origin" error.
Any help would be greatly appreciated! | javascript | apache | sencha-touch | sencha | cors | null | open | Sencha Touch - Cross Domain (CORS) Issue
===
I am attempting to load datapoints from a cross domain URL. Unfortunately I can't get this to work. I have set up my Apache Linux server to support CORS as far as I can tell. I added the following to the header of the configuration file:
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,POST"
Header set Access-Control-Allow-Headers "X-Requested-With"
This is the current setup of my store:
var myStore = Ext.create('Ext.data.Store',
{
fields: [{name: 'xTime', type: 'int'}, {name: 'yData', type: 'float'}, {name: 'target', type: 'string'}],
proxy:
{
type: 'ajax',
url: 'http://test.com/datapoints.json',
useDefaultXhrHeader: false,
reader: 'points'
},
autoLoad: true
});
I'm just trying to find what am I missing here? I'm testing it using Safari and so far, I'm still getting the "Access-Control-Allow-Origin" error.
Any help would be greatly appreciated! | 0 |
11,472,134 | 07/13/2012 14:08:16 | 1,074,346 | 11/30/2011 22:18:55 | 191 | 6 | WordPress/PHP - how to move variable to non-wordpress file? | When I execute this code in `functions.php` I get the path:
$upload_dir = wp_upload_dir();
echo $upload_dir['path'];
//Returns: /some/correct/path/
But I want this path to be moved to my custom script located in `uploads.php` where I can't execute `wp_upload_dir();`. I obviously can't `include()` functions.php either because it would execute everything else that is located there.
Is there any tricky way to pass `$upload_dir` variable to `uploads.php`? | php | wordpress | null | null | null | null | open | WordPress/PHP - how to move variable to non-wordpress file?
===
When I execute this code in `functions.php` I get the path:
$upload_dir = wp_upload_dir();
echo $upload_dir['path'];
//Returns: /some/correct/path/
But I want this path to be moved to my custom script located in `uploads.php` where I can't execute `wp_upload_dir();`. I obviously can't `include()` functions.php either because it would execute everything else that is located there.
Is there any tricky way to pass `$upload_dir` variable to `uploads.php`? | 0 |
11,472,137 | 07/13/2012 14:08:29 | 667,206 | 03/19/2011 10:31:42 | 462 | 20 | TINYINT issue with mysql and sqlalchemy | I have a problem with mysql and sqlalchemy, in short in the real
database it's used TINYINT in various places, and not always as a
Boolean.
I sort of solved the first problem in this way, thus converting to
Boolean or Integer depending on what it is.
def _tinyint_to_boolean(self, tbl):
"""Go through the imported table and convert every tinyint
(which is not supported) by sqlite to a Boolean.
*Modifies the table in place*
"""
for field in tbl.c:
if isinstance(field.type, TINYINT):
if field.type.display_width == 1:
self._normalise_field(tbl, field)
field.type = Boolean()
else:
field.type = Integer()
But now in the code that pushes the data from mysql to the in memory
engine I get all the records and add them to the right session:
for rec in tbl.select().execute().fetchall():
data = dict((col.name, getattr(rec, col.name)) for col in tbl.c)
dest_session.merge(new_record(**data))
*But* in the DB sometimes the TINYINT fields contain 0 and -1, instead
of 1, and it complains: ValueError: int_to_boolean only accepts None, 0 or 1
So I need probably to replace every -1 with a 1, but at what point
should I do it?
I didn't find a way to do something like (pseudo-code).
tbl.update(x==-1).values(1)
Any suggestions?
Maybe better ways to handle the TINYINT issue altogether?*emphasized text*
PS. This problem is related to this question (the code I use is inspired from there) http://stackoverflow.com/questions/11436439/sqlalchemy-read-from-mysql-and-write-to-memory/11436611#11436611
| python | sql | null | null | null | null | open | TINYINT issue with mysql and sqlalchemy
===
I have a problem with mysql and sqlalchemy, in short in the real
database it's used TINYINT in various places, and not always as a
Boolean.
I sort of solved the first problem in this way, thus converting to
Boolean or Integer depending on what it is.
def _tinyint_to_boolean(self, tbl):
"""Go through the imported table and convert every tinyint
(which is not supported) by sqlite to a Boolean.
*Modifies the table in place*
"""
for field in tbl.c:
if isinstance(field.type, TINYINT):
if field.type.display_width == 1:
self._normalise_field(tbl, field)
field.type = Boolean()
else:
field.type = Integer()
But now in the code that pushes the data from mysql to the in memory
engine I get all the records and add them to the right session:
for rec in tbl.select().execute().fetchall():
data = dict((col.name, getattr(rec, col.name)) for col in tbl.c)
dest_session.merge(new_record(**data))
*But* in the DB sometimes the TINYINT fields contain 0 and -1, instead
of 1, and it complains: ValueError: int_to_boolean only accepts None, 0 or 1
So I need probably to replace every -1 with a 1, but at what point
should I do it?
I didn't find a way to do something like (pseudo-code).
tbl.update(x==-1).values(1)
Any suggestions?
Maybe better ways to handle the TINYINT issue altogether?*emphasized text*
PS. This problem is related to this question (the code I use is inspired from there) http://stackoverflow.com/questions/11436439/sqlalchemy-read-from-mysql-and-write-to-memory/11436611#11436611
| 0 |
11,373,196 | 07/07/2012 07:36:22 | 1,380,428 | 05/07/2012 18:23:26 | 106 | 14 | Tables from second schema are not visible in Entites Wizard | I want to add <b>ADO.NET Entity Data Model</b> to my project. I want to querry from <b>two schemas</b>. So I configured my connection to use two different Schemas (according to: http://stackoverflow.com/a/7598378/1380428). Now tables are visible in my <b>Server explorer</b>. But they are not visible in ADO.NET Entity Data Model adding Wizard. Only tables from first schema are visible and they have schema name in front:
<b>TableName(SchemaName)</b>. Note that I am using <b>Oracle Database (Oracle ODP.NET)</b> to connent to database. How can I solve this problem?
Thanks in advance | c# | oracle | entity-framework | ado.net | null | null | open | Tables from second schema are not visible in Entites Wizard
===
I want to add <b>ADO.NET Entity Data Model</b> to my project. I want to querry from <b>two schemas</b>. So I configured my connection to use two different Schemas (according to: http://stackoverflow.com/a/7598378/1380428). Now tables are visible in my <b>Server explorer</b>. But they are not visible in ADO.NET Entity Data Model adding Wizard. Only tables from first schema are visible and they have schema name in front:
<b>TableName(SchemaName)</b>. Note that I am using <b>Oracle Database (Oracle ODP.NET)</b> to connent to database. How can I solve this problem?
Thanks in advance | 0 |
11,373,197 | 07/07/2012 07:36:24 | 1,508,396 | 07/07/2012 07:20:37 | 1 | 0 | Crystal Report Is Displaying only one row from datatable which has 10 rows | I have developed a Windows Application which generates report without database using C#.
I have added a Dataset and a DataTable to it as datasource to crystal report. My datatable gets a minimum of 1 row. Even when my datatable has multiple(like 4,5,10) rows the crystal report still displays only the first row of the datatable.
I have used breakpoints and validated that my datatable has multiple rows.
I am using
Windows XP Service Pack 3 (64-Bit) OS
Visual Studio 2010 Professional
.Net Framework 4
Crystal Report(Downloaded From SAP Website last month)
**Thank You**
Please help me out with this
| c# | crystal-reports | report | null | null | null | open | Crystal Report Is Displaying only one row from datatable which has 10 rows
===
I have developed a Windows Application which generates report without database using C#.
I have added a Dataset and a DataTable to it as datasource to crystal report. My datatable gets a minimum of 1 row. Even when my datatable has multiple(like 4,5,10) rows the crystal report still displays only the first row of the datatable.
I have used breakpoints and validated that my datatable has multiple rows.
I am using
Windows XP Service Pack 3 (64-Bit) OS
Visual Studio 2010 Professional
.Net Framework 4
Crystal Report(Downloaded From SAP Website last month)
**Thank You**
Please help me out with this
| 0 |
11,373,198 | 07/07/2012 07:36:33 | 1,154,261 | 01/17/2012 15:31:07 | 8 | 1 | Need to delete a file -ggdb | So I kinda messed up an managed to create a file named -ggdb in my home directory on a Debian distribution. I have tried surrounding it with " to make it a string literal (like so: `rm "-ggdb"`) but i get the following error: `rm: invalid option -- 'g'`... Any ideas? | debian | rm | null | null | null | null | open | Need to delete a file -ggdb
===
So I kinda messed up an managed to create a file named -ggdb in my home directory on a Debian distribution. I have tried surrounding it with " to make it a string literal (like so: `rm "-ggdb"`) but i get the following error: `rm: invalid option -- 'g'`... Any ideas? | 0 |
11,373,190 | 07/07/2012 07:34:51 | 207,524 | 11/10/2009 05:05:37 | 2,615 | 13 | git mv command with Xcode, resource in Xcode disappears? | I'm trying to go through some git commands and tutorials so I don't have to use Xcode for source control. I tried a simple example with a picture.
- I dragged a picture 0000.jpg into my project.
- I see the picture 0000.jpg has an "A" next to it in Xcode
- I go to the command line and git commit -m "test"
- git mv 0000.jpg 1.jpg
- git commit -m "message"
When I go to the folder where this image lies, I do see it gets changed to 1.jpg. However, in Xcode, I still see the image named as 0000.jpg. Even if I clean the project and close and reopen Xcode, the name stays the same. Am I missing something with the mv command? Or is Xcode just not doing what it's supposed to be doing? Thanks!
| xcode | git | null | null | null | null | open | git mv command with Xcode, resource in Xcode disappears?
===
I'm trying to go through some git commands and tutorials so I don't have to use Xcode for source control. I tried a simple example with a picture.
- I dragged a picture 0000.jpg into my project.
- I see the picture 0000.jpg has an "A" next to it in Xcode
- I go to the command line and git commit -m "test"
- git mv 0000.jpg 1.jpg
- git commit -m "message"
When I go to the folder where this image lies, I do see it gets changed to 1.jpg. However, in Xcode, I still see the image named as 0000.jpg. Even if I clean the project and close and reopen Xcode, the name stays the same. Am I missing something with the mv command? Or is Xcode just not doing what it's supposed to be doing? Thanks!
| 0 |
11,373,199 | 07/07/2012 07:36:34 | 1,134,994 | 01/06/2012 19:12:48 | 8 | 0 | JTable , update the table whenever click on a button | I am currently trying to learn JTable with mysql. I've set my database into JTable and added it into my GUI with using scroll pane.
My question is, how can I make a function to renew my database or do a search operation (both are the same thing so..) whenever I click on my button.
Here is my code (I am reading the database informations into my .ini file)
final Vector columnNames = new Vector();
final Vector data = new Vector();
try
{
// Connect to an Access Database
driver = IniFonksiyon.iniSVNOkut(driver, "databaseBilgileri", "driver");//"com.mysql.jdbc.Driver";
url = IniFonksiyon.iniOkut(url, "databaseBilgileri", "url");//"jdbc:mysql://localhost:3306/";
userid = IniFonksiyon.iniOkut(userid, "databaseBilgileri", "kullanici");
password = IniFonksiyon.iniOkut(password, "databaseBilgileri", "sifre");
dbName = IniFonksiyon.iniOkut(dbName, "databaseBilgileri", "dbIsmi");
Class.forName( driver );
Connection connection = DriverManager.getConnection( url+dbName , userid, password );
// Read data from a table
String sql = "select * from profildb.tbl_detailed";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery( sql );
ResultSetMetaData md = rs.getMetaData();
int columns = md.getColumnCount();
// Get column names
for (int i = 1; i <= columns; i++)
{
columnNames.addElement( md.getColumnName(i) );
}
// Get row data
while (rs.next())
{
Vector row = new Vector(columns);
for (int i = 1; i <= columns; i++)
{
row.addElement( rs.getObject(i) );
}
data.addElement( row );
}
rs.close();
stmt.close();
connection.close();
}
catch(Exception e)
{
System.out.println( e );
}
// Create table with database data
final JTable table = new JTable(data, columnNames)
{
/**
*
*/
private static final long serialVersionUID = 1L;
public Class getColumnClass(int column)
{
for (int row = 0; row < getRowCount(); row++)
{
Object o = getValueAt(row, column);
if (o != null)
{
return o.getClass();
}
}
return Object.class;
}
};
This is the code that handles creating the table, but its directly connected with my main GUI function, so How can I refresh/do another operation like search fucntion?
Thanks in advance. | java | mysql | jtable | jscrollpane | null | null | open | JTable , update the table whenever click on a button
===
I am currently trying to learn JTable with mysql. I've set my database into JTable and added it into my GUI with using scroll pane.
My question is, how can I make a function to renew my database or do a search operation (both are the same thing so..) whenever I click on my button.
Here is my code (I am reading the database informations into my .ini file)
final Vector columnNames = new Vector();
final Vector data = new Vector();
try
{
// Connect to an Access Database
driver = IniFonksiyon.iniSVNOkut(driver, "databaseBilgileri", "driver");//"com.mysql.jdbc.Driver";
url = IniFonksiyon.iniOkut(url, "databaseBilgileri", "url");//"jdbc:mysql://localhost:3306/";
userid = IniFonksiyon.iniOkut(userid, "databaseBilgileri", "kullanici");
password = IniFonksiyon.iniOkut(password, "databaseBilgileri", "sifre");
dbName = IniFonksiyon.iniOkut(dbName, "databaseBilgileri", "dbIsmi");
Class.forName( driver );
Connection connection = DriverManager.getConnection( url+dbName , userid, password );
// Read data from a table
String sql = "select * from profildb.tbl_detailed";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery( sql );
ResultSetMetaData md = rs.getMetaData();
int columns = md.getColumnCount();
// Get column names
for (int i = 1; i <= columns; i++)
{
columnNames.addElement( md.getColumnName(i) );
}
// Get row data
while (rs.next())
{
Vector row = new Vector(columns);
for (int i = 1; i <= columns; i++)
{
row.addElement( rs.getObject(i) );
}
data.addElement( row );
}
rs.close();
stmt.close();
connection.close();
}
catch(Exception e)
{
System.out.println( e );
}
// Create table with database data
final JTable table = new JTable(data, columnNames)
{
/**
*
*/
private static final long serialVersionUID = 1L;
public Class getColumnClass(int column)
{
for (int row = 0; row < getRowCount(); row++)
{
Object o = getValueAt(row, column);
if (o != null)
{
return o.getClass();
}
}
return Object.class;
}
};
This is the code that handles creating the table, but its directly connected with my main GUI function, so How can I refresh/do another operation like search fucntion?
Thanks in advance. | 0 |
11,373,200 | 07/07/2012 07:36:34 | 1,106,398 | 12/19/2011 17:23:28 | 42 | 0 | Get XML data using Ajax | Im tring to get google search suggetions through Ajax ! but googles XML layout is strange to me,all the tutorials and articles i found was about getting normal XML results through Ajax!! How to get google XML results via Ajax?
http://google.com/complete/search?output=toolbar&q=face
<toplevel>
−
<CompleteSuggestion>
<suggestion data="facebook"/>
<num_queries int="20200000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook login"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook mobile"/>
<num_queries int="7610000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook ipo"/>
<num_queries int="543000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook stock"/>
<num_queries int="1850000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook covers"/>
<num_queries int="620000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook cover photo"/>
<num_queries int="3000000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook timeline"/>
<num_queries int="1800000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook statuses"/>
<num_queries int="50600000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facetime"/>
<num_queries int="14400000"/>
</CompleteSuggestion>
</toplevel> | javascript | ajax | null | null | null | null | open | Get XML data using Ajax
===
Im tring to get google search suggetions through Ajax ! but googles XML layout is strange to me,all the tutorials and articles i found was about getting normal XML results through Ajax!! How to get google XML results via Ajax?
http://google.com/complete/search?output=toolbar&q=face
<toplevel>
−
<CompleteSuggestion>
<suggestion data="facebook"/>
<num_queries int="20200000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook login"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook mobile"/>
<num_queries int="7610000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook ipo"/>
<num_queries int="543000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook stock"/>
<num_queries int="1850000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook covers"/>
<num_queries int="620000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook cover photo"/>
<num_queries int="3000000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook timeline"/>
<num_queries int="1800000000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facebook statuses"/>
<num_queries int="50600000"/>
</CompleteSuggestion>
−
<CompleteSuggestion>
<suggestion data="facetime"/>
<num_queries int="14400000"/>
</CompleteSuggestion>
</toplevel> | 0 |
11,373,201 | 07/07/2012 07:36:43 | 881,739 | 09/13/2010 12:06:28 | 146 | 4 | How to make JFileChooser not appearing along with the form it belongs? | Based on this [tutorial][1] I have added a JFileChooser in my form , but it appears when the form is loaded for the first time along with the form.
Any ideas on how to fix that?
Here is the code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package nysemarketpick;
import java.io.File;
import java.io.IOException;
import javax.swing.JFileChooser;
/**
*
* @author skiabox
*/
public class MainForm extends javax.swing.JFrame {
/**
* Creates new form MainForm
*/
public MainForm() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
mainPanel = new javax.swing.JPanel();
fileChooser = new javax.swing.JFileChooser();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
Open = new javax.swing.JMenuItem();
Exit = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenu3 = new javax.swing.JMenu();
jMenu4 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Nyse Stock Pick");
setSize(new java.awt.Dimension(1920, 1080));
org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 1082, Short.MAX_VALUE)
);
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 621, Short.MAX_VALUE)
);
jMenu1.setText("File");
Open.setText("Open");
Open.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
OpenActionPerformed(evt);
}
});
jMenu1.add(Open);
Exit.setText(" Exit");
Exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ExitActionPerformed(evt);
}
});
jMenu1.add(Exit);
jMenuBar1.add(jMenu1);
jMenu2.setText("Options");
jMenuBar1.add(jMenu2);
jMenu3.setText("Tools");
jMenuBar1.add(jMenu3);
jMenu4.setText("Help");
jMenuBar1.add(jMenu4);
setJMenuBar(jMenuBar1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(mainPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(0, 266, Short.MAX_VALUE)
.add(fileChooser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(0, 266, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(mainPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(43, Short.MAX_VALUE))
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(0, 135, Short.MAX_VALUE)
.add(fileChooser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(0, 135, Short.MAX_VALUE)))
);
pack();
}// </editor-fold>
private void OpenActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int returnVal = fileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION)
{
File file = fileChooser.getSelectedFile();
//What to do with the file
PriceVolumeChart chart = new PriceVolumeChart(file.getName());
mainPanel = chart.myPanel;
}
else
{
System.out.println("File access cancelled by user.");
}
}
private void ExitActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.exit(0);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new MainForm().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JMenuItem Exit;
private javax.swing.JMenuItem Open;
private javax.swing.JFileChooser fileChooser;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel mainPanel;
// End of variables declaration
}
[1]: http://netbeans.org/kb/docs/java/gui-filechooser.html
Much of this code is generated from netbeans. | java | swing | netbeans | null | null | null | open | How to make JFileChooser not appearing along with the form it belongs?
===
Based on this [tutorial][1] I have added a JFileChooser in my form , but it appears when the form is loaded for the first time along with the form.
Any ideas on how to fix that?
Here is the code:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package nysemarketpick;
import java.io.File;
import java.io.IOException;
import javax.swing.JFileChooser;
/**
*
* @author skiabox
*/
public class MainForm extends javax.swing.JFrame {
/**
* Creates new form MainForm
*/
public MainForm() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
mainPanel = new javax.swing.JPanel();
fileChooser = new javax.swing.JFileChooser();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
Open = new javax.swing.JMenuItem();
Exit = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenu3 = new javax.swing.JMenu();
jMenu4 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Nyse Stock Pick");
setSize(new java.awt.Dimension(1920, 1080));
org.jdesktop.layout.GroupLayout mainPanelLayout = new org.jdesktop.layout.GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 1082, Short.MAX_VALUE)
);
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 621, Short.MAX_VALUE)
);
jMenu1.setText("File");
Open.setText("Open");
Open.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
OpenActionPerformed(evt);
}
});
jMenu1.add(Open);
Exit.setText(" Exit");
Exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ExitActionPerformed(evt);
}
});
jMenu1.add(Exit);
jMenuBar1.add(jMenu1);
jMenu2.setText("Options");
jMenuBar1.add(jMenu2);
jMenu3.setText("Tools");
jMenuBar1.add(jMenu3);
jMenu4.setText("Help");
jMenuBar1.add(jMenu4);
setJMenuBar(jMenuBar1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(mainPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(0, 266, Short.MAX_VALUE)
.add(fileChooser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(0, 266, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.addContainerGap()
.add(mainPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(43, Short.MAX_VALUE))
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(0, 135, Short.MAX_VALUE)
.add(fileChooser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.add(0, 135, Short.MAX_VALUE)))
);
pack();
}// </editor-fold>
private void OpenActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int returnVal = fileChooser.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION)
{
File file = fileChooser.getSelectedFile();
//What to do with the file
PriceVolumeChart chart = new PriceVolumeChart(file.getName());
mainPanel = chart.myPanel;
}
else
{
System.out.println("File access cancelled by user.");
}
}
private void ExitActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.exit(0);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new MainForm().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JMenuItem Exit;
private javax.swing.JMenuItem Open;
private javax.swing.JFileChooser fileChooser;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel mainPanel;
// End of variables declaration
}
[1]: http://netbeans.org/kb/docs/java/gui-filechooser.html
Much of this code is generated from netbeans. | 0 |
11,373,203 | 07/07/2012 07:37:00 | 673,730 | 03/23/2011 19:21:18 | 48,903 | 2,005 | Accessing inactive union member - undefined? | I was under the impression that accessing an `union` member that's not active is undefined behavior, but I can't seem to find a solid reference (other than answers claiming it's UB but without any support from the standard).
So, is it undefined behavior? | c++ | union | undefined-behavior | null | null | null | open | Accessing inactive union member - undefined?
===
I was under the impression that accessing an `union` member that's not active is undefined behavior, but I can't seem to find a solid reference (other than answers claiming it's UB but without any support from the standard).
So, is it undefined behavior? | 0 |
11,373,210 | 07/07/2012 07:38:08 | 1,485,518 | 06/27/2012 11:47:09 | 1 | 4 | Uploading image part by part | Is there a way to upload an image part by part via PHP ? I mean we are virtually drawing a grid on that image and uploading our desired sell of the image . | php | image-processing | null | null | null | null | open | Uploading image part by part
===
Is there a way to upload an image part by part via PHP ? I mean we are virtually drawing a grid on that image and uploading our desired sell of the image . | 0 |
11,344,157 | 07/05/2012 12:15:52 | 1,473,189 | 06/21/2012 19:40:04 | 1 | 0 | Javascript for Zip Code validation | I'm attempting to have Javascript validate a user-entered zip code.
If it is within the list of valid zip codes, it should take them to a new page to schedule an appointment. If the zip code isn't in the listing, it should display a message that says that it isn't covered by the service area and then keep them on the page.
I have it working to where it takes them to the appointment page if it's valid, but it also takes them to the appointment page if it isn't valid.
Would you guys mind helping me figure this out?
Here is the page the Javascript is running on: http://platinumfactoryservice.com/service-area/ | javascript | zip | null | null | null | null | open | Javascript for Zip Code validation
===
I'm attempting to have Javascript validate a user-entered zip code.
If it is within the list of valid zip codes, it should take them to a new page to schedule an appointment. If the zip code isn't in the listing, it should display a message that says that it isn't covered by the service area and then keep them on the page.
I have it working to where it takes them to the appointment page if it's valid, but it also takes them to the appointment page if it isn't valid.
Would you guys mind helping me figure this out?
Here is the page the Javascript is running on: http://platinumfactoryservice.com/service-area/ | 0 |
11,344,158 | 07/05/2012 12:15:55 | 1,239,953 | 02/29/2012 10:10:16 | 1 | 1 | How to Create a Module in dotnet Nuke in Visual studio 2010? | How to create Modules in Dotnetnuke in Visual Studio 2010.
I have install dotnetnuke 6.2 version in my IIS 7.
Now, I want to create Module with Some database logic.
How can I create a Module in dotnetnuke as well as How can I show Dotnetnuke template in Visual studio installed Template in Visual studio 2010 ?
| visual-studio-2010 | dotnetnuke | null | null | null | null | open | How to Create a Module in dotnet Nuke in Visual studio 2010?
===
How to create Modules in Dotnetnuke in Visual Studio 2010.
I have install dotnetnuke 6.2 version in my IIS 7.
Now, I want to create Module with Some database logic.
How can I create a Module in dotnetnuke as well as How can I show Dotnetnuke template in Visual studio installed Template in Visual studio 2010 ?
| 0 |
11,734,322 | 07/31/2012 06:25:45 | 832,949 | 07/07/2011 06:20:07 | 76 | 2 | Matlab function in C++ | How to define arrays in C++/ Open CV as I do in matlab ?
for example:
x=a:b:c;
or
y=linspace(a,b,n); | c++ | arrays | matlab | opencv | null | null | open | Matlab function in C++
===
How to define arrays in C++/ Open CV as I do in matlab ?
for example:
x=a:b:c;
or
y=linspace(a,b,n); | 0 |
11,734,443 | 07/31/2012 06:37:08 | 1,220,955 | 02/20/2012 11:50:52 | 557 | 60 | How to get whole output of php system function | I want to get all the router list of my network using php on linux.
I have tried php exec and system function but it is give only one router in output.
How to get whole list of router?
$last_line = system('iwlist scan', $retval);
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
$last_line = system('iwlist scan | grep ESSID', $retval);
echo '
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval; | linux | php5 | null | null | null | null | open | How to get whole output of php system function
===
I want to get all the router list of my network using php on linux.
I have tried php exec and system function but it is give only one router in output.
How to get whole list of router?
$last_line = system('iwlist scan', $retval);
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
$last_line = system('iwlist scan | grep ESSID', $retval);
echo '
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval; | 0 |
11,734,446 | 07/31/2012 06:37:22 | 1,448,529 | 06/11/2012 09:03:22 | 1 | 0 | Incosistent results on Firefox and Chrome while assigning base64 image data as src to image | I am trying to draw checkbox image on canvas by assigning base64 image data as src to image object.It works fine on IE but give inconsistent results on Firefox and Chrome
Here is my code
img = document.createElement('img');
img.src = 'data:image/gif;base64,R0lGODlhDgAPAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKbK8BxRgCGhIeLi3ePj3+Xl4efn4+rq5uzs6e/v7PHx7/Pz8fX18/f39vn5+Pr6+fz8+/39/f7+/v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////yH5BAAAAAAALAAAAAAOAA8AhwAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKbK8BxRgCGhIeLi3ePj3+Xl4efn4+rq5uzs6e/v7PHx7/Pz8fX18/f39vn5+Pr6+fz8+/39/f7+/v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////whzADkIHEiQoIKDCBMi5KCAgcMGDh5AiCBhAgUFDB9GnFiRQgWMDSFKpDhhQQULIEVyLLnAwgWQEReQXEDzAgaQEmmyXGAzA8iJNIP21AByZk0MGTRsANmxAk+kShkytHhy6AaBID26hHoVK0OFYDEWHDswIAA7';
ctx.drawImage(
img,
sx,
sy,
sw,
sh,
dx,
dy,
dw,
dh
);
If i put an alert after assigning src to image then it works with FF and chrome even.I guess its all because of javascript asynchronous behaviour, before complete src is assigned to image the drawing process takes place hence not getting complete image.
Could any one tell me how to handle this problem . | javascript | null | null | null | null | null | open | Incosistent results on Firefox and Chrome while assigning base64 image data as src to image
===
I am trying to draw checkbox image on canvas by assigning base64 image data as src to image object.It works fine on IE but give inconsistent results on Firefox and Chrome
Here is my code
img = document.createElement('img');
img.src = 'data:image/gif;base64,R0lGODlhDgAPAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKbK8BxRgCGhIeLi3ePj3+Xl4efn4+rq5uzs6e/v7PHx7/Pz8fX18/f39vn5+Pr6+fz8+/39/f7+/v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////yH5BAAAAAAALAAAAAAOAA8AhwAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKbK8BxRgCGhIeLi3ePj3+Xl4efn4+rq5uzs6e/v7PHx7/Pz8fX18/f39vn5+Pr6+fz8+/39/f7+/v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////whzADkIHEiQoIKDCBMi5KCAgcMGDh5AiCBhAgUFDB9GnFiRQgWMDSFKpDhhQQULIEVyLLnAwgWQEReQXEDzAgaQEmmyXGAzA8iJNIP21AByZk0MGTRsANmxAk+kShkytHhy6AaBID26hHoVK0OFYDEWHDswIAA7';
ctx.drawImage(
img,
sx,
sy,
sw,
sh,
dx,
dy,
dw,
dh
);
If i put an alert after assigning src to image then it works with FF and chrome even.I guess its all because of javascript asynchronous behaviour, before complete src is assigned to image the drawing process takes place hence not getting complete image.
Could any one tell me how to handle this problem . | 0 |
11,734,447 | 07/31/2012 06:37:24 | 958,408 | 09/22/2011 06:26:29 | 1,273 | 105 | Unity3d: Grass on iOS is missing | I have a grass on terrain. In unity editor, in "edit" - "graphic emulation" there is opengl 1.1 and opengl 2.0 options. when I set it to 2.0, grass show fine. but wen I set to opengl es 1.1, grass disappeares. That is OK. But now, I'm trying to build it for my iPad: In player settings i'm setting armv7 platform, iPad only. And I cant see grass on my iPad. Am I doing anything wrong? All I need is to display grass on iPad: no metter opengl version. From xCode logs: "Version: OpenGL ES 2.0 IMGSGX543-63.24", so, openGL version IS 2.0. I guess, it's all about some unity settings stuff, but where? | iphone | unity3d | null | null | null | null | open | Unity3d: Grass on iOS is missing
===
I have a grass on terrain. In unity editor, in "edit" - "graphic emulation" there is opengl 1.1 and opengl 2.0 options. when I set it to 2.0, grass show fine. but wen I set to opengl es 1.1, grass disappeares. That is OK. But now, I'm trying to build it for my iPad: In player settings i'm setting armv7 platform, iPad only. And I cant see grass on my iPad. Am I doing anything wrong? All I need is to display grass on iPad: no metter opengl version. From xCode logs: "Version: OpenGL ES 2.0 IMGSGX543-63.24", so, openGL version IS 2.0. I guess, it's all about some unity settings stuff, but where? | 0 |
11,734,448 | 07/31/2012 06:37:26 | 1,542,233 | 07/21/2012 05:48:28 | 5 | 3 | A Button To Add A Product To A Cart | My Shopping Cart Is Here http://jsfiddle.net/bkw5p/48/
in that i would like to show a button to user on products for adding that product to the shopping cart.
Eg : when the button is clicked on the products list that product should be added to the cart.
i have tried it but i am unable to get it.
kindly help to solve this issues as soon as possible
thanks and regards
s.varun | jquery | null | null | null | null | null | open | A Button To Add A Product To A Cart
===
My Shopping Cart Is Here http://jsfiddle.net/bkw5p/48/
in that i would like to show a button to user on products for adding that product to the shopping cart.
Eg : when the button is clicked on the products list that product should be added to the cart.
i have tried it but i am unable to get it.
kindly help to solve this issues as soon as possible
thanks and regards
s.varun | 0 |
11,734,450 | 07/31/2012 06:37:51 | 1,485,009 | 06/27/2012 08:28:12 | 316 | 16 | What is your favorite gcc parameters? | When working with the gcc, is there any tricks or special parameters you are using for particular purpose? Could anyone share with us? | c | linux | gcc | null | null | 07/31/2012 06:40:32 | not constructive | What is your favorite gcc parameters?
===
When working with the gcc, is there any tricks or special parameters you are using for particular purpose? Could anyone share with us? | 4 |
11,542,042 | 07/18/2012 13:02:30 | 1,421,172 | 05/28/2012 07:21:37 | 1 | 0 | Add images to buttons on navigation bar | I want to add 2 buttons to navigation bar. One button is having image and other one having text. I tried adding the buttons all working fine but button background image is not original size.
Code:
UIBarButtonItem *homeButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:@selector(homeButtonClicked:)];
homeButton.tag = 0;
[homeButton setBackgroundImage:[UIImage imageNamed:@"homeQms_1.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
homeButton.width = 20;
UIBarButtonItem *dpiButton = [[UIBarButtonItem alloc] initWithTitle:@"DPI Menu" style:UIBarButtonItemStylePlain target:self action:@selector(homeButtonClicked:)];
dpiButton.tag = 10;
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:saveButton,dpiButton,nil];
But image is little stretched.
Can anybody help me to solve this. Also I tried adding buttons to the UIToolbar still issue is same.
| ios | ipad | uinavigationcontroller | uiimageview | uibutton | null | open | Add images to buttons on navigation bar
===
I want to add 2 buttons to navigation bar. One button is having image and other one having text. I tried adding the buttons all working fine but button background image is not original size.
Code:
UIBarButtonItem *homeButton = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:@selector(homeButtonClicked:)];
homeButton.tag = 0;
[homeButton setBackgroundImage:[UIImage imageNamed:@"homeQms_1.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
homeButton.width = 20;
UIBarButtonItem *dpiButton = [[UIBarButtonItem alloc] initWithTitle:@"DPI Menu" style:UIBarButtonItemStylePlain target:self action:@selector(homeButtonClicked:)];
dpiButton.tag = 10;
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:saveButton,dpiButton,nil];
But image is little stretched.
Can anybody help me to solve this. Also I tried adding buttons to the UIToolbar still issue is same.
| 0 |
11,542,045 | 07/18/2012 13:02:36 | 1,534,830 | 07/18/2012 12:54:08 | 1 | 0 | Start application just one time C# | I just make an application in C#, but something I don't like. I want to make the application running just one time. Now, if my application is running, when I run the application again, will start another application. I want to make that the application can be running just one time, if you want to run again the application, not create another application, but to start the running application.
Thanks.
| c# | forms | application | time | null | null | open | Start application just one time C#
===
I just make an application in C#, but something I don't like. I want to make the application running just one time. Now, if my application is running, when I run the application again, will start another application. I want to make that the application can be running just one time, if you want to run again the application, not create another application, but to start the running application.
Thanks.
| 0 |
11,541,922 | 07/18/2012 12:56:33 | 1,177,921 | 01/30/2012 11:19:02 | 82 | 3 | How to focus/highlight inside toolbar elements in sencha touch2 | I have done application using sencha touch2 . as per requirement **i need to focus/highlight inside the toolbar elements, when mouse is over(point to) on particular elements**. i have added pressedCls it will work once i will press, but i need to highlight on mouse over. can any tell me how to achieve this one.
Here is my code:
initialize:function () {
this.callParent(arguments);
var Button1 = {
xtype:"button",
id: 'suvilasBtn',
html: '<img height="30" width="40", src="resources/sass/images/icons/about.png" />',
pressedCls: 'customPressedCls',
scope:this
};
var Button2 = {
xtype: "button",
id: 'projectBtn',
html: '<img height="30" width="40", src="resources/sass/images/icons/projects.png" />',
handler: this.onProjectsButtonTap,
scope: this
};
var bottomToolbar = {
xtype:"toolbar",
docked:"bottom",
scrollable: false,
defaults: {
iconMask: true,
ui: 'plain'
},
layout: {
pack : 'center',
align: 'center'
},
items:[
Button1,
Button2
]
};
this.add([ bottomToolbar ]);
} | sencha-touch | sencha | sencha-touch-2 | null | null | null | open | How to focus/highlight inside toolbar elements in sencha touch2
===
I have done application using sencha touch2 . as per requirement **i need to focus/highlight inside the toolbar elements, when mouse is over(point to) on particular elements**. i have added pressedCls it will work once i will press, but i need to highlight on mouse over. can any tell me how to achieve this one.
Here is my code:
initialize:function () {
this.callParent(arguments);
var Button1 = {
xtype:"button",
id: 'suvilasBtn',
html: '<img height="30" width="40", src="resources/sass/images/icons/about.png" />',
pressedCls: 'customPressedCls',
scope:this
};
var Button2 = {
xtype: "button",
id: 'projectBtn',
html: '<img height="30" width="40", src="resources/sass/images/icons/projects.png" />',
handler: this.onProjectsButtonTap,
scope: this
};
var bottomToolbar = {
xtype:"toolbar",
docked:"bottom",
scrollable: false,
defaults: {
iconMask: true,
ui: 'plain'
},
layout: {
pack : 'center',
align: 'center'
},
items:[
Button1,
Button2
]
};
this.add([ bottomToolbar ]);
} | 0 |
11,541,923 | 07/18/2012 12:56:35 | 586,754 | 01/23/2011 22:45:29 | 140 | 28 | c#: how to stop a thread on .dll unload? | I have a scenario where a .dll starts a worker thread that watches some activity of the .dll. It is some kind of a garbage-collection-like thing, cleaning up elements in an internal cache after a time of inactivity.
The problem now is: I have code to stop this thread in a special function Shutdown, but.. this does not always gets called. It gets called form the 1-2 applications I wrote, but using a unit-testing 3rd party tool, e. g., I cannot call this method since I run an arbitrary subset of tests.
Also, I tried hooking such code to the AppDomain DomainUnload event - which also does not get called.
AppDomain.CurrentDomain.DomainUnload += new EventHandler(
(o, e) => Shutdown() );
How to handle this? Any other "design"/approach required in order to make this work? | c# | multithreading | dll | unload | null | null | open | c#: how to stop a thread on .dll unload?
===
I have a scenario where a .dll starts a worker thread that watches some activity of the .dll. It is some kind of a garbage-collection-like thing, cleaning up elements in an internal cache after a time of inactivity.
The problem now is: I have code to stop this thread in a special function Shutdown, but.. this does not always gets called. It gets called form the 1-2 applications I wrote, but using a unit-testing 3rd party tool, e. g., I cannot call this method since I run an arbitrary subset of tests.
Also, I tried hooking such code to the AppDomain DomainUnload event - which also does not get called.
AppDomain.CurrentDomain.DomainUnload += new EventHandler(
(o, e) => Shutdown() );
How to handle this? Any other "design"/approach required in order to make this work? | 0 |
11,541,924 | 07/18/2012 12:56:37 | 1,460,625 | 06/16/2012 12:42:59 | 12 | 0 | Split string by <br> vb.net | I have an html Address line like this:
Addressline1<br>Addressline2<br>...
How can I split them into an array ? | vb.net | null | null | null | null | null | open | Split string by <br> vb.net
===
I have an html Address line like this:
Addressline1<br>Addressline2<br>...
How can I split them into an array ? | 0 |
11,542,051 | 07/18/2012 13:02:56 | 1,113,216 | 12/23/2011 10:10:28 | 53 | 0 | Testing Backbone Model using Jasmine | It is the first time I write a javascript test for a Backbone Model.
Looking in the web resource there are not so many items about this subject.
I found this one, [Testing Backbone applications with Jasmine and Sinon](http://tinnedfruit.com/2011/03/25/testing-backbone-apps-with-jasmine-sinon-2.html), which is pretty old (mars 2001).
Anyway I would like to know:
1) there are other resource more update about this subject
2) the text I wrote (1) is fine or can be improved.
---
(1)
describe('User model', function () {
beforeEach(function () {
this.model = new User();
this.collection = new UserCollection();
});
describe('When creating models', function () {
it('the url should be equal at corresponding api_get_users value', function () {
expect(this.model.url()).toEqual(backendRouter.generate('api_get_users'));
});
describe('when no id is set', function () {
it('should return the collection URL', function () {
expect(this.model.url()).toEqual(this.collection.url);
});
});
describe('when id is set', function () {
it('should return the collection URL and id', function () {
this.model.set({id: 1});
expect(this.model.url()).toEqual(this.collection.url + '/' + this.model.get('id'));
});
});
});
describe('when fetching model from server', function () {
beforeEach(function () {
this.model.set({id: 1});
this.fixture = this.fixtures.Users.valid;
this.fixtureResponse = this.fixture.response.users[0];
this.server = sinon.fakeServer.create();
this.server.respondWith(
'GET',
backendRouter.generate('api_get_users') + '/' + this.model.get('id'),
JSON.stringify(this.fixtureResponse)
);
});
afterEach(function () {
this.server.restore();
});
it('should make the correct request', function () {
this.model.fetch();
expect(this.server.requests.length).toEqual(1);
expect(this.server.requests[0].method).toEqual('GET');
expect(this.server.requests[0].url).toEqual(this.model.url());
});
it('should the response not change', function () {
this.model.fetch();
this.server.respond();
expect(this.fixtureResponse).toEqual(this.model.attributes);
});
it('should exhibit mandatory attributes', function () {
expect(this.model.get('id')).toBeGreaterThan(0);
});
});
}); | javascript | backbone.js | jasmine | null | null | null | open | Testing Backbone Model using Jasmine
===
It is the first time I write a javascript test for a Backbone Model.
Looking in the web resource there are not so many items about this subject.
I found this one, [Testing Backbone applications with Jasmine and Sinon](http://tinnedfruit.com/2011/03/25/testing-backbone-apps-with-jasmine-sinon-2.html), which is pretty old (mars 2001).
Anyway I would like to know:
1) there are other resource more update about this subject
2) the text I wrote (1) is fine or can be improved.
---
(1)
describe('User model', function () {
beforeEach(function () {
this.model = new User();
this.collection = new UserCollection();
});
describe('When creating models', function () {
it('the url should be equal at corresponding api_get_users value', function () {
expect(this.model.url()).toEqual(backendRouter.generate('api_get_users'));
});
describe('when no id is set', function () {
it('should return the collection URL', function () {
expect(this.model.url()).toEqual(this.collection.url);
});
});
describe('when id is set', function () {
it('should return the collection URL and id', function () {
this.model.set({id: 1});
expect(this.model.url()).toEqual(this.collection.url + '/' + this.model.get('id'));
});
});
});
describe('when fetching model from server', function () {
beforeEach(function () {
this.model.set({id: 1});
this.fixture = this.fixtures.Users.valid;
this.fixtureResponse = this.fixture.response.users[0];
this.server = sinon.fakeServer.create();
this.server.respondWith(
'GET',
backendRouter.generate('api_get_users') + '/' + this.model.get('id'),
JSON.stringify(this.fixtureResponse)
);
});
afterEach(function () {
this.server.restore();
});
it('should make the correct request', function () {
this.model.fetch();
expect(this.server.requests.length).toEqual(1);
expect(this.server.requests[0].method).toEqual('GET');
expect(this.server.requests[0].url).toEqual(this.model.url());
});
it('should the response not change', function () {
this.model.fetch();
this.server.respond();
expect(this.fixtureResponse).toEqual(this.model.attributes);
});
it('should exhibit mandatory attributes', function () {
expect(this.model.get('id')).toBeGreaterThan(0);
});
});
}); | 0 |
11,542,053 | 07/18/2012 13:03:03 | 1,534,792 | 07/18/2012 12:33:21 | 1 | 0 | Gitolite on Ubuntu: No adminkey given | I have what I would call a "vanilla" install on Ubuntu Server 12.04LTS (downloaded and installed on the 15th) on Hyper-V.
All seems well with Ubuntu. Synthetic NIC is great. No issues detected.
My plan is to use it as a central GIT repository using Gitolite.
I have SSh correctly installed (at least I think it is because I can "ssh [email protected]".
The key was generated on my Mac in Terminal and copied up. That worked fine.
My problem is that when I attempt to install Gitolite I get the following error:
No adminkey given - not setting up gitolite.
These are the commands I used to perform the install:
sudo apt-get install git-core
sudo apt-get install gitolite
I've also tried this:
sudo apt-get install git-core
sudo adduser \
--system \
--shell /bin/bash \
--gecos 'git version control' \
--group \
--disabled-password \
--home /home/git \
git
sudo apt-get install gitolite
...same result
Some version info:
Git core: 1:1.7.9.5-1
Gitolite: 2.2-1
Ubuntu: 12.04
Any ideas?
Does Gitolite actually run on Ubuntu 12.04?
| git | ubuntu | gitolite | null | null | null | open | Gitolite on Ubuntu: No adminkey given
===
I have what I would call a "vanilla" install on Ubuntu Server 12.04LTS (downloaded and installed on the 15th) on Hyper-V.
All seems well with Ubuntu. Synthetic NIC is great. No issues detected.
My plan is to use it as a central GIT repository using Gitolite.
I have SSh correctly installed (at least I think it is because I can "ssh [email protected]".
The key was generated on my Mac in Terminal and copied up. That worked fine.
My problem is that when I attempt to install Gitolite I get the following error:
No adminkey given - not setting up gitolite.
These are the commands I used to perform the install:
sudo apt-get install git-core
sudo apt-get install gitolite
I've also tried this:
sudo apt-get install git-core
sudo adduser \
--system \
--shell /bin/bash \
--gecos 'git version control' \
--group \
--disabled-password \
--home /home/git \
git
sudo apt-get install gitolite
...same result
Some version info:
Git core: 1:1.7.9.5-1
Gitolite: 2.2-1
Ubuntu: 12.04
Any ideas?
Does Gitolite actually run on Ubuntu 12.04?
| 0 |
11,542,056 | 07/18/2012 13:03:19 | 1,354,038 | 04/24/2012 14:56:09 | 3 | 0 | How do I turn a string reference into a variable | I want $masking_x to act as $masking_y (i.e. dynamically insert $radiovalue but still act as a varibale).
My code is
while($field_radio = mysql_fetch_assoc($result_radio)) {
$radiovalue = $field_radio[radiovalue];
echo "Radio value: ".$radiovalue."</br>";
$masking = "field_masking[checkbox_1001_".$radiovalue."]";
$masking_x = '$'.$masking;
$masking_y = "$field_masking[checkbox_1001_2]";
echo "Masking: ".$masking."</br>";
echo "Masking_x: ".$masking_x."</br>";
echo "Masking_y: ".$masking_y."</br>";
die;
I'm getting the following output:
Radio value: 2
Masking: field_masking[checkbox_1001_2]
Masking_x: $field_masking[checkbox_1001_2]
Masking_y: 2
Any guidance would be greatly appreciated. Thanks in advance.
| php | mysql | null | null | null | null | open | How do I turn a string reference into a variable
===
I want $masking_x to act as $masking_y (i.e. dynamically insert $radiovalue but still act as a varibale).
My code is
while($field_radio = mysql_fetch_assoc($result_radio)) {
$radiovalue = $field_radio[radiovalue];
echo "Radio value: ".$radiovalue."</br>";
$masking = "field_masking[checkbox_1001_".$radiovalue."]";
$masking_x = '$'.$masking;
$masking_y = "$field_masking[checkbox_1001_2]";
echo "Masking: ".$masking."</br>";
echo "Masking_x: ".$masking_x."</br>";
echo "Masking_y: ".$masking_y."</br>";
die;
I'm getting the following output:
Radio value: 2
Masking: field_masking[checkbox_1001_2]
Masking_x: $field_masking[checkbox_1001_2]
Masking_y: 2
Any guidance would be greatly appreciated. Thanks in advance.
| 0 |
11,542,057 | 07/18/2012 13:03:22 | 1,399,290 | 05/16/2012 17:51:37 | 30 | 2 | JBossLazyUnmarshallingException With Tomcat + JBOSS | I have an environment running an app with JBOSS(with javabeans made by my team) and the "front-end" with Tomcat.
All the Models are in the JBOSS. I have a interface in the Tomcat and the implementation for it is in the TOMCAT.
I pass the interface(SomeInterface.class) using a proxy class to the JBOSS waiting as a answer the object with the implementation.
The problem is, i'm getting the exception: java.lang.ClassNotFoundException: org.jboss.invocation.JBossLazyUnmarshallingException
For my search it's a problem with the JBOSS that couldn't "unserlialize" my interface. I checked if both server have the same interface version, and it's ok. Any other thing that i should test? | java | tomcat | jboss | esb | null | null | open | JBossLazyUnmarshallingException With Tomcat + JBOSS
===
I have an environment running an app with JBOSS(with javabeans made by my team) and the "front-end" with Tomcat.
All the Models are in the JBOSS. I have a interface in the Tomcat and the implementation for it is in the TOMCAT.
I pass the interface(SomeInterface.class) using a proxy class to the JBOSS waiting as a answer the object with the implementation.
The problem is, i'm getting the exception: java.lang.ClassNotFoundException: org.jboss.invocation.JBossLazyUnmarshallingException
For my search it's a problem with the JBOSS that couldn't "unserlialize" my interface. I checked if both server have the same interface version, and it's ok. Any other thing that i should test? | 0 |
11,542,029 | 07/18/2012 13:01:45 | 1,513,555 | 07/10/2012 03:09:01 | 8 | 0 | How do i find the service name using WMI in c++? | I am trying to get the process of the running service by using WMI. But i am confused as to how use WMI.
i think that using this method will work
http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.servicename%28v=vs.71%29
But i a dont know how to set up WMI in order to use this
I know i need to do this but am not sure where to go from there
HRESULT hres(CoInitializeEx(NULL, COINIT_MULTITHREADED));
// Set general COM security levels
hres = CoInitializeSecurity(
NULL,
-1, // COM authentication
NULL, // Authentication services
NULL, // Reserved
RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication
RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation
NULL, // Authentication Info
EOAC_NONE, // Additional capabiliteis
NULL // Reserved
); | c++ | winapi | visual-c++ | wmi | wmi-service | null | open | How do i find the service name using WMI in c++?
===
I am trying to get the process of the running service by using WMI. But i am confused as to how use WMI.
i think that using this method will work
http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.servicename%28v=vs.71%29
But i a dont know how to set up WMI in order to use this
I know i need to do this but am not sure where to go from there
HRESULT hres(CoInitializeEx(NULL, COINIT_MULTITHREADED));
// Set general COM security levels
hres = CoInitializeSecurity(
NULL,
-1, // COM authentication
NULL, // Authentication services
NULL, // Reserved
RPC_C_AUTHN_LEVEL_DEFAULT, // Default authentication
RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation
NULL, // Authentication Info
EOAC_NONE, // Additional capabiliteis
NULL // Reserved
); | 0 |
11,542,059 | 07/18/2012 13:03:26 | 1,534,787 | 07/18/2012 12:29:55 | 1 | 0 | Django + jQuery: Why CSRF verification fails on multiple simultaneous requests | I've encountered the following situation (using Django1.4 and jQuery 1.7.1) which I would like to understand:
I submit a form via jQuery 'ajax' function and before this request finishes I click another element which submits the same form but using the jQuery 'submit' function. The response I get - 403, CSRF verifcation failed. Now, of course, to prevent this error it suffices to disable multiple simultaneous submits(they work fine on their own), but this doesn't help to understand where that specific error comes from.
Can anyone explain this? The csrf token is generated once per session so it cannot be some kind of csrf mismatch for the latter request.
Does this have something to do with the way jQuery handels requests? | jquery | django | csrf | django-csrf | null | null | open | Django + jQuery: Why CSRF verification fails on multiple simultaneous requests
===
I've encountered the following situation (using Django1.4 and jQuery 1.7.1) which I would like to understand:
I submit a form via jQuery 'ajax' function and before this request finishes I click another element which submits the same form but using the jQuery 'submit' function. The response I get - 403, CSRF verifcation failed. Now, of course, to prevent this error it suffices to disable multiple simultaneous submits(they work fine on their own), but this doesn't help to understand where that specific error comes from.
Can anyone explain this? The csrf token is generated once per session so it cannot be some kind of csrf mismatch for the latter request.
Does this have something to do with the way jQuery handels requests? | 0 |
11,542,060 | 07/18/2012 13:03:28 | 1,517,195 | 07/11/2012 08:54:30 | 5 | 0 | Nlog does not work | I've got a project in which i wanted to integrate the Logger NLog.
Both, the NLog.dll and the NLog.Extended.dll are added and the files are in the Output folder of my Visual Studio 2010.
I've configurated a NLog.config (already with the extension of adding the Nlog.Extended DLL).
While Running the code i get the follwing error message:
> Test method UnitTestProject.WebserviceReaderTest.IsValidPathTest threw exception:
System.TypeInitializationException: The type initializer for 'MethodCheck.WebserviceReader' threw an exception. ---> NLog.NLogConfigurationException: Exception occurred when loading configuration from C:\Users\pp-admin\Documents\Visual Studio 2010\Projects\Methodenpruefung der Webservices\Methodenpruefung\UnitTestProject\bin\Debug\NLog.config ---> NLog.NLogConfigurationException: Error loading extensions: NLog.Extended ---> System.IO.FileNotFoundException: Could not load file or assembly 'NLog.Extended' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
The error stack trace:
> System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
System.Reflection.Assembly.Load(String assemblyString)
NLog.Config.XmlLoggingConfiguration.ParseExtensionsElement(NLogXmlElement extensionsElement, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 714
NLog.Config.XmlLoggingConfiguration.ParseExtensionsElement(NLogXmlElement extensionsElement, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 729
NLog.Config.XmlLoggingConfiguration.ParseNLogElement(NLogXmlElement nlogElement, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 334
NLog.Config.XmlLoggingConfiguration.ParseTopLevel(NLogXmlElement content, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 298
NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 247
NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 264
NLog.Config.XmlLoggingConfiguration..ctor(String fileName) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 72
NLog.LogFactory.get_Configuration() in c:\NLogBuild\src\NLog\LogFactory.cs: line 148
NLog.LogFactory.GetLogger(LoggerCacheKey cacheKey) in c:\NLogBuild\src\NLog\LogFactory.cs: line 712
NLog.LogFactory.GetLogger(String name) in c:\NLogBuild\src\NLog\LogFactory.cs: line 330
NLog.LogManager.GetCurrentClassLogger() in c:\NLogBuild\src\NLog\LogManager.cs: line 140
MethodCheck.WebserviceReader..cctor() in C:\Users\pp-admin\Documents\Visual Studio 2010\Projects\Methodenpruefung der Webservices\Methodenpruefung\Methodenpruefung\WebserviceReader.cs: line 68
MethodCheck.WebserviceReader_Accessor.IsValidPath(String path)
UnitTestProject.WebserviceReaderTest.IsValidPathTest() in C:\Users\pp-admin\Documents\Visual Studio 2010\Projects\Methodenpruefung der Webservices\Methodenpruefung\UnitTestProject\WebserviceReaderTest.cs: line 157
Could you please help me getting my logger to work correct?
| c# | nlog | filenotfoundexception | assemblybinding | nlog-configuration | 07/19/2012 07:13:03 | too localized | Nlog does not work
===
I've got a project in which i wanted to integrate the Logger NLog.
Both, the NLog.dll and the NLog.Extended.dll are added and the files are in the Output folder of my Visual Studio 2010.
I've configurated a NLog.config (already with the extension of adding the Nlog.Extended DLL).
While Running the code i get the follwing error message:
> Test method UnitTestProject.WebserviceReaderTest.IsValidPathTest threw exception:
System.TypeInitializationException: The type initializer for 'MethodCheck.WebserviceReader' threw an exception. ---> NLog.NLogConfigurationException: Exception occurred when loading configuration from C:\Users\pp-admin\Documents\Visual Studio 2010\Projects\Methodenpruefung der Webservices\Methodenpruefung\UnitTestProject\bin\Debug\NLog.config ---> NLog.NLogConfigurationException: Error loading extensions: NLog.Extended ---> System.IO.FileNotFoundException: Could not load file or assembly 'NLog.Extended' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
The error stack trace:
> System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
System.Reflection.Assembly.Load(String assemblyString)
NLog.Config.XmlLoggingConfiguration.ParseExtensionsElement(NLogXmlElement extensionsElement, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 714
NLog.Config.XmlLoggingConfiguration.ParseExtensionsElement(NLogXmlElement extensionsElement, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 729
NLog.Config.XmlLoggingConfiguration.ParseNLogElement(NLogXmlElement nlogElement, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 334
NLog.Config.XmlLoggingConfiguration.ParseTopLevel(NLogXmlElement content, String baseDirectory) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 298
NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 247
NLog.Config.XmlLoggingConfiguration.Initialize(XmlReader reader, String fileName, Boolean ignoreErrors) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 264
NLog.Config.XmlLoggingConfiguration..ctor(String fileName) in c:\NLogBuild\src\NLog\Config\XmlLoggingConfiguration.cs: line 72
NLog.LogFactory.get_Configuration() in c:\NLogBuild\src\NLog\LogFactory.cs: line 148
NLog.LogFactory.GetLogger(LoggerCacheKey cacheKey) in c:\NLogBuild\src\NLog\LogFactory.cs: line 712
NLog.LogFactory.GetLogger(String name) in c:\NLogBuild\src\NLog\LogFactory.cs: line 330
NLog.LogManager.GetCurrentClassLogger() in c:\NLogBuild\src\NLog\LogManager.cs: line 140
MethodCheck.WebserviceReader..cctor() in C:\Users\pp-admin\Documents\Visual Studio 2010\Projects\Methodenpruefung der Webservices\Methodenpruefung\Methodenpruefung\WebserviceReader.cs: line 68
MethodCheck.WebserviceReader_Accessor.IsValidPath(String path)
UnitTestProject.WebserviceReaderTest.IsValidPathTest() in C:\Users\pp-admin\Documents\Visual Studio 2010\Projects\Methodenpruefung der Webservices\Methodenpruefung\UnitTestProject\WebserviceReaderTest.cs: line 157
Could you please help me getting my logger to work correct?
| 3 |
11,650,754 | 07/25/2012 13:24:33 | 1,352,820 | 04/24/2012 04:40:58 | 11 | 1 | Microsofts latest anti XSS Library for asp.net - 4.2.1 - Problems and Alternatives(?) | I have a problem using the their latest WPL v 4.2.1. The stripping of suspect HTML, javsacript and styling is so aggressive it strips out ALL the CSS.
I understand that CSS can be easily used to inject malicious javascript using URL references, but this also means im losing all the innocent styling that makes my content look readable. The last thing i want displayed on my aspx pages is boring 'plain' text.
My question: Is there another library on the market/the web which I can use which will not strip off my styling elements completely? By that i mean selectively removing only the possibly malicious attributes within the CSS.
I have tried searching but without much luck. If anybody knows of one, could you post the answer here please? I know the current source code can be modified but I'd really like to use an available project if there is one as i'm not very knowledgeable with cross site scripting.
Thanks a ton! | antixsslibrary | null | null | null | null | null | open | Microsofts latest anti XSS Library for asp.net - 4.2.1 - Problems and Alternatives(?)
===
I have a problem using the their latest WPL v 4.2.1. The stripping of suspect HTML, javsacript and styling is so aggressive it strips out ALL the CSS.
I understand that CSS can be easily used to inject malicious javascript using URL references, but this also means im losing all the innocent styling that makes my content look readable. The last thing i want displayed on my aspx pages is boring 'plain' text.
My question: Is there another library on the market/the web which I can use which will not strip off my styling elements completely? By that i mean selectively removing only the possibly malicious attributes within the CSS.
I have tried searching but without much luck. If anybody knows of one, could you post the answer here please? I know the current source code can be modified but I'd really like to use an available project if there is one as i'm not very knowledgeable with cross site scripting.
Thanks a ton! | 0 |
11,650,759 | 07/25/2012 13:24:45 | 1,267,383 | 03/13/2012 19:48:36 | 24 | 0 | How can I add a subtype to this generic Collection? | I want to have a collection of subclass objects but with my generic type implementation as it is now gives an error at `allItems.add(item);` because `allItems` does not hold `Item` types. So how can I change the below code not give an error?
public class ItemManager {
public static Collection<? extends Item> allItems;
...
public static boolean addItem(Item item){
return allItems.add(item);
}
}
A new item might be added as:
itemManager.add(new Bomb());
Is there a way to change `addItem` to:
public static boolean addItem([all subclasses of Item] item) { ... }
or maybe change `allItems` so it can accept receiving an `Item` and a subclass of `Item`?
| java | generics | object | null | null | null | open | How can I add a subtype to this generic Collection?
===
I want to have a collection of subclass objects but with my generic type implementation as it is now gives an error at `allItems.add(item);` because `allItems` does not hold `Item` types. So how can I change the below code not give an error?
public class ItemManager {
public static Collection<? extends Item> allItems;
...
public static boolean addItem(Item item){
return allItems.add(item);
}
}
A new item might be added as:
itemManager.add(new Bomb());
Is there a way to change `addItem` to:
public static boolean addItem([all subclasses of Item] item) { ... }
or maybe change `allItems` so it can accept receiving an `Item` and a subclass of `Item`?
| 0 |
11,650,769 | 07/25/2012 13:25:10 | 1,532,257 | 07/17/2012 15:28:42 | 88 | 1 | How to turn my drag and drop into a click event? | I have a drag and drop game that I am now considering changing.
Basically there is a grid with words in and the word to be spelt is highlighted. Usually you would drag and drop the letters to complete the word, but I am now thinking of making it so the user clicks the letters and they appear in the highlighted area.
Here is the script for it....
$('#pickNext').click(function() {
// remove the class from all td's
$('td').removeClass('spellword');
// pick a random word
rndWord = shuffledWords.sort(function() {
return 0.8 - Math.random();
})[0];
// apply class to all cells containing a letter from that word
$('td[data-word="' + rndWord + '"]').addClass('spellword');
});
$('.drag').draggable({
helper: 'clone',
snap: '.drop',
grid: [60, 60],
revert: function(droppable) {
if (droppable === false) {
return true;
}
else {
return false;
}
}
});
$(".drop").droppable({
drop: function(event, ui) {
word = $(this).data('word');
guesses[word].push($(ui.draggable).attr('data-letter'));
console.log($(event));
console.log($(ui.draggable).text());
console.log('CHECKING : ' + $(this).text() + ' against ' + $(ui.draggable).text().trim());
if ($(this).text() == $(ui.draggable).text().trim()) {
$(this).addClass('wordglow3');
} else {
$(this).addClass('wordglow');
}
console.log('CHECKING : ' + $(this).text() + ' against ' + $(ui.draggable).text().trim());
console.log(guesses);
if (guesses[word].length == 3) {
if (guesses[word].join('') == word) {
$('td[data-word=' + word + ']').addClass('wordglow2');
} else {
$('td[data-word=' + word + ']').addClass("wordglow4");
guesses[word].splice(0, guesses[word].length);
}
}
},
activate: function(event, ui) {
word = $(this).data('word');
// try to remove the class
$('td[data-word=' + word + ']').removeClass('wordglow').removeClass('wordglow4').removeClass('wordglow3');
}
});
How would I go about changing this? Thanks
| javascript | jquery | jquery-ui | null | null | null | open | How to turn my drag and drop into a click event?
===
I have a drag and drop game that I am now considering changing.
Basically there is a grid with words in and the word to be spelt is highlighted. Usually you would drag and drop the letters to complete the word, but I am now thinking of making it so the user clicks the letters and they appear in the highlighted area.
Here is the script for it....
$('#pickNext').click(function() {
// remove the class from all td's
$('td').removeClass('spellword');
// pick a random word
rndWord = shuffledWords.sort(function() {
return 0.8 - Math.random();
})[0];
// apply class to all cells containing a letter from that word
$('td[data-word="' + rndWord + '"]').addClass('spellword');
});
$('.drag').draggable({
helper: 'clone',
snap: '.drop',
grid: [60, 60],
revert: function(droppable) {
if (droppable === false) {
return true;
}
else {
return false;
}
}
});
$(".drop").droppable({
drop: function(event, ui) {
word = $(this).data('word');
guesses[word].push($(ui.draggable).attr('data-letter'));
console.log($(event));
console.log($(ui.draggable).text());
console.log('CHECKING : ' + $(this).text() + ' against ' + $(ui.draggable).text().trim());
if ($(this).text() == $(ui.draggable).text().trim()) {
$(this).addClass('wordglow3');
} else {
$(this).addClass('wordglow');
}
console.log('CHECKING : ' + $(this).text() + ' against ' + $(ui.draggable).text().trim());
console.log(guesses);
if (guesses[word].length == 3) {
if (guesses[word].join('') == word) {
$('td[data-word=' + word + ']').addClass('wordglow2');
} else {
$('td[data-word=' + word + ']').addClass("wordglow4");
guesses[word].splice(0, guesses[word].length);
}
}
},
activate: function(event, ui) {
word = $(this).data('word');
// try to remove the class
$('td[data-word=' + word + ']').removeClass('wordglow').removeClass('wordglow4').removeClass('wordglow3');
}
});
How would I go about changing this? Thanks
| 0 |
11,650,777 | 07/25/2012 13:25:48 | 1,483,442 | 06/26/2012 16:46:54 | 52 | 4 | How do I bind a function to a change in an object's data member in Javascript? | I'm working on a project in Javascript where we're building a Greasemonkey plugin to an organizational site we're using in our office. We're having trouble getting our changes to stay rendered, since we can't simply inject our changes into the existing render function. As a result, we need to find every event where rendering happens and inject our own render function there. However, there are some events that we can see happening, but we can't hook into them. What I'd like to know is how to bind a function to an object's data member, so that the function is called whenever that member changes. One of our team members seemed to think it was possible, but the method he told us to use didn't seem to work.
What we tried was something along the lines of
window.Controller.bind("change:idBoardCurrent", OMGITWORKED);
where idBoardCurrent is a member of window.Controller and OMGITWORKED is the function we'd like to be called when window.Controller.idBoardCurrent is changed.
I'm not very familiar with Javascript or data binding, so I have no idea if this is right or wrong, or what is correct or incorrect about it. If someone could point out what to change in this snippet, or if they could suggest another way to go about this, I would be very appreciative. | javascript | data-binding | null | null | null | null | open | How do I bind a function to a change in an object's data member in Javascript?
===
I'm working on a project in Javascript where we're building a Greasemonkey plugin to an organizational site we're using in our office. We're having trouble getting our changes to stay rendered, since we can't simply inject our changes into the existing render function. As a result, we need to find every event where rendering happens and inject our own render function there. However, there are some events that we can see happening, but we can't hook into them. What I'd like to know is how to bind a function to an object's data member, so that the function is called whenever that member changes. One of our team members seemed to think it was possible, but the method he told us to use didn't seem to work.
What we tried was something along the lines of
window.Controller.bind("change:idBoardCurrent", OMGITWORKED);
where idBoardCurrent is a member of window.Controller and OMGITWORKED is the function we'd like to be called when window.Controller.idBoardCurrent is changed.
I'm not very familiar with Javascript or data binding, so I have no idea if this is right or wrong, or what is correct or incorrect about it. If someone could point out what to change in this snippet, or if they could suggest another way to go about this, I would be very appreciative. | 0 |
11,650,348 | 07/25/2012 13:02:50 | 655,102 | 03/11/2011 09:33:17 | 162 | 2 | if statement checking that div hasClass | hi i want to write if statement which is checking if div dont hasClass and if dont has it script should add it using toggleClass (i'm useing jquery ui), i wrote script above whitch is working almost fine but the first (this) should point to (.apla) that has not "min" class and the second (this) should point (.apla) with clicked (.arrow)
point of this is to check if any (.apla) is open and if any (.apla) is open script should close it using toggleClass (with animation), and after this script should open clicked (.apla) also using toggleClass, could u help me pls
JS
$('.arrow').click(function(){
if (!$(".apla").hasClass("min")) {
$(this).toggleClass("min", "slow");
} else {
$(this).parent().parent().toggleClass("min", "slow");
}
});
HTML
<div id="apla01" class="apla min">
<div class="apla-wraper">
<div class="arrow"></div>
</div>
</div>
<div id="apla02" class="apla min">
<div class="apla-wraper">
<div class="arrow"></div>
</div>
</div>
<div id="apla03" class="apla min">
<div class="apla-wraper">
<div class="arrow"></div>
</div>
</div>
CSS
#apla01.apla.min {
z-index: 5;
left: -800px;
}
#apla02.apla.min {
z-index: 4;
left: -760px;
}
#apla03.apla.min {
z-index: 3;
left: -720px;
}
.apla {
width: 838px;
height: 634px;
position: absolute;
top: 20px;
left: 0;
background: url(../img/bgApla.png) no-repeat -5px center;
}
.apla.min {
}
.apla-wraper {
position: relative;
width: 100%;
height: 100%;
}
.arrow {
width: 28px;
height: 28px;
background: url(../img/arrow.png) no-repeat 0 0;
position: absolute;
top: 50%;
right: -10px;
margin-top: -14px;
cursor: pointer;
}
.apla.min .arrow{
background: url(../img/arrow.png) no-repeat -28px 0;
}
| jquery | null | null | null | null | null | open | if statement checking that div hasClass
===
hi i want to write if statement which is checking if div dont hasClass and if dont has it script should add it using toggleClass (i'm useing jquery ui), i wrote script above whitch is working almost fine but the first (this) should point to (.apla) that has not "min" class and the second (this) should point (.apla) with clicked (.arrow)
point of this is to check if any (.apla) is open and if any (.apla) is open script should close it using toggleClass (with animation), and after this script should open clicked (.apla) also using toggleClass, could u help me pls
JS
$('.arrow').click(function(){
if (!$(".apla").hasClass("min")) {
$(this).toggleClass("min", "slow");
} else {
$(this).parent().parent().toggleClass("min", "slow");
}
});
HTML
<div id="apla01" class="apla min">
<div class="apla-wraper">
<div class="arrow"></div>
</div>
</div>
<div id="apla02" class="apla min">
<div class="apla-wraper">
<div class="arrow"></div>
</div>
</div>
<div id="apla03" class="apla min">
<div class="apla-wraper">
<div class="arrow"></div>
</div>
</div>
CSS
#apla01.apla.min {
z-index: 5;
left: -800px;
}
#apla02.apla.min {
z-index: 4;
left: -760px;
}
#apla03.apla.min {
z-index: 3;
left: -720px;
}
.apla {
width: 838px;
height: 634px;
position: absolute;
top: 20px;
left: 0;
background: url(../img/bgApla.png) no-repeat -5px center;
}
.apla.min {
}
.apla-wraper {
position: relative;
width: 100%;
height: 100%;
}
.arrow {
width: 28px;
height: 28px;
background: url(../img/arrow.png) no-repeat 0 0;
position: absolute;
top: 50%;
right: -10px;
margin-top: -14px;
cursor: pointer;
}
.apla.min .arrow{
background: url(../img/arrow.png) no-repeat -28px 0;
}
| 0 |
11,650,781 | 07/25/2012 13:26:13 | 400,299 | 07/23/2010 13:37:08 | 1,058 | 44 | iOS - Allow user to download file from documents directory but not to upload file using iTunes | Here is a situation I have a data file in document directory which is being updated in the application every now and then. So for the sake of backup I want to save it to my desktop using iTunes. But I don't want that the file should be uploaded back to my application. i.e. I want that user can download the file but can not upload any.
I was thinking to have the data file on some other location like Library and put a button on application settings saying "Prepare backup" that will copy that data file in Document directory, from where user can download it. If user uploads any thing it won't make any difference as my current file is in Library directory.
This is just a thought,
can anyone suggest me other way or the above way is good to go? | iphone | ios | itunes | file-sharing | null | null | open | iOS - Allow user to download file from documents directory but not to upload file using iTunes
===
Here is a situation I have a data file in document directory which is being updated in the application every now and then. So for the sake of backup I want to save it to my desktop using iTunes. But I don't want that the file should be uploaded back to my application. i.e. I want that user can download the file but can not upload any.
I was thinking to have the data file on some other location like Library and put a button on application settings saying "Prepare backup" that will copy that data file in Document directory, from where user can download it. If user uploads any thing it won't make any difference as my current file is in Library directory.
This is just a thought,
can anyone suggest me other way or the above way is good to go? | 0 |
11,472,141 | 07/13/2012 14:08:43 | 1,401,084 | 05/17/2012 13:19:33 | 28 | 0 | Use Of .length in Substring (VB.NET) | Can't figure out why this won't work.
I am trying to analyse a string of variable length containing a "." somewhere inside, and then strip off the "." and all characters before it. This is called via a web service.
When debugging, it works fine until it bails out at the last line, below, with the browser message:
"System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
"
Anyone got any idea?
Code1, below, is an input variable passed to the web service from an eform.
Dim CharNo As New Integer
CharNo = Code1.IndexOf(".")
MyCodebookValueStrip.o_Code1 = Code1.Substring(CharNo + 1, (Code1.Length - CharNo)) | vb.net | indexof | string-length | null | null | null | open | Use Of .length in Substring (VB.NET)
===
Can't figure out why this won't work.
I am trying to analyse a string of variable length containing a "." somewhere inside, and then strip off the "." and all characters before it. This is called via a web service.
When debugging, it works fine until it bails out at the last line, below, with the browser message:
"System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
"
Anyone got any idea?
Code1, below, is an input variable passed to the web service from an eform.
Dim CharNo As New Integer
CharNo = Code1.IndexOf(".")
MyCodebookValueStrip.o_Code1 = Code1.Substring(CharNo + 1, (Code1.Length - CharNo)) | 0 |
11,472,143 | 07/13/2012 14:08:51 | 1,375,978 | 05/04/2012 21:46:12 | 20 | 0 | Split lua string into characters | I only found this related to what I am looking for: http://stackoverflow.com/questions/7111068/split-string-by-count-of-characters but it is not useful for what I mean.
I have a string variable, which is an ammount of 3 numbers (can be from 000 to 999). I need to separate each of the numbers (characters) and get them into a table.
I am programming for a game mod which uses lua, and it has some extra functions. If you could help me to make it using: http://wiki.multitheftauto.com/wiki/Split would be amazing, but any other way is ok too.
Thanks in advance | lua | null | null | null | null | null | open | Split lua string into characters
===
I only found this related to what I am looking for: http://stackoverflow.com/questions/7111068/split-string-by-count-of-characters but it is not useful for what I mean.
I have a string variable, which is an ammount of 3 numbers (can be from 000 to 999). I need to separate each of the numbers (characters) and get them into a table.
I am programming for a game mod which uses lua, and it has some extra functions. If you could help me to make it using: http://wiki.multitheftauto.com/wiki/Split would be amazing, but any other way is ok too.
Thanks in advance | 0 |
11,472,144 | 07/13/2012 14:08:53 | 1,485,081 | 06/27/2012 08:58:16 | 13 | 2 | Merge audio with video perfectly | i've been trying to merge audio with video using AVMutableComposition and AVExportSession , everything works perfectly except that the two assets ( audio asset and the video asset) doesn't have the same duration. So the exported movie is a bit laggy . Is there anyway to resize or redefine the rate of the video so that its duration becomes exactly equal to the audio's duration?? In other words i want to redefine the rate of the video :
lets say audioAsset.duration = 10s;and videoAsset.duration = 9s;
rate = 9/10 ;
All I want is to change the video's rate somehow to run the video a bit slower to match the duration of the audio.
Any thoughts ???
10X
Jad | ios | audio | video | avfoundation | avmutablecomposition | null | open | Merge audio with video perfectly
===
i've been trying to merge audio with video using AVMutableComposition and AVExportSession , everything works perfectly except that the two assets ( audio asset and the video asset) doesn't have the same duration. So the exported movie is a bit laggy . Is there anyway to resize or redefine the rate of the video so that its duration becomes exactly equal to the audio's duration?? In other words i want to redefine the rate of the video :
lets say audioAsset.duration = 10s;and videoAsset.duration = 9s;
rate = 9/10 ;
All I want is to change the video's rate somehow to run the video a bit slower to match the duration of the audio.
Any thoughts ???
10X
Jad | 0 |
11,472,026 | 07/13/2012 14:01:29 | 609,511 | 02/09/2011 10:00:23 | 246 | 12 | is that possible to use instruction pivot in dataset.xsd | when i put this select command into my dataset.xsd
select *
from
(
select TR_DEB,TR_FIN, T_UNITE.LIBELLE as LibUnite, ZONE, MONTANT
from TARIF_COURANT
LEFT JOIN T_UNITE ON TARIF_COURANT.UNITE = T_UNITE.NO_ID
where NO_CLIENT = '440104239' and zone in (1,2,3,4,6)
)as T
pivot
(
min(MONTANT) for ZONE in ([1],[2],[3],[4],[6])
)as P ORDER BY P.TR_DEB
it said that dataset cannot acepted pivot. is there the other way ?
thanks you in advance | sql | query | dataset | pivot | null | null | open | is that possible to use instruction pivot in dataset.xsd
===
when i put this select command into my dataset.xsd
select *
from
(
select TR_DEB,TR_FIN, T_UNITE.LIBELLE as LibUnite, ZONE, MONTANT
from TARIF_COURANT
LEFT JOIN T_UNITE ON TARIF_COURANT.UNITE = T_UNITE.NO_ID
where NO_CLIENT = '440104239' and zone in (1,2,3,4,6)
)as T
pivot
(
min(MONTANT) for ZONE in ([1],[2],[3],[4],[6])
)as P ORDER BY P.TR_DEB
it said that dataset cannot acepted pivot. is there the other way ?
thanks you in advance | 0 |
11,472,027 | 07/13/2012 14:01:33 | 1,016,348 | 10/27/2011 11:10:12 | 1 | 0 | How sorting is happening here and comparison between cap's and small letters? | public class BioDiesel {
public static void main(String args[]) {
LinkedList<String> list = new LinkedList<String>();
list.add("BbB1");
list.add("bBb2");
list.add("bbB3");
list.add("BBb4");
Collections.sort(list);
for (String str : list) {
System.out.print(str + ":");
}
}
}
Hi all Code is bug free and output also i am getting but i am not getting the comparison | java | sorting | collections | scjp | null | null | open | How sorting is happening here and comparison between cap's and small letters?
===
public class BioDiesel {
public static void main(String args[]) {
LinkedList<String> list = new LinkedList<String>();
list.add("BbB1");
list.add("bBb2");
list.add("bbB3");
list.add("BBb4");
Collections.sort(list);
for (String str : list) {
System.out.print(str + ":");
}
}
}
Hi all Code is bug free and output also i am getting but i am not getting the comparison | 0 |
11,472,114 | 07/13/2012 14:07:18 | 851,491 | 07/19/2011 07:40:48 | 739 | 41 | Download Android Source Code on Windows | I want to modify android source and test it on emulator or real device. I am downloading code in Ubuntu but having different problems while downloading. Last time it goes to 3.5 GB and gave some git error.
Anyway, is there any way that I download the code on windows environment like Windows 7 and then port the code to Ubuntu environment to start work on...??? | android | windows-7 | source-code | null | null | null | open | Download Android Source Code on Windows
===
I want to modify android source and test it on emulator or real device. I am downloading code in Ubuntu but having different problems while downloading. Last time it goes to 3.5 GB and gave some git error.
Anyway, is there any way that I download the code on windows environment like Windows 7 and then port the code to Ubuntu environment to start work on...??? | 0 |
11,472,097 | 07/13/2012 14:06:33 | 1,523,752 | 07/13/2012 13:55:31 | 1 | 0 | How to access email contacts from iphone appliaction programatically? | Hi I want to retrieve all email contacts from user email i.e gmail or yahoo or any mail from my iphone app,
Is it possible, give solution to me,
Thanks In Advance. | objective-c | ios | email | abaddressbook | null | null | open | How to access email contacts from iphone appliaction programatically?
===
Hi I want to retrieve all email contacts from user email i.e gmail or yahoo or any mail from my iphone app,
Is it possible, give solution to me,
Thanks In Advance. | 0 |
11,472,098 | 07/13/2012 14:06:35 | 1,523,625 | 07/13/2012 13:05:30 | 1 | 0 | I can not figure out this Error parsing XML: no element found | The last line of code is where I am getting the Parsing XML error. I believe it is also what is causing my 5 other errors. I am new to coding so I will do my best to provide the information needed to help address this issue.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button android:id="@+id/btnStart" android:layout_width="wrap_content"android:layout_height="wrap_content" android:text="Start AsyncTask"></Button>
<Button android:id="@+id/btnSend" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Send Message"></Button>
<TextView android:id="@+id/textStatus" android:textSize="24sp" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Status Goes Here" | xml | parsing | null | null | null | null | open | I can not figure out this Error parsing XML: no element found
===
The last line of code is where I am getting the Parsing XML error. I believe it is also what is causing my 5 other errors. I am new to coding so I will do my best to provide the information needed to help address this issue.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button android:id="@+id/btnStart" android:layout_width="wrap_content"android:layout_height="wrap_content" android:text="Start AsyncTask"></Button>
<Button android:id="@+id/btnSend" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Send Message"></Button>
<TextView android:id="@+id/textStatus" android:textSize="24sp" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Status Goes Here" | 0 |
11,472,148 | 07/13/2012 14:09:04 | 1,523,763 | 07/13/2012 14:01:34 | 1 | 0 | How can I log in to facebook using python (requests/urllib3)? | Im trying to use http://docs.python-requests.org/en/latest/ to log into facebook automatically.
s = requests.session()
params = {'email':'MYEMAILHERE','pass':'MYPASSHERE'}
r = s.post("https://www.facebook.com/login.php/", params = params)
print r.text
But instead of fb showing me the home page it shows the me the "your cookies are disabled"... page.
| python | http | post | cookies | urllib | null | open | How can I log in to facebook using python (requests/urllib3)?
===
Im trying to use http://docs.python-requests.org/en/latest/ to log into facebook automatically.
s = requests.session()
params = {'email':'MYEMAILHERE','pass':'MYPASSHERE'}
r = s.post("https://www.facebook.com/login.php/", params = params)
print r.text
But instead of fb showing me the home page it shows the me the "your cookies are disabled"... page.
| 0 |
11,472,150 | 07/13/2012 14:09:18 | 733,596 | 05/01/2011 19:38:44 | 716 | 10 | What are analogs of Sinon.js (JS mocking library)? | Are there any worthwhile analogs of Sinon.js?
Thanks. | unit-testing | sinon | null | null | null | null | open | What are analogs of Sinon.js (JS mocking library)?
===
Are there any worthwhile analogs of Sinon.js?
Thanks. | 0 |
11,472,154 | 07/13/2012 14:09:28 | 1,488,858 | 06/28/2012 14:25:14 | 1 | 1 | Refresh MView with Toad for Oracle | In Toad for Oracle you can refresh an MVIEW by right click: refresh.
I need to know what type of refresh will be performed (f, c, ?, a) ?
Cheers | toad | null | null | null | null | null | open | Refresh MView with Toad for Oracle
===
In Toad for Oracle you can refresh an MVIEW by right click: refresh.
I need to know what type of refresh will be performed (f, c, ?, a) ?
Cheers | 0 |
11,472,155 | 07/13/2012 14:09:34 | 1,514,943 | 07/10/2012 13:39:49 | 6 | 0 | ?wtx=Y showing up on Google Analytics | This isn't a typical question but it is web related and pertaining to a clients website. I've done some research on it and wanted to check and see if anyone on here is had issues like this.
#1: /Fanuc-servo-motor-repair/?wtx=Y
#3: /?wtx=Y
#26: /yaskawa/?wtx=Y
As you can see, these urls all end with ?wtx=Y. Does anyone know what could be causing this? It's kind of hard to explain to a client when I can't figure out where it's coming from myself. Would it be pertaining to an account like Google AdWords or AdCenter(Bing/Yahoo)? | google | analytics | null | null | null | null | open | ?wtx=Y showing up on Google Analytics
===
This isn't a typical question but it is web related and pertaining to a clients website. I've done some research on it and wanted to check and see if anyone on here is had issues like this.
#1: /Fanuc-servo-motor-repair/?wtx=Y
#3: /?wtx=Y
#26: /yaskawa/?wtx=Y
As you can see, these urls all end with ?wtx=Y. Does anyone know what could be causing this? It's kind of hard to explain to a client when I can't figure out where it's coming from myself. Would it be pertaining to an account like Google AdWords or AdCenter(Bing/Yahoo)? | 0 |
11,472,156 | 07/13/2012 14:09:39 | 1,149,842 | 01/14/2012 22:48:56 | 1 | 0 | LWUIT bitmap-font not working done? | When i use a bitmap font in lwuit List in emulator and SonyEricsson k510i everythings right but in g900 if font size bigger than 9 words not shown ? please help me to fix this problem ... | java-me | lwuit | bitmap-fonts | null | null | null | open | LWUIT bitmap-font not working done?
===
When i use a bitmap font in lwuit List in emulator and SonyEricsson k510i everythings right but in g900 if font size bigger than 9 words not shown ? please help me to fix this problem ... | 0 |
11,628,210 | 07/24/2012 09:46:06 | 1,548,203 | 07/24/2012 09:30:54 | 1 | 0 | access the masterViewController from splitviewcontroller | I have started a master detail application using storyboard and core data.
the managerObjContext is defined in the masterViewController:
@interface addMasterViewController : UITableViewController <NameEditorViewControllerDelegate>
...
@property (strong, nonatomic) NSManagedObjectContext *mngObjCntxt;
and synthesized in the m.file:
@implementation addMasterViewController
...
@synthesize mngObjCntxt=_mngObjCntxt;
now Im trying to set the mngObjCntxt in the application deligate but with no sucess. this is what I have tried:
#import "addAppDelegate.h"
#import "addMasterViewController.h"
#import "addDetailViewController.h"
@implementation addAppDelegate
@synthesize window = _window;
@synthesize splitViewController=_splitViewController;
@synthesize mngObjCntxt = _mngObjCntxt;
@synthesize mngObjModel = _mngObjModel;
@synthesize persistentStoreCoor = _persistentStoreCoor;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
splitViewController.delegate = (id)navigationController.topViewController;
[[[splitViewController viewControllers] objectAtIndex:0] setMngObjCntxt:[self mngObjCntxt]];
return YES;
}
the problem is that via the bolded expresion above im reaching the UINavigationController and not to the masterViewContoller, which hold the mngObjCntxt.
so Im falling on the following error:-[UINavigationController setMngObjCntxt:]: unrecognized selector sent to instance
how can I access the masterViewController frm the app deligate?
thanks!
Shimrit. | ipad | delegates | null | null | null | null | open | access the masterViewController from splitviewcontroller
===
I have started a master detail application using storyboard and core data.
the managerObjContext is defined in the masterViewController:
@interface addMasterViewController : UITableViewController <NameEditorViewControllerDelegate>
...
@property (strong, nonatomic) NSManagedObjectContext *mngObjCntxt;
and synthesized in the m.file:
@implementation addMasterViewController
...
@synthesize mngObjCntxt=_mngObjCntxt;
now Im trying to set the mngObjCntxt in the application deligate but with no sucess. this is what I have tried:
#import "addAppDelegate.h"
#import "addMasterViewController.h"
#import "addDetailViewController.h"
@implementation addAppDelegate
@synthesize window = _window;
@synthesize splitViewController=_splitViewController;
@synthesize mngObjCntxt = _mngObjCntxt;
@synthesize mngObjModel = _mngObjModel;
@synthesize persistentStoreCoor = _persistentStoreCoor;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
splitViewController.delegate = (id)navigationController.topViewController;
[[[splitViewController viewControllers] objectAtIndex:0] setMngObjCntxt:[self mngObjCntxt]];
return YES;
}
the problem is that via the bolded expresion above im reaching the UINavigationController and not to the masterViewContoller, which hold the mngObjCntxt.
so Im falling on the following error:-[UINavigationController setMngObjCntxt:]: unrecognized selector sent to instance
how can I access the masterViewController frm the app deligate?
thanks!
Shimrit. | 0 |
11,628,211 | 07/24/2012 09:46:07 | 1,548,055 | 07/24/2012 08:33:20 | 1 | 0 | How to remove "delete" button in default "Edit" form of sonata admin? | I wrote a code to list data taken from a simple database and there I put an action to edit data. When I click on this Edit button, it goes to the default "Edit" page. There is a button called "delete" there. I want to remove that button... | symfony-sonata | null | null | null | null | null | open | How to remove "delete" button in default "Edit" form of sonata admin?
===
I wrote a code to list data taken from a simple database and there I put an action to edit data. When I click on this Edit button, it goes to the default "Edit" page. There is a button called "delete" there. I want to remove that button... | 0 |
11,628,212 | 07/24/2012 09:46:13 | 829,537 | 07/05/2011 10:54:39 | 30 | 0 | CDI interceptor for a specific type | @InterceptorBinding
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface RequiresPageReload {
}
public interface Page{
public static final String LOAD_STR = "load";
public void load();
}
@RequestScoped
public class PageImpl1 implements Page{
public void load(){
//...
}
@RequiresPageReload
public String foo(){
//...
return "foo1";
}
}
@RequestScoped
public class MyObject{
@RequiresPageReload
public String foo2(){
//...
return "foo2";
}
}
@RequiresPageReload
@Interceptor
public class RequiresPageReloadInterceptor implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@AroundInvoke
public Object forceReload(InvocationContext context) throws Exception {
Object result = context.proceed();
context.getMethod().getDeclaringClass().getDeclaredMethod(Page.LOAD_STR).invoke(context.getTarget()); //***
return result;
}
}
In the line marked with stars, of course I can check through reflection if the method exists and decide accordingly what to do.
But I wonder whether is there a better way to achieve the same behavior?
For example, is it possible to associate interceptors to just a specific type (in this example, imagine I don't want the foo2() method of MyObject to be intercepted because such object does not implement Page)? I considered also using Decorators, but there the problem is "foo"s method don't belong to an interface..
thank you! | java-ee | cdi | interceptor | null | null | null | open | CDI interceptor for a specific type
===
@InterceptorBinding
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface RequiresPageReload {
}
public interface Page{
public static final String LOAD_STR = "load";
public void load();
}
@RequestScoped
public class PageImpl1 implements Page{
public void load(){
//...
}
@RequiresPageReload
public String foo(){
//...
return "foo1";
}
}
@RequestScoped
public class MyObject{
@RequiresPageReload
public String foo2(){
//...
return "foo2";
}
}
@RequiresPageReload
@Interceptor
public class RequiresPageReloadInterceptor implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@AroundInvoke
public Object forceReload(InvocationContext context) throws Exception {
Object result = context.proceed();
context.getMethod().getDeclaringClass().getDeclaredMethod(Page.LOAD_STR).invoke(context.getTarget()); //***
return result;
}
}
In the line marked with stars, of course I can check through reflection if the method exists and decide accordingly what to do.
But I wonder whether is there a better way to achieve the same behavior?
For example, is it possible to associate interceptors to just a specific type (in this example, imagine I don't want the foo2() method of MyObject to be intercepted because such object does not implement Page)? I considered also using Decorators, but there the problem is "foo"s method don't belong to an interface..
thank you! | 0 |
11,628,215 | 07/24/2012 09:46:20 | 1,165,036 | 01/23/2012 13:36:03 | 432 | 32 | Reporting Services SSRS 2008: “HTTP status 401: Unauthorized” Issue | I am using `WPF` application and `SSRS 2008` for reporting. The `Report Server` is configured for Server reports on a `Windows 2003 R2` server. I have configured my `Report Manager Properties Security` settings for `Everyone` and the `Report Manager Site Settings Security` for `Everyone` as I do not want to pass the credentials to the `Report Server` through the `ReportViewer`. Security is not an issue as this would be mostly used on a `LAN`.
I was able to generate the reports using the url for `Report Server` - `http://IPaddress/ReportServer` earlier and it used to work fine. But lately I have been getting the error msg while generating the report: `The request failed with HTTP status 401: Unauthorized.`
Also, when I try to access the Report Manager through my IE
I just figured out that I am able to generate the report using the url: `http://MachineName/ReportServer`. But I would like to be able to use the earlier URL for the same.
I think this is a `loopback check` issue but I am not sure of that. I have also tried the solution from [here][1] but it doesn't seem to work.
[1]: http://support.microsoft.com/kb/871179 | c#-4.0 | reporting-services | ssrs-2008 | ssrs-reports | null | null | open | Reporting Services SSRS 2008: “HTTP status 401: Unauthorized” Issue
===
I am using `WPF` application and `SSRS 2008` for reporting. The `Report Server` is configured for Server reports on a `Windows 2003 R2` server. I have configured my `Report Manager Properties Security` settings for `Everyone` and the `Report Manager Site Settings Security` for `Everyone` as I do not want to pass the credentials to the `Report Server` through the `ReportViewer`. Security is not an issue as this would be mostly used on a `LAN`.
I was able to generate the reports using the url for `Report Server` - `http://IPaddress/ReportServer` earlier and it used to work fine. But lately I have been getting the error msg while generating the report: `The request failed with HTTP status 401: Unauthorized.`
Also, when I try to access the Report Manager through my IE
I just figured out that I am able to generate the report using the url: `http://MachineName/ReportServer`. But I would like to be able to use the earlier URL for the same.
I think this is a `loopback check` issue but I am not sure of that. I have also tried the solution from [here][1] but it doesn't seem to work.
[1]: http://support.microsoft.com/kb/871179 | 0 |
11,628,216 | 07/24/2012 09:46:33 | 1,501,101 | 07/04/2012 09:18:09 | 11 | 0 | trying to Create user defined collection class with list<> | C# : I am trying to create collection class with list of some other user defined class but it show object not set to be an instance of an object when i trying to add object in main object.
Here is my C# code :
namespace ConsoleApplication2
{
public class Monthlst
{
public List<Monday> Monday { get; set; }
public List<Tuesday> Tuesday { get; set; }
public List<Wednesday> Wednesday { get; set; }
public List<Thursday> Thursday { get; set; }
public List<Friday> Friday { get; set; }
public List<Saturday> Saturday { get; set; }
public List<Sunday> Sunday { get; set; }
}
public class Monday
{
public int days { get; set; }
}
public class Tuesday
{
public int days { get; set; }
}
public class Wednesday
{
public int days { get; set; }
}
public class Thursday
{
public int days { get; set; }
}
public class Friday
{
public int days { get; set; }
}
public class Saturday
{
public int days { get; set; }
}
public class Sunday
{
public int days { get; set; }
}
class Program
{
static void Main(string[] args)
{
Monthlst objmonth = new Monthlst();
Wednesday wednes = new Wednesday();
wednes.days = 5;
objmonth.Wednesday.Add(wednes); // here i am getting error object not set to....
}
}
}
Here i am just create instance of my Monthlst class in main method and the object of wednesday class in list property of Monthlst object but why it show me error i dont know Is there any wrong thing i am doing or not please explain....
Thanks,
Raj | c# | class | collections | null | null | null | open | trying to Create user defined collection class with list<>
===
C# : I am trying to create collection class with list of some other user defined class but it show object not set to be an instance of an object when i trying to add object in main object.
Here is my C# code :
namespace ConsoleApplication2
{
public class Monthlst
{
public List<Monday> Monday { get; set; }
public List<Tuesday> Tuesday { get; set; }
public List<Wednesday> Wednesday { get; set; }
public List<Thursday> Thursday { get; set; }
public List<Friday> Friday { get; set; }
public List<Saturday> Saturday { get; set; }
public List<Sunday> Sunday { get; set; }
}
public class Monday
{
public int days { get; set; }
}
public class Tuesday
{
public int days { get; set; }
}
public class Wednesday
{
public int days { get; set; }
}
public class Thursday
{
public int days { get; set; }
}
public class Friday
{
public int days { get; set; }
}
public class Saturday
{
public int days { get; set; }
}
public class Sunday
{
public int days { get; set; }
}
class Program
{
static void Main(string[] args)
{
Monthlst objmonth = new Monthlst();
Wednesday wednes = new Wednesday();
wednes.days = 5;
objmonth.Wednesday.Add(wednes); // here i am getting error object not set to....
}
}
}
Here i am just create instance of my Monthlst class in main method and the object of wednesday class in list property of Monthlst object but why it show me error i dont know Is there any wrong thing i am doing or not please explain....
Thanks,
Raj | 0 |
11,628,217 | 07/24/2012 09:46:36 | 1,275,735 | 03/17/2012 12:43:04 | 80 | 2 | yFrog Image upload issue | I am using the following code for posting image to Twitter with yFrog and getting the response as HTML content, not as xml.
-(IBAction)postToTwitter {
NSURL *postURL = [NSURL URLWithString:@"http://yfrog.com/api/uploadAndPost"];
NSMutableURLRequest *postRequest = [NSMutableURLRequest requestWithURL:postURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
[postRequest setHTTPMethod:@"POST"];
NSString *username = TwitterUserName;
NSString *password = TwitterPassword;
NSString *message = @"Test Tweet";
NSString *source = @"FF";
NSString *api_key= yFrogKey;
NSString *stringBoundary = @"0xKhTmLbOuNdArY---This_Is_ThE_BoUnDaRyy---pqo";
NSString *headerBoundary = [NSString stringWithFormat:@"multipart/form-data;boundary=%@",stringBoundary];
[postRequest addValue:headerBoundary forHTTPHeaderField:@"Content-Type"];
NSMutableData *postBody = [NSMutableData data];
// username part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"username\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[username dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// password part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"password\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[password dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// api_key
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"key\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[api_key dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// message part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"message\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[message dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// source part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"source\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[source dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// media part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Disposition: form-data; name=\"media\"; filename=\"test.jpg\"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Type: image/jpeg\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Transfer-Encoding: binary\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
NSData *imageData = UIImagePNGRepresentation([UIImage imageNamed:@"test.jpg"]);
[postBody appendData:imageData];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postRequest setHTTPBody:postBody];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:postRequest delegate:self];
if (theConnection) {
webData = [[NSMutableData data] retain];
}
else {
NSLog(@"theConnection is NULL");
}
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[webData appendData:data];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString* responseString = [[NSString alloc] initWithData:webData encoding:NSUTF8StringEncoding];
NSLog(@"result: %@", responseString);
[responseString release];
}
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
NSLog(@"error - read error object for details");
}
Can anyone help me to sort out the issue.
Thanks in advance, | objective-c | yfrog | null | null | null | null | open | yFrog Image upload issue
===
I am using the following code for posting image to Twitter with yFrog and getting the response as HTML content, not as xml.
-(IBAction)postToTwitter {
NSURL *postURL = [NSURL URLWithString:@"http://yfrog.com/api/uploadAndPost"];
NSMutableURLRequest *postRequest = [NSMutableURLRequest requestWithURL:postURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
[postRequest setHTTPMethod:@"POST"];
NSString *username = TwitterUserName;
NSString *password = TwitterPassword;
NSString *message = @"Test Tweet";
NSString *source = @"FF";
NSString *api_key= yFrogKey;
NSString *stringBoundary = @"0xKhTmLbOuNdArY---This_Is_ThE_BoUnDaRyy---pqo";
NSString *headerBoundary = [NSString stringWithFormat:@"multipart/form-data;boundary=%@",stringBoundary];
[postRequest addValue:headerBoundary forHTTPHeaderField:@"Content-Type"];
NSMutableData *postBody = [NSMutableData data];
// username part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"username\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[username dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// password part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"password\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[password dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// api_key
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"key\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[api_key dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// message part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"message\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[message dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// source part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"source\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[source dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
// media part
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Disposition: form-data; name=\"media\"; filename=\"test.jpg\"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Type: image/jpeg\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[@"Content-Transfer-Encoding: binary\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
NSData *imageData = UIImagePNGRepresentation([UIImage imageNamed:@"test.jpg"]);
[postBody appendData:imageData];
[postBody appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postRequest setHTTPBody:postBody];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:postRequest delegate:self];
if (theConnection) {
webData = [[NSMutableData data] retain];
}
else {
NSLog(@"theConnection is NULL");
}
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[webData appendData:data];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
NSString* responseString = [[NSString alloc] initWithData:webData encoding:NSUTF8StringEncoding];
NSLog(@"result: %@", responseString);
[responseString release];
}
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
NSLog(@"error - read error object for details");
}
Can anyone help me to sort out the issue.
Thanks in advance, | 0 |
11,628,222 | 07/24/2012 09:46:48 | 1,176,316 | 01/29/2012 10:14:11 | 3 | 1 | Using subversion with R in Eclipse | I wanted to know if you can share your experience of using subversion with R.
Would you have any tutorial on how to set up and use subversion with R in Eclipse?
Much appreciated.
Thanks | eclipse | r | svn | null | null | 07/24/2012 10:45:22 | not a real question | Using subversion with R in Eclipse
===
I wanted to know if you can share your experience of using subversion with R.
Would you have any tutorial on how to set up and use subversion with R in Eclipse?
Much appreciated.
Thanks | 1 |
11,628,235 | 07/24/2012 09:47:12 | 1,545,603 | 07/23/2012 10:35:58 | 1 | 0 | how to call a server side function from javascript code using "tag functions " in asp.net C#? | hope it´s a good one :P
For starters, ive searched what is the "tag operator" <%=%> to no answer, so i'll be refering to it as that
i´m implementing a [progress bar][1] in asp.net C#, this is the relevant part of the user control
im using
<div class="progress_container" >
<div class="progress_bar tip" id="ProgressBar" title="78%"></div>
</div>
<script type="text/javascript">
function myFunction() {
document.getElementById("ProgressBar").setAttribute("title", '<%=getPercent()%>')
var percent = $('.progress_bar').attr('title');
$('.progress_bar').animate({ width: percent }, 1000);
}
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnProgressBar" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Button runat="server" Text="Go!" id="btnProgressBar" OnClientClick="myFunction()" />
</ContentTemplate>
</asp:UpdatePanel>
this is the function from codebehind
public string getPercent(){
Random random = new Random();
int randomNumber = random.Next(0, 100);
return randomNumber + "%";
}
witch manages to work quite nicely for JUST one time, then nothing, its like the call to the function `'<%=getPercent()%>'` just works one time. how can i fix this?
Thanks!
(PD: Please forgive me if i made any grammars mistakes, for english is my second language )
[1]: http://www.htmldrive.net/items/show/1047/jQuery-tooltip-animated-progress-bar
| c# | javascript | asp.net | ajax | null | null | open | how to call a server side function from javascript code using "tag functions " in asp.net C#?
===
hope it´s a good one :P
For starters, ive searched what is the "tag operator" <%=%> to no answer, so i'll be refering to it as that
i´m implementing a [progress bar][1] in asp.net C#, this is the relevant part of the user control
im using
<div class="progress_container" >
<div class="progress_bar tip" id="ProgressBar" title="78%"></div>
</div>
<script type="text/javascript">
function myFunction() {
document.getElementById("ProgressBar").setAttribute("title", '<%=getPercent()%>')
var percent = $('.progress_bar').attr('title');
$('.progress_bar').animate({ width: percent }, 1000);
}
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnProgressBar" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Button runat="server" Text="Go!" id="btnProgressBar" OnClientClick="myFunction()" />
</ContentTemplate>
</asp:UpdatePanel>
this is the function from codebehind
public string getPercent(){
Random random = new Random();
int randomNumber = random.Next(0, 100);
return randomNumber + "%";
}
witch manages to work quite nicely for JUST one time, then nothing, its like the call to the function `'<%=getPercent()%>'` just works one time. how can i fix this?
Thanks!
(PD: Please forgive me if i made any grammars mistakes, for english is my second language )
[1]: http://www.htmldrive.net/items/show/1047/jQuery-tooltip-animated-progress-bar
| 0 |
11,350,237 | 07/05/2012 18:21:27 | 1,286,265 | 03/22/2012 14:58:58 | 6 | 2 | Dynamic query for Crystal Report, "No valid report source is available." | I am trying to create a Crystal Report with a dynamic data source. When i click the report button, the crystal report shows up just fine, but when i click any button the Crystal Report tool bar (i.e. Next page, Export To, etc.), i get a pop with the Error "No valid report source is available."
Here is what my C# code looks like:
private void GenerateReport()
{
using (DataContext reports = new DataContext())
{
var results = //Linq Query;
ReportDocument pr = new ReportDocument();
pr.Load(Server.MapPath(@"CrystalReport1.rpt"));
pr.SetDataSource(results.ToList());
CrystalReportViewer1.ReportSource = pr;
CrystalReportViewer1.DataBind();
}
}
Any help would be greatly appreciated. Thanks in advanced.
| c# | asp.net | crystal-reports-2010 | null | null | null | open | Dynamic query for Crystal Report, "No valid report source is available."
===
I am trying to create a Crystal Report with a dynamic data source. When i click the report button, the crystal report shows up just fine, but when i click any button the Crystal Report tool bar (i.e. Next page, Export To, etc.), i get a pop with the Error "No valid report source is available."
Here is what my C# code looks like:
private void GenerateReport()
{
using (DataContext reports = new DataContext())
{
var results = //Linq Query;
ReportDocument pr = new ReportDocument();
pr.Load(Server.MapPath(@"CrystalReport1.rpt"));
pr.SetDataSource(results.ToList());
CrystalReportViewer1.ReportSource = pr;
CrystalReportViewer1.DataBind();
}
}
Any help would be greatly appreciated. Thanks in advanced.
| 0 |
11,350,241 | 07/05/2012 18:21:35 | 1,276,967 | 03/18/2012 13:56:15 | 1 | 0 | How to select a column in the next row in MSSQL stored procedure? | How can I select QuestionId in the next row via stored procedure?
(Client side: a question(QuestionId:3) will be shown on screen. When next button is clicked, next question(QuestionId:7) will be shown).
**Note that;**
QuestionId has to be changed incrementally and continuously according to RowId after every execution(like 1-3-7-8...). Also any question can be deleted so it is important to keep the order.
+-------+------------+--------------+
| RowId | QuestionId | QuestionText |
+-------+------------+--------------+
| 1 | 1 | aaaa |
| 2 | 3 | bbbb |
| 3 | 7 | cccc |
| 4 | 8 | dddd |
| 5 | 13 | eeee |
| 6 | 17 | ffff |
| 7 | 24 | gggg |
| 8 | 30 | hhhh |
+-------+------------+--------------+ | sql | database | sql-server-2005 | stored-procedures | null | null | open | How to select a column in the next row in MSSQL stored procedure?
===
How can I select QuestionId in the next row via stored procedure?
(Client side: a question(QuestionId:3) will be shown on screen. When next button is clicked, next question(QuestionId:7) will be shown).
**Note that;**
QuestionId has to be changed incrementally and continuously according to RowId after every execution(like 1-3-7-8...). Also any question can be deleted so it is important to keep the order.
+-------+------------+--------------+
| RowId | QuestionId | QuestionText |
+-------+------------+--------------+
| 1 | 1 | aaaa |
| 2 | 3 | bbbb |
| 3 | 7 | cccc |
| 4 | 8 | dddd |
| 5 | 13 | eeee |
| 6 | 17 | ffff |
| 7 | 24 | gggg |
| 8 | 30 | hhhh |
+-------+------------+--------------+ | 0 |
11,350,242 | 07/05/2012 18:21:41 | 1,098,524 | 12/14/2011 19:07:16 | 543 | 7 | Preserving spaces from the XSL stylesheet | I'm trying to convert this XML :-
<list>
<unit>
<data1>a</data1>
<data2>b</data2>
<data3>c</data3>
</unit>
</list>
to this :-
<list>
<unit>
<category1>
<data1>a</data1>
<data2>b</data2>
</category1>
<category2>
<data3>c</data3>
</category2>
</unit>
</list>
using XSL. I'm using the following XSL:-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:s="some_namespace">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="//s:unit" xml:space="preserve">
<category1>
<xsl:apply-templates select="./s:data1"/>
<xsl:apply-templates select="./s:data2"/>
</category1>
<category2>
<xsl:apply-templates select="./s:data3"/>
</category2>
</xsl:template>
</xsl:stylesheet>
Now, this preserves the indentation within <unit> but completely messes it up w.r.t. list. This is what I get :-
<list>
<unit>
<category1>
<data1>a</data1>
<data2>b</data2>
</category1>
<category2>
<data3>c</data3>
</category2>
</unit>
</list>
What am I missing here? | xml | xslt | whitespace | null | null | null | open | Preserving spaces from the XSL stylesheet
===
I'm trying to convert this XML :-
<list>
<unit>
<data1>a</data1>
<data2>b</data2>
<data3>c</data3>
</unit>
</list>
to this :-
<list>
<unit>
<category1>
<data1>a</data1>
<data2>b</data2>
</category1>
<category2>
<data3>c</data3>
</category2>
</unit>
</list>
using XSL. I'm using the following XSL:-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:s="some_namespace">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="//s:unit" xml:space="preserve">
<category1>
<xsl:apply-templates select="./s:data1"/>
<xsl:apply-templates select="./s:data2"/>
</category1>
<category2>
<xsl:apply-templates select="./s:data3"/>
</category2>
</xsl:template>
</xsl:stylesheet>
Now, this preserves the indentation within <unit> but completely messes it up w.r.t. list. This is what I get :-
<list>
<unit>
<category1>
<data1>a</data1>
<data2>b</data2>
</category1>
<category2>
<data3>c</data3>
</category2>
</unit>
</list>
What am I missing here? | 0 |
11,350,249 | 07/05/2012 18:22:05 | 389,453 | 07/12/2010 11:48:49 | 443 | 21 | How to parse a django template and render specific tag | Is it possible to parse a django template and only render a specific tag ?
This [snippet][1] is close to what I'm looking for but it doesn't return the entire template.
Basically if I have this template as input
<html>
<title>{% block title%}{% endblock %}</title>
<body>
{% block content %}
{% mycustomtag "args" %}
{% endblock content %}
</body>
</html>
and i want to only render `mycustomtag` this is the output Im looking for
<html>
<title>{% block title%}{% endblock %}</title>
<body>
{% block content %}
<p>Result from mycustomtag</p>
{% endblock content %}
</body>
</html>
Thanks.
[1]: http://djangosnippets.org/snippets/942/ | python | django | django-templates | django-template-tags | null | null | open | How to parse a django template and render specific tag
===
Is it possible to parse a django template and only render a specific tag ?
This [snippet][1] is close to what I'm looking for but it doesn't return the entire template.
Basically if I have this template as input
<html>
<title>{% block title%}{% endblock %}</title>
<body>
{% block content %}
{% mycustomtag "args" %}
{% endblock content %}
</body>
</html>
and i want to only render `mycustomtag` this is the output Im looking for
<html>
<title>{% block title%}{% endblock %}</title>
<body>
{% block content %}
<p>Result from mycustomtag</p>
{% endblock content %}
</body>
</html>
Thanks.
[1]: http://djangosnippets.org/snippets/942/ | 0 |
11,350,250 | 07/05/2012 18:22:07 | 1,230,041 | 02/24/2012 05:47:19 | 1 | 1 | Error with CakePHP - Notice (8): Undefined variable: uri | I'm starting with CakePHP and i'm following the blog tutorial from the official page.
But when i reach to the section **Creating Post Views** of the tutorial(<http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/part-two.html>), i get an error.
After creating the mentioned files on the tutorial, i direct the browser to *http://mypersonalspace.host.mobi/posts/index* to see if its working correctly. But the page displays the next error:
**Notice (8): Undefined variable: uri [CORE/Cake/Network/CakeRequest.php, line 247]**
I don't know waht to do because i haven't touched that file. I even moved all my CakePHP installation to the *httpdocs* root folder, because i had it originally in a subfolder named *framework*. I've checked the files looking for typos or something, but i have no clue.
Can you help me please?
I'm using the version 2.2.0 of CakePHP and my webserver is hosted in a subdomain(http://mypersonalspace.host.mobi) | php | cakephp | null | null | null | null | open | Error with CakePHP - Notice (8): Undefined variable: uri
===
I'm starting with CakePHP and i'm following the blog tutorial from the official page.
But when i reach to the section **Creating Post Views** of the tutorial(<http://book.cakephp.org/2.0/en/tutorials-and-examples/blog/part-two.html>), i get an error.
After creating the mentioned files on the tutorial, i direct the browser to *http://mypersonalspace.host.mobi/posts/index* to see if its working correctly. But the page displays the next error:
**Notice (8): Undefined variable: uri [CORE/Cake/Network/CakeRequest.php, line 247]**
I don't know waht to do because i haven't touched that file. I even moved all my CakePHP installation to the *httpdocs* root folder, because i had it originally in a subfolder named *framework*. I've checked the files looking for typos or something, but i have no clue.
Can you help me please?
I'm using the version 2.2.0 of CakePHP and my webserver is hosted in a subdomain(http://mypersonalspace.host.mobi) | 0 |
11,350,251 | 07/05/2012 18:22:08 | 1,504,639 | 07/05/2012 16:31:47 | 1 | 0 | text overlapping iframe | I have two iframes on a page and I can't figure out why the text is overlapping the second iframe. Any suggestions? Thanks!
<h1>Spanish Springs Library </h1>
<hr />
<div align="left" id="text" style="float: left;">
<div border="0" align="right" id="tour" style="float: right; width: 450px; height: 300px;"><iframe width="448" frameborder="0" src="http://tours.blackhawkvirtualmedia.com/public/vtour/full/55789" border="0" height="280"></iframe>
<div border="0" align="right" id="map" style="float: right; width: 200px; height: 200px;"><iframe scrolling="no" marginwidth="0" width="200" frameborder="0" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&oe=UTF8&msa=0&msid=108756021178700849594.000457097404325161dd5&ll=39.618251,-119.728832&spn=0.026447,0.034332&t=p&z=13&output=embed" marginheight="0" height="200"></iframe><br /><small>View <a href="http://maps.google.com/maps/ms?ie=UTF8&hl=en&oe=UTF8&msa=0&msid=108756021178700849594.000457097404325161dd5&ll=39.618251,-119.728832&spn=0.026447,0.034332&t=p&z=13&source=embed" target="_blank">a larger version</a> of this map</small> </div>
</div>
<p><a href="/repository/files/8/SS_09_10.pdf" target="_blank" title="Calendar of Events">Calendar of Events</a><br />7100A Pyramid Lake Highway<br />Sparks, NV 89436 </p>
<p><strong><br />Hours:</strong> Mon, 10am - 6pm<br /> Tue - Wed, Noon - 8pm<br /> Thurs, 10am - 6pm<br /> Sun, 10am - 5pm <br /> Fri - Sat, Closed<br /><strong>Phone:</strong> 775-424-1800<br /><strong>FAX:</strong> 775-424-1840 </p>
<p>Spanish Springs Library is located on the Pyramid Highway in Spanish Springs. An octagonal building with open spaces set off by a 64 foot ceiling over the atrium, comfortable seating and thirty-nine public access/Internet computers, it is truly a destination for the entire family. Features include a drive-through service point to pick up and drop off materials, and a 24-hour book return. </p>
<p>The Nell J. Redfield Foundation Young People's Library features a unique oversized stack of books at the entrance and a separate Story Time room. Seven of the thirty-nine public computers (including an adult station so parents and children can work side by side, and two children’s games computers) and a family restroom complete the area as a family friendly place.</p>
<p>The teen zone is a comfortable place with eight of the thirty-nine public access computers and an area for group study and projects.</p>
<p>Programs for all ages are offered including Story Times, guest speakers and artists, craft programs, book discussion for all ages, an art gallery, displays, and much more!</p>
<p>An ADA computer station with a Braille printer is available to the public.</p>
<p>E.L. Cord community meeting rooms provide spaces for groups to meet and groups may arrange to stay after the library is closed.</p>
<p>Self-serve features include express check-out, the ability to pick up holds, Downloadable ebook and audio-book station, automated computer sign-ups, and printing. Offering wireless internet access and printing from your laptop, laptop locks, a public fax machine, a flatbed scanner for public use, and study rooms, the library is truly a destination for the whole family.</p>
<p>Citizens may request exam proctoring at the Spanish Springs Library. </p>
<p>The atmosphere is enhanced by the cozy fireplace, coffee cart and comfortable seating throughout the building.</p>
</div> | iframe | overlap | null | null | null | null | open | text overlapping iframe
===
I have two iframes on a page and I can't figure out why the text is overlapping the second iframe. Any suggestions? Thanks!
<h1>Spanish Springs Library </h1>
<hr />
<div align="left" id="text" style="float: left;">
<div border="0" align="right" id="tour" style="float: right; width: 450px; height: 300px;"><iframe width="448" frameborder="0" src="http://tours.blackhawkvirtualmedia.com/public/vtour/full/55789" border="0" height="280"></iframe>
<div border="0" align="right" id="map" style="float: right; width: 200px; height: 200px;"><iframe scrolling="no" marginwidth="0" width="200" frameborder="0" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&oe=UTF8&msa=0&msid=108756021178700849594.000457097404325161dd5&ll=39.618251,-119.728832&spn=0.026447,0.034332&t=p&z=13&output=embed" marginheight="0" height="200"></iframe><br /><small>View <a href="http://maps.google.com/maps/ms?ie=UTF8&hl=en&oe=UTF8&msa=0&msid=108756021178700849594.000457097404325161dd5&ll=39.618251,-119.728832&spn=0.026447,0.034332&t=p&z=13&source=embed" target="_blank">a larger version</a> of this map</small> </div>
</div>
<p><a href="/repository/files/8/SS_09_10.pdf" target="_blank" title="Calendar of Events">Calendar of Events</a><br />7100A Pyramid Lake Highway<br />Sparks, NV 89436 </p>
<p><strong><br />Hours:</strong> Mon, 10am - 6pm<br /> Tue - Wed, Noon - 8pm<br /> Thurs, 10am - 6pm<br /> Sun, 10am - 5pm <br /> Fri - Sat, Closed<br /><strong>Phone:</strong> 775-424-1800<br /><strong>FAX:</strong> 775-424-1840 </p>
<p>Spanish Springs Library is located on the Pyramid Highway in Spanish Springs. An octagonal building with open spaces set off by a 64 foot ceiling over the atrium, comfortable seating and thirty-nine public access/Internet computers, it is truly a destination for the entire family. Features include a drive-through service point to pick up and drop off materials, and a 24-hour book return. </p>
<p>The Nell J. Redfield Foundation Young People's Library features a unique oversized stack of books at the entrance and a separate Story Time room. Seven of the thirty-nine public computers (including an adult station so parents and children can work side by side, and two children’s games computers) and a family restroom complete the area as a family friendly place.</p>
<p>The teen zone is a comfortable place with eight of the thirty-nine public access computers and an area for group study and projects.</p>
<p>Programs for all ages are offered including Story Times, guest speakers and artists, craft programs, book discussion for all ages, an art gallery, displays, and much more!</p>
<p>An ADA computer station with a Braille printer is available to the public.</p>
<p>E.L. Cord community meeting rooms provide spaces for groups to meet and groups may arrange to stay after the library is closed.</p>
<p>Self-serve features include express check-out, the ability to pick up holds, Downloadable ebook and audio-book station, automated computer sign-ups, and printing. Offering wireless internet access and printing from your laptop, laptop locks, a public fax machine, a flatbed scanner for public use, and study rooms, the library is truly a destination for the whole family.</p>
<p>Citizens may request exam proctoring at the Spanish Springs Library. </p>
<p>The atmosphere is enhanced by the cozy fireplace, coffee cart and comfortable seating throughout the building.</p>
</div> | 0 |
11,350,252 | 07/05/2012 18:22:09 | 1,245,927 | 03/02/2012 20:21:10 | 11 | 1 | PHP & Delphi COM+ DLL & Serial port | That's my most recent problem...
I have here some legacy COM+ DLLs that were developed using Delphi 5. One of those DLLs has a method to write stuff on COM Serial ports using the following code:
AssignFile(fport,'COM1');
Rewrite(fport);
Write(fport,'some command');
CloseFile(fport);
When we started coding the front end to use PHP, we used a WebService on IIS to access the COM+ DLL. I didn't know then that I could use the COM class in PHP to do it. But it was working fine.
So today I changed the php to use the COM class and got rid of the IIS. The DLL is called, the function is executed, but the serial port communication does not work at all. I tried to put some `try..except` on Delphi code but no exception is thrown.
Maybe is something related to privileges that php process doesn't have to access the serial port?
Thanks in advance for any clue! | php | delphi | com | serial-port | null | null | open | PHP & Delphi COM+ DLL & Serial port
===
That's my most recent problem...
I have here some legacy COM+ DLLs that were developed using Delphi 5. One of those DLLs has a method to write stuff on COM Serial ports using the following code:
AssignFile(fport,'COM1');
Rewrite(fport);
Write(fport,'some command');
CloseFile(fport);
When we started coding the front end to use PHP, we used a WebService on IIS to access the COM+ DLL. I didn't know then that I could use the COM class in PHP to do it. But it was working fine.
So today I changed the php to use the COM class and got rid of the IIS. The DLL is called, the function is executed, but the serial port communication does not work at all. I tried to put some `try..except` on Delphi code but no exception is thrown.
Maybe is something related to privileges that php process doesn't have to access the serial port?
Thanks in advance for any clue! | 0 |
11,350,254 | 07/05/2012 18:22:16 | 1,276,152 | 03/17/2012 19:36:18 | 25 | 0 | Facebook FQL PHP Insights | I am struggling trying to find a tutorial or something just to get me started.
I want to grab some stats from a Facebook fan page but all the documentation I have came across seems outdated.
Any help would be greatly appreciated. | php | facebook | api | fql | null | 07/27/2012 00:48:51 | not a real question | Facebook FQL PHP Insights
===
I am struggling trying to find a tutorial or something just to get me started.
I want to grab some stats from a Facebook fan page but all the documentation I have came across seems outdated.
Any help would be greatly appreciated. | 1 |
11,350,255 | 07/05/2012 18:22:17 | 1,253,293 | 03/06/2012 21:22:28 | 15 | 0 | conditional include of sources in kbuild | Say there is a source file a.c with some function func_a. I would like to call func_a based on some feature define and would also like a.c to be included in the module based on ideally same feature define.
so in my module source that is always present (say main.c) I could have something like
#ifdef FEATURE_A
func_a();
#endif
and in the kbuild for the module something like
obj-$(CONFIG_SAMPLE) += sample.o
sample-objs := main.o utils.o
#only if FEATURE_A is defined, include a.c into the sample module
???
But this may not make sense since one is a pre-processor directive and the other a compiler/linker/build directive. Maybe the other way where the pre-processor directive uses some flag defined by the kbuild makes more sense? Is there some way to accomplish this?
Thanks. | linux-kernel | null | null | null | null | null | open | conditional include of sources in kbuild
===
Say there is a source file a.c with some function func_a. I would like to call func_a based on some feature define and would also like a.c to be included in the module based on ideally same feature define.
so in my module source that is always present (say main.c) I could have something like
#ifdef FEATURE_A
func_a();
#endif
and in the kbuild for the module something like
obj-$(CONFIG_SAMPLE) += sample.o
sample-objs := main.o utils.o
#only if FEATURE_A is defined, include a.c into the sample module
???
But this may not make sense since one is a pre-processor directive and the other a compiler/linker/build directive. Maybe the other way where the pre-processor directive uses some flag defined by the kbuild makes more sense? Is there some way to accomplish this?
Thanks. | 0 |
11,350,256 | 07/05/2012 18:22:19 | 430,979 | 08/25/2010 17:03:29 | 93 | 1 | Search between dates (date as VARCHAR) | I have several dates stored as varchar in the following format: 01-01-2012
I want to search between dates, but sadly it isn't working as I expected. I looked for other threads which have the same question (kinda), but the answers provided there didn't work for me.
Here is my code:
$fromday = $_POST['fromday'];
$frommonth = $_POST['frommonth'];
$fromyear = $_POST['fromyear'];
$tillday = $_POST['tillday'];
$tillmonth = $_POST['tillmonth'];
$tillyear = $_POST['tillyear'];
$vanaf = "$fromday-$frommonth-$fromyear";
$tot = "$tillday-$tillmonth-$tillyear";
// zoeken
$sel = "SELECT * FROM bestelling WHERE verzenddatum >= '$vanaf' AND verzenddatum <= '$tot'";
$dosel = mysql_query($sel) or die(mysql_error());
while($row = mysql_fetch_assoc($dosel))
{
$datum = $row['verzenddatum'];
echo $datum;
}
Please let me know what I'm doing wrong! | php | mysql | date | between | null | null | open | Search between dates (date as VARCHAR)
===
I have several dates stored as varchar in the following format: 01-01-2012
I want to search between dates, but sadly it isn't working as I expected. I looked for other threads which have the same question (kinda), but the answers provided there didn't work for me.
Here is my code:
$fromday = $_POST['fromday'];
$frommonth = $_POST['frommonth'];
$fromyear = $_POST['fromyear'];
$tillday = $_POST['tillday'];
$tillmonth = $_POST['tillmonth'];
$tillyear = $_POST['tillyear'];
$vanaf = "$fromday-$frommonth-$fromyear";
$tot = "$tillday-$tillmonth-$tillyear";
// zoeken
$sel = "SELECT * FROM bestelling WHERE verzenddatum >= '$vanaf' AND verzenddatum <= '$tot'";
$dosel = mysql_query($sel) or die(mysql_error());
while($row = mysql_fetch_assoc($dosel))
{
$datum = $row['verzenddatum'];
echo $datum;
}
Please let me know what I'm doing wrong! | 0 |
11,350,262 | 07/05/2012 18:22:32 | 182,804 | 10/01/2009 22:59:05 | 37 | 1 | How to get the Desktop path in Ruby | Is there a cross platform way to get the Dekstop path in Ruby ? | ruby | null | null | null | null | null | open | How to get the Desktop path in Ruby
===
Is there a cross platform way to get the Dekstop path in Ruby ? | 0 |
11,387,318 | 07/08/2012 22:44:08 | 1,494,428 | 07/01/2012 15:35:40 | 13 | 0 | QT HTML Parser (+XQuery) | I'm looking for a QT HTML parser tool.
I have some html source code and I'd like to use XQuery on it.
I already tried using QWebPage + QWebElement, but I don't like this solution cause firstly it doesn't works on non-gui thread (because of QWebPage) and because we can't apply XPath but CSS Path.
The other solution I tried is QXmlQuery, it works great, but the only problem is that it doesn't works if there is an error on the page. For example, the first page I tried was missing systemId (in the DOCTYPE tag), so the parsing was aborted.
I heard we can use gecko for parsing but I have no idea how to use it with QT.
Have you some suggestions ?
Thanks | html | qt | parsing | xpath | xquery | null | open | QT HTML Parser (+XQuery)
===
I'm looking for a QT HTML parser tool.
I have some html source code and I'd like to use XQuery on it.
I already tried using QWebPage + QWebElement, but I don't like this solution cause firstly it doesn't works on non-gui thread (because of QWebPage) and because we can't apply XPath but CSS Path.
The other solution I tried is QXmlQuery, it works great, but the only problem is that it doesn't works if there is an error on the page. For example, the first page I tried was missing systemId (in the DOCTYPE tag), so the parsing was aborted.
I heard we can use gecko for parsing but I have no idea how to use it with QT.
Have you some suggestions ?
Thanks | 0 |
11,387,320 | 07/08/2012 22:44:32 | 1,417,267 | 05/25/2012 11:28:30 | 84 | 11 | NotificationManager.cancel() doesn't work for me | I've been trying for hours to remove a persistent notification set by a service using `startForeground(notification)`
the code I'm using to cancel it:
NotificationManager nManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nManager.cancel(System_Notifications.NOTIFICATION_ID); // cancel existing service notification, doesn't take effect
nManager.cancelAll(); //surpluous, but also doesn't take effect
`System_Notifications.NOTIFICATION_ID` is a int in a different class
public static final int NOTIFICATION_ID = 69;
what am I missing here? I'm baffled | android | android-service | notificationmanager | null | null | null | open | NotificationManager.cancel() doesn't work for me
===
I've been trying for hours to remove a persistent notification set by a service using `startForeground(notification)`
the code I'm using to cancel it:
NotificationManager nManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nManager.cancel(System_Notifications.NOTIFICATION_ID); // cancel existing service notification, doesn't take effect
nManager.cancelAll(); //surpluous, but also doesn't take effect
`System_Notifications.NOTIFICATION_ID` is a int in a different class
public static final int NOTIFICATION_ID = 69;
what am I missing here? I'm baffled | 0 |
11,387,424 | 07/08/2012 23:01:49 | 1,510,671 | 07/08/2012 22:54:28 | 1 | 0 | invalid literal for int() with base 10: 'on' Python-Django | i am learning django from official django tutorial. and i am getting this error when vote something from form. this caused from - probably - vote function under views.py
here is my views.py / vote function :
def vote(request,poll_id):
p=get_object_or_404(Poll, pk=poll_id)
try:
selected_choice = p.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist):
return render_to_response('polls/detail.html', {'poll':p,
'error_message' : "didint select anything ",}, context_instance= RequestContext(request))
else:
selected_choice.votes += 1
selected_choice.save()
return HttpResponseRedirect(reverse('polls.views.results', args=(p.id,)))
| python | django-views | null | null | null | null | open | invalid literal for int() with base 10: 'on' Python-Django
===
i am learning django from official django tutorial. and i am getting this error when vote something from form. this caused from - probably - vote function under views.py
here is my views.py / vote function :
def vote(request,poll_id):
p=get_object_or_404(Poll, pk=poll_id)
try:
selected_choice = p.choice_set.get(pk=request.POST['choice'])
except (KeyError, Choice.DoesNotExist):
return render_to_response('polls/detail.html', {'poll':p,
'error_message' : "didint select anything ",}, context_instance= RequestContext(request))
else:
selected_choice.votes += 1
selected_choice.save()
return HttpResponseRedirect(reverse('polls.views.results', args=(p.id,)))
| 0 |
11,387,429 | 07/08/2012 23:02:50 | 1,367,468 | 05/01/2012 09:14:45 | 3 | 0 | XCode - move target to a different project | I have created an Xcode project and that contains an app and a framework. I would like to move the framework out to a different project. Is there an easy way to do this? | xcode | frameworks | null | null | null | null | open | XCode - move target to a different project
===
I have created an Xcode project and that contains an app and a framework. I would like to move the framework out to a different project. Is there an easy way to do this? | 0 |
11,387,430 | 07/08/2012 23:02:53 | 1,469,292 | 06/20/2012 12:47:03 | 1 | 0 | Meaning of Payload-LINQ | I am new for LINQ, the above code is executing fine for me.
But I couldn't figure out why in the last sentence c.payload.Quantity is written instead of c.Quantity.
When I googled I came to know that the value Quantity is obtained from the payload that we get from the results in c, does that mean that the payload is the final output of filterQuery?
var orderData = new[]
{
new {OrderDate = new DateTime(2011,1,1,8,30,00), ItemID = "100", UnitPrice = 0.99, Quantity =5},
new {OrderDate = new DateTime(2011,1,1,8,31,00), ItemID = "200", UnitPrice = 3.99, Quantity =2},
new {OrderDate = new DateTime(2011,1,1,9,02,00), ItemID = "200", UnitPrice = 1.50, Quantity =1},
new {OrderDate = new DateTime(2011,1,1,9,07,00), ItemID = "100", UnitPrice = 4.10, Quantity =3}
};
var orders = orderData.ToPointStream(Application,ev=>PointEvent.CreateInsert(ev.OrderDate,ev),AdvanceTimeSettings.StrictlyIncreasingStartTime);
var filterQuery = from o in orders where o.Quantity>=2 select o;
(from o in filterQuery.ToIntervalEnumerable() where o.EventKind == EventKind.Insert
select new {o.StartTime,o.EndTime,o.Payload.Quantity}).Dump("Heading"); | linq | null | null | null | null | null | open | Meaning of Payload-LINQ
===
I am new for LINQ, the above code is executing fine for me.
But I couldn't figure out why in the last sentence c.payload.Quantity is written instead of c.Quantity.
When I googled I came to know that the value Quantity is obtained from the payload that we get from the results in c, does that mean that the payload is the final output of filterQuery?
var orderData = new[]
{
new {OrderDate = new DateTime(2011,1,1,8,30,00), ItemID = "100", UnitPrice = 0.99, Quantity =5},
new {OrderDate = new DateTime(2011,1,1,8,31,00), ItemID = "200", UnitPrice = 3.99, Quantity =2},
new {OrderDate = new DateTime(2011,1,1,9,02,00), ItemID = "200", UnitPrice = 1.50, Quantity =1},
new {OrderDate = new DateTime(2011,1,1,9,07,00), ItemID = "100", UnitPrice = 4.10, Quantity =3}
};
var orders = orderData.ToPointStream(Application,ev=>PointEvent.CreateInsert(ev.OrderDate,ev),AdvanceTimeSettings.StrictlyIncreasingStartTime);
var filterQuery = from o in orders where o.Quantity>=2 select o;
(from o in filterQuery.ToIntervalEnumerable() where o.EventKind == EventKind.Insert
select new {o.StartTime,o.EndTime,o.Payload.Quantity}).Dump("Heading"); | 0 |
11,387,433 | 07/08/2012 23:03:24 | 1,510,578 | 07/08/2012 21:12:00 | 4 | 0 | PHP: header() and include/include_once/require/require_once | I am calling header('Location: http://foo.com/foo/'); in a file after calling include() with files which contain function calls (no output). Whenever I call include() I the PHP header() redirect does not work. This only happens on the server. This happens no matter which PHP file I include. (Local files are uploaded to the server during development.)
Thank you for your help,
John Goche | php | redirect | include | require | null | null | open | PHP: header() and include/include_once/require/require_once
===
I am calling header('Location: http://foo.com/foo/'); in a file after calling include() with files which contain function calls (no output). Whenever I call include() I the PHP header() redirect does not work. This only happens on the server. This happens no matter which PHP file I include. (Local files are uploaded to the server during development.)
Thank you for your help,
John Goche | 0 |
11,387,439 | 07/08/2012 23:04:55 | 1,195,909 | 02/07/2012 22:45:53 | 58 | 2 | Attribute error: Rich comparison configuration | I have a class `Point` with `x`and `y` attributes. I'd like to get `False` comparing a `Point` object with any other type of object. For instance, `Point(0, 1) == None` fails:
AttributeError: 'NoneType' object has no attribute 'x'
The class:
class Point():
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, other):
return self.x == other.x and self.y == other.y
def __ne__(self, other):
return not self.__eq__(other)
How do I configure `__eq__`to get `False` in comparison with any other object type? | python | null | null | null | null | null | open | Attribute error: Rich comparison configuration
===
I have a class `Point` with `x`and `y` attributes. I'd like to get `False` comparing a `Point` object with any other type of object. For instance, `Point(0, 1) == None` fails:
AttributeError: 'NoneType' object has no attribute 'x'
The class:
class Point():
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, other):
return self.x == other.x and self.y == other.y
def __ne__(self, other):
return not self.__eq__(other)
How do I configure `__eq__`to get `False` in comparison with any other object type? | 0 |
11,387,443 | 07/08/2012 23:05:47 | 1,342,117 | 04/18/2012 17:39:34 | 11 | 0 | Game Center: how to get user's score? | I have made a game which is supported by game center, it logs on the user and submits his score correctly, but I now need the game getting the score from game center, to let the user retrieve his score if he had to restore his device or to continue a match in a different device.
Sorry if the question is not correctly posted, could someone help please?
Thanks a lot! | ios | xcode4 | game-center | gamekit | null | null | open | Game Center: how to get user's score?
===
I have made a game which is supported by game center, it logs on the user and submits his score correctly, but I now need the game getting the score from game center, to let the user retrieve his score if he had to restore his device or to continue a match in a different device.
Sorry if the question is not correctly posted, could someone help please?
Thanks a lot! | 0 |
11,594,412 | 07/21/2012 17:35:20 | 177,274 | 09/22/2009 16:26:43 | 210 | 16 | ASP.NET Override a webmethod | I have several WebMethods in a C# ASP.NET web app. I'd like to change the behavior of all of them to validate each request. Imagine the code below:
[WebMethod]
public static void DoSomething()
{
if (ValidateRequest())
{
HttpContext.Response.StatusCode = 400;
// do some other stuff
return;
}
// rest of method
}
I've noticed of course that the ValidateRequest() method call is common to a large portion of my WebMethods. Is there anyway I can wire this up so that all WebMethods automatically have this same behavior? Could I add a second attribute to the method to accomplish this?
| c# | asp.net | webmethod | null | null | null | open | ASP.NET Override a webmethod
===
I have several WebMethods in a C# ASP.NET web app. I'd like to change the behavior of all of them to validate each request. Imagine the code below:
[WebMethod]
public static void DoSomething()
{
if (ValidateRequest())
{
HttpContext.Response.StatusCode = 400;
// do some other stuff
return;
}
// rest of method
}
I've noticed of course that the ValidateRequest() method call is common to a large portion of my WebMethods. Is there anyway I can wire this up so that all WebMethods automatically have this same behavior? Could I add a second attribute to the method to accomplish this?
| 0 |
11,594,417 | 07/21/2012 17:35:46 | 784,044 | 06/04/2011 15:19:03 | 20 | 1 | How do I add views to a tab bar application in xCode 4.3.3? | I found a great tutorial on how to do this in xCode 4.0. However, it required use of "MainWindow.xib" which for some reason isn't there in xCode 4.3.3. Storyboard is turned off by the way. | xcode4.3 | uitabbaritem | null | null | null | null | open | How do I add views to a tab bar application in xCode 4.3.3?
===
I found a great tutorial on how to do this in xCode 4.0. However, it required use of "MainWindow.xib" which for some reason isn't there in xCode 4.3.3. Storyboard is turned off by the way. | 0 |
11,594,418 | 07/21/2012 17:36:06 | 75,103 | 03/07/2009 20:08:52 | 1,030 | 41 | How does package location work in Dojo? | I'm working through the example at http://dojotoolkit.org/documentation/tutorials/1.7/hello_dojo/demo/module.html and I've created a directory structure as follows
w:/djt2/index.html
w:/djt2/js/mymodule.js (exact copy of http://dojotoolkit.org/documentation/tutorials/1.7/hello_dojo/demo/myModule.js)
I then set the Tinyweb web-server to serve localhost from w:/djt2
I've changed `index.html` a tiny bit, to adjust for putting `mymodule.js` inside the `js` subdirectory (I've removed comments too below):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial: Hello Dojo!</title>
<script>
var dojoConfig = {
async: true,
packages: [{
name: "djt2",
location: '/js' /* Location #1 */
}]
};
</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"></script>
</head>
<body>
<h1 id="greeting">Hello</h1>
<script>
require(["djt2/mymodule"], function(myModule){ /* Location #2 */
myModule.setText("greeting", "Hello Dojo!");
setTimeout(function(){
myModule.restoreText("greeting");
}, 3000);
});
</script>
</body>
</html>
This works, but I'm not entirely sure I understand why... In particular, at Location #1, the original had `location.pathname.replace(/\/[^/]+$/, '')` which evaluates to the empty string and makes the loader look for mymodule.js at the CDN location (I also tried to set location to `"/"`, but that made it search at `http://mymodule.js/`).
At Location #2 it is a little mystical that the prefix should be `djt2/`...
If someone could explain it, or direct me to the documentation (I'm a bit overwhelmed with learning a new framework :-). | javascript | dojo | null | null | null | null | open | How does package location work in Dojo?
===
I'm working through the example at http://dojotoolkit.org/documentation/tutorials/1.7/hello_dojo/demo/module.html and I've created a directory structure as follows
w:/djt2/index.html
w:/djt2/js/mymodule.js (exact copy of http://dojotoolkit.org/documentation/tutorials/1.7/hello_dojo/demo/myModule.js)
I then set the Tinyweb web-server to serve localhost from w:/djt2
I've changed `index.html` a tiny bit, to adjust for putting `mymodule.js` inside the `js` subdirectory (I've removed comments too below):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tutorial: Hello Dojo!</title>
<script>
var dojoConfig = {
async: true,
packages: [{
name: "djt2",
location: '/js' /* Location #1 */
}]
};
</script>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"></script>
</head>
<body>
<h1 id="greeting">Hello</h1>
<script>
require(["djt2/mymodule"], function(myModule){ /* Location #2 */
myModule.setText("greeting", "Hello Dojo!");
setTimeout(function(){
myModule.restoreText("greeting");
}, 3000);
});
</script>
</body>
</html>
This works, but I'm not entirely sure I understand why... In particular, at Location #1, the original had `location.pathname.replace(/\/[^/]+$/, '')` which evaluates to the empty string and makes the loader look for mymodule.js at the CDN location (I also tried to set location to `"/"`, but that made it search at `http://mymodule.js/`).
At Location #2 it is a little mystical that the prefix should be `djt2/`...
If someone could explain it, or direct me to the documentation (I'm a bit overwhelmed with learning a new framework :-). | 0 |
11,594,420 | 07/21/2012 17:36:11 | 1,502,224 | 07/04/2012 17:59:12 | 8 | 0 | How do you set up Bundles and Get the data back | I am new to the android sdk and I would like to know how I would save my variables in bundles and then get the data back with the onResume() method. Any help would be great. Thanks =) | java | android | sdk | null | null | null | open | How do you set up Bundles and Get the data back
===
I am new to the android sdk and I would like to know how I would save my variables in bundles and then get the data back with the onResume() method. Any help would be great. Thanks =) | 0 |
11,593,912 | 07/21/2012 16:29:43 | 1,542,916 | 07/21/2012 16:21:07 | 1 | 0 | user input in bubble sort (for c) | I'm trying to write a code to let user write his own numbers and decide whether he wants them to be sorted in ascending or descending order, and order them with bubble sort. This is what I could write so far (aka the obvious entrance);
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,a,number;
printf("Enter your numbers. Write -1 to stop. \n");
do{
scanf("%d", &a);
}while(a!=-1);
printf("Enter 1 if you want them to be in ascending order. Enter 2 if you want descending order\n");
scanf("%d",&a);
if(a=1)
do{
system("PAUSE");
return 0;
}
My problem is, I really don't know how to merge bubble sort to that. In all examples I could find had arrays which've been set before hand. I'm thinking I should start with a for structure but I've no idea... Would be glad if I can get any help. Thanks! | c | sorting | bubble | null | null | null | open | user input in bubble sort (for c)
===
I'm trying to write a code to let user write his own numbers and decide whether he wants them to be sorted in ascending or descending order, and order them with bubble sort. This is what I could write so far (aka the obvious entrance);
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,a,number;
printf("Enter your numbers. Write -1 to stop. \n");
do{
scanf("%d", &a);
}while(a!=-1);
printf("Enter 1 if you want them to be in ascending order. Enter 2 if you want descending order\n");
scanf("%d",&a);
if(a=1)
do{
system("PAUSE");
return 0;
}
My problem is, I really don't know how to merge bubble sort to that. In all examples I could find had arrays which've been set before hand. I'm thinking I should start with a for structure but I've no idea... Would be glad if I can get any help. Thanks! | 0 |
11,593,914 | 07/21/2012 16:29:49 | 709,439 | 04/15/2011 08:18:17 | 453 | 11 | Perl read file error | I have to read a big (BIG) file in memory, line by line, using perl.
In case of some error, function open() does return false and $! is set to the system error.
But, if I get some errors *reading* the file?
I use this code:
open(STATISTICS, "<" . $statisticsFile) or die "Can't open statistics file $statisticsFile ($!)";
while (<STATISTICS>) {
my $line = $_;
...
}
close($STATISTICS);
Any hint? | perl | file-io | null | null | null | null | open | Perl read file error
===
I have to read a big (BIG) file in memory, line by line, using perl.
In case of some error, function open() does return false and $! is set to the system error.
But, if I get some errors *reading* the file?
I use this code:
open(STATISTICS, "<" . $statisticsFile) or die "Can't open statistics file $statisticsFile ($!)";
while (<STATISTICS>) {
my $line = $_;
...
}
close($STATISTICS);
Any hint? | 0 |
11,594,404 | 07/21/2012 17:34:35 | 1,542,999 | 07/21/2012 17:27:31 | 1 | 0 | I have a WCF application works fine in all Windows 7 versions except Home edition. Is there anything more to do with it to invoke the WCF? | I have a WCF works fine in all Windows 7 versions except Home edition. Is there anything more to do with Windows 7 Home editions to invoke the WCF ? | wcf | windows-7 | null | null | null | null | open | I have a WCF application works fine in all Windows 7 versions except Home edition. Is there anything more to do with it to invoke the WCF?
===
I have a WCF works fine in all Windows 7 versions except Home edition. Is there anything more to do with Windows 7 Home editions to invoke the WCF ? | 0 |
11,594,421 | 07/21/2012 17:36:27 | 860,343 | 07/24/2011 15:32:12 | 30 | 8 | Compatibility error in MKStoreKit | I'm getting an error:
Incompatible block pointer types sending 'void (^)(NSString *__strong)' to parameter of type 'void (^)(NSString *__strong, NSData *__strong)'
When I'm implementing MKStoreKit 4.3 in my app on the line of onComplete:
-(IBAction)purchaseFull {
[[MKStoreManager sharedManager] buyFeature:@"com.final.satproctor.removeAds"
onComplete:^(NSString* purchasedFeature)
{
NSLog(@"Purchased: %@", purchasedFeature);
//purchaseBtn.hidden = YES;
}
onCancelled:^
{
NSLog(@"User Cancelled Transaction");
}];
}
| iphone | objective-c | ios | xcode | mkstorekit | null | open | Compatibility error in MKStoreKit
===
I'm getting an error:
Incompatible block pointer types sending 'void (^)(NSString *__strong)' to parameter of type 'void (^)(NSString *__strong, NSData *__strong)'
When I'm implementing MKStoreKit 4.3 in my app on the line of onComplete:
-(IBAction)purchaseFull {
[[MKStoreManager sharedManager] buyFeature:@"com.final.satproctor.removeAds"
onComplete:^(NSString* purchasedFeature)
{
NSLog(@"Purchased: %@", purchasedFeature);
//purchaseBtn.hidden = YES;
}
onCancelled:^
{
NSLog(@"User Cancelled Transaction");
}];
}
| 0 |
11,594,423 | 07/21/2012 17:36:34 | 9,084 | 09/15/2008 17:40:53 | 2,218 | 22 | Can a Powershell hashtable be accessed via .Key rather than ["Key"] somehow? | I'm a lazy programmer, and all this hash["Key"] punctuation is getting on my nerves. Is there a syntactic sugar (perhaps a different object type) that allows you to create hashtables that are accessed using member method syntax (hash.Key)? There are many easy hacks to do this in Ruby. Is there a hack to do this in Powershell? | powershell | syntax | hashtable | null | null | null | open | Can a Powershell hashtable be accessed via .Key rather than ["Key"] somehow?
===
I'm a lazy programmer, and all this hash["Key"] punctuation is getting on my nerves. Is there a syntactic sugar (perhaps a different object type) that allows you to create hashtables that are accessed using member method syntax (hash.Key)? There are many easy hacks to do this in Ruby. Is there a hack to do this in Powershell? | 0 |
11,594,428 | 07/21/2012 17:37:00 | 1,378,581 | 05/06/2012 20:40:41 | 1 | 0 | Using anemone on array of URL's | Is it possible to create an Anemone object, have it spider through once and get an array of URL's, and then just have it loop through the array of urls rather than parsing through the html each time? | ruby | anemone | null | null | null | 07/22/2012 15:05:44 | not a real question | Using anemone on array of URL's
===
Is it possible to create an Anemone object, have it spider through once and get an array of URL's, and then just have it loop through the array of urls rather than parsing through the html each time? | 1 |
11,594,391 | 07/21/2012 17:32:53 | 666,835 | 03/18/2011 23:28:44 | 166 | 13 | Why is there @interface above @implementation? | This is bothering me a lot.
I am wondering why there is twice `@interface`. One in `class.h` and other in `class.m`. For example:
`TestTableViewController.h`:
#import <UIKit/UIKit.h>
@interface TestTableViewController : UITableViewController
@end
and (automatically generated) `class.m` i find:
#import "TestTableViewController.h"
@interface TestTableViewController ()
@end
@implementation TestTableViewController
... methods delegated from UITable delegates
@end
So my question is, what the `@interface TestTableViewController ()` in the `.m` file is about. Why it is there? Do I need it?
Thanks in advance | objective-c | ios | xcode | ios5 | xcode4.4 | null | open | Why is there @interface above @implementation?
===
This is bothering me a lot.
I am wondering why there is twice `@interface`. One in `class.h` and other in `class.m`. For example:
`TestTableViewController.h`:
#import <UIKit/UIKit.h>
@interface TestTableViewController : UITableViewController
@end
and (automatically generated) `class.m` i find:
#import "TestTableViewController.h"
@interface TestTableViewController ()
@end
@implementation TestTableViewController
... methods delegated from UITable delegates
@end
So my question is, what the `@interface TestTableViewController ()` in the `.m` file is about. Why it is there? Do I need it?
Thanks in advance | 0 |
11,567,814 | 07/19/2012 19:19:41 | 1,114,790 | 12/24/2011 18:43:44 | 3 | 1 | Problems with spheech recognition (used CMU Sphinx & own model) | I'm GSoC student, which works on project Simon SPHINX support http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/stvlad/1 . And as a part of my project i need to convert data from internal Simon format to format acceptable to SPHINX and then train own acoustic model from this data.
And now, I had the following problem:
when I try to recognize something, using the created model, vocabulary and jsgf grammar, I'm on almost any query about getting the following response:
"READY ....
Listening ...
Stopped listening, please wait ...
INFO: cmn_prior.c (121): cmn_prior_update: from <12.52 -1.49 -0.64 0.21 -0.56 0.18 -0.19 -0.04 -0.33 -0.07 -0.18 -0.24 -0.12>
INFO: cmn_prior.c (139): cmn_prior_update: to <12.66 -1.44 -0.63 0.20 -0.56 0.16 -0.19 -0.05 -0.31 -0.06 -0.15 -0.23 -0.13>
INFO: fsg_search.c (1032): 69 frames, 543 HMMs (7/fr), 1361 senones (19/fr), 125 history entries (1/fr)
ERROR: "fsg_search.c", line 1104: Final result does not match the grammar in frame 69
000000086: (null)
"
can you tell me please: what am I doing wrong?
example of generated model:
http://db.tt/SCVmSpw1 | speech-recognition | cmusphinx | null | null | null | null | open | Problems with spheech recognition (used CMU Sphinx & own model)
===
I'm GSoC student, which works on project Simon SPHINX support http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/stvlad/1 . And as a part of my project i need to convert data from internal Simon format to format acceptable to SPHINX and then train own acoustic model from this data.
And now, I had the following problem:
when I try to recognize something, using the created model, vocabulary and jsgf grammar, I'm on almost any query about getting the following response:
"READY ....
Listening ...
Stopped listening, please wait ...
INFO: cmn_prior.c (121): cmn_prior_update: from <12.52 -1.49 -0.64 0.21 -0.56 0.18 -0.19 -0.04 -0.33 -0.07 -0.18 -0.24 -0.12>
INFO: cmn_prior.c (139): cmn_prior_update: to <12.66 -1.44 -0.63 0.20 -0.56 0.16 -0.19 -0.05 -0.31 -0.06 -0.15 -0.23 -0.13>
INFO: fsg_search.c (1032): 69 frames, 543 HMMs (7/fr), 1361 senones (19/fr), 125 history entries (1/fr)
ERROR: "fsg_search.c", line 1104: Final result does not match the grammar in frame 69
000000086: (null)
"
can you tell me please: what am I doing wrong?
example of generated model:
http://db.tt/SCVmSpw1 | 0 |
5,924,824 | 05/08/2011 00:07:43 | 743,508 | 05/07/2011 23:52:34 | 1 | 0 | Testing the validation of a text box using Selenium | I am trying to test a webpage using Selenium and NUnit. One of my test cases entails the validation of text boxes. Using Selenium and C#, I am able to retrieve the value entered in the text box. But when the validation of the text box fails, an error message is displayed next to the text box.
So, here are my questions:
1. How can I test if an error was raised due to validation failure.
2. Can I get the text of that error.
3. Or, am I way off the mark and what I am trying to do is not at all possible.
I have tried reading the value of the element, but it always seems to be an empty string.
Say, for example, I am trying to test the webpage https://edit.yahoo.com/registration . When I enter "**myname&&" in the First Name field, an error appears stating "Only letters, spaces, hyphens, and apostrophes are allowed". I want to be able to test that this error was raised.
Thanks!! | web-testing | null | null | null | null | null | open | Testing the validation of a text box using Selenium
===
I am trying to test a webpage using Selenium and NUnit. One of my test cases entails the validation of text boxes. Using Selenium and C#, I am able to retrieve the value entered in the text box. But when the validation of the text box fails, an error message is displayed next to the text box.
So, here are my questions:
1. How can I test if an error was raised due to validation failure.
2. Can I get the text of that error.
3. Or, am I way off the mark and what I am trying to do is not at all possible.
I have tried reading the value of the element, but it always seems to be an empty string.
Say, for example, I am trying to test the webpage https://edit.yahoo.com/registration . When I enter "**myname&&" in the First Name field, an error appears stating "Only letters, spaces, hyphens, and apostrophes are allowed". I want to be able to test that this error was raised.
Thanks!! | 0 |
11,567,815 | 07/19/2012 19:19:42 | 1,538,883 | 07/19/2012 19:08:10 | 1 | 0 | Join mysql tables twice on 2 columns = 1 column | I have a database that contains messages. The messages are stored in one table, the user information is stored in another. In the message table, there is an author_id column which represents the user_id of the author from the user table, there are all the message columns, and there is a to_address which represents a concatenation of "u_" + user_id from the user table. Is there any that I can join these two tables, so that it display the username instead of ID in BOTH the author_id AND to_address.
I've tried
SELECT username, ..., username FROM msgs INNER JOIN users ON user_id=author_id AND concat("u_",user_id)=to_address; with obvious error
I've tried using subqueries such as
SELECT
(
SELECT username FROM users INNER JOIN msgs ON user_id=author_id
) AS "From",
(
SELECT username FROM users INNER JOIN msgs ON CONCAT("u_",user_id)=to_address
) AS "To",
(
SELECT timestamp(message_time) FROM msgs
) AS "Sent",
(
SELECT message_subject FROM msgs
) AS "Subject",
(
SELECT message_text AS "Message" FROM msgs
) AS "Message"
and got "Subquery returns more than 1 row". Is there any way that I can do this successfully? | mysql | null | null | null | null | null | open | Join mysql tables twice on 2 columns = 1 column
===
I have a database that contains messages. The messages are stored in one table, the user information is stored in another. In the message table, there is an author_id column which represents the user_id of the author from the user table, there are all the message columns, and there is a to_address which represents a concatenation of "u_" + user_id from the user table. Is there any that I can join these two tables, so that it display the username instead of ID in BOTH the author_id AND to_address.
I've tried
SELECT username, ..., username FROM msgs INNER JOIN users ON user_id=author_id AND concat("u_",user_id)=to_address; with obvious error
I've tried using subqueries such as
SELECT
(
SELECT username FROM users INNER JOIN msgs ON user_id=author_id
) AS "From",
(
SELECT username FROM users INNER JOIN msgs ON CONCAT("u_",user_id)=to_address
) AS "To",
(
SELECT timestamp(message_time) FROM msgs
) AS "Sent",
(
SELECT message_subject FROM msgs
) AS "Subject",
(
SELECT message_text AS "Message" FROM msgs
) AS "Message"
and got "Subquery returns more than 1 row". Is there any way that I can do this successfully? | 0 |
11,567,550 | 07/19/2012 19:00:58 | 1,152,049 | 01/16/2012 14:35:45 | 1 | 0 | Class diagram for a social network | First of all, sorry for my english!
I have to build a simple social network as a school project and I need to follow all stages of the software engineering process.
My problem is in the class diagram, I made one but I have many doubts.
1) Is correct to have many aggregate association?
2) If I want that groups had a wall, is correct insert just an association with Group and Wall?
Any advice would be helpful on how to improve. Thanks | software-engineering | class-design | class-diagram | null | null | null | open | Class diagram for a social network
===
First of all, sorry for my english!
I have to build a simple social network as a school project and I need to follow all stages of the software engineering process.
My problem is in the class diagram, I made one but I have many doubts.
1) Is correct to have many aggregate association?
2) If I want that groups had a wall, is correct insert just an association with Group and Wall?
Any advice would be helpful on how to improve. Thanks | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.