question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
6,193,126
6,193,212
How to get row count from EXEC() in a TSQL SPROC?
I have a TSQL sproc that builds a query as and executes it as follows: EXEC (@sqlTop + @sqlBody + @sqlBottom) @sqlTop contains something like SELECT TOP(x) col1, col2, col3... TOP(x) will limit the rows returned, so later I want to know what the actual number of rows in the table is that match the query. I then replace...
You could instead have the dynamic query return the result as a row set, which you would then insert into a table variable (could be a temporary or ordinary table as well) using the INSERT... EXEC syntax. Afterwards you can just read the saved value into a variable using SELECT @var =...: DECLARE @rowcount TABLE (Value...
How to get row count from EXEC() in a TSQL SPROC? I have a TSQL sproc that builds a query as and executes it as follows: EXEC (@sqlTop + @sqlBody + @sqlBottom) @sqlTop contains something like SELECT TOP(x) col1, col2, col3... TOP(x) will limit the rows returned, so later I want to know what the actual number of rows in...
TITLE: How to get row count from EXEC() in a TSQL SPROC? QUESTION: I have a TSQL sproc that builds a query as and executes it as follows: EXEC (@sqlTop + @sqlBody + @sqlBottom) @sqlTop contains something like SELECT TOP(x) col1, col2, col3... TOP(x) will limit the rows returned, so later I want to know what the actual...
[ "t-sql", "sql-server-2008", "stored-procedures" ]
28
20
71,143
7
0
2011-05-31T20:23:00.217000
2011-05-31T20:31:27.840000
6,193,128
6,193,244
NHibernate query with criteria on child collection member returns only partial child collection
I have a parent-child relationship between Teacher and StudentReport. Each StudentReport has a timestamp field recording when the teacher finished the report. I have a query to find all teachers who have completed one or more of their reports as of a certain number of minutes ago: public IList FindRecentlyActiveTeacher...
Use Fetch return Session.QueryOver ().Fetch(t => t.StudentReports).Where(r => r.FirstSaveTimestamp >= activityCutoff).TransformUsing(Transformers.DistinctRootEntity).List ();
NHibernate query with criteria on child collection member returns only partial child collection I have a parent-child relationship between Teacher and StudentReport. Each StudentReport has a timestamp field recording when the teacher finished the report. I have a query to find all teachers who have completed one or mor...
TITLE: NHibernate query with criteria on child collection member returns only partial child collection QUESTION: I have a parent-child relationship between Teacher and StudentReport. Each StudentReport has a timestamp field recording when the teacher finished the report. I have a query to find all teachers who have co...
[ "nhibernate" ]
6
2
2,618
1
0
2011-05-31T20:23:20.997000
2011-05-31T20:35:25.473000
6,193,136
6,193,228
Regex Matching Help
two I need to match from to
You can use ( ). In the first backreference/group you get the match from to. You must use the /s flag (or an equivalent for the language you use) with this regex to let the. match newlines. Documentation about /s says: To simplify multi-line substitutions, the "." character never matches a newline unless you use the /s...
Regex Matching Help two I need to match from to
TITLE: Regex Matching Help QUESTION: two I need to match from to ANSWER: You can use ( ). In the first backreference/group you get the match from to. You must use the /s flag (or an equivalent for the language you use) with this regex to let the. match newlines. Documentation about /s says: To simplify multi-line sub...
[ "regex" ]
1
1
79
4
0
2011-05-31T20:24:08.347000
2011-05-31T20:33:45.660000
6,193,137
6,193,257
Dynamic plots in HTML
I have been developing a software package to plot astronomical data in the form of a movie. It looks like this. To do this, I export 100 tables of data from Java to gnuplot and use a bash script to turn them into a GIF. I want instead to do it in HTML and maybe Raphael. I'm thinking that I can use a Python script to it...
You will have to test performance issues, but FLOT might be just the thing for you... here is an example of flot animating: http://people.iola.dk/olau/flot/examples/realtime.html
Dynamic plots in HTML I have been developing a software package to plot astronomical data in the form of a movie. It looks like this. To do this, I export 100 tables of data from Java to gnuplot and use a bash script to turn them into a GIF. I want instead to do it in HTML and maybe Raphael. I'm thinking that I can use...
TITLE: Dynamic plots in HTML QUESTION: I have been developing a software package to plot astronomical data in the form of a movie. It looks like this. To do this, I export 100 tables of data from Java to gnuplot and use a bash script to turn them into a GIF. I want instead to do it in HTML and maybe Raphael. I'm think...
[ "html", "plot", "movie" ]
1
2
5,832
3
0
2011-05-31T20:24:10.153000
2011-05-31T20:37:03.320000
6,193,143
6,195,777
Game center and leaderboards
I am looking to implement game center leader boards in my app but have a question: Since the app has been sold in several countries, I wanted to allow the user to see an "overall" leader board which would show all users from anywhere, and then a "country" leader board which would show just those scores for that that co...
Thats a very interesting question.. Unless you can detect where the person is from, you basically can only send it to a overall world leaderboard.. as you can control what countries you wan to release your game to, i believe you can create the leaderboards according to the countries.. But by regions would be a a better...
Game center and leaderboards I am looking to implement game center leader boards in my app but have a question: Since the app has been sold in several countries, I wanted to allow the user to see an "overall" leader board which would show all users from anywhere, and then a "country" leader board which would show just ...
TITLE: Game center and leaderboards QUESTION: I am looking to implement game center leader boards in my app but have a question: Since the app has been sold in several countries, I wanted to allow the user to see an "overall" leader board which would show all users from anywhere, and then a "country" leader board whic...
[ "iphone", "objective-c", "xcode", "ipad", "game-center" ]
0
0
547
1
0
2011-05-31T20:24:40.997000
2011-06-01T02:54:50.117000
6,193,150
6,193,167
C# override a method and optionally throw an exception, is a return value required?
I have a method in C# 4.0 that is like this: protected override bool _update() { if (this.Notes == "") throw new Exception("Some message..."); else base._update(); } The compiler complains that not all code paths return a value, however, if I were to do this: protected override bool _update() { throw new Exception("Som...
Give this a shot:) protected override bool _update() { if (this.Notes == "") throw new Exception("Some message..."); else return base._update(); } You just need to return the output of base._update(), it's not enough to just run it because the value wouldn't get returned.
C# override a method and optionally throw an exception, is a return value required? I have a method in C# 4.0 that is like this: protected override bool _update() { if (this.Notes == "") throw new Exception("Some message..."); else base._update(); } The compiler complains that not all code paths return a value, however...
TITLE: C# override a method and optionally throw an exception, is a return value required? QUESTION: I have a method in C# 4.0 that is like this: protected override bool _update() { if (this.Notes == "") throw new Exception("Some message..."); else base._update(); } The compiler complains that not all code paths retur...
[ "c#-4.0" ]
0
4
1,157
4
0
2011-05-31T20:25:18.873000
2011-05-31T20:27:23.223000
6,193,153
6,195,804
Possible to use wide-character members in Python extension objects?
It's simple to create a member for an object in a Python C extension with a base type of char *, using the T_STRING define in the PyMemberDef declaration. Why does there not seem to be an equivalent for wchar_t *? And if there actually is one, what is it? e.g. struct object contains char *text PyMemberDef array has {"t...
Using a wchar_t directly is not portable. Instead, Python defines the Py_UNICODE type as the storage unit for a Unicode character. Depending on the platform, Py_UNICODE may be defined as wchar_t if available, or an unsigned short/integer/long, the width of which will vary depending on how Python is configured (UCS2 vs ...
Possible to use wide-character members in Python extension objects? It's simple to create a member for an object in a Python C extension with a base type of char *, using the T_STRING define in the PyMemberDef declaration. Why does there not seem to be an equivalent for wchar_t *? And if there actually is one, what is ...
TITLE: Possible to use wide-character members in Python extension objects? QUESTION: It's simple to create a member for an object in a Python C extension with a base type of char *, using the T_STRING define in the PyMemberDef declaration. Why does there not seem to be an equivalent for wchar_t *? And if there actuall...
[ "python", "c", "unicode", "python-extensions" ]
2
2
1,658
1
0
2011-05-31T20:25:30.793000
2011-06-01T03:01:51.613000
6,193,177
6,193,592
Does my JDBC connection to the database use SSL or not?
How can one know if the JDBC connection to an SQL server is secure (i.e. uses SSL) or not? Is it obvious for example from the URL. Do all JDBC drivers support SSL connections to the database server, or does the use of SSL just depends on the specific database vendor?
Do all jdbc drivers support ssl connection to db server and the use of ssl just depends on a specific db vendor? Support for SSL/TLS is not mandated in the JDBC specification. So you cannot expect it in every driver. SSL configuration on the database server could be inferred from the JDBC URL, but this need not be dete...
Does my JDBC connection to the database use SSL or not? How can one know if the JDBC connection to an SQL server is secure (i.e. uses SSL) or not? Is it obvious for example from the URL. Do all JDBC drivers support SSL connections to the database server, or does the use of SSL just depends on the specific database vend...
TITLE: Does my JDBC connection to the database use SSL or not? QUESTION: How can one know if the JDBC connection to an SQL server is secure (i.e. uses SSL) or not? Is it obvious for example from the URL. Do all JDBC drivers support SSL connections to the database server, or does the use of SSL just depends on the spec...
[ "java", "sql-server-2005", "security", "encryption", "ssl" ]
47
27
89,016
2
0
2011-05-31T20:28:04.580000
2011-05-31T21:09:36.340000
6,193,201
6,193,262
Calculate and Display Average
I have scores being submitted by three users and would like to display the average score to the nearest tenth's place. Currently, I am using the query: SELECT AVG(score) as AverageScore FROM PoemScores WHERE poemID = #qGetPoems.poemid# I am able to output AverageScore, but only as a whole number using #getScore.Average...
Depending on your database engine, you probably just need to cast the score as a decimal or a float before averaging it. possible mysql approach: select CAST( AVG( CAST(score as decimal(8,1)) ) as decimal(8,1) ) as AverageScore possible mssql approach: select convert(float(8,1), AVG( convert(float(8,1), score) ) ) as A...
Calculate and Display Average I have scores being submitted by three users and would like to display the average score to the nearest tenth's place. Currently, I am using the query: SELECT AVG(score) as AverageScore FROM PoemScores WHERE poemID = #qGetPoems.poemid# I am able to output AverageScore, but only as a whole ...
TITLE: Calculate and Display Average QUESTION: I have scores being submitted by three users and would like to display the average score to the nearest tenth's place. Currently, I am using the query: SELECT AVG(score) as AverageScore FROM PoemScores WHERE poemID = #qGetPoems.poemid# I am able to output AverageScore, bu...
[ "sql", "sql-server", "sql-server-2008" ]
0
1
1,186
1
0
2011-05-31T20:30:45.190000
2011-05-31T20:37:31.190000
6,193,211
6,193,263
ActionScript AddChild to Stage from Class
I am trying to add an object to my main stage via the addChild() method. Normally, when working within the FLA itself, using addChild(myObject) works just fine. However, it does not work within an external AS class. All of the other tutorials I have found showed me how to do something like this, which is not what I nee...
If this is your document class or a class that has a valid stage reference, you could use: stage.addChild(myObject); EDIT - Added example. Here is an example class that extends EventDispatcher and passes a parameter of the 'stage'. First, the class: package { import flash.display.MovieClip; import flash.display.Stage;...
ActionScript AddChild to Stage from Class I am trying to add an object to my main stage via the addChild() method. Normally, when working within the FLA itself, using addChild(myObject) works just fine. However, it does not work within an external AS class. All of the other tutorials I have found showed me how to do so...
TITLE: ActionScript AddChild to Stage from Class QUESTION: I am trying to add an object to my main stage via the addChild() method. Normally, when working within the FLA itself, using addChild(myObject) works just fine. However, it does not work within an external AS class. All of the other tutorials I have found show...
[ "php", "actionscript-3", "oop", "class", "addchild" ]
1
2
2,417
3
0
2011-05-31T20:31:24.100000
2011-05-31T20:37:32.430000
6,193,220
6,193,383
Is there a way to run an ASP.NET 1.1 web application completely self-contained (without IIS or SQL Server)?
I have an ASP.NET application that we are currently hosting for an external client which is built with.net 1.1 running on IIS and SQL Server 2000. However, I don't want to host this application any longer and want to give it to the client so they can run it on their local machine. Is there a way that they can run this ...
Why not install IIS on the client's local machine? If its OS is some kind of Windows Server, it has IIS installed anyway. Even if it's a normal client machine - Win XP Professional comes with IIS out of the box. Concerning SQL Server: If your app doesn't use any special SQL Server features, you can try to use MSDE (the...
Is there a way to run an ASP.NET 1.1 web application completely self-contained (without IIS or SQL Server)? I have an ASP.NET application that we are currently hosting for an external client which is built with.net 1.1 running on IIS and SQL Server 2000. However, I don't want to host this application any longer and wan...
TITLE: Is there a way to run an ASP.NET 1.1 web application completely self-contained (without IIS or SQL Server)? QUESTION: I have an ASP.NET application that we are currently hosting for an external client which is built with.net 1.1 running on IIS and SQL Server 2000. However, I don't want to host this application ...
[ ".net", "iis", ".net-1.1" ]
2
2
319
3
0
2011-05-31T20:32:53.117000
2011-05-31T20:49:10.907000
6,193,231
6,193,766
NHibernate ISessionFactory.OpenSession() does not open a database connection
I have NHibernate configured with Fluent NNibernate connecting to a PostgreSQL database. I have a worker class that takes an ISessionFactory as a constructor parameter and consumes messages from a queue. For each message the worker process calls ISessionFactory.OpenSession() and it does some database processing. When I...
OpenSession does not open a database connection until needed, and it closes it (i.e. releases it back into the pool) as soon as possible.
NHibernate ISessionFactory.OpenSession() does not open a database connection I have NHibernate configured with Fluent NNibernate connecting to a PostgreSQL database. I have a worker class that takes an ISessionFactory as a constructor parameter and consumes messages from a queue. For each message the worker process cal...
TITLE: NHibernate ISessionFactory.OpenSession() does not open a database connection QUESTION: I have NHibernate configured with Fluent NNibernate connecting to a PostgreSQL database. I have a worker class that takes an ISessionFactory as a constructor parameter and consumes messages from a queue. For each message the ...
[ "nhibernate", "postgresql", "npgsql" ]
2
3
1,708
2
0
2011-05-31T20:34:13.430000
2011-05-31T21:27:01.147000
6,193,233
6,297,063
Fetching MySQL into a listview
So I have successfully managed to create a connection via a MySQL database using this tutorial. The app connects to a MySQL database via a php file on a web server. I want the results from the MySQL database to show up as a list view. Currently it shows up like this: https://i.stack.imgur.com/6Bk0i.jpg Thanks in advanc...
I did the same tutorial, now working on this one to get a list view from MySQL results.
Fetching MySQL into a listview So I have successfully managed to create a connection via a MySQL database using this tutorial. The app connects to a MySQL database via a php file on a web server. I want the results from the MySQL database to show up as a list view. Currently it shows up like this: https://i.stack.imgur...
TITLE: Fetching MySQL into a listview QUESTION: So I have successfully managed to create a connection via a MySQL database using this tutorial. The app connects to a MySQL database via a php file on a web server. I want the results from the MySQL database to show up as a list view. Currently it shows up like this: htt...
[ "android", "mysql", "listview" ]
2
0
2,613
2
0
2011-05-31T20:34:28.683000
2011-06-09T17:46:47.783000
6,193,239
6,193,666
merge two domain objects and reassign children to one of them in Grails
I have two entries in a domain entity that I want to merge. Let's call the parent House and the children Room. I have a situation where I want to merge two House domains that are actually the same. I have the logic to do this top level merge. However, I want to know if there is a way in Grails to easily say, 'go throug...
Grails domain objects expose the hibernate merge() method, but this does something completely different: it merges a (possibly detached) object back into the persistence context. I'm not aware of any built in functionality to merge two objects like you describe. I think you need to manually update the foreign keys as i...
merge two domain objects and reassign children to one of them in Grails I have two entries in a domain entity that I want to merge. Let's call the parent House and the children Room. I have a situation where I want to merge two House domains that are actually the same. I have the logic to do this top level merge. Howev...
TITLE: merge two domain objects and reassign children to one of them in Grails QUESTION: I have two entries in a domain entity that I want to merge. Let's call the parent House and the children Room. I have a situation where I want to merge two House domains that are actually the same. I have the logic to do this top ...
[ "grails", "groovy", "merge", "grails-orm" ]
0
2
2,355
2
0
2011-05-31T20:35:15.720000
2011-05-31T21:17:23.157000
6,193,240
6,193,325
Apache Ant is there any way to get a build to ignore errors
I have a strange situation where I can build a project with ant without any errors on my development machine but when I push the exact same source to the production server I can't get it to build on that side. I get 'cannot find symbol' errors related to specific syntax. I set up a git repo on the production server the...
If the same source is unable to compile on two different machines, that points to a difference in the environment settings between the two machines: either there are different libraries being compiled against on the two machines (which one would hope is not the case if you are using a tool like Ant, you should be speci...
Apache Ant is there any way to get a build to ignore errors I have a strange situation where I can build a project with ant without any errors on my development machine but when I push the exact same source to the production server I can't get it to build on that side. I get 'cannot find symbol' errors related to speci...
TITLE: Apache Ant is there any way to get a build to ignore errors QUESTION: I have a strange situation where I can build a project with ant without any errors on my development machine but when I push the exact same source to the production server I can't get it to build on that side. I get 'cannot find symbol' error...
[ "java", "git", "ant", "jakarta-ee" ]
1
1
5,341
3
0
2011-05-31T20:35:16.207000
2011-05-31T20:43:53.490000
6,193,243
6,193,393
asp.net calendar control previous date selection problem?
friends, i am using asp.net calendar control on page. dynamically i am assigning it previous month date value. it selects that date which is fine but not month so the calendar shows current month when i use previous button then that date is selected. any one guide me what is the solution? my code calstarting.SelectedDa...
You should use Calendar1.TodaysDate= item.StartDate; Calendar1.SelectedDate = item.StartDate; Instead of SelectedDate use TodaysDate and then use SelectedDate to show that date selected.
asp.net calendar control previous date selection problem? friends, i am using asp.net calendar control on page. dynamically i am assigning it previous month date value. it selects that date which is fine but not month so the calendar shows current month when i use previous button then that date is selected. any one gui...
TITLE: asp.net calendar control previous date selection problem? QUESTION: friends, i am using asp.net calendar control on page. dynamically i am assigning it previous month date value. it selects that date which is fine but not month so the calendar shows current month when i use previous button then that date is sel...
[ "c#", "asp.net", "calendar" ]
1
0
2,668
2
0
2011-05-31T20:35:24.050000
2011-05-31T20:49:59.590000
6,193,247
6,193,849
Visual C++ 2008, errors while #include "afxdb.h"
I've got trouble using adxdb.h: I tried to #include "afxdb.h" But I recieved this error: C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afx.h(24): fatal error C1189: #error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d...
Don't directly add the #define _AFXDLL, instead that gets added indirectly by a project configuration setting: go to your project property pages | Configuration Properties | General | Use of MFC, and make sure that is set to Use MFC in a Shared DLL.
Visual C++ 2008, errors while #include "afxdb.h" I've got trouble using adxdb.h: I tried to #include "afxdb.h" But I recieved this error: C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afx.h(24): fatal error C1189: #error: Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll ve...
TITLE: Visual C++ 2008, errors while #include "afxdb.h" QUESTION: I've got trouble using adxdb.h: I tried to #include "afxdb.h" But I recieved this error: C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\afx.h(24): fatal error C1189: #error: Building MFC application with /MD[d] (CRT dll version) requires...
[ "visual-studio-2008", "afx" ]
3
5
10,235
3
0
2011-05-31T20:35:30.217000
2011-05-31T21:35:41.423000
6,193,254
6,198,414
Regex match url without file extension
I would like some help matching the following urls. /settings => /settings.php /657_46hallo => /657_46hallo.php /users/create => /users.php/create /contact/create/user => /contact.php/create/user /view/info.php => /view.php/info.php /view/readme - now.txt => /view.php/readme - now.txt / => [NO MATCH] /filename.php => /...
If you want to match those.php cases you can try this: ^\/([a-zA-Z0-9_]+)(\/)?(.*)?$ See here on Regexr If you want to avoid those cases try this: ^/([a-zA-Z0-9_]+)(?!\.php)(?:(/)(.*)|)$ See here on Regexr The (?!\.php) is a negative look ahead that ensures that there is no.php at this place.
Regex match url without file extension I would like some help matching the following urls. /settings => /settings.php /657_46hallo => /657_46hallo.php /users/create => /users.php/create /contact/create/user => /contact.php/create/user /view/info.php => /view.php/info.php /view/readme - now.txt => /view.php/readme - now...
TITLE: Regex match url without file extension QUESTION: I would like some help matching the following urls. /settings => /settings.php /657_46hallo => /657_46hallo.php /users/create => /users.php/create /contact/create/user => /contact.php/create/user /view/info.php => /view.php/info.php /view/readme - now.txt => /vie...
[ "regex", "replace", "preg-match" ]
6
1
5,162
2
0
2011-05-31T20:36:23.663000
2011-06-01T08:39:40.733000
6,193,268
6,193,427
How do Rails 3 and RefineryCMS manage and release multiple gems from the same Git repo?
I am experimenting with a design for a Rails application which will have most of its functionality delegated to highly specialized Engines. However, there will probably be 10 Engines or so and I definitely don't want to have to manage 10 different gems and Git repositories. Rails and RefineryCMS both seem to house all ...
It's very simple, at http://github.com/resolve/refinerycms there is a folder for each gem. In those folders you will find a gemspec, so building the gems is as simple as cd-ing into those directories and running gem build. Then, the main https://github.com/resolve/refinerycms/blob/master/refinerycms.gemspec simply list...
How do Rails 3 and RefineryCMS manage and release multiple gems from the same Git repo? I am experimenting with a design for a Rails application which will have most of its functionality delegated to highly specialized Engines. However, there will probably be 10 Engines or so and I definitely don't want to have to mana...
TITLE: How do Rails 3 and RefineryCMS manage and release multiple gems from the same Git repo? QUESTION: I am experimenting with a design for a Rails application which will have most of its functionality delegated to highly specialized Engines. However, there will probably be 10 Engines or so and I definitely don't wa...
[ "ruby-on-rails", "ruby-on-rails-3", "modularity", "rails-engines", "refinerycms" ]
0
6
421
1
0
2011-05-31T20:38:24.660000
2011-05-31T20:52:57.553000
6,193,271
6,193,298
Configuring port for django development environment, so the site is available from outside
I am experimenting with django and I throw the code on my server like explained in the first chapters of the django book 2.0. I have apache running on this server, too (port 80). If I stop apache I can start my django site by calling sudo python manage.py runserver 0.0.0.0:80 If I access it from another machine by http...
Specify a different port when starting the dev server: $ python manage.py runserver 0.0.0.0:8000 and connect to the site via: http://myserverip:8000
Configuring port for django development environment, so the site is available from outside I am experimenting with django and I throw the code on my server like explained in the first chapters of the django book 2.0. I have apache running on this server, too (port 80). If I stop apache I can start my django site by cal...
TITLE: Configuring port for django development environment, so the site is available from outside QUESTION: I am experimenting with django and I throw the code on my server like explained in the first chapters of the django book 2.0. I have apache running on this server, too (port 80). If I stop apache I can start my ...
[ "django", "apache", "ubuntu", "port" ]
1
3
939
2
0
2011-05-31T20:38:37.950000
2011-05-31T20:40:44.590000
6,193,273
6,193,310
Releasing in ASP.Net to Production
I recently got a new computer and forgot how to create a Release for my asp.net app. I need to generate a Release folder in the Solution Explorer. I've changed the build from Debug to Relase. What am I missing?
By default, ASP.NET applications place code directly to the bin directory (there won't be Debug or Release directories) when built. So, if you changed the configuration to Release, you should be ready to go. Edit: If you need your assemblies to be output to a Release folder below your bin folder, then open your web app...
Releasing in ASP.Net to Production I recently got a new computer and forgot how to create a Release for my asp.net app. I need to generate a Release folder in the Solution Explorer. I've changed the build from Debug to Relase. What am I missing?
TITLE: Releasing in ASP.Net to Production QUESTION: I recently got a new computer and forgot how to create a Release for my asp.net app. I need to generate a Release folder in the Solution Explorer. I've changed the build from Debug to Relase. What am I missing? ANSWER: By default, ASP.NET applications place code dir...
[ "asp.net", "deployment", "release" ]
2
3
311
1
0
2011-05-31T20:38:44.613000
2011-05-31T20:42:29.387000
6,193,275
6,193,544
Progress ODBC Problem with Sql-width (DBTool?)
I have been given the task of getting some data out of a third party progress database. The problem is that, some tables are reporting an error "Column in table has value exceeding its max length or precision (7864)". Some Googling came up with this being an issue with SQL width on the database, and that running DBTool...
Your 3rd party is ignorant. DBTool is the standard way of dealing with this issue and has been provided for this very purpose. Running dbtool is extremely common and is normally automated to run occasionally (monthly is generally good). They may be confusing it with "dbrpr". Which can reformat blocks and other fun stuf...
Progress ODBC Problem with Sql-width (DBTool?) I have been given the task of getting some data out of a third party progress database. The problem is that, some tables are reporting an error "Column in table has value exceeding its max length or precision (7864)". Some Googling came up with this being an issue with SQL...
TITLE: Progress ODBC Problem with Sql-width (DBTool?) QUESTION: I have been given the task of getting some data out of a third party progress database. The problem is that, some tables are reporting an error "Column in table has value exceeding its max length or precision (7864)". Some Googling came up with this being...
[ "sql", "progress-4gl", "openedge" ]
4
2
5,624
1
0
2011-05-31T20:38:50.027000
2011-05-31T21:05:33.740000
6,193,283
6,202,184
CakePHP Containable Model Not Retrieved
I have the following code in which I am finding a single tag. I want to contain all Posts that relate to a tag that have not been "deleted." I then want to find all tags that those Posts belong to. As a test, I have attached two models to Post at a third level recursion, Tag and User, via contain. The containable behav...
This is not a real answer to the question (which is more of why it happens), but I think this is why it happens and how to get around it. I dug into the Containable class and the query is constructed with my Tag model intact, which lead me to believe that the query and association in the Model class is probably removin...
CakePHP Containable Model Not Retrieved I have the following code in which I am finding a single tag. I want to contain all Posts that relate to a tag that have not been "deleted." I then want to find all tags that those Posts belong to. As a test, I have attached two models to Post at a third level recursion, Tag and ...
TITLE: CakePHP Containable Model Not Retrieved QUESTION: I have the following code in which I am finding a single tag. I want to contain all Posts that relate to a tag that have not been "deleted." I then want to find all tags that those Posts belong to. As a test, I have attached two models to Post at a third level r...
[ "cakephp", "cakephp-1.3" ]
2
3
1,098
1
0
2011-05-31T20:39:40.090000
2011-06-01T13:45:31.277000
6,193,285
6,195,740
Where to set the contentView of UISearchDisplayController that was made in Interface Builder
I have a UISearchBar in a UIToolbar that has a UISearchDisplayController tied to it. I would like the UISearchDisplayController's results to show in a popover below the UISearchBar but I'm having trouble with this. I'm pretty sure it's because there is not a contentsController set but I can't find where to assign a con...
The UISearchDisplayController is made to only be used with another UIViewController ( contentsController, as you mentioned). Though it can be used with any UIViewController, it's main use (and least painful use) is intended to be with a UITableViewController. The contentsController is supposed to be "responsible for ma...
Where to set the contentView of UISearchDisplayController that was made in Interface Builder I have a UISearchBar in a UIToolbar that has a UISearchDisplayController tied to it. I would like the UISearchDisplayController's results to show in a popover below the UISearchBar but I'm having trouble with this. I'm pretty s...
TITLE: Where to set the contentView of UISearchDisplayController that was made in Interface Builder QUESTION: I have a UISearchBar in a UIToolbar that has a UISearchDisplayController tied to it. I would like the UISearchDisplayController's results to show in a popover below the UISearchBar but I'm having trouble with ...
[ "objective-c", "xcode", "ios", "ipad" ]
0
1
552
1
0
2011-05-31T20:39:58.030000
2011-06-01T02:48:24.567000
6,193,286
6,193,481
How do I allow my user to best interact with real-time xml data from a feed?
I am writing a Ruby on Rails(3) application that relies on an xml feed that is updated ~30 seconds. Should I be parsing the xml data on my server with some sort of worker? If this is the case, will the server be able to respond to the client fast enough to stay 'real-time'. I was thinking that it could be done with jav...
There are 3 realistic ways to approach this. I'm not a ruby guy, but none of these methods are ruby specific, either. Refresh the page itself periodically to grab the latest feed. This is the old way of doing it, and though reliable, not a very good user experience. Grab the new data periodically via AJAX and append it...
How do I allow my user to best interact with real-time xml data from a feed? I am writing a Ruby on Rails(3) application that relies on an xml feed that is updated ~30 seconds. Should I be parsing the xml data on my server with some sort of worker? If this is the case, will the server be able to respond to the client f...
TITLE: How do I allow my user to best interact with real-time xml data from a feed? QUESTION: I am writing a Ruby on Rails(3) application that relies on an xml feed that is updated ~30 seconds. Should I be parsing the xml data on my server with some sort of worker? If this is the case, will the server be able to respo...
[ "javascript", "ruby-on-rails" ]
1
1
88
1
0
2011-05-31T20:40:08.287000
2011-05-31T20:58:37.170000
6,193,289
6,193,317
check the format of a date in PHP
I have a date input that requires the user to enter the date in the following format: DD-MM-YYYY - It is then converted to YYYY-MM-DD I want to perform a check to see whether they are entering the correct format. i.e. if anything else is entered other than DD-MM-YYYY then it should produce an error message Im currently...
You are asking the user to enter DD-MM-YYYY, but your list() call expects the explode() order as YYYY-MM-DD. Update your code to with: list($d, $m, $y) = explode('-', $date);
check the format of a date in PHP I have a date input that requires the user to enter the date in the following format: DD-MM-YYYY - It is then converted to YYYY-MM-DD I want to perform a check to see whether they are entering the correct format. i.e. if anything else is entered other than DD-MM-YYYY then it should pro...
TITLE: check the format of a date in PHP QUESTION: I have a date input that requires the user to enter the date in the following format: DD-MM-YYYY - It is then converted to YYYY-MM-DD I want to perform a check to see whether they are entering the correct format. i.e. if anything else is entered other than DD-MM-YYYY ...
[ "php" ]
2
7
373
4
0
2011-05-31T20:40:18.930000
2011-05-31T20:43:18.140000
6,193,293
6,193,394
Create a nonclustered non-unique index within the CREATE TABLE statement with SQL Server
It is possible to create a primary key or unique index within a SQL Server CREATE TABLE statement. Is it possible to create a non-unique index within a CREATE TABLE statement? CREATE TABLE MyTable( a int NOT NULL,b smallint NOT NULL,c smallint NOT NULL,d smallint NOT NULL,e smallint NOT NULL -- This creates a primary ...
As of SQL 2014, this can be accomplished via inline index creation: CREATE TABLE MyTable( a int NOT NULL,b smallint NOT NULL,c smallint NOT NULL,d smallint NOT NULL,e smallint NOT NULL -- This creates a primary key,CONSTRAINT PK_MyTable PRIMARY KEY CLUSTERED (a) -- This creates a unique nonclustered index on columns ...
Create a nonclustered non-unique index within the CREATE TABLE statement with SQL Server It is possible to create a primary key or unique index within a SQL Server CREATE TABLE statement. Is it possible to create a non-unique index within a CREATE TABLE statement? CREATE TABLE MyTable( a int NOT NULL,b smallint NOT NUL...
TITLE: Create a nonclustered non-unique index within the CREATE TABLE statement with SQL Server QUESTION: It is possible to create a primary key or unique index within a SQL Server CREATE TABLE statement. Is it possible to create a non-unique index within a CREATE TABLE statement? CREATE TABLE MyTable( a int NOT NULL,...
[ "sql-server" ]
137
182
188,441
4
0
2011-05-31T20:40:31.070000
2011-05-31T20:50:04.213000
6,193,295
6,193,542
Need help understanding Assembly references
1) What is the difference between using NUnit.Framework; and using Microsoft.VisualStudio.TestTools.UnitTesting; I am having a problem getting my tests to run. I create a new project in VS 2010 (File --> New Project --> Visual C# --> Test, and Visual Studio automatically creates some code for me: using System; using Sy...
NUnit and MSTest (i.e. Microsoft.VisualStudio.TestTools.UnitTesting) are both unit testing frameworks. They both serve the same purpose; to let you define and run unit tests. Selenium generates tests for NUnit out of the box. There is a plugin available that will generate tests for MSTest instead. I haven't tried it ye...
Need help understanding Assembly references 1) What is the difference between using NUnit.Framework; and using Microsoft.VisualStudio.TestTools.UnitTesting; I am having a problem getting my tests to run. I create a new project in VS 2010 (File --> New Project --> Visual C# --> Test, and Visual Studio automatically crea...
TITLE: Need help understanding Assembly references QUESTION: 1) What is the difference between using NUnit.Framework; and using Microsoft.VisualStudio.TestTools.UnitTesting; I am having a problem getting my tests to run. I create a new project in VS 2010 (File --> New Project --> Visual C# --> Test, and Visual Studio ...
[ "c#", "selenium" ]
3
2
247
2
0
2011-05-31T20:40:36.600000
2011-05-31T21:05:21.333000
6,193,297
6,193,351
XML Parsing Error: no element found Location: http://localhost:8000/web.config Line Number 1, Column 1
I'm a newbie to WCF and IIS, and when I try to host a web service in IIS and open it in the browser it shows me the above XML Parsing error. I've tried all the points mentioned in related posts, but it doesnt seem to work. Is there any solution that I might have missed out? EDIT: i followed all the steps exactly as men...
There may be many things that will cause this. If you are using some 3rd party libraries like in this post, check bin folder. Another suggestion is to place Global.asax in root of app and try to catch more detailed exception in Application_Error.
XML Parsing Error: no element found Location: http://localhost:8000/web.config Line Number 1, Column 1 I'm a newbie to WCF and IIS, and when I try to host a web service in IIS and open it in the browser it shows me the above XML Parsing error. I've tried all the points mentioned in related posts, but it doesnt seem to ...
TITLE: XML Parsing Error: no element found Location: http://localhost:8000/web.config Line Number 1, Column 1 QUESTION: I'm a newbie to WCF and IIS, and when I try to host a web service in IIS and open it in the browser it shows me the above XML Parsing error. I've tried all the points mentioned in related posts, but ...
[ "asp.net", "xml", "wcf", "iis", "iis-7" ]
4
2
12,639
4
0
2011-05-31T20:40:42.557000
2011-05-31T20:46:14.270000
6,193,306
6,193,362
Coalescing the results of two find_bys
I have code that obtains the results of two finds: results1 = firstModel.find_by_id(id1) results2 = secondModel.find_by_id(id2) allResults = results1 & results2 # merge the results, removing duplicates # I believe find_by returns an array, but, a little out of desperation, I've also tried, allResults = results1.merge(r...
I believe find_by returns an array, but, a little out of desperation, I've also tried, allResults = results1.merge(results2) However, with both, I get 'undefined method' ('&' or 'merge', respectively) find_by_id will return a single object and not a collection. To return collections, you can do something like this: MyM...
Coalescing the results of two find_bys I have code that obtains the results of two finds: results1 = firstModel.find_by_id(id1) results2 = secondModel.find_by_id(id2) allResults = results1 & results2 # merge the results, removing duplicates # I believe find_by returns an array, but, a little out of desperation, I've al...
TITLE: Coalescing the results of two find_bys QUESTION: I have code that obtains the results of two finds: results1 = firstModel.find_by_id(id1) results2 = secondModel.find_by_id(id2) allResults = results1 & results2 # merge the results, removing duplicates # I believe find_by returns an array, but, a little out of de...
[ "ruby-on-rails", "ruby" ]
1
4
319
3
0
2011-05-31T20:41:49.373000
2011-05-31T20:47:07.907000
6,193,315
6,193,348
Changing background image on hover in <a> tag
I need to put an image link on my webpage, when they hover over the image I want it to change to another image. I am having trouble doing this. I this line in my html: hello my css classes are: #somethingtosay-ballon { background-image: url(Images/button_email_upstate.png); display:block; width:263px; height:167px; te...
Remove the space between #somethingtosay-ballon and.item:hover. It should be: #somethingtosay-ballon.item:hover
Changing background image on hover in <a> tag I need to put an image link on my webpage, when they hover over the image I want it to change to another image. I am having trouble doing this. I this line in my html: hello my css classes are: #somethingtosay-ballon { background-image: url(Images/button_email_upstate.png);...
TITLE: Changing background image on hover in <a> tag QUESTION: I need to put an image link on my webpage, when they hover over the image I want it to change to another image. I am having trouble doing this. I this line in my html: hello my css classes are: #somethingtosay-ballon { background-image: url(Images/button_e...
[ "html", "css", "hover" ]
1
1
5,471
3
0
2011-05-31T20:43:09.777000
2011-05-31T20:45:55.750000
6,193,316
6,193,458
Drawing bus route to Google map
I want to make a public transportation application for Android. First problem I'm facing is how to create a bus route and show it to users. I have a list of bus stops coordinates. I understand, I have to generate encoded polyline which I did. Used this utility here. How can I only show the stops in this route, because ...
You could add a different list of overlayItems to indicate bus stops. It seems to me you did the most difficult part of your mapping related stuff in your app already, adding overlayItems is gonna be quite easy. Stéphane
Drawing bus route to Google map I want to make a public transportation application for Android. First problem I'm facing is how to create a bus route and show it to users. I have a list of bus stops coordinates. I understand, I have to generate encoded polyline which I did. Used this utility here. How can I only show t...
TITLE: Drawing bus route to Google map QUESTION: I want to make a public transportation application for Android. First problem I'm facing is how to create a bus route and show it to users. I have a list of bus stops coordinates. I understand, I have to generate encoded polyline which I did. Used this utility here. How...
[ "android", "google-maps", "routes", "bus" ]
5
0
3,737
1
0
2011-05-31T20:43:13.867000
2011-05-31T20:56:10.197000
6,193,352
6,193,518
PHP4 parameter by reference?
I'm quite used to PHP5 but have to write a PHP4 sync script, now I'm doing some digging to find the differences between PHP5 and 4. Problem is that I get alot of contradiction, some sites tell me that PHP4 has no byref whatever and others tell me this problem only occurs when using foreach.. To clarify an example: func...
The change was only that, in PHP4, objects are copied by default, and in PHP5, they're treated as references by default. i.e.: $a = new stdClass(); $a->prop = "original"; $b = $a; $b->prop = "changed"; echo $a->prop; # PHP4 outputs "original" because $a and $b are different objects # PHP5 outputs "changed" because $a...
PHP4 parameter by reference? I'm quite used to PHP5 but have to write a PHP4 sync script, now I'm doing some digging to find the differences between PHP5 and 4. Problem is that I get alot of contradiction, some sites tell me that PHP4 has no byref whatever and others tell me this problem only occurs when using foreach....
TITLE: PHP4 parameter by reference? QUESTION: I'm quite used to PHP5 but have to write a PHP4 sync script, now I'm doing some digging to find the differences between PHP5 and 4. Problem is that I get alot of contradiction, some sites tell me that PHP4 has no byref whatever and others tell me this problem only occurs w...
[ "php4", "byref" ]
2
3
783
1
0
2011-05-31T20:46:14.740000
2011-05-31T21:02:44.410000
6,193,372
6,233,830
How to generate simple-xml java annotated object from xsd schema
Ok, so I've searched stackoverflow and found unanswered sub-topics regarding this issue, that's why I'd like to have this question clearly pointed out: Is there any tool that will generate the Simple Xml library 's annotated java class from an xsd schema? I received a couple of xsd files describing the objects returned...
I do not believe that JAXB can be used on Android because of missing package requirements ( see here ), especially with earlier versions of the Android API. What you could do instead is send your XSD through xjc and get JAXB class output and then write a script to convert the JAXB annotations into the equivalent Simple...
How to generate simple-xml java annotated object from xsd schema Ok, so I've searched stackoverflow and found unanswered sub-topics regarding this issue, that's why I'd like to have this question clearly pointed out: Is there any tool that will generate the Simple Xml library 's annotated java class from an xsd schema?...
TITLE: How to generate simple-xml java annotated object from xsd schema QUESTION: Ok, so I've searched stackoverflow and found unanswered sub-topics regarding this issue, that's why I'd like to have this question clearly pointed out: Is there any tool that will generate the Simple Xml library 's annotated java class f...
[ "java", "android", "xml", "xsd", "simple-framework" ]
25
4
11,938
3
0
2011-05-31T20:47:50.400000
2011-06-04T00:19:03.993000
6,193,373
6,193,540
Initializing a readonly member variable with a default constructor in C#
I have a simple Factory implementation in my code. I'm aiming to have the constructed objects retain a reference to the factory that created them, so I have them wired up similar to this: public class Factory { public T CreateObject () where T: Foo, new() { return new T() { parent = this }; } } public class Foo { in...
I do not think you can obtain exactly what you want, but you could make a property that is only assignable once and let the factory overwrite it. But I guess the user can always force an override with new CreatingFactory, but I think this makes it difficult and at least clearly shows your intention. You could do someth...
Initializing a readonly member variable with a default constructor in C# I have a simple Factory implementation in my code. I'm aiming to have the constructed objects retain a reference to the factory that created them, so I have them wired up similar to this: public class Factory { public T CreateObject () where T: F...
TITLE: Initializing a readonly member variable with a default constructor in C# QUESTION: I have a simple Factory implementation in my code. I'm aiming to have the constructed objects retain a reference to the factory that created them, so I have them wired up similar to this: public class Factory { public T CreateOb...
[ "c#", "generics", "readonly" ]
0
4
1,286
3
0
2011-05-31T20:47:53.550000
2011-05-31T21:05:16.657000
6,193,377
6,193,445
How to get the length of a dialog item text?
Im trying to get the dialog item text into a buffer. It works with GetDlgItemText(), but how do i get the length of the text so i can allocate the buffer before i read it in there? I want to be sure i always get the whole text. I could use always for example 10k buffer, but it would be nicer if there wasnt any chance t...
Send the window handle, obtained by calling GetDlgItem, a WM_GETTEXTLENGTH message. Or if you prefer call GetWindowTextLength.
How to get the length of a dialog item text? Im trying to get the dialog item text into a buffer. It works with GetDlgItemText(), but how do i get the length of the text so i can allocate the buffer before i read it in there? I want to be sure i always get the whole text. I could use always for example 10k buffer, but ...
TITLE: How to get the length of a dialog item text? QUESTION: Im trying to get the dialog item text into a buffer. It works with GetDlgItemText(), but how do i get the length of the text so i can allocate the buffer before i read it in there? I want to be sure i always get the whole text. I could use always for exampl...
[ "c++", "visual-studio-2008", "winapi" ]
1
3
786
1
0
2011-05-31T20:48:23.613000
2011-05-31T20:54:32.070000
6,193,386
6,193,483
State design pattern User Interface
I am learning the State Design Pattern. I am using C# ASP.Net (not sure if the language is relevant). Basically, my object has states A, B and C, and also actions to move it between different states: ActionAToB, ActionBtoA and ActionAtoC. What I am trying to do is tie this object to a screen, and have buttons trigger t...
Use the Observer Pattern as well as the State Pattern. Have your Form class (or whatever you're using for your UI) be an Observer which observes your A-B-C objects. When those objects change their state, they will notify the view and she will update herself accordingly, hiding the appropiate buttons. I blogged about th...
State design pattern User Interface I am learning the State Design Pattern. I am using C# ASP.Net (not sure if the language is relevant). Basically, my object has states A, B and C, and also actions to move it between different states: ActionAToB, ActionBtoA and ActionAtoC. What I am trying to do is tie this object to ...
TITLE: State design pattern User Interface QUESTION: I am learning the State Design Pattern. I am using C# ASP.Net (not sure if the language is relevant). Basically, my object has states A, B and C, and also actions to move it between different states: ActionAToB, ActionBtoA and ActionAtoC. What I am trying to do is t...
[ "c#", "asp.net", "design-patterns", "user-interface", "state-pattern" ]
6
1
2,359
1
0
2011-05-31T20:49:27.267000
2011-05-31T20:58:52.973000
6,193,387
6,193,727
Populating DataGrid in WPF with anonymous type collection
I'm populating datagrid with collection of anonymous types (I'm setting DataGrid's DataContext property). And there are no errors. And nothing dsiplayed in datagrid. I've tried to make the same with defined object collection, but again nothing is displayed. Please could you instruct me what to do. Thanks! EDIT 1 Ok. I ...
You likely need to do two things. The first, as @Tim suggested, is assign the query to the DataGrid.ItemsSource property. myDataGrid.ItemsSource = from a in x select new { Prop1 = a.A, Prop2 = a.B,... }; The second bit will be to enable automatic column generation on your DataGrid: Edit: I've recreated your picture usi...
Populating DataGrid in WPF with anonymous type collection I'm populating datagrid with collection of anonymous types (I'm setting DataGrid's DataContext property). And there are no errors. And nothing dsiplayed in datagrid. I've tried to make the same with defined object collection, but again nothing is displayed. Plea...
TITLE: Populating DataGrid in WPF with anonymous type collection QUESTION: I'm populating datagrid with collection of anonymous types (I'm setting DataGrid's DataContext property). And there are no errors. And nothing dsiplayed in datagrid. I've tried to make the same with defined object collection, but again nothing ...
[ "c#", "wpf", "datagrid", "datacontext", "anonymous-types" ]
4
7
6,021
3
0
2011-05-31T20:49:29.817000
2011-05-31T21:23:06.837000
6,193,390
6,193,747
Grails: what are the main issues (and his solutions) when deploying in weblogic?
I'm trying to deploy my grails application (*.war) in a weblogic server. But now I'm getting error: "/index.gsp" not found. While I run to solve this I'm think what more problems can happen when someone change deploy from Apache Tomcat to Oracle Weblogic. Anybody have a list of commons problems/solutions to share? Than...
A list of common problems with different application servers and how to deal with these problems can already be found in the FAQ on the Grails community page. http://www.grails.org/FAQ#Application Servers http://www.grails.org/Deployment#Weblogic 11g
Grails: what are the main issues (and his solutions) when deploying in weblogic? I'm trying to deploy my grails application (*.war) in a weblogic server. But now I'm getting error: "/index.gsp" not found. While I run to solve this I'm think what more problems can happen when someone change deploy from Apache Tomcat to ...
TITLE: Grails: what are the main issues (and his solutions) when deploying in weblogic? QUESTION: I'm trying to deploy my grails application (*.war) in a weblogic server. But now I'm getting error: "/index.gsp" not found. While I run to solve this I'm think what more problems can happen when someone change deploy from...
[ "grails", "weblogic" ]
0
2
1,759
1
0
2011-05-31T20:49:50.247000
2011-05-31T21:24:54.163000
6,193,409
6,194,038
Building DAG from given edges
Let's have graph with N verticles with no edges. Let's have list of edges: x1 y1 x2 y2 x3 y3... xk yk We'll have to process all edges from 1 to k. We'll have to say if x-th edge is making cycle in graph. If it's not, add it to the graph. How to do something like this efficiently? I mean not to check with DFS if x-th ed...
Create a edge object. In the edge object you have two flags. A trace flag and an added flag. Build your object model from the list of edges you want to check. Add all edges, and connect edges that link using pointers in the edge object. When adding an edge to the model, link to the newly added edge all previously added...
Building DAG from given edges Let's have graph with N verticles with no edges. Let's have list of edges: x1 y1 x2 y2 x3 y3... xk yk We'll have to process all edges from 1 to k. We'll have to say if x-th edge is making cycle in graph. If it's not, add it to the graph. How to do something like this efficiently? I mean no...
TITLE: Building DAG from given edges QUESTION: Let's have graph with N verticles with no edges. Let's have list of edges: x1 y1 x2 y2 x3 y3... xk yk We'll have to process all edges from 1 to k. We'll have to say if x-th edge is making cycle in graph. If it's not, add it to the graph. How to do something like this effi...
[ "graph" ]
0
1
663
2
0
2011-05-31T20:51:25.423000
2011-05-31T21:56:33.373000
6,193,411
6,193,453
How to invoke a prototype function within same object?
I have the following javascript code. var Test = function(){ $("#"+elementId).click(function(){ // How to call Test.callbackTest here? }); } Test.prototype.callbackTest = function(){ //code } If I want to call callbackTest() in clicking event, do I have to use this.callbackTest()? or is there any better ways?
You can make callbackTest private: var Test = function(){ function callbackTest(){ //code } $("#"+elementId).click(callBackTest); }; Otherwise it should be var Test = function(){ var me = this; $("#"+elementId).click(function(){ me.callbackTest(); }); };
How to invoke a prototype function within same object? I have the following javascript code. var Test = function(){ $("#"+elementId).click(function(){ // How to call Test.callbackTest here? }); } Test.prototype.callbackTest = function(){ //code } If I want to call callbackTest() in clicking event, do I have to use t...
TITLE: How to invoke a prototype function within same object? QUESTION: I have the following javascript code. var Test = function(){ $("#"+elementId).click(function(){ // How to call Test.callbackTest here? }); } Test.prototype.callbackTest = function(){ //code } If I want to call callbackTest() in clicking event, ...
[ "javascript", "closures" ]
1
1
247
2
0
2011-05-31T20:51:34.567000
2011-05-31T20:55:25.097000
6,193,414
6,194,159
Dependency Injection with Ninject and Filter attribute for asp.net mvc
I'm writing a custom Authorization Filter for asp.net mvc 3. I need to inject a userservice into the class but I have no idea how to do this. public class AuthorizeAttribute: FilterAttribute, IAuthorizationFilter { private IUserService userService; private string[] roles; public AuthorizeAttribute(params string[] role...
See this answer: Custom Authorization MVC 3 and Ninject IoC If you want to use constructor injection then you need to create an attribute and a filter. /// Marker attribute public class MyAuthorizeAttribute: FilterAttribute { } /// Filter public class MyAuthorizeFilter: IAuthorizationFilter { private readonly IUserSer...
Dependency Injection with Ninject and Filter attribute for asp.net mvc I'm writing a custom Authorization Filter for asp.net mvc 3. I need to inject a userservice into the class but I have no idea how to do this. public class AuthorizeAttribute: FilterAttribute, IAuthorizationFilter { private IUserService userService; ...
TITLE: Dependency Injection with Ninject and Filter attribute for asp.net mvc QUESTION: I'm writing a custom Authorization Filter for asp.net mvc 3. I need to inject a userservice into the class but I have no idea how to do this. public class AuthorizeAttribute: FilterAttribute, IAuthorizationFilter { private IUserSer...
[ "asp.net-mvc", "asp.net-mvc-3", "ninject" ]
56
82
26,885
4
0
2011-05-31T20:51:41.243000
2011-05-31T22:09:15.387000
6,193,415
6,198,161
Why is C# .NET WebException not being caught in WP7 emulator?
I'm developing a Windows Phone 7 app, and I need to PUT some data on our company's REST api. I was testing out this API call, and ran into a WebException that I couldn't catch. My call was originally in a lambda, so I pulled it out into member functions, but still no luck. The error string is "The remote server returne...
Research tells me there's a new ClientHttp stack in Silverlight 3 and above. http://msdn.microsoft.com/en-us/library/dd920295(v=vs.95).aspx
Why is C# .NET WebException not being caught in WP7 emulator? I'm developing a Windows Phone 7 app, and I need to PUT some data on our company's REST api. I was testing out this API call, and ran into a WebException that I couldn't catch. My call was originally in a lambda, so I pulled it out into member functions, but...
TITLE: Why is C# .NET WebException not being caught in WP7 emulator? QUESTION: I'm developing a Windows Phone 7 app, and I need to PUT some data on our company's REST api. I was testing out this API call, and ran into a WebException that I couldn't catch. My call was originally in a lambda, so I pulled it out into mem...
[ "c#", ".net", "rest", "windows-phone-7", "httpwebrequest" ]
1
0
484
1
0
2011-05-31T20:51:43.773000
2011-06-01T08:15:06.500000
6,193,420
6,193,440
code igniter / php - concatenating two POST variables to form a new variable
I have a form where a user submits his member name, first and last. I want to combine these two and send them to the database as a member ID using code igniter's url_title functionality. In other words just making sure that it's all lower case, underscores, URL safe, etc. This is the code in my model, but in the databa...
PHP uses. to concat strings, not +. $v_memberid = $v_membername. "_". $v_memberlast;
code igniter / php - concatenating two POST variables to form a new variable I have a form where a user submits his member name, first and last. I want to combine these two and send them to the database as a member ID using code igniter's url_title functionality. In other words just making sure that it's all lower case...
TITLE: code igniter / php - concatenating two POST variables to form a new variable QUESTION: I have a form where a user submits his member name, first and last. I want to combine these two and send them to the database as a member ID using code igniter's url_title functionality. In other words just making sure that i...
[ "php", "codeigniter" ]
2
8
11,433
2
0
2011-05-31T20:52:23.740000
2011-05-31T20:54:04.300000
6,193,426
6,193,464
Error when compiling
I am trying to compile this code: /* Includes */ #include /* Symbolic Constants */ #include /* Primitive System Data Types */ #include /* Errors */ #include /* Input/Output */ #include /* General Utilities */ #include /* POSIX Threads */ #include /* String handling */ #include /* Semaphore */ /* prototype for thread r...
You can't cast the address of your handle function to void * before passing it into pthread_create. Just pass it as-is. pthread_create (&thread_a, NULL, &handler, (void *) &i[0]); pthread_create (&thread_b, NULL, &handler, (void *) &i[1]); Also, change your handler function's signature per nos's comment below.
Error when compiling I am trying to compile this code: /* Includes */ #include /* Symbolic Constants */ #include /* Primitive System Data Types */ #include /* Errors */ #include /* Input/Output */ #include /* General Utilities */ #include /* POSIX Threads */ #include /* String handling */ #include /* Semaphore */ /* p...
TITLE: Error when compiling QUESTION: I am trying to compile this code: /* Includes */ #include /* Symbolic Constants */ #include /* Primitive System Data Types */ #include /* Errors */ #include /* Input/Output */ #include /* General Utilities */ #include /* POSIX Threads */ #include /* String handling */ #include /* ...
[ "c", "macos", "g++", "pthreads", "compiler-errors" ]
2
2
850
2
0
2011-05-31T20:52:53.787000
2011-05-31T20:56:48.043000
6,193,428
6,193,561
Problems starting Cassandra with “./bin/cassandra -f”
For some reason when I try to start Cassandra with this command: bin/cassandra -f The terminal gets stuck on: Listening for thrift clients... Is it normal? Does that mean that Thrift can talk too Thrift? I am using Ubuntu Server.
That sounds normal. Cassandra -f doesn't create an interactive session, it just runs Cassandra in the foreground, but as a server process. To interact with Cassandra, you can start a CLI session in another terminal window. See http://wiki.apache.org/cassandra/CassandraCli for details of how to do this, and the commands...
Problems starting Cassandra with “./bin/cassandra -f” For some reason when I try to start Cassandra with this command: bin/cassandra -f The terminal gets stuck on: Listening for thrift clients... Is it normal? Does that mean that Thrift can talk too Thrift? I am using Ubuntu Server.
TITLE: Problems starting Cassandra with “./bin/cassandra -f” QUESTION: For some reason when I try to start Cassandra with this command: bin/cassandra -f The terminal gets stuck on: Listening for thrift clients... Is it normal? Does that mean that Thrift can talk too Thrift? I am using Ubuntu Server. ANSWER: That soun...
[ "ubuntu", "cassandra", "thrift", "ubuntu-server" ]
6
12
4,450
1
0
2011-05-31T20:52:58.170000
2011-05-31T21:07:06.093000
6,193,433
6,193,462
Smart Garbage Collection?
You can garbage collect in Java simply by calling System.gc() but sometimes this "stalls" the application. Is it a bad idea to garbage collect like this and avoid stalls: new Thread(new Runnable() { public void run() { System.gc(); } }).start(); Or might this lead to even more problems?
Yes, most times it is a very bad idea to call System.gc(). There are exceptions but they are few and it is mostly better to spend the time making sure you are not doing things that hurt performance in a GC environment and to study and make sure you understand how a gc works than to try to handle it yourself by explicit...
Smart Garbage Collection? You can garbage collect in Java simply by calling System.gc() but sometimes this "stalls" the application. Is it a bad idea to garbage collect like this and avoid stalls: new Thread(new Runnable() { public void run() { System.gc(); } }).start(); Or might this lead to even more problems?
TITLE: Smart Garbage Collection? QUESTION: You can garbage collect in Java simply by calling System.gc() but sometimes this "stalls" the application. Is it a bad idea to garbage collect like this and avoid stalls: new Thread(new Runnable() { public void run() { System.gc(); } }).start(); Or might this lead to even mor...
[ "java", "garbage-collection", "stability" ]
3
3
591
6
0
2011-05-31T20:53:18.543000
2011-05-31T20:56:24.973000
6,193,438
6,209,031
Duplicate entries in apache solr index upon reindexing in Drupal
I am using apache solr search integration on my Drupal 6 website: govoluntourism.com. I have my search results themed using views and a search-result.tpl.php file. The search-result.tpl.php contains: $nid = $result['fields']['nid']['value']; echo views_embed_view($name = 'search', $display_id = 'default', $nid); When I...
I looked at your site and the duplicate search results all point to the same nodes, so that means you probably don't have actual duplicate content. The first thing to do if you suspect your index is corrupt and you can't find the problem, is probably to reindex all of your content. You can do that by going here: http:/...
Duplicate entries in apache solr index upon reindexing in Drupal I am using apache solr search integration on my Drupal 6 website: govoluntourism.com. I have my search results themed using views and a search-result.tpl.php file. The search-result.tpl.php contains: $nid = $result['fields']['nid']['value']; echo views_em...
TITLE: Duplicate entries in apache solr index upon reindexing in Drupal QUESTION: I am using apache solr search integration on my Drupal 6 website: govoluntourism.com. I have my search results themed using views and a search-result.tpl.php file. The search-result.tpl.php contains: $nid = $result['fields']['nid']['valu...
[ "apache", "drupal", "drupal-6", "solr", "duplicates" ]
1
3
1,950
2
0
2011-05-31T20:53:49.900000
2011-06-01T23:54:22.177000
6,193,439
6,196,322
Conversion problem in ansi c
Possible Duplicates: Floating point inaccuracy examples Is JavaScript's Math broken? I need to convert some data from txt file into double value and I'm using this function for this: atof. The problem is that the value which must be convert is 5.550000 and the atof function return 5.5499999999999998 and this is a probl...
drhirsch is correct - 5.55 cannot be exactly represented in binary floating point (in the same way that 1 ÷ 7 cannot be exactly represented in decimal). However, for your purposes, this shouldn't be a problem, because a float definitely can store 5.55 accurate to three places, which is the number you have. This just me...
Conversion problem in ansi c Possible Duplicates: Floating point inaccuracy examples Is JavaScript's Math broken? I need to convert some data from txt file into double value and I'm using this function for this: atof. The problem is that the value which must be convert is 5.550000 and the atof function return 5.5499999...
TITLE: Conversion problem in ansi c QUESTION: Possible Duplicates: Floating point inaccuracy examples Is JavaScript's Math broken? I need to convert some data from txt file into double value and I'm using this function for this: atof. The problem is that the value which must be convert is 5.550000 and the atof functio...
[ "c", "floating-point", "floating-accuracy", "atof" ]
3
2
351
3
0
2011-05-31T20:54:04.167000
2011-06-01T04:35:06.787000
6,193,441
6,193,820
Jquery .select() with .live()
How do I make this trigger when I select the text in the input? It has to be live/delegate $('input:text').live('select', function () { alert("selected"); }); Updated to input:text by popular demand. I still do not get an alert message when selecting text in input boxes. The example on http://api.jquery.com/select/ giv...
Your code works fine for me here (jsFiddle) in Opera, FF, Safari and Chrome. IE8 doesn't seem to like it, however. I thought maybe it was because.live() binds an event handler to the document and it's possible IE doesn't have an onselect event on the document so I tried limiting the scope of it to the body and even to ...
Jquery .select() with .live() How do I make this trigger when I select the text in the input? It has to be live/delegate $('input:text').live('select', function () { alert("selected"); }); Updated to input:text by popular demand. I still do not get an alert message when selecting text in input boxes. The example on htt...
TITLE: Jquery .select() with .live() QUESTION: How do I make this trigger when I select the text in the input? It has to be live/delegate $('input:text').live('select', function () { alert("selected"); }); Updated to input:text by popular demand. I still do not get an alert message when selecting text in input boxes. ...
[ "select", "jquery", "textinput" ]
1
2
622
2
0
2011-05-31T20:54:08.330000
2011-05-31T21:32:25.710000
6,193,449
6,193,494
How do I actively increment my counter based off of my AJAX results?
I am on the final step of my first ajax project. I've made a thumbs up icon that when pressed increments a column in the database via this code: HERE IS THE HTML AND JQUERY ON THE VIEWABLE PAGE +1 Vote Up! HERE IS THE HIDDEN PHP PAGE IT IS SENT TO So now I just need to be able to dynamically have my counter work when a...
var currentCount = $('#comment_id').text(); $('#comment_id').text(++currentCount);
How do I actively increment my counter based off of my AJAX results? I am on the final step of my first ajax project. I've made a thumbs up icon that when pressed increments a column in the database via this code: HERE IS THE HTML AND JQUERY ON THE VIEWABLE PAGE +1 Vote Up! HERE IS THE HIDDEN PHP PAGE IT IS SENT TO So ...
TITLE: How do I actively increment my counter based off of my AJAX results? QUESTION: I am on the final step of my first ajax project. I've made a thumbs up icon that when pressed increments a column in the database via this code: HERE IS THE HTML AND JQUERY ON THE VIEWABLE PAGE +1 Vote Up! HERE IS THE HIDDEN PHP PAGE...
[ "php", "jquery", "html", "css", "ajax" ]
0
1
2,562
4
0
2011-05-31T20:54:57.140000
2011-05-31T21:00:21.460000
6,193,457
6,194,058
EGID and RGID incorrectly displayed in ps o/p?
I have this: $ ls -l test1.sh -rwxr-sr-x 1 root root 24 2011-05-31 13:27 test1.sh # sgid root $ id uid=1001(abc) gid=1001(abc) groups=4(adm),6(disk),20(dialout),21(fax),24(cdrom),26(tape),29(audio),30(dip),44(video),46(plugdev),104( fuse),106(lpadmin),112(netdev),121(admin),122(sambashare),1001(abc),1002(sbox) But, wh...
Writing safe shell scripts is really hard. Think about $PATH, $IFS,... So, Linux doesn't honour the setuid/setgid bit for shell scripts.
EGID and RGID incorrectly displayed in ps o/p? I have this: $ ls -l test1.sh -rwxr-sr-x 1 root root 24 2011-05-31 13:27 test1.sh # sgid root $ id uid=1001(abc) gid=1001(abc) groups=4(adm),6(disk),20(dialout),21(fax),24(cdrom),26(tape),29(audio),30(dip),44(video),46(plugdev),104( fuse),106(lpadmin),112(netdev),121(admi...
TITLE: EGID and RGID incorrectly displayed in ps o/p? QUESTION: I have this: $ ls -l test1.sh -rwxr-sr-x 1 root root 24 2011-05-31 13:27 test1.sh # sgid root $ id uid=1001(abc) gid=1001(abc) groups=4(adm),6(disk),20(dialout),21(fax),24(cdrom),26(tape),29(audio),30(dip),44(video),46(plugdev),104( fuse),106(lpadmin),11...
[ "linux", "bash" ]
1
3
1,008
2
0
2011-05-31T20:56:06.437000
2011-05-31T21:59:23.390000
6,193,460
6,196,207
How to use RestSharp with OAuth?
I am confused which factory OAuth1Authenticator factory method should I use. I think I should get a consumer secret token (can I get it with RestSharp?), then use OAuth1Authenticator.ForRequestToken, then obtain access token and secret access token(how?), then use OAuth1Authenticator.ForAccessToken and use the return v...
OAuth 1 is multi-step, so you have to use a different static method each step of the way. There's an example here: https://github.com/restsharp/RestSharp/blob/master/test/RestSharp.IntegrationTests/OAuth1Tests.cs
How to use RestSharp with OAuth? I am confused which factory OAuth1Authenticator factory method should I use. I think I should get a consumer secret token (can I get it with RestSharp?), then use OAuth1Authenticator.ForRequestToken, then obtain access token and secret access token(how?), then use OAuth1Authenticator.Fo...
TITLE: How to use RestSharp with OAuth? QUESTION: I am confused which factory OAuth1Authenticator factory method should I use. I think I should get a consumer secret token (can I get it with RestSharp?), then use OAuth1Authenticator.ForRequestToken, then obtain access token and secret access token(how?), then use OAut...
[ "oauth", "restsharp" ]
9
15
20,492
1
0
2011-05-31T20:56:15.940000
2011-06-01T04:15:53.463000
6,193,461
6,193,486
global vars vs local vars
I have a program that constantly calls a function. In my function i use variables that are only used inside of that function. Is it better "Style" to have these variables as global so that they are not constantly being created or better to have them in the function since they are irrelevant for the rest of the program....
What you are doing is correct. You want to avoid global scope variables. Let the compiler or interpreter take care of any memory usage optimization. If you go down the other road you will be in a world of hurt.
global vars vs local vars I have a program that constantly calls a function. In my function i use variables that are only used inside of that function. Is it better "Style" to have these variables as global so that they are not constantly being created or better to have them in the function since they are irrelevant fo...
TITLE: global vars vs local vars QUESTION: I have a program that constantly calls a function. In my function i use variables that are only used inside of that function. Is it better "Style" to have these variables as global so that they are not constantly being created or better to have them in the function since they...
[ "variables", "global-variables", "local-variables" ]
1
2
108
5
0
2011-05-31T20:56:17.670000
2011-05-31T20:59:09.293000
6,193,466
6,215,918
Tomcat Basic Authentication Permissions Issue
I currently have a web service running some basic authentication through Tomcat. I get the login box to pop up fine, and I can log in with accounts I have defined in the tomcat-users.xml file. However, when it comes to defining permissions based on roles, I'm having some issues. Currently, I have three roles: manager, ...
After some more investigation, I discovered that using @RolesAllowed was doing nothing in my code due to the way my web.xml file was configured. I decided to move in the direction of setting authentication by URI path. This is done through modifying the web.xml to allow a subset of users to access each path under separ...
Tomcat Basic Authentication Permissions Issue I currently have a web service running some basic authentication through Tomcat. I get the login box to pop up fine, and I can log in with accounts I have defined in the tomcat-users.xml file. However, when it comes to defining permissions based on roles, I'm having some is...
TITLE: Tomcat Basic Authentication Permissions Issue QUESTION: I currently have a web service running some basic authentication through Tomcat. I get the login box to pop up fine, and I can log in with accounts I have defined in the tomcat-users.xml file. However, when it comes to defining permissions based on roles, ...
[ "java", "authentication", "tomcat", "jersey" ]
2
1
1,546
2
0
2011-05-31T20:56:56.187000
2011-06-02T14:29:54.640000
6,193,473
6,193,569
Webservice sending null in integer fields
I am trying to use a 3rd party webservice. One of the fields that is returned is defined as In the SOAP response they send the field as This is causes the.Net deserializer to throw an exception as the empty xml element is not a valid integer. What is the best way to handle this? I have tried tweaking the wsdl to mark t...
I don't think the.Net deserialiser can cope with this. How about tweaking the definition of SomeField to a string. This way can check for a null, but you would have to do an Int32.Parse to the real value. The accessor could be: void int? GetSomeField() { if (someField == null) return null; return In32.Parse(someField);...
Webservice sending null in integer fields I am trying to use a 3rd party webservice. One of the fields that is returned is defined as In the SOAP response they send the field as This is causes the.Net deserializer to throw an exception as the empty xml element is not a valid integer. What is the best way to handle this...
TITLE: Webservice sending null in integer fields QUESTION: I am trying to use a 3rd party webservice. One of the fields that is returned is defined as In the SOAP response they send the field as This is causes the.Net deserializer to throw an exception as the empty xml element is not a valid integer. What is the best ...
[ ".net", "soap", "soap-client" ]
2
4
4,159
3
0
2011-05-31T20:57:36.563000
2011-05-31T21:07:53.657000
6,193,485
6,199,057
FTPClient corrupts the images while uploading to ftp server on android?
I'm trying to upload images to a FTP server (on my local PC) from Android Phone (HTC Desire HD). Images are going to FTP server but they are corrupted. And the method (ftpClient.storeFile()) throws IOException (Bad File Number) Please help me. This is the corrupted image link: http://imageshack.us/photo/my-images/820/k...
Problem is solved. FTPClient class has "last packet data loss bug". But this was solved with 3.0.1 23.05.2011 release. You can see from detailed explanation about bug: https://issues.apache.org/jira/browse/NET-409 You can download fixed relea https://repository.apache.org/content/repositories/snapshots/commons-net/comm...
FTPClient corrupts the images while uploading to ftp server on android? I'm trying to upload images to a FTP server (on my local PC) from Android Phone (HTC Desire HD). Images are going to FTP server but they are corrupted. And the method (ftpClient.storeFile()) throws IOException (Bad File Number) Please help me. This...
TITLE: FTPClient corrupts the images while uploading to ftp server on android? QUESTION: I'm trying to upload images to a FTP server (on my local PC) from Android Phone (HTC Desire HD). Images are going to FTP server but they are corrupted. And the method (ftpClient.storeFile()) throws IOException (Bad File Number) Pl...
[ "java", "android", "ftp", "ftp-client", "apache-commons-net" ]
7
2
8,379
2
0
2011-05-31T20:59:03.800000
2011-06-01T09:31:45.607000
6,193,492
6,257,347
Gigya service not working in Flex4, though it was working fine in Flex3
I was gigya service to login to my webpage using social services login. Everything was working fine in my flex 3, but when since I have changed my code to flex 4, I am unable to see any gigya services being loaded. My code is below: import c7.config.ServerConfig; import com.adobe.serialization.json.JSON; import com.hu...
The Gigaya Service was not working because of the Spark component. I dont have the reason why spark s:Group is not supporting gigya, but if I keep the flex3 mx:Canvas component to do the job, it works perfectly.
Gigya service not working in Flex4, though it was working fine in Flex3 I was gigya service to login to my webpage using social services login. Everything was working fine in my flex 3, but when since I have changed my code to flex 4, I am unable to see any gigya services being loaded. My code is below: import c7.confi...
TITLE: Gigya service not working in Flex4, though it was working fine in Flex3 QUESTION: I was gigya service to login to my webpage using social services login. Everything was working fine in my flex 3, but when since I have changed my code to flex 4, I am unable to see any gigya services being loaded. My code is belo...
[ "apache-flex", "flex3", "flex4", "gigya" ]
0
0
256
1
0
2011-05-31T20:59:51.870000
2011-06-06T20:00:04.813000
6,193,498
6,193,521
Pythonic way to find maximum value and its index in a list?
If I want the maximum value in a list, I can just write max(List), but what if I also need the index of the maximum value? I can write something like this: maximum=0 for i,value in enumerate(List): if value>maximum: maximum=value index=i But it looks tedious to me. And if I write: List.index(max(List)) Then it will ite...
There are many options, for example: import operator index, value = max(enumerate(my_list), key=operator.itemgetter(1))
Pythonic way to find maximum value and its index in a list? If I want the maximum value in a list, I can just write max(List), but what if I also need the index of the maximum value? I can write something like this: maximum=0 for i,value in enumerate(List): if value>maximum: maximum=value index=i But it looks tedious t...
TITLE: Pythonic way to find maximum value and its index in a list? QUESTION: If I want the maximum value in a list, I can just write max(List), but what if I also need the index of the maximum value? I can write something like this: maximum=0 for i,value in enumerate(List): if value>maximum: maximum=value index=i But ...
[ "python" ]
212
213
440,928
11
0
2011-05-31T21:00:40.980000
2011-05-31T21:03:00.507000
6,193,505
6,193,557
Design choice: Do I want extension methods to throw exceptions on null?
Possible Duplicate: C#: Best practice for validating “this” argument in extension methods I'm ambivalent about a design choice, and would like to hear the opinions of the SO community. The example I bring up here is just one possible case where this design choice has to be made - in reality, there might be many more ca...
Microsoft throws an ArgumentNullException if the collections invoked in LINQ are empty. This is really more a matter of style, but is consistent with the way extension methods are supposed to behave. @m0sa is right though in that you'll get a null reference from your foreach, but I would say check up top and throw Argu...
Design choice: Do I want extension methods to throw exceptions on null? Possible Duplicate: C#: Best practice for validating “this” argument in extension methods I'm ambivalent about a design choice, and would like to hear the opinions of the SO community. The example I bring up here is just one possible case where thi...
TITLE: Design choice: Do I want extension methods to throw exceptions on null? QUESTION: Possible Duplicate: C#: Best practice for validating “this” argument in extension methods I'm ambivalent about a design choice, and would like to hear the opinions of the SO community. The example I bring up here is just one possi...
[ "c#", "null", "extension-methods" ]
7
12
2,063
4
0
2011-05-31T21:01:08.497000
2011-05-31T21:06:52.973000
6,193,506
6,193,675
VS 2010 C++ IntelliSense "a storage class may not be specified here" even though it can?
This is a fairly minor question, but it's annoying me: IntelliSense seems to be convinced that declaring static variables at the function-scope in an if condition is an error, and complains about it. Only it builds just fine, and even the MSDN docs mention it as a legitimate usage. I'd really like to get rid of the wav...
The VC++ compiler allows this as a silent extension (it is not legal C++), but the VC++ IntelliSense engine is based on the EDG compiler frontend, not the VC++ compiler (go figure). So, the IntelliSense error is correct if you're concerned about writing portable code.
VS 2010 C++ IntelliSense "a storage class may not be specified here" even though it can? This is a fairly minor question, but it's annoying me: IntelliSense seems to be convinced that declaring static variables at the function-scope in an if condition is an error, and complains about it. Only it builds just fine, and e...
TITLE: VS 2010 C++ IntelliSense "a storage class may not be specified here" even though it can? QUESTION: This is a fairly minor question, but it's annoying me: IntelliSense seems to be convinced that declaring static variables at the function-scope in an if condition is an error, and complains about it. Only it build...
[ "c++", "visual-studio-2010", "static", "intellisense" ]
3
6
4,665
2
0
2011-05-31T21:01:11.973000
2011-05-31T21:18:36.983000
6,193,513
6,193,676
Trying to implement excanvas but getting errors
I'm trying to implement excanvas so that my script works in IE as well as standards compliant browsers. I'm including jquery, excanvas then my script. I'm creating the canvas element like so: data.canvas = $(document.createElement('canvas')).attr('width', data.fontwidth * 80 + 'px').attr('height', data.fontheight * 25 ...
From the docs: If you have created your canvas element dynamically it will not have the getContext method added to the element. To get it working you need to call initElement on the G_vmlCanvasManager object. var el = document.createElement('canvas'); G_vmlCanvasManager.initElement(el); var ctx = el.getContext('2d');
Trying to implement excanvas but getting errors I'm trying to implement excanvas so that my script works in IE as well as standards compliant browsers. I'm including jquery, excanvas then my script. I'm creating the canvas element like so: data.canvas = $(document.createElement('canvas')).attr('width', data.fontwidth *...
TITLE: Trying to implement excanvas but getting errors QUESTION: I'm trying to implement excanvas so that my script works in IE as well as standards compliant browsers. I'm including jquery, excanvas then my script. I'm creating the canvas element like so: data.canvas = $(document.createElement('canvas')).attr('width'...
[ "javascript", "jquery", "excanvas" ]
3
3
3,222
2
0
2011-05-31T21:01:38.823000
2011-05-31T21:18:38.620000
6,193,523
6,193,562
MySQL Query not printing out data
I'm trying to retrieve some data from my table only for some reason I cant get it to return anything. userID().") or die(mysql_error())"); $arr_uemail = mysql_fetch_array($data); while($arr_uemail = mysql_fetch_array($data)) { echo $arr_uemail['email']; } /*For Debugging purposes echo $usersClass->userID();*/?> Can ...
There are a lot of errors. The first is $curr_uemail = mysql_query("select * from produgg_users where produgg_users.id = ".$usersClass->userID()) or die(whoops); The second you shouldn't call mysql_fetch_assoc before while, because if the result contains only 1 Record it would never enter in the while The final code is...
MySQL Query not printing out data I'm trying to retrieve some data from my table only for some reason I cant get it to return anything. userID().") or die(mysql_error())"); $arr_uemail = mysql_fetch_array($data); while($arr_uemail = mysql_fetch_array($data)) { echo $arr_uemail['email']; } /*For Debugging purposes ec...
TITLE: MySQL Query not printing out data QUESTION: I'm trying to retrieve some data from my table only for some reason I cant get it to return anything. userID().") or die(mysql_error())"); $arr_uemail = mysql_fetch_array($data); while($arr_uemail = mysql_fetch_array($data)) { echo $arr_uemail['email']; } /*For Deb...
[ "php", "mysql" ]
0
1
121
2
0
2011-05-31T21:03:04.250000
2011-05-31T21:07:08.413000
6,193,525
6,193,543
jQuery: Get all input vals within a table and serialize
Given the following table structure, how would I get all the input vals within a table when the.button is clicked? This is the jquery I have so far: $('.button').click(function() { alert($(this).parent('table').('input').serialize()); }); The function isn't working though, it's not finding the input in the table I gues...
table is not the parent of the button, td is... try: $(this).closest('table').find('input').serialize()
jQuery: Get all input vals within a table and serialize Given the following table structure, how would I get all the input vals within a table when the.button is clicked? This is the jquery I have so far: $('.button').click(function() { alert($(this).parent('table').('input').serialize()); }); The function isn't workin...
TITLE: jQuery: Get all input vals within a table and serialize QUESTION: Given the following table structure, how would I get all the input vals within a table when the.button is clicked? This is the jquery I have so far: $('.button').click(function() { alert($(this).parent('table').('input').serialize()); }); The fun...
[ "jquery", "serialization" ]
3
8
15,842
2
0
2011-05-31T21:03:08.980000
2011-05-31T21:05:26.047000
6,193,526
6,193,547
Are text editors that use Markdown by detault safer than other text editors
I'm familiar with CKEditor which converts bold text to its HTML tags. Other editors (like the editor on this site) use Markdown formatting and I see bold text wrapped in stars instead of HTML like this **text**. Sp does this mean that using a markdown editor protects you by default from any XSS in that user input? I th...
According to this: http://michelf.com/weblog/2010/markdown-and-xss/ It doesn't escape XSS on default
Are text editors that use Markdown by detault safer than other text editors I'm familiar with CKEditor which converts bold text to its HTML tags. Other editors (like the editor on this site) use Markdown formatting and I see bold text wrapped in stars instead of HTML like this **text**. Sp does this mean that using a m...
TITLE: Are text editors that use Markdown by detault safer than other text editors QUESTION: I'm familiar with CKEditor which converts bold text to its HTML tags. Other editors (like the editor on this site) use Markdown formatting and I see bold text wrapped in stars instead of HTML like this **text**. Sp does this m...
[ "php", "security", "xss", "ckeditor", "markdown" ]
1
3
555
2
0
2011-05-31T21:03:16.467000
2011-05-31T21:05:35.483000
6,193,528
6,193,847
using canvas.drawcircle to mark a point in google-maps android
I want to mark certain points in google maps,I read http://developer.android.com/resources/tutorials/views/hello-mapview.html But the problem which I am facing is that, this method is useful when we want to show a image on top of google maps, however I want a circle which may have any given color. Also I want to show a...
To draw a circle, you should create your custom class that extends Overlay, and override the draw method @Override public void draw(Canvas canvas, MapView mapview, boolean shadow) { super.draw(canvas, mapview, shadow); paint = new Paint(); paint.setAntiAlias(true); paint.setARGB(80,0,0,255); canvas.drawCircle( x,y,radi...
using canvas.drawcircle to mark a point in google-maps android I want to mark certain points in google maps,I read http://developer.android.com/resources/tutorials/views/hello-mapview.html But the problem which I am facing is that, this method is useful when we want to show a image on top of google maps, however I want...
TITLE: using canvas.drawcircle to mark a point in google-maps android QUESTION: I want to mark certain points in google maps,I read http://developer.android.com/resources/tutorials/views/hello-mapview.html But the problem which I am facing is that, this method is useful when we want to show a image on top of google ma...
[ "java", "android", "google-maps", "android-canvas" ]
0
0
1,586
1
0
2011-05-31T21:03:27.717000
2011-05-31T21:35:24.577000
6,193,536
6,193,710
Sorting a csv file in Python with sorted() returns values in programmer DESC order, not time DESC order
I'm not doing anything overly complex I believe. I'm presorting a large csv data file because it is full of data that arrives in random time order. The index is correct, but the return formatting is off. sortedList=sorted(reader,key=operator.itemgetter(1)) So instead of sorting like [-100 -10 -1 0 10 100 5000 6000]; I ...
Just from the output you see there, it looks like these are being sorted as strings rather than as numbers. So you could do: sortedList=sorted(reader, key=lambda t: int( t[1] )) or sortedList=sorted(reader, key=lambda t: float( t[1] )) Or better, try to ensure that the sequence reader gets populated with numbers, rathe...
Sorting a csv file in Python with sorted() returns values in programmer DESC order, not time DESC order I'm not doing anything overly complex I believe. I'm presorting a large csv data file because it is full of data that arrives in random time order. The index is correct, but the return formatting is off. sortedList=s...
TITLE: Sorting a csv file in Python with sorted() returns values in programmer DESC order, not time DESC order QUESTION: I'm not doing anything overly complex I believe. I'm presorting a large csv data file because it is full of data that arrives in random time order. The index is correct, but the return formatting is...
[ "python", "numerical", "sorting" ]
2
3
2,811
5
0
2011-05-31T21:04:53.613000
2011-05-31T21:21:38.900000
6,193,537
6,194,049
Are there any tools for automatically generating Java code for screen scraping
Is there a way of browsing a web site through a proxy and autogenerating Java code (using HtmlClient) that can play back the requests?
Not sure what your code generation needs are. Have you looked at Apache JMeter that records test cases through a proxy and also provides interfaces for you to generate your own data.
Are there any tools for automatically generating Java code for screen scraping Is there a way of browsing a web site through a proxy and autogenerating Java code (using HtmlClient) that can play back the requests?
TITLE: Are there any tools for automatically generating Java code for screen scraping QUESTION: Is there a way of browsing a web site through a proxy and autogenerating Java code (using HtmlClient) that can play back the requests? ANSWER: Not sure what your code generation needs are. Have you looked at Apache JMeter ...
[ "java", "proxy", "screen-scraping", "auto-generate" ]
0
0
175
2
0
2011-05-31T21:05:00.073000
2011-05-31T21:57:35.027000
6,193,538
6,193,678
From for loops to numpy dot implementation
N=100 reliab=zeros((N,N)) for i in range(N): for j in range(N): if random() < 0.6: reliab[i,j] = 1 else: reliab[i,j] = 0 As in my code this matrix filling is recalled a huge number of times, these for loops should be changed with a dot product...but I dunno how to do it... Anyone willing to help me?
I'm not sure I understand your problem completely, but the following line should be doing the same thing as your code: reliab = numpy.int32(numpy.random.rand(N,N) < 0.6)
From for loops to numpy dot implementation N=100 reliab=zeros((N,N)) for i in range(N): for j in range(N): if random() < 0.6: reliab[i,j] = 1 else: reliab[i,j] = 0 As in my code this matrix filling is recalled a huge number of times, these for loops should be changed with a dot product...but I dunno how to do it... ...
TITLE: From for loops to numpy dot implementation QUESTION: N=100 reliab=zeros((N,N)) for i in range(N): for j in range(N): if random() < 0.6: reliab[i,j] = 1 else: reliab[i,j] = 0 As in my code this matrix filling is recalled a huge number of times, these for loops should be changed with a dot product...but I dunn...
[ "python", "loops", "numpy" ]
1
4
266
2
0
2011-05-31T21:05:05.327000
2011-05-31T21:18:42.823000
6,193,541
6,193,603
C char pointer vs pointer to char array, increment dynamic allocation
I am new to C, and I am having difficulty understanding the reason why the block of code below is not working. #include #include int main() { char *src = "http://localhost"; /* THIS WORKS char scheme[10]; char *dp = scheme; */ //DOESN'T WORK char *dp = malloc(10); while (*src!= ':') { *dp = *src; src++; dp++; } *dp ...
You are changing dp inside the loop dp = malloc(10); let's say dp has the value 0x42000000 while () { dp++; } let's say the loop went 4 times, so dp has the value 0x42000004 *dp = 0; now you put a null character at the address pointed to by dp puts(dp); and then you try to print that null:) Save dp and print the saved ...
C char pointer vs pointer to char array, increment dynamic allocation I am new to C, and I am having difficulty understanding the reason why the block of code below is not working. #include #include int main() { char *src = "http://localhost"; /* THIS WORKS char scheme[10]; char *dp = scheme; */ //DOESN'T WORK char *...
TITLE: C char pointer vs pointer to char array, increment dynamic allocation QUESTION: I am new to C, and I am having difficulty understanding the reason why the block of code below is not working. #include #include int main() { char *src = "http://localhost"; /* THIS WORKS char scheme[10]; char *dp = scheme; */ //D...
[ "c" ]
6
10
1,920
4
0
2011-05-31T21:05:21.270000
2011-05-31T21:10:21.257000
6,193,556
6,193,656
How do Python properties work?
I've been successfully using Python properties, but I don't see how they could work. If I dereference a property outside of a class, I just get an object of type property: @property def hello(): return "Hello, world!" hello # But if I put a property in a class, the behavior is very different: class Foo(object): @prope...
As others have noted, they use a language feature called descriptors. The reason that the actual property object is returned when you access it via a class Foo.hello lies in how the property implements the __get__(self, instance, owner) special method: If a descriptor is accessed on an instance, then that instance is p...
How do Python properties work? I've been successfully using Python properties, but I don't see how they could work. If I dereference a property outside of a class, I just get an object of type property: @property def hello(): return "Hello, world!" hello # But if I put a property in a class, the behavior is very diffe...
TITLE: How do Python properties work? QUESTION: I've been successfully using Python properties, but I don't see how they could work. If I dereference a property outside of a class, I just get an object of type property: @property def hello(): return "Hello, world!" hello # But if I put a property in a class, the beha...
[ "python", "properties" ]
98
66
63,734
4
0
2011-05-31T21:06:35.783000
2011-05-31T21:15:59.150000
6,193,558
6,193,715
.net section running real slow
Update: The answers from Andrew and Conrad were both equally helpful. The easy fix for the timing issue fixed the problem, and caching the bigger object references instead of re-building them every time removed the source of the problem. Thanks for the input, guys. I'm working with a c#.NET API and for some reason the ...
Is there a different RRD file for each tag in your tagList? In your pseudo code you open each file N number of times. (You stated there is only 10 objects in the list thought.) Then you perform an update. I can only assume that you dispose your RRD file after you have updated it. If you do not you are keeping reference...
.net section running real slow Update: The answers from Andrew and Conrad were both equally helpful. The easy fix for the timing issue fixed the problem, and caching the bigger object references instead of re-building them every time removed the source of the problem. Thanks for the input, guys. I'm working with a c#.N...
TITLE: .net section running real slow QUESTION: Update: The answers from Andrew and Conrad were both equally helpful. The easy fix for the timing issue fixed the problem, and caching the bigger object references instead of re-building them every time removed the source of the problem. Thanks for the input, guys. I'm w...
[ "c#", ".net", "performance" ]
0
1
156
3
0
2011-05-31T21:06:53.253000
2011-05-31T21:21:52.420000
6,193,560
6,193,729
Can you Host Windows Apps Online?
Can you host demos of open source apps online, similar to how http://php.opensourcecms.com/ does for CMSs? For example, could you host a demo of Open Office for people to try out online? Maybe by connecting to a server that has Windows 7 installed or some Windows 7 simulator. How would you do that if you could?
It would certainly be possible, using something like a combination of remote desktop and virtual servers, however I haven't seen any solution like that. The main reason for that is of course that it would require a lot of hardware. While a web server can handle thousands of concurrent users, a server running virtual re...
Can you Host Windows Apps Online? Can you host demos of open source apps online, similar to how http://php.opensourcecms.com/ does for CMSs? For example, could you host a demo of Open Office for people to try out online? Maybe by connecting to a server that has Windows 7 installed or some Windows 7 simulator. How would...
TITLE: Can you Host Windows Apps Online? QUESTION: Can you host demos of open source apps online, similar to how http://php.opensourcecms.com/ does for CMSs? For example, could you host a demo of Open Office for people to try out online? Maybe by connecting to a server that has Windows 7 installed or some Windows 7 si...
[ "windows", "open-source" ]
0
0
524
2
0
2011-05-31T21:06:59.367000
2011-05-31T21:23:19.483000
6,193,567
6,194,743
Url mapping to a plugin view
What is the best, or the preferred way to map an url to a view that is within a plugin installed in a grails app? The application has its own views, however, there is a view that is directly connected to the plugin and I would like to be able to access it. As far as I can see, there is no way to directly map the view i...
As far I know (I just read the docs and did some testing), it is not possible to map directly to a view in a plugin unless there is a controller that can forward to it. Plugin controllers are generally available the same way your application's controllers are available. To get around this you can just copy the view int...
Url mapping to a plugin view What is the best, or the preferred way to map an url to a view that is within a plugin installed in a grails app? The application has its own views, however, there is a view that is directly connected to the plugin and I would like to be able to access it. As far as I can see, there is no w...
TITLE: Url mapping to a plugin view QUESTION: What is the best, or the preferred way to map an url to a view that is within a plugin installed in a grails app? The application has its own views, however, there is a view that is directly connected to the plugin and I would like to be able to access it. As far as I can ...
[ "grails", "view", "grails-plugin", "url-mapping" ]
0
0
824
2
0
2011-05-31T21:07:36.107000
2011-05-31T23:35:35.860000
6,193,574
6,193,783
Save Javascript objects in sessionStorage
SessionStorage and LocalStorage allows to save key/value pairs in a web browser. The value must be a string, and save js objects is not trivial. var user = {'name':'John'}; sessionStorage.setItem('user', user); var obj = sessionStorage.user; // obj='[object Object]' Not an object Nowadays, you can avoid this limitation...
Either you can use the accessors provided by the Web Storage API or you could write a wrapper/adapter. From your stated issue with defineGetter/defineSetter is sounds like writing a wrapper/adapter is too much work for you. I honestly don't know what to tell you. Maybe you could reevaluate your opinion of what is a "ri...
Save Javascript objects in sessionStorage SessionStorage and LocalStorage allows to save key/value pairs in a web browser. The value must be a string, and save js objects is not trivial. var user = {'name':'John'}; sessionStorage.setItem('user', user); var obj = sessionStorage.user; // obj='[object Object]' Not an obje...
TITLE: Save Javascript objects in sessionStorage QUESTION: SessionStorage and LocalStorage allows to save key/value pairs in a web browser. The value must be a string, and save js objects is not trivial. var user = {'name':'John'}; sessionStorage.setItem('user', user); var obj = sessionStorage.user; // obj='[object Ob...
[ "javascript", "session-storage" ]
195
23
359,667
10
0
2011-05-31T21:08:05.843000
2011-05-31T21:28:41.743000
6,193,589
6,200,306
How can I put a floating div to the bottom of the page?
I have a web page with a "header", a content with two columns and a "footer". The content left column or "contentinfo" has variable size because it depends on the information loaded. The right column or "sidebar" has two different divs in it, one with a "menu" and other with "credits". Something like: You can see a ske...
¡I made it! It is a bit amateurish but it works: I put the "credits" under the "footer" with a height:100px; and a position:absolute; top:-100px; In the side bar i added a "slot" empty div with height:100px. In that way I avoid collisions. You can see it in http://blog.tomtucker.cz.cc The HTML: Header Content Menu Slot...
How can I put a floating div to the bottom of the page? I have a web page with a "header", a content with two columns and a "footer". The content left column or "contentinfo" has variable size because it depends on the information loaded. The right column or "sidebar" has two different divs in it, one with a "menu" and...
TITLE: How can I put a floating div to the bottom of the page? QUESTION: I have a web page with a "header", a content with two columns and a "footer". The content left column or "contentinfo" has variable size because it depends on the information loaded. The right column or "sidebar" has two different divs in it, one...
[ "html", "positioning", "css-float" ]
0
2
1,165
1
0
2011-05-31T21:09:24.797000
2011-06-01T11:19:37.680000
6,193,597
6,193,630
Where does OCUnit store NSUserDefaults?
I read the question Easy way to see saved NSUserDefaults? I found the.plist file for the app, but where's the one for the testing bundle?
It seems that OCUnit doesn't store NSUserDefaults persistently but rather in memory. But, I could be wrong.
Where does OCUnit store NSUserDefaults? I read the question Easy way to see saved NSUserDefaults? I found the.plist file for the app, but where's the one for the testing bundle?
TITLE: Where does OCUnit store NSUserDefaults? QUESTION: I read the question Easy way to see saved NSUserDefaults? I found the.plist file for the app, but where's the one for the testing bundle? ANSWER: It seems that OCUnit doesn't store NSUserDefaults persistently but rather in memory. But, I could be wrong.
[ "nsuserdefaults", "ocunit", "sentestingkit" ]
1
1
1,180
3
0
2011-05-31T21:10:04.500000
2011-05-31T21:12:55.477000
6,193,599
6,193,636
Prepared SELECT statement in .Net
I can't understand what I am doing wrong, I can't seem to SELECT with a prepared statement. However I can INSERT with a prepared statement. MySqlCommand cmd = new MySqlCommand("SELECT * FROM code_post WHERE name =?postRequired LIMIT 1", dbcon); cmd.Parameters.Add(new MySqlParameter("?postRequired", requestString)); cmd...
To fill a DataSet you will need a DataAdapter. Try this: MySqlCommand cmd = new MySqlCommand("SELECT * FROM code_post WHERE name =?postRequired LIMIT 1", dbcon); cmd.Parameters.Add(new MySqlParameter("?postRequired", requestString)); cmd.ExecuteNonQuery(); DataSet ds = new DataSet(); MySqlDataAdapter dAdap = new MySql...
Prepared SELECT statement in .Net I can't understand what I am doing wrong, I can't seem to SELECT with a prepared statement. However I can INSERT with a prepared statement. MySqlCommand cmd = new MySqlCommand("SELECT * FROM code_post WHERE name =?postRequired LIMIT 1", dbcon); cmd.Parameters.Add(new MySqlParameter("?p...
TITLE: Prepared SELECT statement in .Net QUESTION: I can't understand what I am doing wrong, I can't seem to SELECT with a prepared statement. However I can INSERT with a prepared statement. MySqlCommand cmd = new MySqlCommand("SELECT * FROM code_post WHERE name =?postRequired LIMIT 1", dbcon); cmd.Parameters.Add(new ...
[ "c#", "mysql", "select", "prepared-statement" ]
2
5
6,719
2
0
2011-05-31T21:10:06.843000
2011-05-31T21:13:43.827000
6,193,607
6,193,661
Cannot find direct.h
For some reason when I try to compile my code, I get this error: fatal error: direct.h: No such file or directory compilation terminated. I'm on linux using g++ (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7)
direct.h is part of the Digital Mars compiler, not gcc. Most of its functions have similar names on linux that's posix standarized. Read the manpage for e.g. getcwd, rmdir, mkdir,or clarify your question as to which functions you need. As a start, just remove the include and see what other errors you are getting, and w...
Cannot find direct.h For some reason when I try to compile my code, I get this error: fatal error: direct.h: No such file or directory compilation terminated. I'm on linux using g++ (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7)
TITLE: Cannot find direct.h QUESTION: For some reason when I try to compile my code, I get this error: fatal error: direct.h: No such file or directory compilation terminated. I'm on linux using g++ (GCC) 4.6.0 20110509 (Red Hat 4.6.0-7) ANSWER: direct.h is part of the Digital Mars compiler, not gcc. Most of its func...
[ "gcc", "compiler-errors" ]
7
7
37,976
3
0
2011-05-31T21:10:39.730000
2011-05-31T21:16:40.040000
6,193,609
6,193,719
Using JQuery how do you create a control the name of a class?
I'm using append in the following way: $('#city').append(' ' + value['name'] + '. ' + value['city'] + ', ' + value['state'] +' ' + value['zip'] + ' ' + ' '); Which results in something like this: Antone Stark. Doyletown, Rhode Island 43467 How do you use value['state'] to name the class?
If the states were two letter codes, you could do this: $('#city').append(' ' + value['name'] + '. ' + value['city'] + ', ' + value['state'] +' ' + value['zip'] + ' ' + ' '); However, classes are space-separated meaning they are treated as separate when split up by spaces. So if you add something there with a space (li...
Using JQuery how do you create a control the name of a class? I'm using append in the following way: $('#city').append(' ' + value['name'] + '. ' + value['city'] + ', ' + value['state'] +' ' + value['zip'] + ' ' + ' '); Which results in something like this: Antone Stark. Doyletown, Rhode Island 43467 How do you use val...
TITLE: Using JQuery how do you create a control the name of a class? QUESTION: I'm using append in the following way: $('#city').append(' ' + value['name'] + '. ' + value['city'] + ', ' + value['state'] +' ' + value['zip'] + ' ' + ' '); Which results in something like this: Antone Stark. Doyletown, Rhode Island 43467 ...
[ "javascript", "jquery", "html" ]
0
1
130
2
0
2011-05-31T21:11:14.860000
2011-05-31T21:22:02.177000
6,193,624
6,212,165
Syntax error (missing operator) in query expression 'System.Byte[]'
Hi i was using stored procedure in SQL Server to pass parameters to the query, but now I'm changing my database to ms access and it's my first time to deal with. how can i pass byte[] to sql query? bacause i got this error Syntax error (missing operator) in query expression 'System.Byte[]'. this is my code public stati...
result is still 0; i know the problem where it was. if the connection is closed the query will be executed successfully, but if it is opend it will not be executed due to this condition. if (con.State!= ConnectionState.Open) { con.Open(); result = cmd.ExecuteNonQuery(); con.Close(); } it must be if (con.State!= Connect...
Syntax error (missing operator) in query expression 'System.Byte[]' Hi i was using stored procedure in SQL Server to pass parameters to the query, but now I'm changing my database to ms access and it's my first time to deal with. how can i pass byte[] to sql query? bacause i got this error Syntax error (missing operato...
TITLE: Syntax error (missing operator) in query expression 'System.Byte[]' QUESTION: Hi i was using stored procedure in SQL Server to pass parameters to the query, but now I'm changing my database to ms access and it's my first time to deal with. how can i pass byte[] to sql query? bacause i got this error Syntax erro...
[ "ms-access", "syntax-error", "oledbexception" ]
0
0
2,102
2
0
2011-05-31T21:12:37.897000
2011-06-02T08:29:54.500000
6,193,625
6,193,663
ObservableCollection better than ObjectSet
Why is it better (in WPF, C#, Entity Framework) to bind ListBox to an ObservableCollection created upon the ObjectSet (from Entity Framework) rather than binding to ObjectSet directly? One more question: When I bind ListBox to ObservableCollection, any additions to the collection updates ListBox. Great. But ObservableC...
ObservableCollection implements INotifyPropertyChanged as well as INotifyCollectionChanged, both of which WPF uses to rebind elements to the UI. Thus, you could add an item to the ObservableCollection and immediately the UI would update with no code interaction from you. ObjectSet implements neither, and so doesnt get ...
ObservableCollection better than ObjectSet Why is it better (in WPF, C#, Entity Framework) to bind ListBox to an ObservableCollection created upon the ObjectSet (from Entity Framework) rather than binding to ObjectSet directly? One more question: When I bind ListBox to ObservableCollection, any additions to the collect...
TITLE: ObservableCollection better than ObjectSet QUESTION: Why is it better (in WPF, C#, Entity Framework) to bind ListBox to an ObservableCollection created upon the ObjectSet (from Entity Framework) rather than binding to ObjectSet directly? One more question: When I bind ListBox to ObservableCollection, any additi...
[ "c#", ".net", "wpf", "entity-framework", "data-binding" ]
5
6
4,338
2
0
2011-05-31T21:12:39.763000
2011-05-31T21:16:51.347000
6,193,626
6,195,592
render a page to a file with rails
I have a background process that loads a Rails 3.0 environment. I would like to have that process refresh cached pages instead of having to wait for them to be loaded the first time. How could I take a set of params push it through the render pipeline to the point where I could direct the plain html to a file?
Rails 3.0 is a Rack Application. You can use a Rack Middleware to do it. Take a look a Rack::Deflater::GzipStream for a code sample and Rails on Rack for the RoR specific parts.
render a page to a file with rails I have a background process that loads a Rails 3.0 environment. I would like to have that process refresh cached pages instead of having to wait for them to be loaded the first time. How could I take a set of params push it through the render pipeline to the point where I could direct...
TITLE: render a page to a file with rails QUESTION: I have a background process that loads a Rails 3.0 environment. I would like to have that process refresh cached pages instead of having to wait for them to be loaded the first time. How could I take a set of params push it through the render pipeline to the point wh...
[ "ruby", "ruby-on-rails-3", "caching" ]
1
1
161
1
0
2011-05-31T21:12:41.113000
2011-06-01T02:26:30.683000
6,193,628
6,193,886
How do I find Queue Manager name when Queues are created via Websphere 6.1 running in RAD 7?
I am new to Websphere, and at this client site, we are running an older version of Websphere in an older version of RAD. I used a python script to define a queue factory and some queues, using a script provided by another individual at the site. However, there was not mention of a queue manager in the script. It appear...
There are about 3 or 4 questions here. Let's see if I can address all of them. First, creating administered objects is completely separate from defining queues in the queue manager. Typically, the WebSphere MQ admin defines the queues and topics, then provides the host, port, channel, QMgr and queue/topic names to the ...
How do I find Queue Manager name when Queues are created via Websphere 6.1 running in RAD 7? I am new to Websphere, and at this client site, we are running an older version of Websphere in an older version of RAD. I used a python script to define a queue factory and some queues, using a script provided by another indiv...
TITLE: How do I find Queue Manager name when Queues are created via Websphere 6.1 running in RAD 7? QUESTION: I am new to Websphere, and at this client site, we are running an older version of Websphere in an older version of RAD. I used a python script to define a queue factory and some queues, using a script provide...
[ "websphere", "ibm-mq", "websphere-6.1", "mq-visual-edit" ]
1
2
6,746
1
0
2011-05-31T21:12:43.720000
2011-05-31T21:39:55.190000
6,193,629
6,193,650
Formatting Textbox into MM/YYYY
I have a textbox in my web forms (ASP.NET Web Forms) which I want to show something like this: MM/YYYY I want this "/" in the middle when user is entering the month and year. How should I do this on C#?
Take a look at the MaskedTextbox class (for Windows Forms anyway... I see you've now specified it as Web Forms).
Formatting Textbox into MM/YYYY I have a textbox in my web forms (ASP.NET Web Forms) which I want to show something like this: MM/YYYY I want this "/" in the middle when user is entering the month and year. How should I do this on C#?
TITLE: Formatting Textbox into MM/YYYY QUESTION: I have a textbox in my web forms (ASP.NET Web Forms) which I want to show something like this: MM/YYYY I want this "/" in the middle when user is entering the month and year. How should I do this on C#? ANSWER: Take a look at the MaskedTextbox class (for Windows Forms ...
[ "c#", "string", "webforms", "textbox" ]
4
3
2,116
4
0
2011-05-31T21:12:49.347000
2011-05-31T21:15:11.300000
6,193,633
6,194,169
Overriding addChild() at root?
I've seen methods for overriding addChild inside of movieclips, but can you do it at the upper-most root level? As in, overriding it on the main timeline.
Here's what you need to do. First create a document class for your FLA. In this case, I've called it Main.as: package { import flash.display.DisplayObject; import flash.display.MovieClip; public class Main extends MovieClip { public function Main() { var spr: MovieClip = new MovieClip(); spr.graphics.beginFill(0x66666...
Overriding addChild() at root? I've seen methods for overriding addChild inside of movieclips, but can you do it at the upper-most root level? As in, overriding it on the main timeline.
TITLE: Overriding addChild() at root? QUESTION: I've seen methods for overriding addChild inside of movieclips, but can you do it at the upper-most root level? As in, overriding it on the main timeline. ANSWER: Here's what you need to do. First create a document class for your FLA. In this case, I've called it Main.a...
[ "flash", "actionscript-3", "overriding", "root", "addchild" ]
0
1
995
3
0
2011-05-31T21:13:17.263000
2011-05-31T22:10:28.723000
6,193,644
6,193,748
reloadRowsAtIndexPaths stops loading UITableViewCells?
I'm trying to incorporate favicons into a UITableView. The table basically fetches websites, and I want to display the favicon onto the right. I put a placeholder icon at the right initially and let a function in the background run. This function takes the URL of the website, parses it and attempts to find the favicon....
It is not entirely clear if you are accessing and modifying your UI from the separate thread. If so, this is the cause of your unreliability. UIKit can be accessed only from the main thread. If you are interested you will find many questions on S.O. and many discussions on the web. There is a workaround, if you want to...
reloadRowsAtIndexPaths stops loading UITableViewCells? I'm trying to incorporate favicons into a UITableView. The table basically fetches websites, and I want to display the favicon onto the right. I put a placeholder icon at the right initially and let a function in the background run. This function takes the URL of t...
TITLE: reloadRowsAtIndexPaths stops loading UITableViewCells? QUESTION: I'm trying to incorporate favicons into a UITableView. The table basically fetches websites, and I want to display the favicon onto the right. I put a placeholder icon at the right initially and let a function in the background run. This function ...
[ "objective-c", "ios", "tableview" ]
0
2
901
3
0
2011-05-31T21:14:34.057000
2011-05-31T21:25:05.537000
6,193,652
6,193,680
How do you eliminate an all divs of a child class but one?
I have the following DOM structure: Delete Selected Delete How do you save city and div class b, but delete div class a and c if you know that the user has selected "b" (you know this using logs your console.log(variable)) Basically what JQuery method would you use to do this and how?
$('.city').find('.a,.c').remove(); Or $('.city div:not(.b)').remove(); With class variable: var selectedClass = 'b'; $('.city div').not('.' + selectedClass).remove();
How do you eliminate an all divs of a child class but one? I have the following DOM structure: Delete Selected Delete How do you save city and div class b, but delete div class a and c if you know that the user has selected "b" (you know this using logs your console.log(variable)) Basically what JQuery method would you...
TITLE: How do you eliminate an all divs of a child class but one? QUESTION: I have the following DOM structure: Delete Selected Delete How do you save city and div class b, but delete div class a and c if you know that the user has selected "b" (you know this using logs your console.log(variable)) Basically what JQuer...
[ "javascript", "jquery", "html" ]
2
1
73
6
0
2011-05-31T21:15:42.847000
2011-05-31T21:18:49.447000
6,193,654
6,193,665
How do I pass a function as a parameter to run multiple times?
I don't understand function closures and anonymous functions very well. What I'm trying to do is create a function that runs the inputted function randomly based on a dice roll: repeat(1,6,foobar()); function repeat(numDie, dieType, func){ var total = 0; for (var i=0; i < numDie; i++){ var dieRoll = Math.floor(Math.ra...
By writing foobar(), you're calling foobar and passing its return value. Remove the parentheses to pass the function instead of calling it.
How do I pass a function as a parameter to run multiple times? I don't understand function closures and anonymous functions very well. What I'm trying to do is create a function that runs the inputted function randomly based on a dice roll: repeat(1,6,foobar()); function repeat(numDie, dieType, func){ var total = 0; f...
TITLE: How do I pass a function as a parameter to run multiple times? QUESTION: I don't understand function closures and anonymous functions very well. What I'm trying to do is create a function that runs the inputted function randomly based on a dice roll: repeat(1,6,foobar()); function repeat(numDie, dieType, func)...
[ "javascript", "function", "parameters" ]
2
8
343
2
0
2011-05-31T21:15:49.417000
2011-05-31T21:16:56.227000
6,193,668
6,193,688
iPhone - iAds at top and bottom of the screen
Is this possible to put iAds at the top and bottom of the screen at the same time?
Yes, it is possible. Just create multiple instances of the iAD banner object and then manage them like regular.
iPhone - iAds at top and bottom of the screen Is this possible to put iAds at the top and bottom of the screen at the same time?
TITLE: iPhone - iAds at top and bottom of the screen QUESTION: Is this possible to put iAds at the top and bottom of the screen at the same time? ANSWER: Yes, it is possible. Just create multiple instances of the iAD banner object and then manage them like regular.
[ "iphone", "objective-c", "iad" ]
1
1
277
1
0
2011-05-31T21:17:56.110000
2011-05-31T21:19:16.357000
6,193,682
6,193,879
phpmailer column loop & skip NULLs
I am trying to loop through 5 columns in a row to send an email with PHPmailer. Each row can contain up to 5 email addresses but not all do. My loop method works but if a NULL exists where no email address is available, the email does not get sent. How can I get my script to ignore NULLs. Also, is there a better loop p...
You can solve this by eliminating the NULLs in your MySQL query from the server. Try this MySQL query instead, which should eliminate the NULLs: SELECT * FROM ( SELECT Email1 as email FROM $table2 where IPaddress='000.000.000.000' UNION SELECT Email2 as email FROM $table2 where IPaddress='000.000.000.000' UNION SELECT ...
phpmailer column loop & skip NULLs I am trying to loop through 5 columns in a row to send an email with PHPmailer. Each row can contain up to 5 email addresses but not all do. My loop method works but if a NULL exists where no email address is available, the email does not get sent. How can I get my script to ignore NU...
TITLE: phpmailer column loop & skip NULLs QUESTION: I am trying to loop through 5 columns in a row to send an email with PHPmailer. Each row can contain up to 5 email addresses but not all do. My loop method works but if a NULL exists where no email address is available, the email does not get sent. How can I get my s...
[ "phpmailer" ]
0
1
464
1
0
2011-05-31T21:18:54.103000
2011-05-31T21:39:21.503000
6,193,683
6,194,033
Ruby On Rails Database
Whenever I run the command rvmsudo rake db:migrate (I need to use rvmsudo because I'm using rvm), the sqlite3 files generated are owned by root. ls -l db/*.sqlite3 Because of this, I keep on getting a SQLite3 Read Only Error whenever I try to do anything to the database, and I have to manually enter the command: sudo c...
Did you install RVM as root, and if so, is there a reason it wasn't installed as your normal (less-privileged) user? I use RVM daily, on a number of machines, and haven't had to install RVM as root.
Ruby On Rails Database Whenever I run the command rvmsudo rake db:migrate (I need to use rvmsudo because I'm using rvm), the sqlite3 files generated are owned by root. ls -l db/*.sqlite3 Because of this, I keep on getting a SQLite3 Read Only Error whenever I try to do anything to the database, and I have to manually en...
TITLE: Ruby On Rails Database QUESTION: Whenever I run the command rvmsudo rake db:migrate (I need to use rvmsudo because I'm using rvm), the sqlite3 files generated are owned by root. ls -l db/*.sqlite3 Because of this, I keep on getting a SQLite3 Read Only Error whenever I try to do anything to the database, and I h...
[ "ruby-on-rails", "ruby-on-rails-3", "sqlite3-ruby" ]
0
2
138
1
0
2011-05-31T21:18:54.377000
2011-05-31T21:55:50.960000
6,193,692
6,193,773
Understanding ECMAScript implicit semicolons and whitespace parsing
I've seen, very often in fact, this cited as why to use K&R style when writing ECMAScript. function foo () { return { foo: 1 }; } That doesn't work in ECMAScript or Javascript: implicit-semicolon addition results in the function returning undefined. However I see this all the time too function bar () { var a = "BAR"; r...
Because the syntax doesn't work with an implicit semicolon at the end of the line. If you add the semicolon: function bar () { var a = "BAR"; return a;.toLowerCase(); } you would get a syntax error on the next line.
Understanding ECMAScript implicit semicolons and whitespace parsing I've seen, very often in fact, this cited as why to use K&R style when writing ECMAScript. function foo () { return { foo: 1 }; } That doesn't work in ECMAScript or Javascript: implicit-semicolon addition results in the function returning undefined. Ho...
TITLE: Understanding ECMAScript implicit semicolons and whitespace parsing QUESTION: I've seen, very often in fact, this cited as why to use K&R style when writing ECMAScript. function foo () { return { foo: 1 }; } That doesn't work in ECMAScript or Javascript: implicit-semicolon addition results in the function retur...
[ "javascript", "coding-style", "whitespace", "ecmascript-5" ]
3
2
323
1
0
2011-05-31T21:19:26.733000
2011-05-31T21:27:32.943000
6,193,694
6,193,840
Need to escape white space before appending to url
This is the parameter portion of the string as I need it:?parentId=PRICE&childId=%20LIST This is the parameter portion as it is (Note the missing %20):?parentId=PRICE&childId=LIST Here is the function that gathers the data from two select boxes (#parentCodes and #childCodes): function ajaxCodeDetails(){ $.getJSON( "man...
It's not a problem with jQuery but with the form. It seems that leading and trailing spaces are ignored in the option's text (apparently, this is the normal behaviour of browsers, see below): space space DEMO but it works if they are set as value s: space space DEMO The HTML specification has an interesting chapter abo...
Need to escape white space before appending to url This is the parameter portion of the string as I need it:?parentId=PRICE&childId=%20LIST This is the parameter portion as it is (Note the missing %20):?parentId=PRICE&childId=LIST Here is the function that gathers the data from two select boxes (#parentCodes and #child...
TITLE: Need to escape white space before appending to url QUESTION: This is the parameter portion of the string as I need it:?parentId=PRICE&childId=%20LIST This is the parameter portion as it is (Note the missing %20):?parentId=PRICE&childId=LIST Here is the function that gathers the data from two select boxes (#pare...
[ "jquery" ]
0
3
1,216
5
0
2011-05-31T21:19:31.867000
2011-05-31T21:35:01.377000
6,193,697
6,193,757
Get address of a multidimensional static array
How can I get the address of a multidimensional static array? For example, this is my array char array[2][10] = {"word1", "word2"}; Is it possible to get the address to make me reference this array using a pointer like this? char** pointer; I tried &array or directly pointer = (char**)array; but it crashes at startup.
char **pointer means that a pointer is pointing to a pointer. So *pointer is expected to be a pointer (e.g. 4-byte value which can be interpreted as an address). This is not the case with your array: it is a contiguous area in memory (20 bytes). So when you try to convert the array to char ** your application crashes. ...
Get address of a multidimensional static array How can I get the address of a multidimensional static array? For example, this is my array char array[2][10] = {"word1", "word2"}; Is it possible to get the address to make me reference this array using a pointer like this? char** pointer; I tried &array or directly point...
TITLE: Get address of a multidimensional static array QUESTION: How can I get the address of a multidimensional static array? For example, this is my array char array[2][10] = {"word1", "word2"}; Is it possible to get the address to make me reference this array using a pointer like this? char** pointer; I tried &array...
[ "c", "arrays" ]
2
5
352
2
0
2011-05-31T21:19:44.273000
2011-05-31T21:25:46.670000
6,193,702
6,193,939
Sendgrid - SMTP or CURL?
We are setting up a bulk mailing system using sendgrid as our core. We are managing the lists ourselves and sendgrid is simply our transport and are using code igniter to build the system. We are wondering what you would recommend we use, sendgrid as an smtp server, or use it's curl API. We are sending emails out to x0...
Reading the documentation at http://sendgrid.com/documentation/map/version/v2#api there is little to choose between them. All functionality is available either way. For PHP, I recommend smtp server with their SMTP API to take advantage of existing libraries that correctly format, mime encode, and send the email. Notabl...
Sendgrid - SMTP or CURL? We are setting up a bulk mailing system using sendgrid as our core. We are managing the lists ourselves and sendgrid is simply our transport and are using code igniter to build the system. We are wondering what you would recommend we use, sendgrid as an smtp server, or use it's curl API. We are...
TITLE: Sendgrid - SMTP or CURL? QUESTION: We are setting up a bulk mailing system using sendgrid as our core. We are managing the lists ourselves and sendgrid is simply our transport and are using code igniter to build the system. We are wondering what you would recommend we use, sendgrid as an smtp server, or use it'...
[ "php", "email", "codeigniter", "sendgrid" ]
7
6
6,918
3
0
2011-05-31T21:20:12.693000
2011-05-31T21:46:29.273000
6,193,725
6,206,853
Aptana Scriptdoc doesn't show up in Code Assist
I've followed all the instructions to get my code comments to show up in Code Assist but I'm not having any luck. Currently using Aptana 3 plugin inside of Eclipse (could that be the issue?) myObj = { /** * Gets the current foo * @param {String} fooId The unique identifier for the foo. * @return {Object} Returns the cu...
Found out on the Aptana support forums that their Scriptdoc setup doesn't support undeclared vars. If I change the above code to: var myObj = { /** * Gets the current foo * @param {String} fooId The unique identifier for the foo. * @return {Object} Returns the current foo. */ getFoo: function (fooID) { return bar[fooID...
Aptana Scriptdoc doesn't show up in Code Assist I've followed all the instructions to get my code comments to show up in Code Assist but I'm not having any luck. Currently using Aptana 3 plugin inside of Eclipse (could that be the issue?) myObj = { /** * Gets the current foo * @param {String} fooId The unique identifie...
TITLE: Aptana Scriptdoc doesn't show up in Code Assist QUESTION: I've followed all the instructions to get my code comments to show up in Code Assist but I'm not having any luck. Currently using Aptana 3 plugin inside of Eclipse (could that be the issue?) myObj = { /** * Gets the current foo * @param {String} fooId Th...
[ "javascript", "eclipse", "aptana" ]
0
1
1,225
1
0
2011-05-31T21:22:47.773000
2011-06-01T19:52:35.650000
6,193,734
6,194,078
Implicit conversions with std::function
Possible Duplicates: Why can't my C++ compiler deduce template argument for boost function? Isn't the template argument (the signature) of std::function part of its type? I have the following: #include void Foo( std::function ); void Foo( std::function ); void Bar(); int main() { Foo( Bar ); // Error: ambiguous Foo( [...
Any call to Foo with a parameter which is not exactly one of std::function and std::function will result in an unresolved overloading. Even silly things like Foo(1) or Foo("abc"). This is because constructors of std::function are templated and accept any type. std::function (1) would fail at instantiation, but overload...
Implicit conversions with std::function Possible Duplicates: Why can't my C++ compiler deduce template argument for boost function? Isn't the template argument (the signature) of std::function part of its type? I have the following: #include void Foo( std::function ); void Foo( std::function ); void Bar(); int main() ...
TITLE: Implicit conversions with std::function QUESTION: Possible Duplicates: Why can't my C++ compiler deduce template argument for boost function? Isn't the template argument (the signature) of std::function part of its type? I have the following: #include void Foo( std::function ); void Foo( std::function ); void B...
[ "c++", "c++11", "implicit-conversion", "overloading" ]
9
6
4,353
2
0
2011-05-31T21:23:53.990000
2011-05-31T22:01:39.593000
6,193,742
6,193,932
Samsung Galaxy Tab doesn't play 3gp or mp4 with h.263, but plays mp4 with h.264/youtube
I'm trying to play some videos from web, using VideoView.setVideoPath() This videos are.mp4's Using MediaInfo, I found some important lines: Codec (Human Name)................................MPEG-4 Visual Codec Profile.....................................Simple@L1 Codec Settings (Matrix)...........................Defau...
I transcode my videos to XviD which play nicely on my Galaxy Tab. They're just dvd rips for my kids to watch. My understanding is that there's no H.263 codec available for the tab.
Samsung Galaxy Tab doesn't play 3gp or mp4 with h.263, but plays mp4 with h.264/youtube I'm trying to play some videos from web, using VideoView.setVideoPath() This videos are.mp4's Using MediaInfo, I found some important lines: Codec (Human Name)................................MPEG-4 Visual Codec Profile.................
TITLE: Samsung Galaxy Tab doesn't play 3gp or mp4 with h.263, but plays mp4 with h.264/youtube QUESTION: I'm trying to play some videos from web, using VideoView.setVideoPath() This videos are.mp4's Using MediaInfo, I found some important lines: Codec (Human Name)................................MPEG-4 Visual Codec Pro...
[ "android", "h.264", "mp4", "android-videoview", "galaxy-tab" ]
0
0
3,600
1
0
2011-05-31T21:24:34.110000
2011-05-31T21:45:41.100000
6,193,743
6,193,787
Get a control handle by its name
I have a UserControl with several PictureBoxes on it. These are the only controls on the UserControl. All the PictureBoxes are all named 'pbx' plus a color such as 'pbxGrey' or 'pbxBlack'. I have a method that selects one of the PictureBoxes and changes the BorderStyle to represent that it has been selected. I have tri...
You should try using the casting operator: Also, you shouldn't assign handle a new object if you're planning to throw it away on the next line: I would suggest something like: if(this.Controls["pbx" + color] is PictureBox) { PictureBox handle = this.Controls["pbx" + color] as PictureBox; } or: using(PictureBox handle =...
Get a control handle by its name I have a UserControl with several PictureBoxes on it. These are the only controls on the UserControl. All the PictureBoxes are all named 'pbx' plus a color such as 'pbxGrey' or 'pbxBlack'. I have a method that selects one of the PictureBoxes and changes the BorderStyle to represent that...
TITLE: Get a control handle by its name QUESTION: I have a UserControl with several PictureBoxes on it. These are the only controls on the UserControl. All the PictureBoxes are all named 'pbx' plus a color such as 'pbxGrey' or 'pbxBlack'. I have a method that selects one of the PictureBoxes and changes the BorderStyle...
[ "visual-studio-2008", "user-controls", "c#-3.0", "handle" ]
0
0
361
1
0
2011-05-31T21:24:34.327000
2011-05-31T21:29:11.770000