PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,766,152 | 07/20/2011 17:46:11 | 721,110 | 04/22/2011 20:49:21 | 89 | 1 | Javascript and AI, fact or fiction? | In the tv I saw some interesting robots. These had some diodes, sun collectors and some motors. The diodes decided where the light is, so they turned the robot into the direction, which fed it with light. It kind of followed the light.
Now, based on this I was wondering about some easy AI. Is there as way to write an engine which can learn from the user interaction?
As a starter, it would be enough to learn and remember only for the session the user is on the page.
Any help is appreciated. | javascript | artificial-intelligence | null | null | null | 07/22/2011 01:49:39 | not a real question | Javascript and AI, fact or fiction?
===
In the tv I saw some interesting robots. These had some diodes, sun collectors and some motors. The diodes decided where the light is, so they turned the robot into the direction, which fed it with light. It kind of followed the light.
Now, based on this I was wondering about some easy AI. Is there as way to write an engine which can learn from the user interaction?
As a starter, it would be enough to learn and remember only for the session the user is on the page.
Any help is appreciated. | 1 |
6,724,977 | 07/17/2011 15:50:48 | 283,145 | 02/28/2010 15:50:55 | 1,384 | 53 | Comparisons of arbitrary arithmetic types: does anyone know an implementation? | While writing several math utilities I bumped into need to implement generic utility that can perform comparisons between any two fundamental arithmetic types. As I began coding, it became clear that this operation is not as straightforward as it seems, since I need correct handling of corner cases, especially when the types have different precision, i.e. rounding strategy during conversion between types becomes important. Consider:
float a1 = 4.8f;
int a2 = 4;
assert(a2 != (int) a1); //fails erroneously since we truncated a1
float b1 = 40000000.0f; //can represent only 40000000 and 40000004 accurately
long b2 = 40000002;
assert(b1 != (float) b2); //fails erroneously since we now truncated b2
The above can be implemented using c++0x type traits to automatically select the appropriate algorithm according to the template arguments supplied to the comparison function. However, this is quite complex and there's quite a lot of places where bugs can creep, so I don't think inventing everything myself is worthwhile. Does anyone know a library that implements the above correctly? | c++ | comparison | c++0x | numeric | null | null | open | Comparisons of arbitrary arithmetic types: does anyone know an implementation?
===
While writing several math utilities I bumped into need to implement generic utility that can perform comparisons between any two fundamental arithmetic types. As I began coding, it became clear that this operation is not as straightforward as it seems, since I need correct handling of corner cases, especially when the types have different precision, i.e. rounding strategy during conversion between types becomes important. Consider:
float a1 = 4.8f;
int a2 = 4;
assert(a2 != (int) a1); //fails erroneously since we truncated a1
float b1 = 40000000.0f; //can represent only 40000000 and 40000004 accurately
long b2 = 40000002;
assert(b1 != (float) b2); //fails erroneously since we now truncated b2
The above can be implemented using c++0x type traits to automatically select the appropriate algorithm according to the template arguments supplied to the comparison function. However, this is quite complex and there's quite a lot of places where bugs can creep, so I don't think inventing everything myself is worthwhile. Does anyone know a library that implements the above correctly? | 0 |
10,136,449 | 04/13/2012 06:51:57 | 885,735 | 08/09/2011 10:23:01 | 1 | 0 | How can Block direct access to drupal 6 site | i have developed a site on drupal 6 and now i want to Block direct access to any node url on my site,how can i Block any user to acces the site and redirect on login page from where they can create a new account if he doesnot have user id and passsword,so any one please help me regarding this.Thanks in advance | drupal-6 | null | null | null | null | null | open | How can Block direct access to drupal 6 site
===
i have developed a site on drupal 6 and now i want to Block direct access to any node url on my site,how can i Block any user to acces the site and redirect on login page from where they can create a new account if he doesnot have user id and passsword,so any one please help me regarding this.Thanks in advance | 0 |
10,018,398 | 04/04/2012 20:01:01 | 26,107 | 10/08/2008 11:31:38 | 1,870 | 6 | Autoplay HTML on CD for Windows & Mac | I'm building a CD for a client that contains a video training course. I am building it in HTML and JavaScript. I wish this to auto-play the index.html file on windows & Mac.
I understand Windows 7 doesn't auto-play by default, but I just want some advice on how to make this as seamless as possible. Everything I've done up until now has been on the Web, not on a CD. Thanks. | html | autoplay | null | null | null | null | open | Autoplay HTML on CD for Windows & Mac
===
I'm building a CD for a client that contains a video training course. I am building it in HTML and JavaScript. I wish this to auto-play the index.html file on windows & Mac.
I understand Windows 7 doesn't auto-play by default, but I just want some advice on how to make this as seamless as possible. Everything I've done up until now has been on the Web, not on a CD. Thanks. | 0 |
11,338,372 | 07/05/2012 05:41:45 | 1,503,008 | 07/05/2012 05:37:11 | 1 | 0 | blackberry touch application using phonegap | Hi I have created one blackberry touch application using phonegap. My application is 6 mb in size, my problem is it takes 5-6 mins to load the application | blackberry | phonegap | null | null | null | 07/06/2012 02:15:12 | not a real question | blackberry touch application using phonegap
===
Hi I have created one blackberry touch application using phonegap. My application is 6 mb in size, my problem is it takes 5-6 mins to load the application | 1 |
7,509,626 | 09/22/2011 04:39:39 | 781,303 | 06/02/2011 14:27:03 | 435 | 5 | Access user's text messages on iphone | Is there a way to access a user's text messages (without an internet connection, obviously...not trying to take the client's messages) and analyze the text within an app?
Totally understandable if there isn't (for security reasons), but I figured i'd ask anyway. | iphone | ios | sms | null | null | null | open | Access user's text messages on iphone
===
Is there a way to access a user's text messages (without an internet connection, obviously...not trying to take the client's messages) and analyze the text within an app?
Totally understandable if there isn't (for security reasons), but I figured i'd ask anyway. | 0 |
5,673,715 | 04/15/2011 07:37:11 | 703,838 | 04/12/2011 10:09:30 | 1 | 0 | Java Socket Programming | How do the server sockets and the sockets are bind in Java | java | null | null | null | null | 04/15/2011 07:41:37 | not a real question | Java Socket Programming
===
How do the server sockets and the sockets are bind in Java | 1 |
3,888,385 | 10/08/2010 07:10:43 | 469,948 | 10/08/2010 07:10:43 | 1 | 0 | Are there any Quality Management tools other than Sonar | We in our organizationa are trying to implement a source code quality management tool. Sonar is one such tool we have come across, and it's quite full of features and is phenomenal. We want to compare it with it's peers, if there are any, before we actually implement it.
Are there any good contenders to Sonar's capabilities and features? | sonar | null | null | null | null | 10/28/2011 13:42:20 | not constructive | Are there any Quality Management tools other than Sonar
===
We in our organizationa are trying to implement a source code quality management tool. Sonar is one such tool we have come across, and it's quite full of features and is phenomenal. We want to compare it with it's peers, if there are any, before we actually implement it.
Are there any good contenders to Sonar's capabilities and features? | 4 |
4,470,917 | 12/17/2010 13:33:13 | 435,316 | 08/30/2010 20:19:10 | 18 | 0 | How do I get the index of the current item in relation to the parent element with jQuery? | I am trying to get the index of the current item within
<ul id="navbar">
<li><a href="#a">Link</a></li>
<li><a href="#b">Link</a></li>
<li><a href="#c">Link</a></li>
<li><a href="#d">Link</a></li>
<li><a href="#e">Link</a></li>
</ul>
I am using jQuery and have got the total by simply using
$('ul.navbar').children().length;
How do I get the current index in relation to the parent element?
eg. Third link is clicked, 3 is returned or 2 if as an array.
I've tried the following but keep returning -1 for not found
$('ul.navbar a').click(function(){
var curPos = $(this).parent().parent().index($(this).parent());
}); | jquery | jquery-selectors | selectors | parent-child | parent | null | open | How do I get the index of the current item in relation to the parent element with jQuery?
===
I am trying to get the index of the current item within
<ul id="navbar">
<li><a href="#a">Link</a></li>
<li><a href="#b">Link</a></li>
<li><a href="#c">Link</a></li>
<li><a href="#d">Link</a></li>
<li><a href="#e">Link</a></li>
</ul>
I am using jQuery and have got the total by simply using
$('ul.navbar').children().length;
How do I get the current index in relation to the parent element?
eg. Third link is clicked, 3 is returned or 2 if as an array.
I've tried the following but keep returning -1 for not found
$('ul.navbar a').click(function(){
var curPos = $(this).parent().parent().index($(this).parent());
}); | 0 |
8,068,407 | 11/09/2011 16:46:10 | 203,948 | 11/05/2009 18:36:57 | 391 | 2 | Whats the best way to compare a tables data against another? | Okay so I have 2 select statements:
SELECT DISTINCT Email
FROM dbo.Customers
WHERE (Email IS NOT NULL)
AND (Email LIKE '%@%')
AND (RIGHT(Email, 4) IN ('.net', '.com', '.org'))
AND (Email NOT LIKE '%@UniformCity.com')
AND (Email NOT LIKE '%@LifeUniform.com')
AND (CHARINDEX('.',Email) <> 1)
AND (RIGHT(RTRIM(Email), 1) <> '.') AND (LEFT(LTRIM(Email), 1) <> '@')
AND (Email not Like '%[`:;_*-,^[^]()+%\/=#-]%' escape '^') order by Email
AND
SELECT replace(replace(
replace(
replace(EmailOptOut,'"','')
, ',held','')
, ',unsub','')
, ',confirm','')
as CleanEmail
FROM [LifeMail].[dbo].[EmailOptOuts]
I only want to select the emails from the Customers table, THAT ARE NOT in the EmailOptOuts table. Whats the best way to achieve this? I thought about using cursors and looping, but I'm sure you experts know a better way. | sql-server | sql-server-2008 | tsql | null | null | null | open | Whats the best way to compare a tables data against another?
===
Okay so I have 2 select statements:
SELECT DISTINCT Email
FROM dbo.Customers
WHERE (Email IS NOT NULL)
AND (Email LIKE '%@%')
AND (RIGHT(Email, 4) IN ('.net', '.com', '.org'))
AND (Email NOT LIKE '%@UniformCity.com')
AND (Email NOT LIKE '%@LifeUniform.com')
AND (CHARINDEX('.',Email) <> 1)
AND (RIGHT(RTRIM(Email), 1) <> '.') AND (LEFT(LTRIM(Email), 1) <> '@')
AND (Email not Like '%[`:;_*-,^[^]()+%\/=#-]%' escape '^') order by Email
AND
SELECT replace(replace(
replace(
replace(EmailOptOut,'"','')
, ',held','')
, ',unsub','')
, ',confirm','')
as CleanEmail
FROM [LifeMail].[dbo].[EmailOptOuts]
I only want to select the emails from the Customers table, THAT ARE NOT in the EmailOptOuts table. Whats the best way to achieve this? I thought about using cursors and looping, but I'm sure you experts know a better way. | 0 |
6,172,085 | 05/30/2011 03:40:50 | 458,700 | 09/26/2010 13:30:05 | 308 | 7 | Run website on iPhone and Blackberry | a friend of mine have a website of buying and selling products and the website is running just fine , but he want to be able to access his website form Blackberry and iPhone , he is not a mobile application developer , if anyone know how to do that with the easiest and fastest way , we will be appreciated
Thanks in Advance | iphone | blackberry | null | null | null | 05/30/2011 19:28:20 | not a real question | Run website on iPhone and Blackberry
===
a friend of mine have a website of buying and selling products and the website is running just fine , but he want to be able to access his website form Blackberry and iPhone , he is not a mobile application developer , if anyone know how to do that with the easiest and fastest way , we will be appreciated
Thanks in Advance | 1 |
9,257,450 | 02/13/2012 08:27:08 | 308,456 | 04/03/2010 20:33:45 | 36 | 0 | How to encrypt a file and then decrypt? | I am writing an application in which I sync a file to a server where I want to sign the file then send it back to the client where it can be decrypted for verification.
There seem to be multiple gnupg modules for Python - can someone recommend which I one I should use (and available in Ubuntu/Debian) and how to get started doing this?
Thanks! | python | encryption | gnupg | null | null | 02/14/2012 14:42:10 | not constructive | How to encrypt a file and then decrypt?
===
I am writing an application in which I sync a file to a server where I want to sign the file then send it back to the client where it can be decrypted for verification.
There seem to be multiple gnupg modules for Python - can someone recommend which I one I should use (and available in Ubuntu/Debian) and how to get started doing this?
Thanks! | 4 |
2,616,397 | 04/11/2010 08:07:30 | 11,236 | 09/16/2008 06:29:28 | 4,428 | 80 | Best Maven plugins | We are just moving to Maven, and I understand there is a world of different plugins & extensions. Which are the best ones you recommend for general usage?
(On plugin per answer please) | maven-2 | plugins | java | null | null | 10/05/2011 02:18:38 | not constructive | Best Maven plugins
===
We are just moving to Maven, and I understand there is a world of different plugins & extensions. Which are the best ones you recommend for general usage?
(On plugin per answer please) | 4 |
7,747,264 | 10/12/2011 22:17:43 | 167,420 | 09/02/2009 18:20:41 | 126 | 9 | JSONP calls not working with apple-mobile-web-app-capable="yes" | **The Problem:**
With `<meta name="apple-mobile-web-app-capable" content="yes" />` set, all of my jsonp requests are getting denied. I read that by setting content="yes", you cannot change the page. But I was unaware you couldnt request external resources. And this app **has** to be full screen. Is there way around using this tag to set the iPad to full screen mode on an html5 app?
Right now my requests are just being sent to another subdomain and they are all getting denied? Anyone have an idea on how to get around this? Allow jsonp and force fullscreen mode?
| jquery | ipad | html5 | webkit | null | null | open | JSONP calls not working with apple-mobile-web-app-capable="yes"
===
**The Problem:**
With `<meta name="apple-mobile-web-app-capable" content="yes" />` set, all of my jsonp requests are getting denied. I read that by setting content="yes", you cannot change the page. But I was unaware you couldnt request external resources. And this app **has** to be full screen. Is there way around using this tag to set the iPad to full screen mode on an html5 app?
Right now my requests are just being sent to another subdomain and they are all getting denied? Anyone have an idea on how to get around this? Allow jsonp and force fullscreen mode?
| 0 |
645,575 | 03/14/2009 07:23:09 | 78,004 | 03/14/2009 07:11:49 | 1 | 1 | 3D Image manipulation(drag&drop,editing,rotation,resize,zoom in & zoom out) | thanks for quick reply
i am new to silverlight.
i am learning basics of silverlight now.
but i need to implement image rotation and drop&drop from one position to another position,editing,resize,zoom in & zoom out as soon as possible.
Can you just explain image rotation,drag&drop with corresponding **code samples**.
Please as soon as possible. | silverlight-2.0 | silverlight | silverlight-2-rc0 | null | null | 03/30/2012 12:34:28 | not a real question | 3D Image manipulation(drag&drop,editing,rotation,resize,zoom in & zoom out)
===
thanks for quick reply
i am new to silverlight.
i am learning basics of silverlight now.
but i need to implement image rotation and drop&drop from one position to another position,editing,resize,zoom in & zoom out as soon as possible.
Can you just explain image rotation,drag&drop with corresponding **code samples**.
Please as soon as possible. | 1 |
3,196,536 | 07/07/2010 15:55:21 | 88,373 | 04/08/2009 00:14:10 | 1,842 | 93 | Add Service Reference not appearing | In a Windows Phone 7 Silverlight project, I had a service reference to a WCF service. This morning when I opened up the project, suddenly the namespaces for my WCF service were unknown. The option for "Update Service Reference" in Solution Explorer was not there, so I deleted the Service Reference with the intent of re-adding it. But the option for "Add Service Reference" is also not there. Gone. Disappeared.
Closed and re-opened the solution. Restarted VS2010 Ultimate. No dice. Anyone run across this? | silverlight | wcf | windows-phone-7 | vs2010 | null | null | open | Add Service Reference not appearing
===
In a Windows Phone 7 Silverlight project, I had a service reference to a WCF service. This morning when I opened up the project, suddenly the namespaces for my WCF service were unknown. The option for "Update Service Reference" in Solution Explorer was not there, so I deleted the Service Reference with the intent of re-adding it. But the option for "Add Service Reference" is also not there. Gone. Disappeared.
Closed and re-opened the solution. Restarted VS2010 Ultimate. No dice. Anyone run across this? | 0 |
9,092,396 | 02/01/2012 07:38:11 | 1,182,145 | 02/01/2012 07:33:08 | 1 | 0 | How can I configure IP address from class E on Linux? | I want to use Class E IP address on Linux.
How can I configure IP address from class E on Linux?
If I command 'ifconfig' using class E IP, it returs the follwing answer.
ifconfig: SIOCSIFADDR: Invalid argument
Because the E class is not to be used. That is why the kernel does not permit setting such address.
But I want to use Class E IP address for our experiment.
How can I? | linux | class | ip | ifconfig | null | 02/01/2012 14:05:17 | off topic | How can I configure IP address from class E on Linux?
===
I want to use Class E IP address on Linux.
How can I configure IP address from class E on Linux?
If I command 'ifconfig' using class E IP, it returs the follwing answer.
ifconfig: SIOCSIFADDR: Invalid argument
Because the E class is not to be used. That is why the kernel does not permit setting such address.
But I want to use Class E IP address for our experiment.
How can I? | 2 |
5,713,795 | 04/19/2011 08:46:14 | 99,989 | 05/02/2009 21:27:09 | 1,474 | 21 | Boost.python overloaded constructor for numpy array and python list | How do I expose catch a call to construct a class exposed with boost python that's called with a numpy array or python list? | python | boost-python | null | null | null | null | open | Boost.python overloaded constructor for numpy array and python list
===
How do I expose catch a call to construct a class exposed with boost python that's called with a numpy array or python list? | 0 |
8,888,775 | 01/17/2012 01:52:38 | 676,028 | 03/25/2011 02:15:33 | 197 | 2 | Newsletter overall background of body | How do I change the body background color of a newsletter in Custom templates? is there a specific "body" tag only for email messages?
Thanks! | mailchimp | null | null | null | null | 01/17/2012 13:11:31 | off topic | Newsletter overall background of body
===
How do I change the body background color of a newsletter in Custom templates? is there a specific "body" tag only for email messages?
Thanks! | 2 |
8,858,170 | 01/13/2012 22:34:43 | 1,148,579 | 01/13/2012 21:44:38 | 1 | 0 | How to restrict access to mysql connection from other classes? | Sup! We have core class with mysql connection, than we include plugin and we need that plugin cant access to our DB without core class methods.
**index.php**
<?php
class Core
{
function connect()
{
$db = @mysql_connect($host, $user, $pass);
@mysql_select_db($base, $db);
}
function query($sql)
{
return mysql_query($sql);
}
}
global $c;
$c = new Core();
include('plugin.php');
$p = new Plugin();
echo $p->not_work_connection();
echo $p->work_connection();
?>
**plugin.php**
<?php
class Plugin
{
function not_work_connection()
{
$sql = 'SELECT * FROM `net_country` LIMIT 0 , 1';
$result = mysql_query($sql);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
return print_r($row, 1);
}
}
function work_connection()
{
global $c;
$result =$c->query('SELECT * FROM `net_country` LIMIT 0 , 1');
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
return print_r($row, 1);
}
}
}
?>
I need restrict access from included scripts, but thay can use core methods to make queries. How i can make it? | php | mysql | null | null | null | null | open | How to restrict access to mysql connection from other classes?
===
Sup! We have core class with mysql connection, than we include plugin and we need that plugin cant access to our DB without core class methods.
**index.php**
<?php
class Core
{
function connect()
{
$db = @mysql_connect($host, $user, $pass);
@mysql_select_db($base, $db);
}
function query($sql)
{
return mysql_query($sql);
}
}
global $c;
$c = new Core();
include('plugin.php');
$p = new Plugin();
echo $p->not_work_connection();
echo $p->work_connection();
?>
**plugin.php**
<?php
class Plugin
{
function not_work_connection()
{
$sql = 'SELECT * FROM `net_country` LIMIT 0 , 1';
$result = mysql_query($sql);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
return print_r($row, 1);
}
}
function work_connection()
{
global $c;
$result =$c->query('SELECT * FROM `net_country` LIMIT 0 , 1');
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
return print_r($row, 1);
}
}
}
?>
I need restrict access from included scripts, but thay can use core methods to make queries. How i can make it? | 0 |
3,192,817 | 07/07/2010 07:51:08 | 385,278 | 07/07/2010 07:51:08 | 1 | 0 | image not displaying when runat="server" is set | i have an image as such:
<img src="../pics/img.gif" runat="server" id="imgID" alt="Close" />
the image is not displayed unless i removed the runat="server".
is there any reason for this behavior? | c# | asp.net | null | null | null | null | open | image not displaying when runat="server" is set
===
i have an image as such:
<img src="../pics/img.gif" runat="server" id="imgID" alt="Close" />
the image is not displayed unless i removed the runat="server".
is there any reason for this behavior? | 0 |
8,384,966 | 12/05/2011 11:58:55 | 1,035,414 | 11/08/2011 10:37:50 | 1 | 0 | Selecting Picker items text the details in textfileds and save | I kept 3 items in picker, by selecting the first picker item i want to text in text fields,respectively after want to save the datas. I dont how to write the code to save the datas in appdelegate class in -(void)applicationDidEnterBackground:(UIApplication *)application{}.Please do the needful for this. Thanks in advance.
| iphone | text | save | uipickerview | null | null | open | Selecting Picker items text the details in textfileds and save
===
I kept 3 items in picker, by selecting the first picker item i want to text in text fields,respectively after want to save the datas. I dont how to write the code to save the datas in appdelegate class in -(void)applicationDidEnterBackground:(UIApplication *)application{}.Please do the needful for this. Thanks in advance.
| 0 |
6,912,682 | 08/02/2011 13:15:07 | 760,995 | 05/19/2011 11:49:43 | 1 | 0 | How to play guitar sounds programmatically in iPhone application? | I need some help for creating piano and guitar sound in iphone app.So if someone can provide me tutorial or source code it would be great.
I found a link but it did not help me.
The link is as follows:
http://stackoverflow.com/questions/4926532/creating-a-realistic-strum-on-iphone | iphone-sdk-4.0 | null | null | null | null | 08/03/2011 20:22:49 | not a real question | How to play guitar sounds programmatically in iPhone application?
===
I need some help for creating piano and guitar sound in iphone app.So if someone can provide me tutorial or source code it would be great.
I found a link but it did not help me.
The link is as follows:
http://stackoverflow.com/questions/4926532/creating-a-realistic-strum-on-iphone | 1 |
10,243,287 | 04/20/2012 09:08:47 | 1,123,654 | 12/30/2011 22:44:58 | 11 | 5 | Expression syntax for parent_table.field_name | If my JasperReport report shows data from a SQL query like this:
SELECT
"invoices"."invoice_id",
"invoices"."name",
"invoices"."contact_id",
"relationship_contacts"."name",
FROM "invoices"
LEFT JOIN "contacts" AS "relationship_contacts" ON ("invoices"."contact_id" = "relationship_contacts"."contact_id")
how should I specify invoices.name and relationship_contacts.name in JRDesignExpression.setText()? This does not seem to be valid:
$F{relationship_contacts.name}
| jasper-reports | null | null | null | null | null | open | Expression syntax for parent_table.field_name
===
If my JasperReport report shows data from a SQL query like this:
SELECT
"invoices"."invoice_id",
"invoices"."name",
"invoices"."contact_id",
"relationship_contacts"."name",
FROM "invoices"
LEFT JOIN "contacts" AS "relationship_contacts" ON ("invoices"."contact_id" = "relationship_contacts"."contact_id")
how should I specify invoices.name and relationship_contacts.name in JRDesignExpression.setText()? This does not seem to be valid:
$F{relationship_contacts.name}
| 0 |
6,039,109 | 05/18/2011 02:02:54 | 758,415 | 05/18/2011 01:54:23 | 1 | 0 | How do I replace part of a large string in Python? | I have a file with multiple lines, each having a long sequence of characters (no spaces).
For example in one line:
qwerrqweqweasdqweqwe**replacethistext**asdasdasd
qwerrqweqweasdqweqwe**withthistext**asdasdasd
The specific string I am looking for can happen any where in a certain line.
How would I accomplish this?
Thanks | python | null | null | null | null | null | open | How do I replace part of a large string in Python?
===
I have a file with multiple lines, each having a long sequence of characters (no spaces).
For example in one line:
qwerrqweqweasdqweqwe**replacethistext**asdasdasd
qwerrqweqweasdqweqwe**withthistext**asdasdasd
The specific string I am looking for can happen any where in a certain line.
How would I accomplish this?
Thanks | 0 |
8,825,277 | 01/11/2012 19:16:59 | 979,903 | 10/05/2011 07:41:50 | 46 | 1 | how to catch Duplicate colum value exception spring | I have written my dao layer and service layer for my database using spring.
In some of the tables we have unique constraints for some columns. If we try to insert the duplicate values for those columns how to catch those exceptions specifically based on the column name? Basically i need to know because of which column the query getting failed.
Please help me. Thanks in advance
| spring | exception-handling | null | null | null | null | open | how to catch Duplicate colum value exception spring
===
I have written my dao layer and service layer for my database using spring.
In some of the tables we have unique constraints for some columns. If we try to insert the duplicate values for those columns how to catch those exceptions specifically based on the column name? Basically i need to know because of which column the query getting failed.
Please help me. Thanks in advance
| 0 |
795,746 | 04/28/2009 00:03:46 | 96,828 | 04/27/2009 23:56:00 | 1 | 0 | Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result | I get the error when trying to run this:
<?php
require_once('includes/DbConnector.php');
$connector = new DbConnector();
$result = $connector->query('SELECT title,content FROM staff_vacancies ORDER BY ordering LIMIT 0,100');
// Get an array containing the results.
// Loop for each item in that array
while ($row = $connector->fetchArray($result)){
echo $row['title'].'</h3>';
echo $row['content'];
}
?>
I have a linked file: DbConnector.php:
<?php
////////////////////////////////////////////////////////////////////////////////////////
// Class: DbConnector
// Purpose: Connect to a database, MySQL version
///////////////////////////////////////////////////////////////////////////////////////
require_once 'SystemComponent.php';
class DbConnector extends SystemComponent {
var $theQuery;
var $link;
//*** Function: DbConnector, Purpose: Connect to the database ***
function DbConnector(){
// Load settings from parent class
$settings = SystemComponent::getSettings();
// Get the main settings from the array we just loaded
$host = $settings['dbhost'];
$db = $settings['dbname'];
$user = $settings['dbusername'];
$pass = $settings['dbpassword'];
//the settings
$host = 'localhost';
$db = 'xxx';
$user = 'xxx';
$pass = 'xxx';
// Connect to the database
$this->link = mysql_connect($host, $user, $pass);
mysql_select_db($db);
register_shutdown_function(array(&$this, 'close'));
}
//*** Function: query, Purpose: Execute a database query ***
function query($query) {
$this->theQuery = $query;
return mysql_query($query, $this->link);
}
//*** Function: getQuery, Purpose: Returns the last database query, for debugging ***
function getQuery() {
return $this->theQuery;
}
//*** Function: getNumRows, Purpose: Return row count, MySQL version ***
function getNumRows($result) {
return mysql_num_rows($result);
}
//*** Function: fetchArray, Purpose: Get array of query results ***
function fetchArray($result) {
return mysql_fetch_array($result);
}
//*** Function: close, Purpose: Close the connection ***
function close() {
mysql_close($this->link);
}
}
?>
Does anyone know what the problem is? | php | mysql | null | null | null | 07/31/2012 13:17:03 | not a real question | Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
===
I get the error when trying to run this:
<?php
require_once('includes/DbConnector.php');
$connector = new DbConnector();
$result = $connector->query('SELECT title,content FROM staff_vacancies ORDER BY ordering LIMIT 0,100');
// Get an array containing the results.
// Loop for each item in that array
while ($row = $connector->fetchArray($result)){
echo $row['title'].'</h3>';
echo $row['content'];
}
?>
I have a linked file: DbConnector.php:
<?php
////////////////////////////////////////////////////////////////////////////////////////
// Class: DbConnector
// Purpose: Connect to a database, MySQL version
///////////////////////////////////////////////////////////////////////////////////////
require_once 'SystemComponent.php';
class DbConnector extends SystemComponent {
var $theQuery;
var $link;
//*** Function: DbConnector, Purpose: Connect to the database ***
function DbConnector(){
// Load settings from parent class
$settings = SystemComponent::getSettings();
// Get the main settings from the array we just loaded
$host = $settings['dbhost'];
$db = $settings['dbname'];
$user = $settings['dbusername'];
$pass = $settings['dbpassword'];
//the settings
$host = 'localhost';
$db = 'xxx';
$user = 'xxx';
$pass = 'xxx';
// Connect to the database
$this->link = mysql_connect($host, $user, $pass);
mysql_select_db($db);
register_shutdown_function(array(&$this, 'close'));
}
//*** Function: query, Purpose: Execute a database query ***
function query($query) {
$this->theQuery = $query;
return mysql_query($query, $this->link);
}
//*** Function: getQuery, Purpose: Returns the last database query, for debugging ***
function getQuery() {
return $this->theQuery;
}
//*** Function: getNumRows, Purpose: Return row count, MySQL version ***
function getNumRows($result) {
return mysql_num_rows($result);
}
//*** Function: fetchArray, Purpose: Get array of query results ***
function fetchArray($result) {
return mysql_fetch_array($result);
}
//*** Function: close, Purpose: Close the connection ***
function close() {
mysql_close($this->link);
}
}
?>
Does anyone know what the problem is? | 1 |
11,573,277 | 07/20/2012 05:15:12 | 1,194,358 | 02/07/2012 10:08:43 | 1 | 1 | php crawl name and address details to csv format | I need to filter CompanyName, FirstName, Surname, Addr1, Addr2, Town, City, Postcode, Phone1, Phone 2 from the following two sites out into an CSV flat file format
http://www.chester.anglican.org/churches.asp
http://www.solicitors.co.uk/probate/cheshire/1/ this search result has 7 pages.
can any one help me immediately ?
Thanks and regards
| php | crawl | null | null | null | 07/20/2012 13:03:50 | not a real question | php crawl name and address details to csv format
===
I need to filter CompanyName, FirstName, Surname, Addr1, Addr2, Town, City, Postcode, Phone1, Phone 2 from the following two sites out into an CSV flat file format
http://www.chester.anglican.org/churches.asp
http://www.solicitors.co.uk/probate/cheshire/1/ this search result has 7 pages.
can any one help me immediately ?
Thanks and regards
| 1 |
10,505,810 | 05/08/2012 20:13:15 | 1,366,353 | 04/30/2012 17:25:49 | 55 | 8 | Good software to generate SQL from ER diagram? | I am creating a database and I need to create some tables. I would like to know if there is a good software (preferably free) that generates SQL code from the ER diagram.
| sql | database | null | null | null | 05/10/2012 10:07:08 | not constructive | Good software to generate SQL from ER diagram?
===
I am creating a database and I need to create some tables. I would like to know if there is a good software (preferably free) that generates SQL code from the ER diagram.
| 4 |
441,243 | 01/13/2009 23:05:53 | 54,815 | 01/13/2009 23:04:23 | 1 | 0 | Anyone used Zephyr test management system? | Anyone used Zephyr test management system? See their site at http://www.getzephyr.com/.
Interested in experience with integrating it with PHPUnit based testing environments. | testing | management | null | null | null | 02/28/2012 23:51:19 | not constructive | Anyone used Zephyr test management system?
===
Anyone used Zephyr test management system? See their site at http://www.getzephyr.com/.
Interested in experience with integrating it with PHPUnit based testing environments. | 4 |
9,944,241 | 03/30/2012 13:47:10 | 1,303,304 | 03/30/2012 13:02:37 | 1 | 0 | ext3: Copy operation corrupts file | I have a weird file system problem:
Copy operations corrupt files (md5 sums do not match anymore after copying)
Example
> md5sum refseq_rna.00.tar.gz
55ab2c66f92685521f9e693f4130f581 refseq_rna.00.tar.gz
> cp refseq_rna.00.tar.gz refseq_rna.00.tar.gz.2
> md5sum refseq_rna.00.tar.gz.2
66987ad21cc124dc45b17e4b5d4520a2 refseq_rna.00.tar.gz.2
The files have equals sizes, so the md5 sum mismatches seem to be due to bit flips.
> ls -l
total 2194520
-rw-r--r-- 1 root root 1122490886 Mar 30 15:01 refseq_rna.00.tar.gz
-rw-r--r-- 1 root root 1122490886 Mar 30 15:06 refseq_rna.00.tar.gz.2
OS: Gentoo; Filesystem: ext3; RAID-5 (Software-Raid-Controller)
What could be the cause of this problem, the file system, the raid controller or a harddisk failure? And how to check this?
| filesystems | md5 | corrupt | raid | ext3 | 03/30/2012 16:05:39 | off topic | ext3: Copy operation corrupts file
===
I have a weird file system problem:
Copy operations corrupt files (md5 sums do not match anymore after copying)
Example
> md5sum refseq_rna.00.tar.gz
55ab2c66f92685521f9e693f4130f581 refseq_rna.00.tar.gz
> cp refseq_rna.00.tar.gz refseq_rna.00.tar.gz.2
> md5sum refseq_rna.00.tar.gz.2
66987ad21cc124dc45b17e4b5d4520a2 refseq_rna.00.tar.gz.2
The files have equals sizes, so the md5 sum mismatches seem to be due to bit flips.
> ls -l
total 2194520
-rw-r--r-- 1 root root 1122490886 Mar 30 15:01 refseq_rna.00.tar.gz
-rw-r--r-- 1 root root 1122490886 Mar 30 15:06 refseq_rna.00.tar.gz.2
OS: Gentoo; Filesystem: ext3; RAID-5 (Software-Raid-Controller)
What could be the cause of this problem, the file system, the raid controller or a harddisk failure? And how to check this?
| 2 |
10,756,679 | 05/25/2012 14:55:55 | 1,368,371 | 05/01/2012 18:38:52 | 20 | 0 | inserted posted details into database | When a user registers with my website they are then required to enter personal details. The entered details will be added to the personaldetails table in my datbase. I have the following code but it does not work, I cannot figure out why. Can anyone help? I am getting error:query was empty
$myusername=$_POST['username'];
$mypassword=$_SESSION['mypassword'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$dob = $_POST['dob'];
$totalwins = $_POST['totalwins'];
$totalloses = $_POST['totalloses'];
$email = $_POST['email'];
$country = $_POST['country'];
$info = $_POST['info'];
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$queryreg = mysql_query("
INSERT INTO $tbl_name VALUES('','','$myusername','$mypassword''$firstname','$surname','$totalwins','$totalloses','$email','$country','$info','$dob' )
");
if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
else {
echo "<br><br>Your details have been successfully updated. Go back to the personal details page to view your updated information.";
} | php | null | null | null | null | 05/25/2012 18:29:11 | too localized | inserted posted details into database
===
When a user registers with my website they are then required to enter personal details. The entered details will be added to the personaldetails table in my datbase. I have the following code but it does not work, I cannot figure out why. Can anyone help? I am getting error:query was empty
$myusername=$_POST['username'];
$mypassword=$_SESSION['mypassword'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$dob = $_POST['dob'];
$totalwins = $_POST['totalwins'];
$totalloses = $_POST['totalloses'];
$email = $_POST['email'];
$country = $_POST['country'];
$info = $_POST['info'];
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$queryreg = mysql_query("
INSERT INTO $tbl_name VALUES('','','$myusername','$mypassword''$firstname','$surname','$totalwins','$totalloses','$email','$country','$info','$dob' )
");
if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
else {
echo "<br><br>Your details have been successfully updated. Go back to the personal details page to view your updated information.";
} | 3 |
10,649,749 | 05/18/2012 09:07:51 | 1,402,925 | 05/18/2012 08:54:45 | 1 | 0 | how can i connect my phone to my laptop? | I want to connect to my laptop und other smartphone using my smart phone through WiFi.
I've written an app (android), but can only find wifi network, no device.
does anyone have any idea how to find smartphone and laptop? | java | android | tcpclient | null | null | 05/19/2012 01:31:00 | not a real question | how can i connect my phone to my laptop?
===
I want to connect to my laptop und other smartphone using my smart phone through WiFi.
I've written an app (android), but can only find wifi network, no device.
does anyone have any idea how to find smartphone and laptop? | 1 |
4,082,068 | 11/02/2010 21:02:02 | 495,264 | 11/02/2010 21:02:02 | 1 | 0 | C# architecture | I've created a simple C# desktop application, that uses data from several text files. I'm wondering how to define the architecture of my application? | c# | architecture | null | null | null | 11/02/2010 21:04:41 | not a real question | C# architecture
===
I've created a simple C# desktop application, that uses data from several text files. I'm wondering how to define the architecture of my application? | 1 |
8,819,007 | 01/11/2012 12:11:20 | 921,704 | 08/31/2011 13:36:33 | 18 | 0 | how display a docx document on ios? | I would like display a doc(x) file that I downloaded on a server in my ios app. How to do that ?
thanks | objective-c | ios | docx | null | null | 01/11/2012 22:19:57 | not a real question | how display a docx document on ios?
===
I would like display a doc(x) file that I downloaded on a server in my ios app. How to do that ?
thanks | 1 |
8,476,615 | 12/12/2011 15:25:35 | 690,431 | 04/04/2011 01:52:25 | 395 | 5 | examples of web sites that use jBPM? | I'd like to see some examples of web sites that are using jBPM. Can anyone point me to some live web sites that use jBPM?
I'm not looking for a jBPM tutorial (at the moment at least), simply want to get a hands on feel for how some web sites are using the product. | workflow | jbpm | bpm | null | null | 12/12/2011 17:23:55 | too localized | examples of web sites that use jBPM?
===
I'd like to see some examples of web sites that are using jBPM. Can anyone point me to some live web sites that use jBPM?
I'm not looking for a jBPM tutorial (at the moment at least), simply want to get a hands on feel for how some web sites are using the product. | 3 |
10,900,811 | 06/05/2012 16:06:25 | 437,039 | 09/01/2010 14:15:51 | 2,287 | 35 | Which resource folders do you recomment for tablet app? | At the moment, I set these resource folders:
/res
/drawable
/drawable-large-hdpi
/layout
/layout-port
/layout-large-hdpi
`large-hdpi` folders are for Galaxy Tab, while others are for other tablets.
What additional resource folders do you suggest to add? | android | android-layout | embedded-resource | android-tablet | null | 06/11/2012 12:31:38 | not constructive | Which resource folders do you recomment for tablet app?
===
At the moment, I set these resource folders:
/res
/drawable
/drawable-large-hdpi
/layout
/layout-port
/layout-large-hdpi
`large-hdpi` folders are for Galaxy Tab, while others are for other tablets.
What additional resource folders do you suggest to add? | 4 |
2,291,657 | 02/18/2010 19:42:50 | 276,409 | 02/18/2010 19:32:21 | 1 | 0 | Jquery/Javascript Access Table Row Attribute | I need to access two attributes I've assigned to my row in code-behind.
userId and eventId
here is what I have.. and have tried.
function ExportToPbuse()
{
var rowCount = GeneralReport.rows.length;
for (var i = 0; i < rowCount; i++) {
var userId= GeneralTbl.tbodies.row[i]$(this).attr("userid")
var eventId= GeneralTbl.tbodies.row[i]$(this).attr("eventid")
//exportArray add userId and eventId
}
}
this doesn't work... and I've tried a few other ways, but I'm really not all that familiar with jquery so any suggestions would help greatly..thanks :) | jquery | html | c# | null | null | null | open | Jquery/Javascript Access Table Row Attribute
===
I need to access two attributes I've assigned to my row in code-behind.
userId and eventId
here is what I have.. and have tried.
function ExportToPbuse()
{
var rowCount = GeneralReport.rows.length;
for (var i = 0; i < rowCount; i++) {
var userId= GeneralTbl.tbodies.row[i]$(this).attr("userid")
var eventId= GeneralTbl.tbodies.row[i]$(this).attr("eventid")
//exportArray add userId and eventId
}
}
this doesn't work... and I've tried a few other ways, but I'm really not all that familiar with jquery so any suggestions would help greatly..thanks :) | 0 |
6,334,644 | 06/13/2011 18:33:09 | 237,351 | 12/23/2009 04:18:15 | 704 | 39 | LESS css set dynamic background image with mixin | I am using <a href="http://lesscss.org">LESS CSS </a>.
I am currently using Mixins with variables. <br/> <br/>Something like this works okay :
.border-radius (@radius) { border-radius: @radius; }
#header { .border-radius(4px); }
This is <b>not</b> :
.bg-img(@img) { background-image:url(@img); }
#logo { .bg-img("../images/logo.jpg"); }
i have tried combinations of using ' & " in the background-image:url <b>('') & ("")</b> but then it tries to get the image as `images/@img` instead of the image name. other wise it gives me an error of <br/> `Cannot call method 'charAt' of undefined`
I think writing `background-image:url()` all the time is too tedious, is this possible..?
| css | variables | less | mixins | null | null | open | LESS css set dynamic background image with mixin
===
I am using <a href="http://lesscss.org">LESS CSS </a>.
I am currently using Mixins with variables. <br/> <br/>Something like this works okay :
.border-radius (@radius) { border-radius: @radius; }
#header { .border-radius(4px); }
This is <b>not</b> :
.bg-img(@img) { background-image:url(@img); }
#logo { .bg-img("../images/logo.jpg"); }
i have tried combinations of using ' & " in the background-image:url <b>('') & ("")</b> but then it tries to get the image as `images/@img` instead of the image name. other wise it gives me an error of <br/> `Cannot call method 'charAt' of undefined`
I think writing `background-image:url()` all the time is too tedious, is this possible..?
| 0 |
3,097,184 | 06/22/2010 21:12:52 | 370,825 | 06/19/2010 03:05:57 | 6 | 0 | Asp.net MVC 2 Editor Template that is a List of Complex Type | Alright I will try to give a good description along with my HTML that is being rendered and the request data I am seeing.
I have created an EditorTemplate to be in charge of rendering a collection of phone numbers. So this template is expecting a List<PhoneNumber> for its model. I have a Model for my View that contains this List<PhoneNumber> as a property called PhoneNumbers.
I am simply using the <%: Html.EditorFor(m => m.PhoneNumbers) %> to pass my data to the Editor. Here is a snippet of the Html that I am seeing being rendered for one of my Phone Number properties which happens to be the area code:
<input type="text" value="" style="width: 30px;" name="PhoneNumbers.[0].AreaCode" maxlength="3" id="PhoneNumbers__2__AreaCode">
This all appears to be correct and I am inspecting the request with fiddler and it seems to be properly passing back all my values for the collection but it seems that the MVC 2 model binder must be unable to bind it back to the original collection.
| asp.net-mvc-2 | mvc-editor-templates | null | null | null | null | open | Asp.net MVC 2 Editor Template that is a List of Complex Type
===
Alright I will try to give a good description along with my HTML that is being rendered and the request data I am seeing.
I have created an EditorTemplate to be in charge of rendering a collection of phone numbers. So this template is expecting a List<PhoneNumber> for its model. I have a Model for my View that contains this List<PhoneNumber> as a property called PhoneNumbers.
I am simply using the <%: Html.EditorFor(m => m.PhoneNumbers) %> to pass my data to the Editor. Here is a snippet of the Html that I am seeing being rendered for one of my Phone Number properties which happens to be the area code:
<input type="text" value="" style="width: 30px;" name="PhoneNumbers.[0].AreaCode" maxlength="3" id="PhoneNumbers__2__AreaCode">
This all appears to be correct and I am inspecting the request with fiddler and it seems to be properly passing back all my values for the collection but it seems that the MVC 2 model binder must be unable to bind it back to the original collection.
| 0 |
7,878,702 | 10/24/2011 16:22:14 | 1,011,237 | 10/24/2011 16:07:48 | 1 | 0 | which tool is good for load testing please help me as per our requirements | as per these rquirements please help me which load testing is best .
it is a .net application.
1) makng sure that the webserver can holsd peek 27,000 mails in the server for or in 24 hours duration.
2)making sure the mail meter is keeping up.
3)as of 7,500 users can able to send atleast 1 to 2 mails for 10 to 20 minutes.
please help me with these.
Thank You. | testing | load | null | null | null | 10/24/2011 18:01:21 | not constructive | which tool is good for load testing please help me as per our requirements
===
as per these rquirements please help me which load testing is best .
it is a .net application.
1) makng sure that the webserver can holsd peek 27,000 mails in the server for or in 24 hours duration.
2)making sure the mail meter is keeping up.
3)as of 7,500 users can able to send atleast 1 to 2 mails for 10 to 20 minutes.
please help me with these.
Thank You. | 4 |
6,106,907 | 05/24/2011 07:08:49 | 12,652 | 09/16/2008 15:08:04 | 2,252 | 134 | Why is MRI the mainstream Ruby interpreter, while it performs the worst? | 1) Having seen [this interpreter comparison graph][1], I wondered the reasons behind the MRI's mainstream usage, although it performs the worst. Why aren't [Kiji][2] or [Ruby Enterprise Edition][3] used more frequently; lack of gem support or something else?
![Ruby comparison graph][4]
2) Does Ruby 1.9.2 have copy-on-write support, [which leads Rails processes to use %33 less memory][5]?
[1]: http://engineering.twitter.com/2011/05/faster-ruby-kiji-update.html
[2]: http://engineering.twitter.com/2011/03/building-faster-ruby-garbage-collector.html
[3]: http://blog.phusion.nl/2011/02/21/ruby-enterprise-edition-1-8-7-2011-02-released/
[4]: http://i.stack.imgur.com/kQG72.png
[5]: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_how_it_works | ruby | interpreter | ruby-enterprise-edition | null | null | 05/25/2011 16:45:07 | not constructive | Why is MRI the mainstream Ruby interpreter, while it performs the worst?
===
1) Having seen [this interpreter comparison graph][1], I wondered the reasons behind the MRI's mainstream usage, although it performs the worst. Why aren't [Kiji][2] or [Ruby Enterprise Edition][3] used more frequently; lack of gem support or something else?
![Ruby comparison graph][4]
2) Does Ruby 1.9.2 have copy-on-write support, [which leads Rails processes to use %33 less memory][5]?
[1]: http://engineering.twitter.com/2011/05/faster-ruby-kiji-update.html
[2]: http://engineering.twitter.com/2011/03/building-faster-ruby-garbage-collector.html
[3]: http://blog.phusion.nl/2011/02/21/ruby-enterprise-edition-1-8-7-2011-02-released/
[4]: http://i.stack.imgur.com/kQG72.png
[5]: http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_how_it_works | 4 |
4,728,042 | 01/18/2011 19:15:34 | 473,795 | 10/12/2010 20:25:55 | 134 | 3 | Book on Problem Solving | Could anyone recommend a book on the art of problem solving? I would greatly appreciate this. Thank you. | problem | problem-solving | problems | null | null | 01/18/2011 19:23:15 | off topic | Book on Problem Solving
===
Could anyone recommend a book on the art of problem solving? I would greatly appreciate this. Thank you. | 2 |
5,008,791 | 02/15/2011 19:54:04 | 1,228 | 08/13/2008 13:58:55 | 36,367 | 1,326 | WPF toolbox installer for a type defined in a different assembly | I'm trying to create a VSIX installer for a WPF control.
Its supposedly easy, but the "easy" version assumes that you create the WPF control in the **VSIX project**.
The thing is, I've got my UserControl nestled deep within one of my DLLs, and I don't believe pulling it out is the best design. I'd like to leave it in there, but I can't seem to do this AND have the control added to the toolbox.
One option would be to move the code I need to install it to the toolbox into the control's assembly, but that would add a dependency to **Microsoft.VisualStudio.Shell.Immutable.10.0.dll**. The assembly is both used by someone with Visual Studio installed, and a remote server running within a service where VS isn't installed, so that's a no-go.
Another option I tried was to "trick" the toolbox installer VSIX by applying the RegistrationAttribute to *proxies* which would register the types defined in the other assembly. Thought it would work, but weird stuff happened.
![all kinds of weirdness in the toolbox][1]
Instead of getting two controls, I get a bunch of Border controls (the standard WPF border) in oddly named tabs, some of which echo some of my namespaces.
**How can I register a WPF UserControl with the Toolbox when the control is defined in an assembly other than the VSIX?**
[1]: http://i.stack.imgur.com/5veRg.png | wpf | usercontrols | install | toolbox | null | null | open | WPF toolbox installer for a type defined in a different assembly
===
I'm trying to create a VSIX installer for a WPF control.
Its supposedly easy, but the "easy" version assumes that you create the WPF control in the **VSIX project**.
The thing is, I've got my UserControl nestled deep within one of my DLLs, and I don't believe pulling it out is the best design. I'd like to leave it in there, but I can't seem to do this AND have the control added to the toolbox.
One option would be to move the code I need to install it to the toolbox into the control's assembly, but that would add a dependency to **Microsoft.VisualStudio.Shell.Immutable.10.0.dll**. The assembly is both used by someone with Visual Studio installed, and a remote server running within a service where VS isn't installed, so that's a no-go.
Another option I tried was to "trick" the toolbox installer VSIX by applying the RegistrationAttribute to *proxies* which would register the types defined in the other assembly. Thought it would work, but weird stuff happened.
![all kinds of weirdness in the toolbox][1]
Instead of getting two controls, I get a bunch of Border controls (the standard WPF border) in oddly named tabs, some of which echo some of my namespaces.
**How can I register a WPF UserControl with the Toolbox when the control is defined in an assembly other than the VSIX?**
[1]: http://i.stack.imgur.com/5veRg.png | 0 |
5,010,103 | 02/15/2011 22:07:44 | 281,671 | 02/25/2010 23:03:51 | 2,084 | 4 | Show Dialog With WebBrowser Question | I want to show a printer dialog but when I run the following code, it prints right away while the ShowPrinterDialog is open. In other words, it doesn't wait for the ShowPrinterDialog to close before printing.
WebBrowser browser = new WebBrowser();
browser.DocumentText = "<b>Stack Overflow FTW!</b>";
browser.DocumentCompleted += Browser_DocumentCompleted;
Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e){
((WebBrowser)sender).ShowPrinterDialog();
((WebBrowser)sender).Print();
}
Any ideas on how to fix this? | c# | printing | webbrowser-control | printdialog | null | null | open | Show Dialog With WebBrowser Question
===
I want to show a printer dialog but when I run the following code, it prints right away while the ShowPrinterDialog is open. In other words, it doesn't wait for the ShowPrinterDialog to close before printing.
WebBrowser browser = new WebBrowser();
browser.DocumentText = "<b>Stack Overflow FTW!</b>";
browser.DocumentCompleted += Browser_DocumentCompleted;
Browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e){
((WebBrowser)sender).ShowPrinterDialog();
((WebBrowser)sender).Print();
}
Any ideas on how to fix this? | 0 |
7,552,146 | 09/26/2011 07:59:24 | 964,621 | 09/26/2011 07:53:55 | 1 | 0 | Nginx http push module install error for ( Ubuntu ) | root@murat-VirtualBox:/var# ./configure --add-module=/var/nginx_http_push_module-0.692
bash: ./configure: No such file or directory
root@murat-VirtualBox:var# cd nginx_http_push_module-0.692
root@murat-VirtualBox:var/nginx_http_push_module-0.692# ./configure --add-
module=/var/nginx_http_push_module-0.692
bash: ./configure: No such file or directory
I want install Nginx http push module! Please help :( | ubuntu | nginx | null | null | null | 09/26/2011 08:12:06 | off topic | Nginx http push module install error for ( Ubuntu )
===
root@murat-VirtualBox:/var# ./configure --add-module=/var/nginx_http_push_module-0.692
bash: ./configure: No such file or directory
root@murat-VirtualBox:var# cd nginx_http_push_module-0.692
root@murat-VirtualBox:var/nginx_http_push_module-0.692# ./configure --add-
module=/var/nginx_http_push_module-0.692
bash: ./configure: No such file or directory
I want install Nginx http push module! Please help :( | 2 |
10,288,585 | 04/23/2012 21:27:25 | 1,230,123 | 02/24/2012 06:43:15 | 561 | 56 | Is it legal to create APK sender application? | I'm thinking of creating an APK sender application which you can send and share your installed APKs. Is that legal if want to put it in google play?
Note: I never read policies and stuff.. | android | apk | legal | null | null | 04/23/2012 21:48:45 | off topic | Is it legal to create APK sender application?
===
I'm thinking of creating an APK sender application which you can send and share your installed APKs. Is that legal if want to put it in google play?
Note: I never read policies and stuff.. | 2 |
10,481,439 | 05/07/2012 11:40:14 | 1,378,529 | 05/06/2012 19:55:07 | 6 | 0 | how i put action mouse for puzzle number game |
package puzzleNumberGame;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author mlk 10-4-2012
*/
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.Date;
import java.util.TimerTask;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;
import javax.swing.JOptionPane;
public class EasyPuzzleScreen extends JFrame {
private long starttime = System.currentTimeMillis();
public static void main(String []args){
//Clock eg = new Clock();
//component of first frame
//craete frist buttons
JButton TimeButton = new JButton("Time");
JButton HighScoreButton = new JButton("high score");
JButton SaveButton= new JButton("Save");
JButton SkipButton = new JButton("Skip");
//JLabel timeLabel = new JLabel();
// create second buttons
JButton b1=new JButton ("1");
JButton b2=new JButton ("2");
JButton b3=new JButton ("3");
JButton b4=new JButton ("4");
JButton b5=new JButton ("5");
JButton b6=new JButton ("6");
JButton b7=new JButton ("7");
JButton b8=new JButton ("8");
JButton b9=new JButton ("9");
JButton b10=new JButton ("10");
JButton b11=new JButton ("11");
JButton b12=new JButton ("12");
JButton b13=new JButton ("13");
JButton b14=new JButton ("14");
JButton b15=new JButton ("15");
JButton b16=new JButton ("");
b16.setVisible(false);
//object from class
final EasyPuzzleScreen easy =new EasyPuzzleScreen();
// for frame1
easy.setVisible(true);
// easy.setSize(450, 450);
easy.setBounds(400, 190, 450, 450);
easy.setResizable(false);
easy.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
easy.setTitle("puzzle number: Easy puzzle from (1-15)");
BorderLayout easyLayout = new BorderLayout();
Container c1 = easy.getContentPane();
c1.setLayout(easyLayout);
JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayout(4,4,5,5));
c1.add(panel1, BorderLayout.WEST);
panel1.add(TimeButton);
panel1.add(HighScoreButton);
panel1.add(SaveButton);
panel1.add(SkipButton);
JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayout(4,4,4,4));
c1.add(panel2, BorderLayout.CENTER);
// c1.add(puzzel , BorderLayout.CENTER );
//panel2.add(buttons);
panel2.add(b1 );
panel2.add(b2 );
panel2.add(b3 );
panel2.add(b4 );
panel2.add(b5 );
panel2.add(b6 );
panel2.add(b7 );
panel2.add(b8 );
panel2.add(b9 );
panel2.add(b10 );
panel2.add(b11 );
panel2.add(b12 );
panel2.add(b13 );
panel2.add(b14 );
panel2.add(b15 );
//c
TimeButton.setBackground(Color.gray);
HighScoreButton.setBackground(Color.gray);
SaveButton.setBackground(Color.gray);
SkipButton.setBackground(Color.gray);
panel1.setBackground(Color.pink);
panel2.setBackground(Color.gray);
//actionListeners
SkipButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e ){
easy.setVisible(false);}});
HighScoreButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e ){
HighScore.main(null);
}});
TimeButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e ){
// long starttime;
//starttime = System.currentTimeMillis();
JOptionPane.showMessageDialog(null, "Time "+ (System.currentTimeMillis()- easy.starttime)/1000+" sec");
}});
}
}
my idea to complete this game
Empty spot can have a button as well but not visible. Clicking on a button next to invisible button should make clicked one invisible and invisible becomes visible. So, viewer will think that you have moved it.
can you help me to make this idea i want
| for-loop | numbers | mouse | action | puzzle | null | open | how i put action mouse for puzzle number game
===
package puzzleNumberGame;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author mlk 10-4-2012
*/
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import java.util.Date;
import java.util.TimerTask;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;
import javax.swing.JOptionPane;
public class EasyPuzzleScreen extends JFrame {
private long starttime = System.currentTimeMillis();
public static void main(String []args){
//Clock eg = new Clock();
//component of first frame
//craete frist buttons
JButton TimeButton = new JButton("Time");
JButton HighScoreButton = new JButton("high score");
JButton SaveButton= new JButton("Save");
JButton SkipButton = new JButton("Skip");
//JLabel timeLabel = new JLabel();
// create second buttons
JButton b1=new JButton ("1");
JButton b2=new JButton ("2");
JButton b3=new JButton ("3");
JButton b4=new JButton ("4");
JButton b5=new JButton ("5");
JButton b6=new JButton ("6");
JButton b7=new JButton ("7");
JButton b8=new JButton ("8");
JButton b9=new JButton ("9");
JButton b10=new JButton ("10");
JButton b11=new JButton ("11");
JButton b12=new JButton ("12");
JButton b13=new JButton ("13");
JButton b14=new JButton ("14");
JButton b15=new JButton ("15");
JButton b16=new JButton ("");
b16.setVisible(false);
//object from class
final EasyPuzzleScreen easy =new EasyPuzzleScreen();
// for frame1
easy.setVisible(true);
// easy.setSize(450, 450);
easy.setBounds(400, 190, 450, 450);
easy.setResizable(false);
easy.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
easy.setTitle("puzzle number: Easy puzzle from (1-15)");
BorderLayout easyLayout = new BorderLayout();
Container c1 = easy.getContentPane();
c1.setLayout(easyLayout);
JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayout(4,4,5,5));
c1.add(panel1, BorderLayout.WEST);
panel1.add(TimeButton);
panel1.add(HighScoreButton);
panel1.add(SaveButton);
panel1.add(SkipButton);
JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayout(4,4,4,4));
c1.add(panel2, BorderLayout.CENTER);
// c1.add(puzzel , BorderLayout.CENTER );
//panel2.add(buttons);
panel2.add(b1 );
panel2.add(b2 );
panel2.add(b3 );
panel2.add(b4 );
panel2.add(b5 );
panel2.add(b6 );
panel2.add(b7 );
panel2.add(b8 );
panel2.add(b9 );
panel2.add(b10 );
panel2.add(b11 );
panel2.add(b12 );
panel2.add(b13 );
panel2.add(b14 );
panel2.add(b15 );
//c
TimeButton.setBackground(Color.gray);
HighScoreButton.setBackground(Color.gray);
SaveButton.setBackground(Color.gray);
SkipButton.setBackground(Color.gray);
panel1.setBackground(Color.pink);
panel2.setBackground(Color.gray);
//actionListeners
SkipButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e ){
easy.setVisible(false);}});
HighScoreButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e ){
HighScore.main(null);
}});
TimeButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e ){
// long starttime;
//starttime = System.currentTimeMillis();
JOptionPane.showMessageDialog(null, "Time "+ (System.currentTimeMillis()- easy.starttime)/1000+" sec");
}});
}
}
my idea to complete this game
Empty spot can have a button as well but not visible. Clicking on a button next to invisible button should make clicked one invisible and invisible becomes visible. So, viewer will think that you have moved it.
can you help me to make this idea i want
| 0 |
474,277 | 01/23/2009 19:59:44 | 40,667 | 11/25/2008 15:12:45 | 250 | 22 | Considering a new Rails app with existing data (not a db, actual data) -- what is the best way to proceed? | I have been tasked with developing a new retail e-commerce storefront for my current job, and I am considering tackling it with RoR to A) Build a "real" project with my limited Rails knowledge, and B) Give management quick turnaround and feedback (they are wanting to get this done ASAP and their deadlines are rather unrealistic - I'm talking a couple of weeks to go from nothing to working model so they can start to market it with SEO/SEM and, I kid you not, "video blogging" because my boss heard that's the future).
We do have a database structure in place but it's absolutely terrible and was thrown together without rhyme nor reason, so I'm going to largely ignore it and create a new database from scratch; however, I have existing data that I need to load into the application (like I said, it's an e-commerce app and we have the product data). I need to massage this data into a usable format because our supplier provides it to us with cryptic, abbreviated column names and it's highly denormalized, especially in the categories (I've posted a question regarding it before - basically the categories table has six fields, one for each category/subcategory, with some of them being blank if that category doesn't apply).
There are two main issues that are giving me second thoughts:
1) As I said the data needs to be put into a "proper" database schema; I can't just load it as-is. I have some thoughts as to a good data model for it, but my analysis is not completed yet. There would end up being a large amount of joins tables to link various things together (e.g. products_categories, products_attributes, products_prices) etc and these tables would link products not via an ID but by their SKU (see below).
2) Everything already has an ID that's generated for it, but anything new I add needs to have one autogenerated; I doubt this will be a problem with any mature RDBMS, but I know Rails likes to generate IDs itself. Also, almost all of the product-related tables are linked by SKUs (and in the data provided by the supplier are actually a composite key consisting of the prefix and stock number, which combined make up the full SKU), not by IDs and I'm not sure if this will be a performance issue (of course, I could always manually create indexes on these columns to speed it up). It does mean that I'll need to break away from the Rails conventions, however.
In short, I think that Rails might be a good choice as far as time-to-market and ease-of-development, but having to work with the existing data content might turn into a pain because the application will need to be developed around that, instead of the "traditional" Rails app, and that factor is giving me major doubts about using Rails. There are also some other issues (having to set up a Linux server, and the fact that the area I live in has very few Rails developers so if I left the company I'd basically be holding them hostage as far as updates/modifications). I'm really unsure as to the best path to proceed. | data | brownfield | ruby-on-rails | null | null | null | open | Considering a new Rails app with existing data (not a db, actual data) -- what is the best way to proceed?
===
I have been tasked with developing a new retail e-commerce storefront for my current job, and I am considering tackling it with RoR to A) Build a "real" project with my limited Rails knowledge, and B) Give management quick turnaround and feedback (they are wanting to get this done ASAP and their deadlines are rather unrealistic - I'm talking a couple of weeks to go from nothing to working model so they can start to market it with SEO/SEM and, I kid you not, "video blogging" because my boss heard that's the future).
We do have a database structure in place but it's absolutely terrible and was thrown together without rhyme nor reason, so I'm going to largely ignore it and create a new database from scratch; however, I have existing data that I need to load into the application (like I said, it's an e-commerce app and we have the product data). I need to massage this data into a usable format because our supplier provides it to us with cryptic, abbreviated column names and it's highly denormalized, especially in the categories (I've posted a question regarding it before - basically the categories table has six fields, one for each category/subcategory, with some of them being blank if that category doesn't apply).
There are two main issues that are giving me second thoughts:
1) As I said the data needs to be put into a "proper" database schema; I can't just load it as-is. I have some thoughts as to a good data model for it, but my analysis is not completed yet. There would end up being a large amount of joins tables to link various things together (e.g. products_categories, products_attributes, products_prices) etc and these tables would link products not via an ID but by their SKU (see below).
2) Everything already has an ID that's generated for it, but anything new I add needs to have one autogenerated; I doubt this will be a problem with any mature RDBMS, but I know Rails likes to generate IDs itself. Also, almost all of the product-related tables are linked by SKUs (and in the data provided by the supplier are actually a composite key consisting of the prefix and stock number, which combined make up the full SKU), not by IDs and I'm not sure if this will be a performance issue (of course, I could always manually create indexes on these columns to speed it up). It does mean that I'll need to break away from the Rails conventions, however.
In short, I think that Rails might be a good choice as far as time-to-market and ease-of-development, but having to work with the existing data content might turn into a pain because the application will need to be developed around that, instead of the "traditional" Rails app, and that factor is giving me major doubts about using Rails. There are also some other issues (having to set up a Linux server, and the fact that the area I live in has very few Rails developers so if I left the company I'd basically be holding them hostage as far as updates/modifications). I'm really unsure as to the best path to proceed. | 0 |
3,710,745 | 09/14/2010 16:12:56 | 447,534 | 09/14/2010 15:58:31 | 1 | 0 | Google Maps v3 OverlayView.getProjection() | I cannot seem to figure out why the object returned by getProjection() is undefined. Here is my code:
// Handles the completion of the rectangle
var ne = recBounds.getNorthEast();
var sw = recBounds.getSouthWest();
$("#map_tools_selat").attr( 'value', sw.lat() );
$("#map_tools_nwlat").attr( 'value', ne.lat() );
$("#map_tools_selng").attr( 'value', ne.lng() );
$("#map_tools_nwlng").attr( 'value', sw.lng() );
// Set Zoom Level
$("#map_tools_zoomlevel").attr( 'value', HAR.map.getZoom()+1 );
document.getElementById("map_tools_centerLat").value = HAR.map.getCenter().lat();
document.getElementById("map_tools_centerLong").value = HAR.map.getCenter().lng();
// All this junk below is for getting pixel coordinates for a lat/lng =/
MyOverlay.prototype = new google.maps.OverlayView();
MyOverlay.prototype.onAdd = function() { }
MyOverlay.prototype.onRemove = function() { }
MyOverlay.prototype.draw = function() { }
function MyOverlay(map) { this.setMap(map); }
var overlay = new MyOverlay(HAR.map);
var projection = overlay.getProjection();
// END - all the junk
var p = projection.fromLatLngToContainerPixel(recBounds.getCenter());
alert(p.x+", "+p.y);
My error is: **Cannot call method 'fromLatLngToContainerPixel' of undefined** | google-maps | google-maps-api-3 | null | null | null | null | open | Google Maps v3 OverlayView.getProjection()
===
I cannot seem to figure out why the object returned by getProjection() is undefined. Here is my code:
// Handles the completion of the rectangle
var ne = recBounds.getNorthEast();
var sw = recBounds.getSouthWest();
$("#map_tools_selat").attr( 'value', sw.lat() );
$("#map_tools_nwlat").attr( 'value', ne.lat() );
$("#map_tools_selng").attr( 'value', ne.lng() );
$("#map_tools_nwlng").attr( 'value', sw.lng() );
// Set Zoom Level
$("#map_tools_zoomlevel").attr( 'value', HAR.map.getZoom()+1 );
document.getElementById("map_tools_centerLat").value = HAR.map.getCenter().lat();
document.getElementById("map_tools_centerLong").value = HAR.map.getCenter().lng();
// All this junk below is for getting pixel coordinates for a lat/lng =/
MyOverlay.prototype = new google.maps.OverlayView();
MyOverlay.prototype.onAdd = function() { }
MyOverlay.prototype.onRemove = function() { }
MyOverlay.prototype.draw = function() { }
function MyOverlay(map) { this.setMap(map); }
var overlay = new MyOverlay(HAR.map);
var projection = overlay.getProjection();
// END - all the junk
var p = projection.fromLatLngToContainerPixel(recBounds.getCenter());
alert(p.x+", "+p.y);
My error is: **Cannot call method 'fromLatLngToContainerPixel' of undefined** | 0 |
7,549,929 | 09/26/2011 01:46:51 | 640,558 | 03/02/2011 04:50:28 | 673 | 15 | What kind of algorithms are used to break down data? | I'm sorry if this is really easy. I'm new to algorithms(and programming in general) so I'm not even sure what to search.
Here's my problem. I have a table with a large amount of data and need to do lookups on each and break down each of the data down. Here's a simplified numeric example. Image I have this table:
1 [1]
2 [1, 1]
4 [2, 2]
now I want to break down 4. I look up and see 2+2=4. so then I look up 2 and see if breaks down into 1+1 so I know 2+1+1=4 and 1+1+1+1=4. For this problem, I should break it down(using the computed table) into 4 results(the 3 mentioned and 4 *1 =4).
I am not sure but is this a graph problem? or some other type? I think I can solve this by just using a recursions that break this down, but I want to learn if there's an general accepted way and this process will deal with large amounts of data so I'll need to design it in a way that the breakdown can be distributed over multiple cpu's.
Any idea what type of problem this is or the logic to solve it? I'm sorry if this question already exists, I'm not sure what exactly I need to search to find what I need to learn.
Thank you! | algorithm | math | graph-algorithm | null | null | 09/26/2011 06:03:22 | not a real question | What kind of algorithms are used to break down data?
===
I'm sorry if this is really easy. I'm new to algorithms(and programming in general) so I'm not even sure what to search.
Here's my problem. I have a table with a large amount of data and need to do lookups on each and break down each of the data down. Here's a simplified numeric example. Image I have this table:
1 [1]
2 [1, 1]
4 [2, 2]
now I want to break down 4. I look up and see 2+2=4. so then I look up 2 and see if breaks down into 1+1 so I know 2+1+1=4 and 1+1+1+1=4. For this problem, I should break it down(using the computed table) into 4 results(the 3 mentioned and 4 *1 =4).
I am not sure but is this a graph problem? or some other type? I think I can solve this by just using a recursions that break this down, but I want to learn if there's an general accepted way and this process will deal with large amounts of data so I'll need to design it in a way that the breakdown can be distributed over multiple cpu's.
Any idea what type of problem this is or the logic to solve it? I'm sorry if this question already exists, I'm not sure what exactly I need to search to find what I need to learn.
Thank you! | 1 |
9,306,467 | 02/16/2012 06:17:43 | 1,210,766 | 02/15/2012 08:09:12 | 3 | 0 | Iframe memory usage | What is the memory allocation for the Iframes?<br>
Is it varies for browsers?<br>
How can we find the memory usage of the iframes?<br>
If we store more data in Javascript (like 1-2 MB) in iframe content will it affect the browser performance? | javascript | iframe | null | null | null | 02/16/2012 16:14:08 | not a real question | Iframe memory usage
===
What is the memory allocation for the Iframes?<br>
Is it varies for browsers?<br>
How can we find the memory usage of the iframes?<br>
If we store more data in Javascript (like 1-2 MB) in iframe content will it affect the browser performance? | 1 |
8,470,193 | 12/12/2011 05:13:06 | 1,093,104 | 12/12/2011 05:03:17 | 1 | 0 | Selenium fails with empty exception message | I'm using Selenium 2.7.0 and Python 2.6, my OS is Mac OS X 10.7.
When I'm trying to instantiate webdriver object I'm getting the following message:
selenium.common.exception.WebDriverException: Message: ''
Previously I was using Selenium 2.13.0, but I've installed older version because I have working installation on another machine. The first attempt (after reinstallation) to launch webdriver was successful, but all subsequent are not. Then I tried to use Chrome driver instead Firefox, and got the same situation: successful first attempt and unsuccessful subsequent ones.
It's quite hard to google because error message is empty. | selenium | webdriver | null | null | null | null | open | Selenium fails with empty exception message
===
I'm using Selenium 2.7.0 and Python 2.6, my OS is Mac OS X 10.7.
When I'm trying to instantiate webdriver object I'm getting the following message:
selenium.common.exception.WebDriverException: Message: ''
Previously I was using Selenium 2.13.0, but I've installed older version because I have working installation on another machine. The first attempt (after reinstallation) to launch webdriver was successful, but all subsequent are not. Then I tried to use Chrome driver instead Firefox, and got the same situation: successful first attempt and unsuccessful subsequent ones.
It's quite hard to google because error message is empty. | 0 |
6,491,238 | 06/27/2011 09:59:52 | 817,128 | 06/27/2011 09:59:52 | 1 | 0 | data sending through usb | my project is after streaming video And parsing it ,i should send that data through usb to leopard dm365 board,i need the c code for sending the parsed data through usb.
im using,
os:ubuntu 10.04
usb cable: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
regards
vs | linux | null | null | null | null | 06/27/2011 11:16:56 | not a real question | data sending through usb
===
my project is after streaming video And parsing it ,i should send that data through usb to leopard dm365 board,i need the c code for sending the parsed data through usb.
im using,
os:ubuntu 10.04
usb cable: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
regards
vs | 1 |
7,087,598 | 08/17/2011 03:21:30 | 897,732 | 08/17/2011 00:36:32 | -1 | 0 | HashMap return in an API call | Why is it bad to return a HashMap from an API call? And why?
This is mainly in reference to Saas/Cloud computing | interview-questions | high-availability | null | null | null | 08/17/2011 17:14:51 | not a real question | HashMap return in an API call
===
Why is it bad to return a HashMap from an API call? And why?
This is mainly in reference to Saas/Cloud computing | 1 |
10,990,222 | 06/12/2012 03:35:15 | 968,095 | 09/27/2011 23:50:17 | 14 | 1 | Photoshop's "Export for web and devices" to export with divs instead of tables | Are there any ways for Photoshop to export html with divs instead of tables when making a website psd design? <br/> <br/>
The design that I am working with has some complex positioning. <br/>
Here is an example of the table: [PasteBin][1] <br/> <br/>
[1]: http://pastebin.com/72x5nsHy | html | photoshop | null | null | null | 06/13/2012 07:09:58 | off topic | Photoshop's "Export for web and devices" to export with divs instead of tables
===
Are there any ways for Photoshop to export html with divs instead of tables when making a website psd design? <br/> <br/>
The design that I am working with has some complex positioning. <br/>
Here is an example of the table: [PasteBin][1] <br/> <br/>
[1]: http://pastebin.com/72x5nsHy | 2 |
11,749,099 | 07/31/2012 21:14:03 | 153,923 | 08/10/2009 19:24:09 | 2,931 | 281 | Get Brush from Color without SolidColorBrush | It looks like the [SolidColorBrush][1] requires .NET 3 or up, and I have a requirement to keep away from requiring manufacturing computers go through an upgrade.
So, given a [System.Drawing.Color][2] `color`, how would I create a [System.Drawing.Brush][3]?
public static Brush GetBrush(Color color) {
Brush result = Brushes.Black;
// What goes here?
return result;
}
The only static methods I see in Brushes are `Equals` and `ReferenceEquals`; non-static is only `Clone`.
[1]: http://msdn.microsoft.com/en-us/library/system.windows.media.solidcolorbrush.aspx
[2]: http://msdn.microsoft.com/en-us/library/system.drawing.color.aspx
[3]: http://msdn.microsoft.com/en-us/library/system.drawing.brush.aspx | c# | windows | drawing | null | null | null | open | Get Brush from Color without SolidColorBrush
===
It looks like the [SolidColorBrush][1] requires .NET 3 or up, and I have a requirement to keep away from requiring manufacturing computers go through an upgrade.
So, given a [System.Drawing.Color][2] `color`, how would I create a [System.Drawing.Brush][3]?
public static Brush GetBrush(Color color) {
Brush result = Brushes.Black;
// What goes here?
return result;
}
The only static methods I see in Brushes are `Equals` and `ReferenceEquals`; non-static is only `Clone`.
[1]: http://msdn.microsoft.com/en-us/library/system.windows.media.solidcolorbrush.aspx
[2]: http://msdn.microsoft.com/en-us/library/system.drawing.color.aspx
[3]: http://msdn.microsoft.com/en-us/library/system.drawing.brush.aspx | 0 |
9,846,754 | 03/23/2012 21:34:54 | 1,289,090 | 03/23/2012 20:00:29 | 1 | 0 | Split a string with a lot of deviders | i have a issue with programming for android.
i have a string like this:
[["Km"],["Portagens"],["Refeições - Almoço"],["Refeições - Jantar"],["Refeições - Lanche"],["Estacionamento"],["Estadia Hotel"],["Gasóleo"],["Gasolina"],["Taxi"],["Combóio"],["Avião"],["Viatura de Aluguer"],["Viaturas BIQ"],["Economato"],["Correio"],["Outros"],["Refeições - Pequeno almoço"]]
I want to split this, to save the content into a array, like this:
Km
Portagens
Refeições-Almoço
Refeições-Jantar
Refeições-Lanche
Estacionamento
.
.
.
.
So the dividers are:
1- [
2- ]
3 - "
4 - ,
How can i split the string with this chars?
If i use [\\W], i get some blank strings.
Can you help me?
Regards.
| split | null | null | null | null | null | open | Split a string with a lot of deviders
===
i have a issue with programming for android.
i have a string like this:
[["Km"],["Portagens"],["Refeições - Almoço"],["Refeições - Jantar"],["Refeições - Lanche"],["Estacionamento"],["Estadia Hotel"],["Gasóleo"],["Gasolina"],["Taxi"],["Combóio"],["Avião"],["Viatura de Aluguer"],["Viaturas BIQ"],["Economato"],["Correio"],["Outros"],["Refeições - Pequeno almoço"]]
I want to split this, to save the content into a array, like this:
Km
Portagens
Refeições-Almoço
Refeições-Jantar
Refeições-Lanche
Estacionamento
.
.
.
.
So the dividers are:
1- [
2- ]
3 - "
4 - ,
How can i split the string with this chars?
If i use [\\W], i get some blank strings.
Can you help me?
Regards.
| 0 |
3,360,130 | 07/29/2010 06:56:50 | 405,339 | 07/29/2010 06:26:50 | 1 | 0 | How to convert time data in java? | The following time formats are in outlook calendar file
DTSTART;TZID="Eastern":20100728T140000
DTEND;TZID="Eastern":20100728T150000
how to convert this time to java time format. | java | null | null | null | null | null | open | How to convert time data in java?
===
The following time formats are in outlook calendar file
DTSTART;TZID="Eastern":20100728T140000
DTEND;TZID="Eastern":20100728T150000
how to convert this time to java time format. | 0 |
7,936,378 | 10/29/2011 01:23:14 | 1,019,066 | 10/28/2011 20:19:54 | 1 | 0 | Calling Matlab function from python | I have one project in which I have one one matlab code which I have to run tho' Django.
I tried installing Mlabwrap ..But it gives me following error.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mlabwrap.py", line 188, in <module>
import mlabraw
ImportError: No module named mlabraw
I also tried ompc (http://ompc.juricap.com/) but after addpath...it gives me a error...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\ihooks.py", line 407, in import_module
q, tail = self.find_head_package(parent, str(name))
File "C:\Python27\lib\ihooks.py", line 479, in find_head_packag
raise ImportError, "No module named '%s'" % qname
ImportError: No module named 'addpath'
| python | django | matlab | null | null | null | open | Calling Matlab function from python
===
I have one project in which I have one one matlab code which I have to run tho' Django.
I tried installing Mlabwrap ..But it gives me following error.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mlabwrap.py", line 188, in <module>
import mlabraw
ImportError: No module named mlabraw
I also tried ompc (http://ompc.juricap.com/) but after addpath...it gives me a error...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\ihooks.py", line 407, in import_module
q, tail = self.find_head_package(parent, str(name))
File "C:\Python27\lib\ihooks.py", line 479, in find_head_packag
raise ImportError, "No module named '%s'" % qname
ImportError: No module named 'addpath'
| 0 |
9,039,506 | 01/27/2012 20:17:46 | 693,560 | 04/05/2011 09:40:08 | 635 | 6 | A better solution for placing my 'logon' div on my page | I have a page where I divided things like this:
- a div for the header
- a div for the menu
- a div for the content
- a div for the logon
- a div for the sidebar
Here is a jsfiddle: http://jsfiddle.net/cambraca/f9eYx/3/
You noticed that the logon div is located inside of the content page. This is because I need the logon to be exactly on top of the content area. You noticed also that the sidebar can disappear with the Hide me hyperlink.
I don't like the logon inside of the content area. Is there any other solution? Possible to have the logon div at the same level as other div? I'm not very good at css and I'm pretty sure there is a better alternative for the logon placement.
Thanks for your help.
| html | css | null | null | null | 01/31/2012 16:17:45 | not constructive | A better solution for placing my 'logon' div on my page
===
I have a page where I divided things like this:
- a div for the header
- a div for the menu
- a div for the content
- a div for the logon
- a div for the sidebar
Here is a jsfiddle: http://jsfiddle.net/cambraca/f9eYx/3/
You noticed that the logon div is located inside of the content page. This is because I need the logon to be exactly on top of the content area. You noticed also that the sidebar can disappear with the Hide me hyperlink.
I don't like the logon inside of the content area. Is there any other solution? Possible to have the logon div at the same level as other div? I'm not very good at css and I'm pretty sure there is a better alternative for the logon placement.
Thanks for your help.
| 4 |
6,284,775 | 06/08/2011 20:21:21 | 216,353 | 11/22/2009 04:49:59 | 304 | 9 | Libraries for hash partitioning/Sharding with JPA | My department has decided move to hash partitioning/sharding for some of our large Oracle databases. We will be splitting our entities across different schemas. I've been tasked to do a spike to evaluate the suitability of different JPA implementations for this.
The two that I've told to focus on are [EclipseLink][1] and Apache [OpenJPA/Slice][2]. We have exclusively used Hibernate in the past, but [Hibernate Shards][3] is in beta, and appears no longer be actively developed (last release was in 2007), so we are not considering it.
I will be doing my own evaluation and trial implementations, but I don't trust that I will get a good feel for the overall quality of these implementations in the time that I've been given. If you are using OpenJPA and/or EclipseLink in a production environment, especially if your database is shareded, I would like to hear about your experiences (positive and negative), your opinions about their overall quality, and if you'd make the same choice again if given the opportunity.
[1]: http://www.eclipse.org/eclipselink/
[2]: http://openjpa.apache.org/
[3]: http://www.hibernate.org/subprojects/shards.html | jpa | eclipselink | openjpa | sharding | null | null | open | Libraries for hash partitioning/Sharding with JPA
===
My department has decided move to hash partitioning/sharding for some of our large Oracle databases. We will be splitting our entities across different schemas. I've been tasked to do a spike to evaluate the suitability of different JPA implementations for this.
The two that I've told to focus on are [EclipseLink][1] and Apache [OpenJPA/Slice][2]. We have exclusively used Hibernate in the past, but [Hibernate Shards][3] is in beta, and appears no longer be actively developed (last release was in 2007), so we are not considering it.
I will be doing my own evaluation and trial implementations, but I don't trust that I will get a good feel for the overall quality of these implementations in the time that I've been given. If you are using OpenJPA and/or EclipseLink in a production environment, especially if your database is shareded, I would like to hear about your experiences (positive and negative), your opinions about their overall quality, and if you'd make the same choice again if given the opportunity.
[1]: http://www.eclipse.org/eclipselink/
[2]: http://openjpa.apache.org/
[3]: http://www.hibernate.org/subprojects/shards.html | 0 |
1,133,289 | 07/15/2009 19:01:30 | 34,685 | 11/05/2008 14:09:21 | 780 | 23 | Simplest example of need for "unification" in type inference | I'm trying to get my head around how type inference is implemented.
In particularly, I don't quite see where/why the heavy lifting of "unification" comes into play.
I'll give an example in "pseudo C#" to help clarify:
The naive way to do it would be something like this:
Suppose you "parse" your program into an expression tree such that it can be executed with:
interface IEnvironment
{
object lookup(string name);
}
interface IExpression
{
// Evaluate this program in this environment
object Evaluate(IEnvironment e);
}
So something like "Multiplication" might be implemented with:
class Multiply : IExpression
{
IExpression lhs;
IExpression rhs;
// etc.
public object Evaluate(IEnvironment e)
{
// assume for the moment C# has polymorphic multiplication
return lhs.Evaluate(e) * rhs.Evaluate(e);
}
}
Then to "implement" type inference, you could just do something like:
interface ITypeEnvironment
{
Type getType(string name);
}
interface IExpression
{
//as before
object Evaluate(IEnvironment e);
// infer type
Type inferType(ITypeEnvironment typeEnvironment);
}
Then "Multiplication"'s type inference might just be something like:
class Multiply : IExpression
{
IExpression lhs;
IExpression rhs;
// ...
public Type inferType(ITypeEnvironment typeEnvironment)
{
Type lhsType = lhs.inferType(typeEnvironment);
Type rhsType = rhs.inferType(typeEnvironment);
if(lhsType != rhsType)
throw new Exception("lhs and rhs types do not match");
// you could also check here that lhs/rhs are one of double/int/float etc.
return lhsType;
}
}
lhs and rhs might be simple constants, or "variables" which are looked up in the environment:
class Constant : IExpression
{
object value;
public Type inferType(ITypeEnvironment typeEnvironment)
{
return value.GetType(); // The type of the value;
}
public object Evaluate(IEnvironment environment)
{
return value;
}
}
class Variable : IExpression
{
string name;
public Type inferType(ITypeEnvironment typeEnvironment)
{
return typeEnvironment.getType(name);
}
public object Evaluate(IEnvironment environment)
{
return environment.lookup(name);
}
}
But nowhere in this do we end up with the need for a "unification" algorithm.
So, clearly, my example is not complex enough. Does it need higher order functions? Do we need "parametric polymorphism"?
What is the simplest possible example where "unification" is actually needed to correctly infer the type of an expression.
An example in Scheme (i.e. an example of a very small Scheme program where you require unification to correctly infer the type of the s-expression would be ideal).
| scheme | c# | unification | type-inference | null | null | open | Simplest example of need for "unification" in type inference
===
I'm trying to get my head around how type inference is implemented.
In particularly, I don't quite see where/why the heavy lifting of "unification" comes into play.
I'll give an example in "pseudo C#" to help clarify:
The naive way to do it would be something like this:
Suppose you "parse" your program into an expression tree such that it can be executed with:
interface IEnvironment
{
object lookup(string name);
}
interface IExpression
{
// Evaluate this program in this environment
object Evaluate(IEnvironment e);
}
So something like "Multiplication" might be implemented with:
class Multiply : IExpression
{
IExpression lhs;
IExpression rhs;
// etc.
public object Evaluate(IEnvironment e)
{
// assume for the moment C# has polymorphic multiplication
return lhs.Evaluate(e) * rhs.Evaluate(e);
}
}
Then to "implement" type inference, you could just do something like:
interface ITypeEnvironment
{
Type getType(string name);
}
interface IExpression
{
//as before
object Evaluate(IEnvironment e);
// infer type
Type inferType(ITypeEnvironment typeEnvironment);
}
Then "Multiplication"'s type inference might just be something like:
class Multiply : IExpression
{
IExpression lhs;
IExpression rhs;
// ...
public Type inferType(ITypeEnvironment typeEnvironment)
{
Type lhsType = lhs.inferType(typeEnvironment);
Type rhsType = rhs.inferType(typeEnvironment);
if(lhsType != rhsType)
throw new Exception("lhs and rhs types do not match");
// you could also check here that lhs/rhs are one of double/int/float etc.
return lhsType;
}
}
lhs and rhs might be simple constants, or "variables" which are looked up in the environment:
class Constant : IExpression
{
object value;
public Type inferType(ITypeEnvironment typeEnvironment)
{
return value.GetType(); // The type of the value;
}
public object Evaluate(IEnvironment environment)
{
return value;
}
}
class Variable : IExpression
{
string name;
public Type inferType(ITypeEnvironment typeEnvironment)
{
return typeEnvironment.getType(name);
}
public object Evaluate(IEnvironment environment)
{
return environment.lookup(name);
}
}
But nowhere in this do we end up with the need for a "unification" algorithm.
So, clearly, my example is not complex enough. Does it need higher order functions? Do we need "parametric polymorphism"?
What is the simplest possible example where "unification" is actually needed to correctly infer the type of an expression.
An example in Scheme (i.e. an example of a very small Scheme program where you require unification to correctly infer the type of the s-expression would be ideal).
| 0 |
7,802,501 | 10/18/2011 04:40:48 | 828,824 | 07/04/2011 23:40:47 | 30 | 2 | Reprogramming a USB device? | Might be a dumb question, but I have an idea for something, and it involves taking some old web cams and other usb devices (like a usb stethoscope), and reprogramming to work with my own application (not their proprietary software). What are the general steps to going about doing so? Can someone point me to some resources? I have knowledge in C, and SystemVerilog and stuff... I basically want to create my own application that interfaces with these devices in a manner that I want.
Thanks a lot! | usb | null | null | null | null | null | open | Reprogramming a USB device?
===
Might be a dumb question, but I have an idea for something, and it involves taking some old web cams and other usb devices (like a usb stethoscope), and reprogramming to work with my own application (not their proprietary software). What are the general steps to going about doing so? Can someone point me to some resources? I have knowledge in C, and SystemVerilog and stuff... I basically want to create my own application that interfaces with these devices in a manner that I want.
Thanks a lot! | 0 |
11,452,375 | 07/12/2012 12:58:27 | 1,520,266 | 07/12/2012 09:10:50 | 1 | 0 | In symfony2 ubuntu ,app_dev.php is needed in localhost? | IN localhost/padma/Dotslinker/web/app_dev.php/logindetails/new the RuntimeException: You need to enable either the SQLite3 or PDO_SQLite extension for the profiler to run properly.but in localhost/padma/Dotslinker/web/app.php/logindetails/new no exception.sure i need to go with app_dev.php | php | ubuntu | symfony-2.0 | null | null | 07/13/2012 10:47:58 | not a real question | In symfony2 ubuntu ,app_dev.php is needed in localhost?
===
IN localhost/padma/Dotslinker/web/app_dev.php/logindetails/new the RuntimeException: You need to enable either the SQLite3 or PDO_SQLite extension for the profiler to run properly.but in localhost/padma/Dotslinker/web/app.php/logindetails/new no exception.sure i need to go with app_dev.php | 1 |
343,863 | 12/05/2008 13:41:20 | 15,108 | 09/17/2008 06:08:24 | 294 | 34 | What kind of working agreements do you have in your team? | In [this book][1] I've read a lot about working agreements. But since we don't have any in our team, or at least none that are plain for everyone to see, I'd like to ask you if you have such agreements in your team. And of course what kind of agreements?
[1]: http://www.amazon.com/Agile-Retrospectives-Making-Teams-Great/dp/0977616649/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1228484281&sr=8-1 | language-agnostic | teamwork | project-management | null | null | 05/08/2012 17:49:23 | off topic | What kind of working agreements do you have in your team?
===
In [this book][1] I've read a lot about working agreements. But since we don't have any in our team, or at least none that are plain for everyone to see, I'd like to ask you if you have such agreements in your team. And of course what kind of agreements?
[1]: http://www.amazon.com/Agile-Retrospectives-Making-Teams-Great/dp/0977616649/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1228484281&sr=8-1 | 2 |
2,600,379 | 04/08/2010 13:51:48 | 304,767 | 03/30/2010 03:25:19 | 16 | 0 | How do you stream text to an IRC Channel | does anyone know how you go about streaming text to a IRC server?
I have a game server, and i'd like to stream the chat to IRC. I can get the chat as a string within a C# program..
Anyone know how to do this? Or a good resource to look at?
Cheers | irc | c# | null | null | null | null | open | How do you stream text to an IRC Channel
===
does anyone know how you go about streaming text to a IRC server?
I have a game server, and i'd like to stream the chat to IRC. I can get the chat as a string within a C# program..
Anyone know how to do this? Or a good resource to look at?
Cheers | 0 |
3,530,566 | 08/20/2010 11:53:28 | 59,816 | 01/28/2009 15:50:17 | 31 | 2 | Why do I get a 401 error in git when pushing changes to github? | I get the following error when trying to push changes to github from the cygwin command promt on windows xp.
$ git push
Password: [my-password-here]
error: The requested URL returned error: 401 while accessing https://[username]:github.com/[username]/[repository-location]/info/refs
fatal: HTTP request failed
Searches from google seemed to point at changing the path to the certificate file on windows, which i had already done in order to clone the repository. | windows | git | http-status-code-401 | null | null | null | open | Why do I get a 401 error in git when pushing changes to github?
===
I get the following error when trying to push changes to github from the cygwin command promt on windows xp.
$ git push
Password: [my-password-here]
error: The requested URL returned error: 401 while accessing https://[username]:github.com/[username]/[repository-location]/info/refs
fatal: HTTP request failed
Searches from google seemed to point at changing the path to the certificate file on windows, which i had already done in order to clone the repository. | 0 |
4,123,768 | 11/08/2010 12:22:22 | 438,034 | 09/02/2010 13:44:06 | 322 | 27 | Has anyone used TPL Dataflow yet? | [TPL Dataflow][1] was recently released along with the [Visual Studio 2010 Async CTP][2].
Now, I'm curious: Has anyone used this library yet? As I'm very interested in using it for an actor/agent-based architecture, I'd love to hear about outcomes from the usage of this library, how you used it (and incorporated it in your design), as well as why you chose to use it [over other parallel design paradigms].
Thanks in advance!
[1]: http://blogs.msdn.com/b/pfxteam/archive/2010/10/28/10081950.aspx
[2]: http://msdn.microsoft.com/da-dk/vstudio/async%28en-us%29.aspx | .net | concurrency | task-parallel-library | dataflow | parallel-processing | 07/09/2011 01:25:44 | not constructive | Has anyone used TPL Dataflow yet?
===
[TPL Dataflow][1] was recently released along with the [Visual Studio 2010 Async CTP][2].
Now, I'm curious: Has anyone used this library yet? As I'm very interested in using it for an actor/agent-based architecture, I'd love to hear about outcomes from the usage of this library, how you used it (and incorporated it in your design), as well as why you chose to use it [over other parallel design paradigms].
Thanks in advance!
[1]: http://blogs.msdn.com/b/pfxteam/archive/2010/10/28/10081950.aspx
[2]: http://msdn.microsoft.com/da-dk/vstudio/async%28en-us%29.aspx | 4 |
7,869,257 | 10/23/2011 21:13:38 | 983,246 | 10/07/2011 01:32:25 | 10 | 0 | this operator java | I have a question about the this operator in java. in the case where a programmer would write a code like this:
private int counter;
public Incrementor(int counter){
this.counter = counter;
}
would it be better to avoid shadowing effect and go with this:
private int counter;
public Incrementor(int startValue){
counter = startValue;
}
wouldn't the this operator make the this operator obsolete in programming?
| java | this | operator-keyword | null | null | 10/24/2011 18:00:05 | not constructive | this operator java
===
I have a question about the this operator in java. in the case where a programmer would write a code like this:
private int counter;
public Incrementor(int counter){
this.counter = counter;
}
would it be better to avoid shadowing effect and go with this:
private int counter;
public Incrementor(int startValue){
counter = startValue;
}
wouldn't the this operator make the this operator obsolete in programming?
| 4 |
7,220,073 | 08/28/2011 09:24:01 | 125,179 | 06/18/2009 15:16:19 | 517 | 36 | How to set limit-rate option in Curb gem? | I'd like to set `--limit-rate` option for downloads done by Curb gem (ruby interface to curl).
In curl:
curl --limit-rate 10K http://server/large_file.rar
For downloads by Curb I have this code (plus progressbar, but that's not relevant to this question):
require 'rubygems'
require 'curb'
request = 'http://server/large_file.rar'
filename = 'large_file.rar'
f = open(filename, 'wb')
c = Curl::Easy.new(request) do |curl|
curl.on_body { |d| f << d; d.length }
end
c.perform
f.close
How do I set `--limit-rate` option in this script? As long as I can tell, there's no easy way (I've already read rdoc and done some googling).
| ruby | gem | curb | null | null | null | open | How to set limit-rate option in Curb gem?
===
I'd like to set `--limit-rate` option for downloads done by Curb gem (ruby interface to curl).
In curl:
curl --limit-rate 10K http://server/large_file.rar
For downloads by Curb I have this code (plus progressbar, but that's not relevant to this question):
require 'rubygems'
require 'curb'
request = 'http://server/large_file.rar'
filename = 'large_file.rar'
f = open(filename, 'wb')
c = Curl::Easy.new(request) do |curl|
curl.on_body { |d| f << d; d.length }
end
c.perform
f.close
How do I set `--limit-rate` option in this script? As long as I can tell, there's no easy way (I've already read rdoc and done some googling).
| 0 |
3,066,566 | 06/18/2010 00:47:34 | 293,581 | 03/14/2010 21:38:27 | 96 | 8 | Attempt to open browser in C++ | I am attempting to open Firefox using C++ on Linux (Ubuntu). However, I get an segmentation fault. What am I doing wrong, and what should I do?
std::cout << system("/usr/bin/firefox") << std::endl;
I hope to hear from you.
Kind regards,
Machiel | c++ | firefox | browser | system | open | null | open | Attempt to open browser in C++
===
I am attempting to open Firefox using C++ on Linux (Ubuntu). However, I get an segmentation fault. What am I doing wrong, and what should I do?
std::cout << system("/usr/bin/firefox") << std::endl;
I hope to hear from you.
Kind regards,
Machiel | 0 |
9,298,079 | 02/15/2012 17:20:38 | 1,011,263 | 10/24/2011 16:25:56 | 137 | 0 | Placing barButtons on Navigation Bar | I am adding an image to my UINavigationBar. Its 100 pixels long (yeah a very long navigation bar). I need to add some barbuttons to the first row (within in the first 44 pixels), and to add another few barbuttons to the next row (within the next 44 pixels).
How can i do this programatically ?
![enter image description here][1]
Those 4 boxes are barButtons, and how can i place them at those positions ?
[1]: http://i.stack.imgur.com/eU6aZ.jpg | iphone | objective-c | cocoa-touch | null | null | 02/16/2012 05:48:03 | too localized | Placing barButtons on Navigation Bar
===
I am adding an image to my UINavigationBar. Its 100 pixels long (yeah a very long navigation bar). I need to add some barbuttons to the first row (within in the first 44 pixels), and to add another few barbuttons to the next row (within the next 44 pixels).
How can i do this programatically ?
![enter image description here][1]
Those 4 boxes are barButtons, and how can i place them at those positions ?
[1]: http://i.stack.imgur.com/eU6aZ.jpg | 3 |
2,314,033 | 02/22/2010 20:46:47 | 271,503 | 02/12/2010 00:58:11 | 72 | 2 | What do you use newlisp for? | Do you use newlisp? What have you used it for? | scripting | lisp | null | null | null | 02/22/2010 20:59:34 | not a real question | What do you use newlisp for?
===
Do you use newlisp? What have you used it for? | 1 |
4,588,921 | 01/03/2011 22:21:06 | 486,660 | 10/25/2010 16:16:40 | 1 | 0 | Client/Server (Service) Communications for a c# Windows Service | I have a Windows Service that I am in the process of writing. I don't have a problem with the service in and of itself, but this is the first service that I need to have some ad-hoc communications with a client (others have just been statically configured via the .config file). I need to have a client talk to the service and send it messages and get back replies.
At first flush I thought of WCF, but I can't seem to resolve how to get my Windows Service and WCF to **talk to each other**. I can have the Windows Service host the WCF service, but that is not the same as getting an instance so I could say, wire up an event. I also don't see a way of getting the WCF service to get an instance of the running Windows Service so _it_ can talk to the Windows Service.
Either I am missing something, or, I need someone to tell me that I can't "get there from here". If it can't be done I guess I will resort to "low level" Socket calls where the service is handling the communications directly--I was just hoping to avoid doing that.
Thanks in advance,
Jim | .net | wcf | windows-services | null | null | null | open | Client/Server (Service) Communications for a c# Windows Service
===
I have a Windows Service that I am in the process of writing. I don't have a problem with the service in and of itself, but this is the first service that I need to have some ad-hoc communications with a client (others have just been statically configured via the .config file). I need to have a client talk to the service and send it messages and get back replies.
At first flush I thought of WCF, but I can't seem to resolve how to get my Windows Service and WCF to **talk to each other**. I can have the Windows Service host the WCF service, but that is not the same as getting an instance so I could say, wire up an event. I also don't see a way of getting the WCF service to get an instance of the running Windows Service so _it_ can talk to the Windows Service.
Either I am missing something, or, I need someone to tell me that I can't "get there from here". If it can't be done I guess I will resort to "low level" Socket calls where the service is handling the communications directly--I was just hoping to avoid doing that.
Thanks in advance,
Jim | 0 |
8,702,038 | 01/02/2012 14:33:15 | 1,011,174 | 10/24/2011 15:32:36 | 152 | 6 | How to test an object pool? | As I write an object pool is use C# special. But I don't know how to test it.
My object pool has implemented from `interface IPool<T>`
interface IPool<T>
where T : class
{
int Capcity { get; }
int Remainer { get; }
T Fetch();
void Store(T obj);
}
And my object pool have a constructor method `public ObjectPool(int capcity, Func<T> creater = null, Action<T> rester = null)`
| c# | objectpool | null | null | null | 01/03/2012 06:41:51 | not a real question | How to test an object pool?
===
As I write an object pool is use C# special. But I don't know how to test it.
My object pool has implemented from `interface IPool<T>`
interface IPool<T>
where T : class
{
int Capcity { get; }
int Remainer { get; }
T Fetch();
void Store(T obj);
}
And my object pool have a constructor method `public ObjectPool(int capcity, Func<T> creater = null, Action<T> rester = null)`
| 1 |
10,626,088 | 05/16/2012 20:19:32 | 834,925 | 07/08/2011 07:19:22 | 278 | 5 | Removed from sale for my application update in appstore? | I have an IPhone application in appstore that is rejected and the status is removed from sale.Now i put an update for that application and it again showing removed from sale,but my application is gone through processing for appstore status(i think that will come only if they accept the application),and all my in apppurchase state is approved and in my application status date released is also came and give an option for the update.in the reselution center they state that the application is approved so all issues are closed.Then why my application status is showing removed from sale status in appstore without showing any reason.Can anybody help me ? | iphone | null | null | null | null | 05/17/2012 12:59:55 | too localized | Removed from sale for my application update in appstore?
===
I have an IPhone application in appstore that is rejected and the status is removed from sale.Now i put an update for that application and it again showing removed from sale,but my application is gone through processing for appstore status(i think that will come only if they accept the application),and all my in apppurchase state is approved and in my application status date released is also came and give an option for the update.in the reselution center they state that the application is approved so all issues are closed.Then why my application status is showing removed from sale status in appstore without showing any reason.Can anybody help me ? | 3 |
4,919,414 | 02/07/2011 08:52:33 | 606,140 | 02/07/2011 08:52:33 | 1 | 0 | Using native c++ code in c# - problem with std::vector | I want to use my native c++ functions from dll in managed c# code.
But my functions take arguments like std::vector<int>& - a vector reference...
How I can implement this argument in dllimport statement? I know for example that there are IntPtr and so on but what will be for std::vector<>? | c# | c++ | null | null | null | null | open | Using native c++ code in c# - problem with std::vector
===
I want to use my native c++ functions from dll in managed c# code.
But my functions take arguments like std::vector<int>& - a vector reference...
How I can implement this argument in dllimport statement? I know for example that there are IntPtr and so on but what will be for std::vector<>? | 0 |
2,575,801 | 04/04/2010 20:36:11 | 130,929 | 06/30/2009 09:02:28 | 1,020 | 75 | What kind of knowledge you need to invent a new programming language? | I just finished to read "[coders at works][1]", a brilliant book by Peter Seibel with 15 interviews to some of the most interesting computer programmers alive today.
Well, many of the interviewees have (co)invented\implemented a new programming language.
For example:
* Joe Armstrong: Inventor of Erlang
* L. Peter Deutsch: implementer of Smalltalk-80
* Brendan Eich: Inventor of JavaScript
* Dan Ingalls: Smalltalk implementor and designer
* Simon Peyton Jones: Coinventor of Haskell
* Guy Steele: Coinventor of Scheme
Is out of any doubt that their minds have something special and unreachable, and i'm not crazy to think i will ever able to create a new language; i'm just interested in this topic.
So, imagine a funny\grotesque scenario where your crazy boss one day will come to your desk to say "i want a new programming language with my name on it..take the time you need and do it", what will you start to study?
What kind of knowledge do you need to model, design and implement a brand new programming language?
[1]: http://www.amazon.com/Coders-at-Work-Peter-Seibel/dp/1430219483/ref=sr_1_1?ie=UTF8&s=books&qid=1270411049&sr=8-1 | knowledge | programming-languages | self-improvement | null | null | 04/01/2011 07:12:57 | not constructive | What kind of knowledge you need to invent a new programming language?
===
I just finished to read "[coders at works][1]", a brilliant book by Peter Seibel with 15 interviews to some of the most interesting computer programmers alive today.
Well, many of the interviewees have (co)invented\implemented a new programming language.
For example:
* Joe Armstrong: Inventor of Erlang
* L. Peter Deutsch: implementer of Smalltalk-80
* Brendan Eich: Inventor of JavaScript
* Dan Ingalls: Smalltalk implementor and designer
* Simon Peyton Jones: Coinventor of Haskell
* Guy Steele: Coinventor of Scheme
Is out of any doubt that their minds have something special and unreachable, and i'm not crazy to think i will ever able to create a new language; i'm just interested in this topic.
So, imagine a funny\grotesque scenario where your crazy boss one day will come to your desk to say "i want a new programming language with my name on it..take the time you need and do it", what will you start to study?
What kind of knowledge do you need to model, design and implement a brand new programming language?
[1]: http://www.amazon.com/Coders-at-Work-Peter-Seibel/dp/1430219483/ref=sr_1_1?ie=UTF8&s=books&qid=1270411049&sr=8-1 | 4 |
7,903,954 | 10/26/2011 14:14:57 | 471,303 | 10/10/2010 03:22:51 | 584 | 28 | Why use id when we can just use NSObject? | I know that when we want to create an unknown value object we use id. However, I'm curious that why did Apple to choose id which decides it's value during runtime, when every object is a subclass of NSObject. So instead of <code>id delegate</code> we could have used <code>NSObject *delegate</code> Does anyone know why? Thanks. | objective-c | cocoa | null | null | null | null | open | Why use id when we can just use NSObject?
===
I know that when we want to create an unknown value object we use id. However, I'm curious that why did Apple to choose id which decides it's value during runtime, when every object is a subclass of NSObject. So instead of <code>id delegate</code> we could have used <code>NSObject *delegate</code> Does anyone know why? Thanks. | 0 |
9,742,668 | 03/16/2012 18:30:12 | 1,055,495 | 11/19/2011 16:28:07 | 22 | 6 | Rails 3 integrate image in a view template | I'm locked with a stupid issue in Rails 3... In fact, I'm building the css to design my application and I've a div called banner in which I want to integrate a logo (that is a png file). So I'm working on the views/layouts/application.html.erb.
I've put the image.png into the public/images folder.
In my css I use:
background-image: url("images/rails.png");
And nothing displays... It drives me nuts. Is there someone to help me with this basic question? Does it has something to do with Rails?
Thanks | html | css | ruby-on-rails-3 | image | view | null | open | Rails 3 integrate image in a view template
===
I'm locked with a stupid issue in Rails 3... In fact, I'm building the css to design my application and I've a div called banner in which I want to integrate a logo (that is a png file). So I'm working on the views/layouts/application.html.erb.
I've put the image.png into the public/images folder.
In my css I use:
background-image: url("images/rails.png");
And nothing displays... It drives me nuts. Is there someone to help me with this basic question? Does it has something to do with Rails?
Thanks | 0 |
2,796,272 | 05/09/2010 01:16:55 | 336,455 | 05/09/2010 01:16:54 | 1 | 0 | How to learn GUI programming in F# | These days I am interested in learning F#, and would like to use it for GUI applications. Unfortunately I have no previous background in .Net or C#. Are there any good resources (web sites, books) for learning this without going through C# first?
Many thanks in advance. | f# | gui | .net | null | null | 07/19/2012 15:10:20 | not constructive | How to learn GUI programming in F#
===
These days I am interested in learning F#, and would like to use it for GUI applications. Unfortunately I have no previous background in .Net or C#. Are there any good resources (web sites, books) for learning this without going through C# first?
Many thanks in advance. | 4 |
10,474,184 | 05/06/2012 20:50:20 | 694,199 | 04/06/2011 05:14:53 | 122 | 13 | Javascript Object Prototype Refference | As per my knowledge second case should be true, but its false.
So why its not true
**Case 1**
var P = function(){};
P.prototype.get = function(){};
var p = new P,q = new P;
console.log(q.__proto__ === p.__proto__) //true
**Case 2**
var PP = function(){
var P = function(){};
P.prototype.get = function(){};
return new P;
};
var p = new PP, q = new PP;
console.log(q.__proto__ === p.__proto__) //false | javascript | node.js | null | null | null | null | open | Javascript Object Prototype Refference
===
As per my knowledge second case should be true, but its false.
So why its not true
**Case 1**
var P = function(){};
P.prototype.get = function(){};
var p = new P,q = new P;
console.log(q.__proto__ === p.__proto__) //true
**Case 2**
var PP = function(){
var P = function(){};
P.prototype.get = function(){};
return new P;
};
var p = new PP, q = new PP;
console.log(q.__proto__ === p.__proto__) //false | 0 |
4,358,413 | 12/05/2010 10:48:50 | 531,111 | 12/05/2010 10:25:30 | 1 | 0 | Storing Image in WebApplication Folder | I am sending image to a Servlet using html form. I am getting only filename but wants the full path of the image. Second, i want to store this image in web application images folder. Kindly Help.. | java | null | null | null | null | null | open | Storing Image in WebApplication Folder
===
I am sending image to a Servlet using html form. I am getting only filename but wants the full path of the image. Second, i want to store this image in web application images folder. Kindly Help.. | 0 |
4,269,395 | 11/24/2010 16:57:57 | 492,767 | 05/05/2010 13:13:03 | 158 | 7 | Rails - Accidentally dropped my table. | Being stupid, and careless, I accidentally dropped my table with contents. How do I re-create that table again in RAils? Tried to run `rake db:migrate` but it didn't create a new table. Thanks. | mysql | ruby-on-rails | null | null | null | null | open | Rails - Accidentally dropped my table.
===
Being stupid, and careless, I accidentally dropped my table with contents. How do I re-create that table again in RAils? Tried to run `rake db:migrate` but it didn't create a new table. Thanks. | 0 |
5,574,046 | 04/06/2011 23:09:21 | 302,064 | 03/25/2010 20:39:05 | 93 | 1 | If django has proven that auto-admin can be done well, why hasn't anyone done it in PHP? | Just curious, if django has already proven that auto-admin can be done well, why hasn't anyone done it in PHP?
Or if I am wrong and there are good ones out there, what are they?
Thanks in advance | php | django | null | null | null | 04/06/2011 23:21:06 | not constructive | If django has proven that auto-admin can be done well, why hasn't anyone done it in PHP?
===
Just curious, if django has already proven that auto-admin can be done well, why hasn't anyone done it in PHP?
Or if I am wrong and there are good ones out there, what are they?
Thanks in advance | 4 |
6,032,802 | 05/17/2011 14:59:55 | 717,386 | 04/20/2011 15:04:37 | 1 | 0 | What the difference = pointers | What the difference between:
int x = (int *)7;
to:
int x = 7;
thanks
| c | pointers | null | null | null | 05/19/2011 08:22:20 | not a real question | What the difference = pointers
===
What the difference between:
int x = (int *)7;
to:
int x = 7;
thanks
| 1 |
11,115,601 | 06/20/2012 08:28:50 | 1,458,002 | 06/15/2012 07:02:37 | 1 | 1 | I am searching for js libries for flowchart connectors which is similar to jsplmub whic i want to used with raphael object | I am searching for js libries for flowchart connectors which is similar to jsplmub whic i want to used with raphael object.
So please help me out for this if anyone knows similar lib for jsplmub.
| jquery | raphael | null | null | null | 06/22/2012 11:54:31 | not constructive | I am searching for js libries for flowchart connectors which is similar to jsplmub whic i want to used with raphael object
===
I am searching for js libries for flowchart connectors which is similar to jsplmub whic i want to used with raphael object.
So please help me out for this if anyone knows similar lib for jsplmub.
| 4 |
657,614 | 03/18/2009 09:59:06 | 76,035 | 03/10/2009 08:26:09 | 284 | 19 | Parsing expressions with an undefined arity of parameters | I'm trying to parse a string in a self-made language into a sort of tree, e.g.:
# a * b1 b2 -> c * d1 d2 -> e # f
should result in:
# a
* b1 b2
-> c
* d1 d2
-> e
# f1 f2
* g
#, * and -> are symbols. a, b1, etc. are texts.
Since the moment I know only rpn method to evaluate expressions, and my current solution is as follows. If I allow only a single text token after each symbol I can easily convert expression first into RPN notation (b = b1 b2; d = d1 d2; f = f1 f2) and parse it from here:
a b c -> * d e -> * # f g * #
However, merging text tokens and whatever else comes seems to be problematic. My idea was to create marker tokens (M), so RPN looks like:
a M b2 b1 M c -> * M d2 d1 M e -> * # f2 f1 M g * #
which is also parseable and seems to solve the problem.
That said:
1. Does anyone have experience with something like that and can say it is or it is not a viable solution for the future?
2. Are there better methods for parsing expressions with undefined arity of arguments?
3. Can you point me at some good resources?
Note. Yes, I know this example very much resembles Lisp prefix notation and maybe the way to go would be to add some brackets, but I don't have any experience here. However, the source text must not contain any artificial brackets and also I'm not sure what to do about potential infix mixins like # a * b -> [if value1 = value2] c -> d.
Thanks for any help. | algorithm | rpn | parsing | nlp | null | null | open | Parsing expressions with an undefined arity of parameters
===
I'm trying to parse a string in a self-made language into a sort of tree, e.g.:
# a * b1 b2 -> c * d1 d2 -> e # f
should result in:
# a
* b1 b2
-> c
* d1 d2
-> e
# f1 f2
* g
#, * and -> are symbols. a, b1, etc. are texts.
Since the moment I know only rpn method to evaluate expressions, and my current solution is as follows. If I allow only a single text token after each symbol I can easily convert expression first into RPN notation (b = b1 b2; d = d1 d2; f = f1 f2) and parse it from here:
a b c -> * d e -> * # f g * #
However, merging text tokens and whatever else comes seems to be problematic. My idea was to create marker tokens (M), so RPN looks like:
a M b2 b1 M c -> * M d2 d1 M e -> * # f2 f1 M g * #
which is also parseable and seems to solve the problem.
That said:
1. Does anyone have experience with something like that and can say it is or it is not a viable solution for the future?
2. Are there better methods for parsing expressions with undefined arity of arguments?
3. Can you point me at some good resources?
Note. Yes, I know this example very much resembles Lisp prefix notation and maybe the way to go would be to add some brackets, but I don't have any experience here. However, the source text must not contain any artificial brackets and also I'm not sure what to do about potential infix mixins like # a * b -> [if value1 = value2] c -> d.
Thanks for any help. | 0 |
6,899,619 | 08/01/2011 14:07:24 | 824,892 | 07/01/2011 12:48:44 | 1 | 0 | SQL set vs select giving different results when using date/char | I am having trouble converting/editing dates in MySQL, probably be easiest if I show my issue:
INPUT:
declare @from_dattim2 datetime
set @from_dattim2 = (select dateadd(day,-30,'2011-07-18'))
print @from_dattim2
OUTPUT:
Jun 18 2011 12:00AM
which makes sense, then...
INPUT:
declare @from_dattim2 datetime
set @from_dattim2 = (select dateadd(day,-30,'2011-07-18'))
print @from_dattim2
select convert (datetime, @from_dattim2, 121)
OUTPUT:
2011-06-18 00:00:00.000
This is the output I want however it doesn't seem to work when I try to set my variable:
INPUT:
declare @from_dattim2 datetime
set @from_dattim2 = (select dateadd(day,-30,'2011-07-18'))
set @from_dattim2 = convert (datetime, @from_dattim2, 121)
OUTPUT:
Jun 18 2011 12:00AM
Any ideas how I can set my variable to the format yyyy-mm-dd etc rather than Jun 18 etc? | sql | null | null | null | null | null | open | SQL set vs select giving different results when using date/char
===
I am having trouble converting/editing dates in MySQL, probably be easiest if I show my issue:
INPUT:
declare @from_dattim2 datetime
set @from_dattim2 = (select dateadd(day,-30,'2011-07-18'))
print @from_dattim2
OUTPUT:
Jun 18 2011 12:00AM
which makes sense, then...
INPUT:
declare @from_dattim2 datetime
set @from_dattim2 = (select dateadd(day,-30,'2011-07-18'))
print @from_dattim2
select convert (datetime, @from_dattim2, 121)
OUTPUT:
2011-06-18 00:00:00.000
This is the output I want however it doesn't seem to work when I try to set my variable:
INPUT:
declare @from_dattim2 datetime
set @from_dattim2 = (select dateadd(day,-30,'2011-07-18'))
set @from_dattim2 = convert (datetime, @from_dattim2, 121)
OUTPUT:
Jun 18 2011 12:00AM
Any ideas how I can set my variable to the format yyyy-mm-dd etc rather than Jun 18 etc? | 0 |
200,284 | 10/14/2008 07:43:49 | 10,708 | 09/16/2008 01:12:33 | 272 | 15 | What are alternatives to ExtJS? | So what I'm looking for is a javascript framework I can use that has several UI controls available as part of the UI. I have taken a look at [jQuery][1] but there controls are very basic comparted to ExtJS. Are there any other competitive alternatives?
[1]: http://ui.jquery.com/home | javascript | frameworks | gui | null | null | 02/07/2012 15:02:28 | not constructive | What are alternatives to ExtJS?
===
So what I'm looking for is a javascript framework I can use that has several UI controls available as part of the UI. I have taken a look at [jQuery][1] but there controls are very basic comparted to ExtJS. Are there any other competitive alternatives?
[1]: http://ui.jquery.com/home | 4 |
10,569,273 | 05/13/2012 04:15:15 | 1,391,758 | 05/13/2012 03:53:14 | 1 | 0 | Can I pull email addresses from my Facebook app users? | I would like to pull the user information - especially users email addresses - out from my old Facebook app to use for a newsletter. The app became way more successful than expected and I regret not setting up a proper sign up system to gather email addresses for a newsletter. Is this possible?
And what would be reasonable amount to pay someone to pull the email addresses along with other basic info into a database that I can combine with a new and better system.
I'm very much a newbie and would appreciate any help on the matter. I don't even know which keywords to put in job ad on Freelancer.com to ask someone to do the job.
Thanks a lot, guys!
Jakob
| facebook | email | application | null | null | 05/13/2012 05:48:28 | off topic | Can I pull email addresses from my Facebook app users?
===
I would like to pull the user information - especially users email addresses - out from my old Facebook app to use for a newsletter. The app became way more successful than expected and I regret not setting up a proper sign up system to gather email addresses for a newsletter. Is this possible?
And what would be reasonable amount to pay someone to pull the email addresses along with other basic info into a database that I can combine with a new and better system.
I'm very much a newbie and would appreciate any help on the matter. I don't even know which keywords to put in job ad on Freelancer.com to ask someone to do the job.
Thanks a lot, guys!
Jakob
| 2 |
9,263,083 | 02/13/2012 15:25:51 | 438,158 | 09/02/2010 15:58:36 | 260 | 0 | use keyboard on main screen | is there any way to use keyboard on main screen ?
when we use Google search gadjet , it goes to a program and here we can use keyboard to type , but is there any way to use keyboard on main screen ?
| android | null | null | null | null | 02/14/2012 14:16:36 | off topic | use keyboard on main screen
===
is there any way to use keyboard on main screen ?
when we use Google search gadjet , it goes to a program and here we can use keyboard to type , but is there any way to use keyboard on main screen ?
| 2 |
5,837,089 | 04/29/2011 20:31:00 | 127,543 | 06/23/2009 12:14:11 | 1,241 | 76 | Lighttpd rewrite conversion? | So, I'm trying to move a site over to Lighttpd but I can't seem to get the URL re-writes correct - any idea what these would translate to in Lighttpd-speak?
RewriteRule ^portfolio/([^/]+) /index.php?portfolio=$1 [NC]
RewriteCond $1 ^(portfolio|news|about|contact|home|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
I've tried a few configurations to no avail:
"^/(?!portfolio)(.+)/?$" => "/index.php?portfolio=$1"
"^/portfolio/(\d+)(?:\?(.*))?" => "/index.php?portfolio=$1" | mod-rewrite | lighttpd | null | null | null | null | open | Lighttpd rewrite conversion?
===
So, I'm trying to move a site over to Lighttpd but I can't seem to get the URL re-writes correct - any idea what these would translate to in Lighttpd-speak?
RewriteRule ^portfolio/([^/]+) /index.php?portfolio=$1 [NC]
RewriteCond $1 ^(portfolio|news|about|contact|home|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
I've tried a few configurations to no avail:
"^/(?!portfolio)(.+)/?$" => "/index.php?portfolio=$1"
"^/portfolio/(\d+)(?:\?(.*))?" => "/index.php?portfolio=$1" | 0 |
10,348,899 | 04/27/2012 10:21:45 | 1,312,635 | 04/04/2012 10:50:29 | 1 | 0 | Breadcrumb trail, PHP or Javascript? | I'm wondering what's the best way to go about creating a breadcrumb trail for my site. I've seen examples using javascript and php.
What do people here recommend? And how do YOU go about it?
Cheers
| php | javascript | breadcrumbs | null | null | 04/27/2012 10:24:55 | not constructive | Breadcrumb trail, PHP or Javascript?
===
I'm wondering what's the best way to go about creating a breadcrumb trail for my site. I've seen examples using javascript and php.
What do people here recommend? And how do YOU go about it?
Cheers
| 4 |
10,234,414 | 04/19/2012 18:24:59 | 308,665 | 04/04/2010 10:58:39 | 952 | 48 | Need to understand how tracking codes may be working in web content | I was recently approached by a web partner and they asked me to add their '*tracking code*' to my site as shown below. The data and address would be different, but the structure is the same as below. Currently they load our site in an IFrame and what I can't understand is...
How could the **script** portion provide any value to them? Can a parent page read JavaScript state of something in a hosted IFrame? Google uses a similar pattern but they set the **src** which has Script that is executed when the page loads and could read the state.
Can anyone explain how this might be working or is this just useless page spam?
<img src="https://www.APartnerCompany.foo/thing.img?arg=value" />
<script type="text/javascript">
//<![CDATA[
var Foo = {};
Foo.Tracking = {};
Foo.Tracking.Sale = {};
Foo.Tracking.Sale.amount = '100.00';
//]]>
</script> | javascript | html | analytics | null | null | null | open | Need to understand how tracking codes may be working in web content
===
I was recently approached by a web partner and they asked me to add their '*tracking code*' to my site as shown below. The data and address would be different, but the structure is the same as below. Currently they load our site in an IFrame and what I can't understand is...
How could the **script** portion provide any value to them? Can a parent page read JavaScript state of something in a hosted IFrame? Google uses a similar pattern but they set the **src** which has Script that is executed when the page loads and could read the state.
Can anyone explain how this might be working or is this just useless page spam?
<img src="https://www.APartnerCompany.foo/thing.img?arg=value" />
<script type="text/javascript">
//<![CDATA[
var Foo = {};
Foo.Tracking = {};
Foo.Tracking.Sale = {};
Foo.Tracking.Sale.amount = '100.00';
//]]>
</script> | 0 |
10,749,845 | 05/25/2012 06:55:33 | 1,078,678 | 12/03/2011 06:13:02 | 57 | 4 | Notification of new row added in MySQL via SMS | Is there ANY way possible that after new data is inserted into a MySQL database, and part of that data is a phone number. Can that number then be texted via SMS though php or any scripting languages, hosting service, etc?
Just to give a general idea of context: The new row will actually be inserted from a mobile application. | mysql | sms | null | null | null | 05/25/2012 19:45:30 | not a real question | Notification of new row added in MySQL via SMS
===
Is there ANY way possible that after new data is inserted into a MySQL database, and part of that data is a phone number. Can that number then be texted via SMS though php or any scripting languages, hosting service, etc?
Just to give a general idea of context: The new row will actually be inserted from a mobile application. | 1 |
11,495,805 | 07/15/2012 21:36:26 | 870,781 | 07/30/2011 15:09:42 | 599 | 15 | A better way to swap form field type depending on context | Is it possible to make a single form type to handle both of the below scenarios?
I'm working on an application where a "normal" user (e.g. ROLE_USER) can perform a task by filling out a form. When the record gets created, he is linked to the event table. Additionally the ROLE_ADMIN user can link people on their behalf (using the same form with an additional 'user' field), selecting the user from a list of users.
At the moment I have an "eventType" and an "eventAdminType" with 98% code duplication. I've read about transformers and also form events, but I'm not entirely sure how I can adapt them to my needs.
Form code of "eventType":
$builder
->add(
'reservedSlots', 'choice', array(
'choices' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5'),
'required' => true,
)
)
Form code of "eventAdminType":
$builder
->add('user')
->add(
'reservedSlots', 'choice', array(
'choices' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5'),
'required' => true,
)
)
Entity code:
class EventUser
{
...
/**
* @ORM\OneToOne(targetEntity="User")
* @var type
*/
private $user;
...
// all the other fields
/**
*
* @ORM\Column(type="integer")
*/
private $reservedSlots
How would I create a single form type the above?
| php | symfony-2.0 | null | null | null | null | open | A better way to swap form field type depending on context
===
Is it possible to make a single form type to handle both of the below scenarios?
I'm working on an application where a "normal" user (e.g. ROLE_USER) can perform a task by filling out a form. When the record gets created, he is linked to the event table. Additionally the ROLE_ADMIN user can link people on their behalf (using the same form with an additional 'user' field), selecting the user from a list of users.
At the moment I have an "eventType" and an "eventAdminType" with 98% code duplication. I've read about transformers and also form events, but I'm not entirely sure how I can adapt them to my needs.
Form code of "eventType":
$builder
->add(
'reservedSlots', 'choice', array(
'choices' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5'),
'required' => true,
)
)
Form code of "eventAdminType":
$builder
->add('user')
->add(
'reservedSlots', 'choice', array(
'choices' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5'),
'required' => true,
)
)
Entity code:
class EventUser
{
...
/**
* @ORM\OneToOne(targetEntity="User")
* @var type
*/
private $user;
...
// all the other fields
/**
*
* @ORM\Column(type="integer")
*/
private $reservedSlots
How would I create a single form type the above?
| 0 |
3,977,901 | 10/20/2010 12:43:45 | 475,580 | 10/14/2010 09:35:22 | 1 | 0 | how to unblock blackberry wi-fi | My users's blackberries wi-fi is blocked by mobile operator. anybody knows how to unblock it.
| blackberry | wifi | null | null | null | 10/20/2010 12:56:52 | off topic | how to unblock blackberry wi-fi
===
My users's blackberries wi-fi is blocked by mobile operator. anybody knows how to unblock it.
| 2 |
10,862,682 | 06/02/2012 13:30:59 | 233,539 | 12/17/2009 05:59:05 | 11 | 1 | Hibernate, iBatis, Spring JDBC Template, which one to use? | I am developing a web app in java. I am thinking of using Spring MVC. But at ORM side, I have a decision to make. I have studied about ORMs like Hibernate,iBatis, Spring JDBC Template etc.
I find iBatis and Spring JDBC Template (using RowMapper) are almost same, where you map each query to an object. So you have to write a class for each query.
In Hibernate, you map each table with a class.It reduces the need to write SQL.
I guess Hibernate is preferable when you are not good in SQL.In my case, I am quite comfortable in SQL, so want to use iBatis or Spring JDBC Template which will give me good control over SQL and these are less complex than Hibernate.
But Hibernate provide caching which other ORMs do not provide.
So my questions:
1. Which one to use between iBatis and Spring JDBC Template?
2. Is Hibernate caching (or any other Hibernate feature which I do not know) so good that I should go with Hibernate instead of other ORMs? | spring | hibernate | orm | ibatis | null | 06/02/2012 17:08:36 | not constructive | Hibernate, iBatis, Spring JDBC Template, which one to use?
===
I am developing a web app in java. I am thinking of using Spring MVC. But at ORM side, I have a decision to make. I have studied about ORMs like Hibernate,iBatis, Spring JDBC Template etc.
I find iBatis and Spring JDBC Template (using RowMapper) are almost same, where you map each query to an object. So you have to write a class for each query.
In Hibernate, you map each table with a class.It reduces the need to write SQL.
I guess Hibernate is preferable when you are not good in SQL.In my case, I am quite comfortable in SQL, so want to use iBatis or Spring JDBC Template which will give me good control over SQL and these are less complex than Hibernate.
But Hibernate provide caching which other ORMs do not provide.
So my questions:
1. Which one to use between iBatis and Spring JDBC Template?
2. Is Hibernate caching (or any other Hibernate feature which I do not know) so good that I should go with Hibernate instead of other ORMs? | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.