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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,308,824 | 02/22/2010 04:38:31 | 169,447 | 09/07/2009 01:07:02 | 128 | 3 | How to handle unresponsive Co-workers? | Currently in a situation where a co-worker refuses to do any work, and seems to want to make me do all the work, and then take the credit for it. Unfortunately for me, he tells the boss that we are sharing the work, but he is doing more work than I am. Said co-worker has been with the company longer than I have so the boss believes him more easily than me.
How do you deal with situations like this? Is it wise to point out the code differences in the source? Or is it better to just bite the bullet and deal? | politics | null | null | null | null | null | open | How to handle unresponsive Co-workers?
===
Currently in a situation where a co-worker refuses to do any work, and seems to want to make me do all the work, and then take the credit for it. Unfortunately for me, he tells the boss that we are sharing the work, but he is doing more work than I am. Said co-worker has been with the company longer than I have so the boss believes him more easily than me.
How do you deal with situations like this? Is it wise to point out the code differences in the source? Or is it better to just bite the bullet and deal? | 0 |
8,468,483 | 12/11/2011 23:52:01 | 1,092,841 | 12/11/2011 23:46:57 | 1 | 0 | Invalid Request | I'm getting an invalid request error when I try to connect my Foursquare account to the web app I'm making. I have my redirect url correct it's http://4sqairports.com | java | foursquare | null | null | null | 12/12/2011 00:05:12 | not a real question | Invalid Request
===
I'm getting an invalid request error when I try to connect my Foursquare account to the web app I'm making. I have my redirect url correct it's http://4sqairports.com | 1 |
2,386,011 | 03/05/2010 10:30:44 | 232,519 | 12/15/2009 23:08:51 | 57 | 24 | read gsm number from iphone through java | Is it possible through java to read the number from the iphone.
Lets say i have a html page where they have to fill in the gsm number, can java read the number from the phone and fill the form with it? | iphone | numbers | html | java | null | null | open | read gsm number from iphone through java
===
Is it possible through java to read the number from the iphone.
Lets say i have a html page where they have to fill in the gsm number, can java read the number from the phone and fill the form with it? | 0 |
2,432,846 | 03/12/2010 13:06:27 | 290,627 | 03/10/2010 15:07:12 | 1 | 0 | Check if server exists | Here is the problem. User can enter server name and connection string for database.
If server is not accessible (wrong address, firewalls or any other issue), I want to be aware of this as quickly as possible.
If I'm using sqlConnection and try to connect to a non-accessible server this takes very long (I think more than 1 minute!). This has nothing to do with connection timeout btw so setting this property won't help.
My idea is to first try to ping server and if I get response (which means server is accessible from the point of application), than proceed with sqlConnection. If there is no response from ping, operation is aborted and user is properly notified.
Is there any better way of doing this? Any idea would be welcome. | c# | .net | null | null | null | null | open | Check if server exists
===
Here is the problem. User can enter server name and connection string for database.
If server is not accessible (wrong address, firewalls or any other issue), I want to be aware of this as quickly as possible.
If I'm using sqlConnection and try to connect to a non-accessible server this takes very long (I think more than 1 minute!). This has nothing to do with connection timeout btw so setting this property won't help.
My idea is to first try to ping server and if I get response (which means server is accessible from the point of application), than proceed with sqlConnection. If there is no response from ping, operation is aborted and user is properly notified.
Is there any better way of doing this? Any idea would be welcome. | 0 |
5,473,861 | 03/29/2011 14:07:42 | 671,853 | 03/22/2011 19:30:14 | 1 | 0 | How to refresh JTable with vectors | I have been stumped with this for quite some time now. I understand you use the table model to refresh the actual table with the new values however I cannot seem to get this to work. I have added a tablemodellistener to my form and have a tableChanged method. However, I cannot seem to figure out why the tableChanged method isn't getting called when I insert into a the table.
public void tableChanged(TableModelEvent e) {
int row = e.getFirstRow();
int column = e.getColumn();
DefaultTableModel model = (DefaultTableModel)e.getSource();
// String columnName = model.getColumnName(column);
//Object data_1 = model.getValueAt(row, column);
//model.fireTableCellUpdated(row, column);
//model.fireTableDataChanged();
//customerTable.repaint();
}
Could I completely rebuild the table if I click the refresh button on my form? Would that at all be possible? If not, do I have to call my tableChanged method from my refresh button's action performed method in order for it to trigger? I've been stuck on this for quite some time now and I would just like to get this figured out for the benefit of learning. | java | refresh | jtable | tablemodel | null | null | open | How to refresh JTable with vectors
===
I have been stumped with this for quite some time now. I understand you use the table model to refresh the actual table with the new values however I cannot seem to get this to work. I have added a tablemodellistener to my form and have a tableChanged method. However, I cannot seem to figure out why the tableChanged method isn't getting called when I insert into a the table.
public void tableChanged(TableModelEvent e) {
int row = e.getFirstRow();
int column = e.getColumn();
DefaultTableModel model = (DefaultTableModel)e.getSource();
// String columnName = model.getColumnName(column);
//Object data_1 = model.getValueAt(row, column);
//model.fireTableCellUpdated(row, column);
//model.fireTableDataChanged();
//customerTable.repaint();
}
Could I completely rebuild the table if I click the refresh button on my form? Would that at all be possible? If not, do I have to call my tableChanged method from my refresh button's action performed method in order for it to trigger? I've been stuck on this for quite some time now and I would just like to get this figured out for the benefit of learning. | 0 |
10,837,962 | 05/31/2012 16:57:19 | 1,337,506 | 04/17/2012 00:08:02 | 6 | 0 | On invoking the eclipse getting JVM terminated error | I have installed the "jdk-6u32-windows-x64" and "jboss-4.2.2.GA" and also the eclipse "eclipse-jee-ganymede-SR1-win32" i did set the path in the environment varaible as "c:\Program Files\Java\jdk1.6.0_32\bin"
My configuration file .ini has
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
Error is
JVM terminted. Exit code=-1
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX.mAXpERMsIZE=256m
...............
and goes on
Need Urgent help to sort out this issue
Regards,
Java Starter | java | eclipse | null | null | null | null | open | On invoking the eclipse getting JVM terminated error
===
I have installed the "jdk-6u32-windows-x64" and "jboss-4.2.2.GA" and also the eclipse "eclipse-jee-ganymede-SR1-win32" i did set the path in the environment varaible as "c:\Program Files\Java\jdk1.6.0_32\bin"
My configuration file .ini has
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
Error is
JVM terminted. Exit code=-1
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX.mAXpERMsIZE=256m
...............
and goes on
Need Urgent help to sort out this issue
Regards,
Java Starter | 0 |
408,212 | 01/02/2009 22:44:25 | 11,829 | 09/16/2008 11:37:33 | 465 | 15 | Best .NET blog engine | I am thinking about switching my blog away from [Community Server][1] to something that is simpler and focuses more on just being a good blog.
What are the different .NET blogging engines and which one do you recommend?
[1]: http://communityserver.com/ | blogs | .net | null | null | null | 09/12/2011 11:51:43 | not constructive | Best .NET blog engine
===
I am thinking about switching my blog away from [Community Server][1] to something that is simpler and focuses more on just being a good blog.
What are the different .NET blogging engines and which one do you recommend?
[1]: http://communityserver.com/ | 4 |
6,520,832 | 06/29/2011 12:45:36 | 707,751 | 04/14/2011 10:26:01 | 92 | 19 | Set layout height and weight | I know mobile/tablet height and weight.there is some layout.I give height and weidth according to mobile/tablet height and weight .Please help me .I created layout height and weight according to mobile height/weight .
Please help me | android | null | null | null | null | 06/29/2011 14:20:28 | not a real question | Set layout height and weight
===
I know mobile/tablet height and weight.there is some layout.I give height and weidth according to mobile/tablet height and weight .Please help me .I created layout height and weight according to mobile height/weight .
Please help me | 1 |
11,663,457 | 07/26/2012 06:14:37 | 1,126,580 | 01/02/2012 17:13:56 | 6 | 0 | I want play audio while mobile is shaking |
I want to play audio file while mobile is shaking.I inserted this code for my shaking
code.
MediaPlayer mPlayer1 = MediaPlayer.create(null, R.raw.hello);
try {
mPlayer1.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mPlayer1.start();
| android | accelerometer | null | null | null | 07/26/2012 11:32:47 | not a real question | I want play audio while mobile is shaking
===
I want to play audio file while mobile is shaking.I inserted this code for my shaking
code.
MediaPlayer mPlayer1 = MediaPlayer.create(null, R.raw.hello);
try {
mPlayer1.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
mPlayer1.start();
| 1 |
10,493,032 | 05/08/2012 05:26:22 | 1,120,875 | 12/29/2011 09:50:58 | 6 | 0 | Unable to mount a file system - failed, reason given by server: Permission denied | I am trying to mount an nfs files system but i am getting "**failed, reason given by server: Permission denied**". i know i have a time issue - my linux server booting with one time (2012) and my client with other older time (like 2002) and the client will update the server time with his time.(only after the server is up, so there are some files that wont be up to date - i know this is an issue but this is the design i have in my system, the client is updating the server time) .
i have a solution to the issue: i can issue "touch" to all server files and then issue "exportfs -ra" command - it will work fine after. but i don't want to issue touch to all files each time. can u pls assist me and tell me which files are relevant to the "mount" operation so i will touch only these files? | linux | time | mount | permission-denied | null | null | open | Unable to mount a file system - failed, reason given by server: Permission denied
===
I am trying to mount an nfs files system but i am getting "**failed, reason given by server: Permission denied**". i know i have a time issue - my linux server booting with one time (2012) and my client with other older time (like 2002) and the client will update the server time with his time.(only after the server is up, so there are some files that wont be up to date - i know this is an issue but this is the design i have in my system, the client is updating the server time) .
i have a solution to the issue: i can issue "touch" to all server files and then issue "exportfs -ra" command - it will work fine after. but i don't want to issue touch to all files each time. can u pls assist me and tell me which files are relevant to the "mount" operation so i will touch only these files? | 0 |
8,626,412 | 12/24/2011 19:15:42 | 312,034 | 04/08/2010 15:26:09 | 11 | 0 | List of android apps written in python | I am going to develop an android app. Since I know python better, I would like to know what are some of the android apps that are written in python? | android | python | mobile | null | null | 12/25/2011 09:12:44 | not constructive | List of android apps written in python
===
I am going to develop an android app. Since I know python better, I would like to know what are some of the android apps that are written in python? | 4 |
9,863,303 | 03/25/2012 19:30:07 | 1,060,048 | 11/22/2011 15:09:38 | 24 | 0 | php code behaves different in Chrome and Mozilla browsers | I have a Create new account page. The form is in page named Register.php and once user submit it, it will go to Confirm.php, where it validates the field if everything is correct shows the " Account Created " Message.
> In Chrome. The error message is shown in Register.php and once all
> fields are filled then only will show confirm.php. But in Mozilla, it
> goes to Confirm.php and shows a blank page.
My code for Register.php is :
<div class="signup_form">
<form action="confirm.php" method="post" >
<?php
session_start();
if(isset($_SESSION['error']))
{
echo '<p>'.$_SESSION['error']['username'].'</p>';
echo '<p>'.$_SESSION['error']['email'].'</p>';
echo '<p>'.$_SESSION['error']['password'].'</p>';
unset($_SESSION['error']);
}
?>
<p>
<font size="3" face="arial" color="gray"> <label for="username"><b> UserName*</b> </label> </font>
<input name="username" type="text" id="username" input style="height:33px" size = "50" size="30"/>
</p>
<p>
<font size="3" face="arial" color="gray"> <label for="email"><b> E-mail Address*</b> </label> </font>
<input name="email" type="text" id="email" input style="height:33px" size = "50" size="30"/>
</p>
<p>
<font size="3" face="arial" color="gray"> <label for="password"><b> Password*</b> </label> </font>
<input name="password" type="password" id="password" input style="height:33px" size = "50" size="30"/>
</p>
<p>
<input name="submit" type="image" src="images/submit.gif" value="submit"/> </p>
</form>
</div>
and for Confirm.php code is :
<?php
session_start();
include('configdb.php');
if(isset($_POST['submit']))
{
if($_POST['username'] == '')
{
$_SESSION['error']['username'] = "User Name is required.";
}
if($_POST['email'] == '')
{
$_SESSION['error']['email'] = "E-mail is required.";
}
else
{
if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $_POST['email']))
{
$email= $_POST['email'];
$sql1 = "SELECT * FROM user WHERE email = '$email'";
$result1 = mysqli_query($mysqli,$sql1) or die(mysqli_error($mysqli));
if (mysqli_num_rows($result1) > 0) {
$_SESSION['error']['email'] = "This Email is already used.";
}
}
else
{
$_SESSION['error']['email'] = "Your email is not valid.";
}
}
if($_POST['password'] == '')
{
$_SESSION['error']['password'] = "Password is required.";
}
if(isset($_SESSION['error']))
{
header("Location: register.php");
exit;
}
else
{
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$sql2 = "INSERT INTO users (username, email, password) VALUES ('$username', '$email', '$password')";
$result2 = mysqli_query($mysqli,$sql2) or die(mysqli_error());
if($result2)
{
echo '<div>Your account is now active. You may now <a href="login.php">Log in</a></div>';
| php | php5 | null | null | null | 03/26/2012 19:21:04 | not constructive | php code behaves different in Chrome and Mozilla browsers
===
I have a Create new account page. The form is in page named Register.php and once user submit it, it will go to Confirm.php, where it validates the field if everything is correct shows the " Account Created " Message.
> In Chrome. The error message is shown in Register.php and once all
> fields are filled then only will show confirm.php. But in Mozilla, it
> goes to Confirm.php and shows a blank page.
My code for Register.php is :
<div class="signup_form">
<form action="confirm.php" method="post" >
<?php
session_start();
if(isset($_SESSION['error']))
{
echo '<p>'.$_SESSION['error']['username'].'</p>';
echo '<p>'.$_SESSION['error']['email'].'</p>';
echo '<p>'.$_SESSION['error']['password'].'</p>';
unset($_SESSION['error']);
}
?>
<p>
<font size="3" face="arial" color="gray"> <label for="username"><b> UserName*</b> </label> </font>
<input name="username" type="text" id="username" input style="height:33px" size = "50" size="30"/>
</p>
<p>
<font size="3" face="arial" color="gray"> <label for="email"><b> E-mail Address*</b> </label> </font>
<input name="email" type="text" id="email" input style="height:33px" size = "50" size="30"/>
</p>
<p>
<font size="3" face="arial" color="gray"> <label for="password"><b> Password*</b> </label> </font>
<input name="password" type="password" id="password" input style="height:33px" size = "50" size="30"/>
</p>
<p>
<input name="submit" type="image" src="images/submit.gif" value="submit"/> </p>
</form>
</div>
and for Confirm.php code is :
<?php
session_start();
include('configdb.php');
if(isset($_POST['submit']))
{
if($_POST['username'] == '')
{
$_SESSION['error']['username'] = "User Name is required.";
}
if($_POST['email'] == '')
{
$_SESSION['error']['email'] = "E-mail is required.";
}
else
{
if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $_POST['email']))
{
$email= $_POST['email'];
$sql1 = "SELECT * FROM user WHERE email = '$email'";
$result1 = mysqli_query($mysqli,$sql1) or die(mysqli_error($mysqli));
if (mysqli_num_rows($result1) > 0) {
$_SESSION['error']['email'] = "This Email is already used.";
}
}
else
{
$_SESSION['error']['email'] = "Your email is not valid.";
}
}
if($_POST['password'] == '')
{
$_SESSION['error']['password'] = "Password is required.";
}
if(isset($_SESSION['error']))
{
header("Location: register.php");
exit;
}
else
{
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$sql2 = "INSERT INTO users (username, email, password) VALUES ('$username', '$email', '$password')";
$result2 = mysqli_query($mysqli,$sql2) or die(mysqli_error());
if($result2)
{
echo '<div>Your account is now active. You may now <a href="login.php">Log in</a></div>';
| 4 |
8,324,991 | 11/30/2011 11:12:28 | 885,588 | 08/09/2011 09:05:31 | 12 | 0 | what are the latest java technologies to implement high performance website? | I want to implement a website with J2EE and mysql. What are the parts of the J2EE(struts,spring MVC etc) are recommended to implement a high performance and secured website. The website should also have user account management to give access to registered users and administrators. If you recommend any thing, will it allows me to use Lucene to incorporate if I need high speed searching?
Thanks a lot!
Chintu | java-ee | null | null | null | null | 11/30/2011 14:26:02 | too localized | what are the latest java technologies to implement high performance website?
===
I want to implement a website with J2EE and mysql. What are the parts of the J2EE(struts,spring MVC etc) are recommended to implement a high performance and secured website. The website should also have user account management to give access to registered users and administrators. If you recommend any thing, will it allows me to use Lucene to incorporate if I need high speed searching?
Thanks a lot!
Chintu | 3 |
10,219,544 | 04/18/2012 23:24:33 | 1,133,831 | 01/06/2012 07:14:37 | 86 | 1 | Click two links with one click | I am trying to write some jquery that will allow me to click two links at the same time. I want to click #campaign and #link32 at the same time. So far I have this code...
$('#campaign').bind('click', function() {
#link32);
});
It doesn't seem to be working. Im sure I am just messing up something simple. Can anyone help.
Thanks,
Nate | jquery | bind | null | null | null | 04/19/2012 11:37:56 | not a real question | Click two links with one click
===
I am trying to write some jquery that will allow me to click two links at the same time. I want to click #campaign and #link32 at the same time. So far I have this code...
$('#campaign').bind('click', function() {
#link32);
});
It doesn't seem to be working. Im sure I am just messing up something simple. Can anyone help.
Thanks,
Nate | 1 |
10,783,001 | 05/28/2012 10:19:15 | 1,421,410 | 05/28/2012 09:39:51 | 1 | 0 | Objectify Google DataSore Query | Here's the thing :-)
We have two classes, Appointment and Hairdresser, both having the same, one ancestor (a static final Key: topParent)representing the HairSalon Key. The Appointment contains the Hairdresser like this:<br/>
@Parent
public Key parent;
public Key hairdresserKey;`
<br/>
but when we try to filter out the appointment, it doesn't come up with a result. The parent in the hairdresserKey == null, that might be a clue, but we're kind of stuck now.
So can someone please tell us what's wrong with this query?
Thanks a lot!
appointment.hairdresserKey = new Key<Hairdresser>(topParent, Hairdresser.class, appointment.hairdresser.id);
appointment.parent = topParent;
Key<Hairdresser> queryKey = new Key<Hairdresser>(topParent, Hairdresser.class, appointment.hairdresser.id);
Objectify ofyTransaction = ObjectifyService.beginTransaction();
try {
List<Key<Appointment>> previousTimeSlotOneHour = ofyTransaction.query(Appointment.class)
.ancestor(topParent)
.filter("hairdresserKey", appointment.hairdresserKey)
.filter("timeSlot", appointment.timeSlot.getPreviousTimeSlot())
.filter("LENGTH", 1.0d).listKeys();
| java | objectify | null | null | null | null | open | Objectify Google DataSore Query
===
Here's the thing :-)
We have two classes, Appointment and Hairdresser, both having the same, one ancestor (a static final Key: topParent)representing the HairSalon Key. The Appointment contains the Hairdresser like this:<br/>
@Parent
public Key parent;
public Key hairdresserKey;`
<br/>
but when we try to filter out the appointment, it doesn't come up with a result. The parent in the hairdresserKey == null, that might be a clue, but we're kind of stuck now.
So can someone please tell us what's wrong with this query?
Thanks a lot!
appointment.hairdresserKey = new Key<Hairdresser>(topParent, Hairdresser.class, appointment.hairdresser.id);
appointment.parent = topParent;
Key<Hairdresser> queryKey = new Key<Hairdresser>(topParent, Hairdresser.class, appointment.hairdresser.id);
Objectify ofyTransaction = ObjectifyService.beginTransaction();
try {
List<Key<Appointment>> previousTimeSlotOneHour = ofyTransaction.query(Appointment.class)
.ancestor(topParent)
.filter("hairdresserKey", appointment.hairdresserKey)
.filter("timeSlot", appointment.timeSlot.getPreviousTimeSlot())
.filter("LENGTH", 1.0d).listKeys();
| 0 |
7,878,288 | 10/24/2011 15:47:48 | 856,076 | 07/21/2011 13:48:57 | 6 | 1 | How do I recover deleted Facebook app? | Can someone help me recover deleted app?
My Friend accidentally deleted it Yesterday. | facebook | support | null | null | null | 10/24/2011 19:50:06 | off topic | How do I recover deleted Facebook app?
===
Can someone help me recover deleted app?
My Friend accidentally deleted it Yesterday. | 2 |
5,693,560 | 04/17/2011 12:40:45 | 412,269 | 08/05/2010 18:21:39 | 187 | 1 | uitextview bug? | I have a `UITextView` that is placed at the bottom of my modal view. My modal view is implemented using the `UIModalPresentationPageSheet`. Once I created the UITextView and place it at the top of the page, it displays correctly with the text loading on view, however once it's at the bottom the textview is blank unless a touch is pressed on the textview. I also have a `UIScrollView`in my view however I cant figure out the problem of the `UITextview`. | iphone | uitextview | null | null | null | null | open | uitextview bug?
===
I have a `UITextView` that is placed at the bottom of my modal view. My modal view is implemented using the `UIModalPresentationPageSheet`. Once I created the UITextView and place it at the top of the page, it displays correctly with the text loading on view, however once it's at the bottom the textview is blank unless a touch is pressed on the textview. I also have a `UIScrollView`in my view however I cant figure out the problem of the `UITextview`. | 0 |
4,311,942 | 11/30/2010 08:50:42 | 524,886 | 11/30/2010 08:50:42 | 1 | 0 | what is the lastest seo technology using Google | what is the lastest seo technology using Google | seo | null | null | null | null | 07/15/2011 11:00:38 | off topic | what is the lastest seo technology using Google
===
what is the lastest seo technology using Google | 2 |
9,261,602 | 02/13/2012 13:45:29 | 995,434 | 10/14/2011 12:52:44 | 88 | 4 | copy a graph (adjacency_list) to another one | How can I copy a graph of type adjacency_list to another one graph of type adjacency_list ?
typedef adjacency_list<setS, setS, undirectedS, NodeDataStruct, EdgeDataStruct> MyGraph;
MyGraph g1, g2;
// processing g1: adding vertices and edges ...
// processing g2: adding some vertices and edges ...
g1.clear();
g1 = g2 // this gives an execution error (exception)
g1 = MyGraph(g2); // this also gives an execution error
g2.clear(); | c++ | boost | copy | boost-graph | null | null | open | copy a graph (adjacency_list) to another one
===
How can I copy a graph of type adjacency_list to another one graph of type adjacency_list ?
typedef adjacency_list<setS, setS, undirectedS, NodeDataStruct, EdgeDataStruct> MyGraph;
MyGraph g1, g2;
// processing g1: adding vertices and edges ...
// processing g2: adding some vertices and edges ...
g1.clear();
g1 = g2 // this gives an execution error (exception)
g1 = MyGraph(g2); // this also gives an execution error
g2.clear(); | 0 |
9,991,944 | 04/03/2012 11:03:07 | 1,365,428 | 03/19/2012 08:36:08 | 205 | 34 | How to create color custom scrollbar in pure css? | Hi i am try to create custom scrollbar in css but is not make it?
anybody help me ?
| html | css | null | null | null | 04/03/2012 12:07:21 | not a real question | How to create color custom scrollbar in pure css?
===
Hi i am try to create custom scrollbar in css but is not make it?
anybody help me ?
| 1 |
4,875,594 | 02/02/2011 14:29:20 | 283,040 | 02/28/2010 10:29:43 | 76 | 9 | Best List view solution for asp.net mvc? | Its common to observe listview developments for webforms but no common in mvc. on the other hand for mvc I´m only finding grid views displaying tabular data.
In your opinion which is the best List view solution for asp.net mvc?. | asp.net-mvc | listview | uiview | null | null | null | open | Best List view solution for asp.net mvc?
===
Its common to observe listview developments for webforms but no common in mvc. on the other hand for mvc I´m only finding grid views displaying tabular data.
In your opinion which is the best List view solution for asp.net mvc?. | 0 |
7,967,220 | 11/01/2011 13:31:24 | 909,648 | 08/24/2011 12:49:40 | 21 | 1 | fullcalendar: pass data to PHP eventsource url | I am using fullcalendar for a project I'm working on. the page is set up as follows.
my calendar page uses the eventsources call to get a JSON string containing all of the event data from a PHP script.
eventSources: [{
type: 'GET',
data: {
test: '1'
},
url: 'includes/build_calendar_events.php'
}]
I would like to pass a few variables to the PHP script so that I can filter the data that is returned in the JSON string.
The "data:" never seems to get to the PHP page to filter the data.
Am I using this correctly, or is that not how the data section is supposed to be used? | php | jquery | ajax | get | fullcalendar | 11/01/2011 15:00:48 | too localized | fullcalendar: pass data to PHP eventsource url
===
I am using fullcalendar for a project I'm working on. the page is set up as follows.
my calendar page uses the eventsources call to get a JSON string containing all of the event data from a PHP script.
eventSources: [{
type: 'GET',
data: {
test: '1'
},
url: 'includes/build_calendar_events.php'
}]
I would like to pass a few variables to the PHP script so that I can filter the data that is returned in the JSON string.
The "data:" never seems to get to the PHP page to filter the data.
Am I using this correctly, or is that not how the data section is supposed to be used? | 3 |
3,380,507 | 08/01/2010 02:30:56 | 1,114,639 | 01/28/2010 02:56:52 | 1 | 3 | Why I can't run perl from Textmate? | #!/usr/bin/perl -w
use WWW::Mechanize;
print $WWW::Mechanize::VERSION."\n";
1) run from Textmate :
Can't locate WWW/Mechanize.pm in @INC (@INC contains: /Applications/TextMate.app/Contents/SharedSupport/Bundles/Perl.tmbundle/Support /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /Users/xxx/Development/test.pl line 2.
BEGIN failed--compilation aborted at /Users/xxx/Development/test.pl line 2.
2) run from terminal
sh-3.2# perl test.pl
1.64
What should I do?
Help me please.
| perl | textmate | null | null | null | null | open | Why I can't run perl from Textmate?
===
#!/usr/bin/perl -w
use WWW::Mechanize;
print $WWW::Mechanize::VERSION."\n";
1) run from Textmate :
Can't locate WWW/Mechanize.pm in @INC (@INC contains: /Applications/TextMate.app/Contents/SharedSupport/Bundles/Perl.tmbundle/Support /Library/Perl/Updates/5.10.0 /System/Library/Perl/5.10.0/darwin-thread-multi-2level /System/Library/Perl/5.10.0 /Library/Perl/5.10.0/darwin-thread-multi-2level /Library/Perl/5.10.0 /Network/Library/Perl/5.10.0/darwin-thread-multi-2level /Network/Library/Perl/5.10.0 /Network/Library/Perl /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level /System/Library/Perl/Extras/5.10.0 .) at /Users/xxx/Development/test.pl line 2.
BEGIN failed--compilation aborted at /Users/xxx/Development/test.pl line 2.
2) run from terminal
sh-3.2# perl test.pl
1.64
What should I do?
Help me please.
| 0 |
1,310,127 | 08/21/2009 04:45:51 | 15,537 | 09/17/2008 10:16:53 | 6,350 | 221 | OleDB only returning DbNull, what have I done wrong? | I've got the following code:
// personCount = 7291; correct value
int personCount = (int)new OleDbCommand("SELECT COUNT(*) AS [count] FROM [Individual]", _accessGp).ExecuteScalar();
List<Person> people = new List<Person>();
OleDbCommand personQuery = new OleDbCommand("SELECT * FROM [Individual]", _access);
using (OleDbDataReader personReader = personQuery.ExecuteReader())
{
int curPerson = 1;
while (personReader.Read())
{
// This runs several times
if (personReader.IsDBNull(0)) continue;
// [snip] create a new Person and add it to people
curPerson++;
}
// at this point, curPerson == 1 and the list is empty.
}
This is my exact code. Field 0 is the primary key, so should never be null, but every single row being returned from the database has all the fields set to DBNull! I can't see what I'm doing wrong, can anyone shed some light on this? | c# | oledb | oledbdatareader | null | null | null | open | OleDB only returning DbNull, what have I done wrong?
===
I've got the following code:
// personCount = 7291; correct value
int personCount = (int)new OleDbCommand("SELECT COUNT(*) AS [count] FROM [Individual]", _accessGp).ExecuteScalar();
List<Person> people = new List<Person>();
OleDbCommand personQuery = new OleDbCommand("SELECT * FROM [Individual]", _access);
using (OleDbDataReader personReader = personQuery.ExecuteReader())
{
int curPerson = 1;
while (personReader.Read())
{
// This runs several times
if (personReader.IsDBNull(0)) continue;
// [snip] create a new Person and add it to people
curPerson++;
}
// at this point, curPerson == 1 and the list is empty.
}
This is my exact code. Field 0 is the primary key, so should never be null, but every single row being returned from the database has all the fields set to DBNull! I can't see what I'm doing wrong, can anyone shed some light on this? | 0 |
8,232,190 | 11/22/2011 18:53:50 | 965,704 | 09/26/2011 19:05:59 | 10 | 0 | Develop for Android or iOS? | I'm just getting started with mobile development, and would like some tips and pros/cons when it comes to developing apps for Android/iOS. I have lots of experience with object-oriented languages such as C# and Java, and some experience with web development.
More specifically, I would like to know:
- If any OS has a significant advantage over the other?
- The biggest differences between Android and iOS when it comes to developing apps (except the fact that one is in Java and the other is in Objective-C)
- What are the main differences in terms of functions/features that their APIs support (i.e. are there any significant limitations to what an app can do)?
Any other tips are also welcome! | android | ios | null | null | null | 11/22/2011 19:04:59 | not constructive | Develop for Android or iOS?
===
I'm just getting started with mobile development, and would like some tips and pros/cons when it comes to developing apps for Android/iOS. I have lots of experience with object-oriented languages such as C# and Java, and some experience with web development.
More specifically, I would like to know:
- If any OS has a significant advantage over the other?
- The biggest differences between Android and iOS when it comes to developing apps (except the fact that one is in Java and the other is in Objective-C)
- What are the main differences in terms of functions/features that their APIs support (i.e. are there any significant limitations to what an app can do)?
Any other tips are also welcome! | 4 |
1,784,466 | 11/23/2009 16:54:06 | 127,213 | 06/22/2009 21:45:48 | 69 | 1 | XNA Antialias question! | I've got problems with XNA and antialiasing. I can activate it using
graphics.PreferMultiSampling = true;
graphics.ApplyChanges();
however - it's only 2x antialiasing. Even if I set
graphics.GraphicsDevice.PresentationParameters.MultiSampleType = MultiSampleType.SixteenSamples;
it stays only 2x antialiasing. If i go to my graphics driver settings (NVIDIA GeForce 9800 GT) and set Antialiastype from Application decides to 16x, then I get nice and clean antialiasing. But if it's set on 'Application decides' i don't get more than 2x
Anyone an idea why?
Thanks! | xna | multisampling | antialiasing | null | null | null | open | XNA Antialias question!
===
I've got problems with XNA and antialiasing. I can activate it using
graphics.PreferMultiSampling = true;
graphics.ApplyChanges();
however - it's only 2x antialiasing. Even if I set
graphics.GraphicsDevice.PresentationParameters.MultiSampleType = MultiSampleType.SixteenSamples;
it stays only 2x antialiasing. If i go to my graphics driver settings (NVIDIA GeForce 9800 GT) and set Antialiastype from Application decides to 16x, then I get nice and clean antialiasing. But if it's set on 'Application decides' i don't get more than 2x
Anyone an idea why?
Thanks! | 0 |
3,350,887 | 07/28/2010 07:53:09 | 26,521 | 10/09/2008 14:54:41 | 2,014 | 48 | When using a windows service, is it better to use the start parameters or just have an app.config? | When clicking on the properties of a windows service, you can set the start parameters. Would you rather use this to configure a Windows Service or use an app.config?
For a user, it's much easier to change the start parameters of a service than having to go and look for the install directory of the service, open the app.config and edit it. | windows-services | null | null | null | null | null | open | When using a windows service, is it better to use the start parameters or just have an app.config?
===
When clicking on the properties of a windows service, you can set the start parameters. Would you rather use this to configure a Windows Service or use an app.config?
For a user, it's much easier to change the start parameters of a service than having to go and look for the install directory of the service, open the app.config and edit it. | 0 |
6,383,423 | 06/17/2011 08:49:48 | 802,918 | 06/17/2011 08:49:48 | 1 | 0 | WPFToolkit.Extended RichTextBox run time format | I requried to **formate** runtime, i.e. make bold seleted text runtime.
Thanks you | c# | c#-4.0 | null | null | null | 06/17/2011 11:52:35 | not a real question | WPFToolkit.Extended RichTextBox run time format
===
I requried to **formate** runtime, i.e. make bold seleted text runtime.
Thanks you | 1 |
3,811,862 | 09/28/2010 10:39:30 | 460,479 | 09/28/2010 10:39:29 | 1 | 0 | Cant get a custom ItemDelegate to work | first off, im new to python and pyqt so please bear with me.
Im using a QTableView with a QSqlTableModel everything works as intended.
The last column of the view contains only 0 and 1 as value which i want to display as checkbox and this column should be editable.
Ive read that you should subclass QItemDelegate which i did. Unluckily my table wont show the last column as a checkbox.
I tried to set the delegate only for the last column (the way i would prefer) using setItemDelegateForColumn(), it didnt work. So i modified it and set it for the entire QTableView using setItemDelegate() reacting only to requests to the last column. It still wont work. Wont work means there are no error messages it just wont do what i say ;) It seems that none of the methods i reimplemented gets ever called except __init__(). So i guess im missing something fundamental.
Ive extracted the relevant lines of code, KSCheckBoxDelegate is my subclass. This is the version where the delegate is set up for the entire QTableView.
<pre><code>
-- code from applications main class --
self.taglist = QTableView()
self.tagmodel = QSqlTableModel()
self.tagmodel.setTable("data")
self.tagmodel.select()
self.taglist.setModel(self.tagmodel)
print self.taglist.itemDelegate()
myDel = KSCheckBoxDelegate(self)
myDel.colnumber = 3
self.taglist.setItemDelegate(myDel)
-- KSCheckBoxDelegate.py --
from PyQt4.QtGui import *
class KSCheckBoxDelegate(QStyledItemDelegate):
colnumber = None
def __init__ (self, parent = None):
print "KSCheckBoxDelegate::init"
QStyledItemDelegate.__init__(self, parent)
def createEditor(self, parent, option, index):
print "KSCheckBoxDelegate::createEditor"
if index.column()==self.colnumber:
return QCheckBox(self)
else:
return QStyledItemDelegate.createEditor(self, parent, option, index)
def setEditorData (self, editor, index):
print "KSCheckBoxDelegate::setEditorData"
if index.column() == self.colnumber:
cont = index.model().data(index, Qt.DisplayRole).toString()
if cont == "1":
editor.setCheckState(Qt.Checked)
else:
editor.setCheckState(Qt.UnChecked)
else:
QStyledItemDelegate.setEditorData(self,editor, index)
def setModelData (self, editor, model, index):
print "KSCheckBoxDelegate::setModelData"
if index.column() == self.colnumber:
if editor.checkBox.checkState() == Qt.Checked:
model.setData(index, 1)
else:
model.setData(index, 0)
else:
QStyledItemDelegate.setModelData(self, editor, model, index)
</code></pre>
Any hints for me on that issue?
Furthermore i have difficulties with the currentChanged() signal of the QTableViews selectionModel. Im printing the top right coordinates of the selection. I keep getting wrong indexes (not invalid) when clicking with the left mouse button. Using the cursor keys gets me the right indexes. Using selectionChanged() has the same behaviour. Im actually getting the coordinates of the second last selected cell of the QTableView. For instance im clicking on the coordinates <1,1> <2,1> the second click would show me the coordinates <1,1>.
<pre><code>
selInd = self.taglist.selectionModel().selectedIndexes()
if(len(selInd) > 0):
self.xPosData=selInd[0].column()
self.yPosData=selInd[0].row()
</code></pre>
And last off using OnManualSubmit as editStrategy doesnt throw an error (return false) when calling submitAll() but doesnt save the data either. It works with choosing OnFieldChange as editStrategy. Which i can live with but is not was i have intended to do.
Thanks for your time.
Horst | python | pyqt | null | null | null | null | open | Cant get a custom ItemDelegate to work
===
first off, im new to python and pyqt so please bear with me.
Im using a QTableView with a QSqlTableModel everything works as intended.
The last column of the view contains only 0 and 1 as value which i want to display as checkbox and this column should be editable.
Ive read that you should subclass QItemDelegate which i did. Unluckily my table wont show the last column as a checkbox.
I tried to set the delegate only for the last column (the way i would prefer) using setItemDelegateForColumn(), it didnt work. So i modified it and set it for the entire QTableView using setItemDelegate() reacting only to requests to the last column. It still wont work. Wont work means there are no error messages it just wont do what i say ;) It seems that none of the methods i reimplemented gets ever called except __init__(). So i guess im missing something fundamental.
Ive extracted the relevant lines of code, KSCheckBoxDelegate is my subclass. This is the version where the delegate is set up for the entire QTableView.
<pre><code>
-- code from applications main class --
self.taglist = QTableView()
self.tagmodel = QSqlTableModel()
self.tagmodel.setTable("data")
self.tagmodel.select()
self.taglist.setModel(self.tagmodel)
print self.taglist.itemDelegate()
myDel = KSCheckBoxDelegate(self)
myDel.colnumber = 3
self.taglist.setItemDelegate(myDel)
-- KSCheckBoxDelegate.py --
from PyQt4.QtGui import *
class KSCheckBoxDelegate(QStyledItemDelegate):
colnumber = None
def __init__ (self, parent = None):
print "KSCheckBoxDelegate::init"
QStyledItemDelegate.__init__(self, parent)
def createEditor(self, parent, option, index):
print "KSCheckBoxDelegate::createEditor"
if index.column()==self.colnumber:
return QCheckBox(self)
else:
return QStyledItemDelegate.createEditor(self, parent, option, index)
def setEditorData (self, editor, index):
print "KSCheckBoxDelegate::setEditorData"
if index.column() == self.colnumber:
cont = index.model().data(index, Qt.DisplayRole).toString()
if cont == "1":
editor.setCheckState(Qt.Checked)
else:
editor.setCheckState(Qt.UnChecked)
else:
QStyledItemDelegate.setEditorData(self,editor, index)
def setModelData (self, editor, model, index):
print "KSCheckBoxDelegate::setModelData"
if index.column() == self.colnumber:
if editor.checkBox.checkState() == Qt.Checked:
model.setData(index, 1)
else:
model.setData(index, 0)
else:
QStyledItemDelegate.setModelData(self, editor, model, index)
</code></pre>
Any hints for me on that issue?
Furthermore i have difficulties with the currentChanged() signal of the QTableViews selectionModel. Im printing the top right coordinates of the selection. I keep getting wrong indexes (not invalid) when clicking with the left mouse button. Using the cursor keys gets me the right indexes. Using selectionChanged() has the same behaviour. Im actually getting the coordinates of the second last selected cell of the QTableView. For instance im clicking on the coordinates <1,1> <2,1> the second click would show me the coordinates <1,1>.
<pre><code>
selInd = self.taglist.selectionModel().selectedIndexes()
if(len(selInd) > 0):
self.xPosData=selInd[0].column()
self.yPosData=selInd[0].row()
</code></pre>
And last off using OnManualSubmit as editStrategy doesnt throw an error (return false) when calling submitAll() but doesnt save the data either. It works with choosing OnFieldChange as editStrategy. Which i can live with but is not was i have intended to do.
Thanks for your time.
Horst | 0 |
10,550,027 | 05/11/2012 10:56:07 | 1,389,238 | 05/11/2012 10:43:57 | 1 | 0 | Need Sqllite Database Query browser - Andriod developer | I`m new to android development, using SQLlite as database ,
Like to ask two question
1) Is there any query browser for SQLlite kindly give me link to download(Open source)
2) If there is query browser then how can i create schema and data and dump the same database into my Emulator in eclipse and check, how can we dump the same database to samsung Tablet 10.1 or android device
Thanks
| java | android | sqlite | null | null | 05/11/2012 13:19:29 | not a real question | Need Sqllite Database Query browser - Andriod developer
===
I`m new to android development, using SQLlite as database ,
Like to ask two question
1) Is there any query browser for SQLlite kindly give me link to download(Open source)
2) If there is query browser then how can i create schema and data and dump the same database into my Emulator in eclipse and check, how can we dump the same database to samsung Tablet 10.1 or android device
Thanks
| 1 |
10,785,650 | 05/28/2012 13:41:43 | 622,875 | 02/18/2011 09:30:41 | 1,239 | 71 | Will Autoupdate Startup task work in azure application? | I have built one startup task for Azure application contain exe file(running periodically with some time interval) and now i would like to make it autoupdating at every week as i have asked before [here][1]
However i'll do some logic of replacing that file through that exe(startup task) then also it is not going to take any effect of new file. I have concluded that new startup task will take effect only if we upgrade/created that azure project with new file. (Correct me if i understood something wrong)
So is there any way to do my logic works by rebooting instance (by exe/startuptask) ?
I think it will also take original file(added in startuptask at the time of upgrading/creating application) instead of new file!
Is is possible anyway?
[1]: http://stackoverflow.com/questions/7721654/how-to-do-automatic-update-of-exe-project-in-c-sharp-and-azure-startup-task | azure | startup | auto-update | null | null | null | open | Will Autoupdate Startup task work in azure application?
===
I have built one startup task for Azure application contain exe file(running periodically with some time interval) and now i would like to make it autoupdating at every week as i have asked before [here][1]
However i'll do some logic of replacing that file through that exe(startup task) then also it is not going to take any effect of new file. I have concluded that new startup task will take effect only if we upgrade/created that azure project with new file. (Correct me if i understood something wrong)
So is there any way to do my logic works by rebooting instance (by exe/startuptask) ?
I think it will also take original file(added in startuptask at the time of upgrading/creating application) instead of new file!
Is is possible anyway?
[1]: http://stackoverflow.com/questions/7721654/how-to-do-automatic-update-of-exe-project-in-c-sharp-and-azure-startup-task | 0 |
6,871,606 | 07/29/2011 10:14:35 | 865,161 | 07/27/2011 10:28:33 | 8 | 0 | How to render an array.to_json with :include option in Rails ? | In my controller I have :
def index
@tasks = Task.get_tasks(current_user, params)
respond_to do |format|
format.html
# Sends correct JSON but not including the 'author' object in it
# format.json { render :json => @tasks.to_json(:include => [:author]) }
# With this the JSON look correct but is interpreted as a string in the JavaScript code
format.json { render :json => @tasks.map { |e| e = e.to_json(:include => [:author]) } }
end
end
Do you know any 'clean' solution to properly pass the `:include` option when rendering an array converted to JSON ? | javascript | ruby-on-rails | ruby | json | null | null | open | How to render an array.to_json with :include option in Rails ?
===
In my controller I have :
def index
@tasks = Task.get_tasks(current_user, params)
respond_to do |format|
format.html
# Sends correct JSON but not including the 'author' object in it
# format.json { render :json => @tasks.to_json(:include => [:author]) }
# With this the JSON look correct but is interpreted as a string in the JavaScript code
format.json { render :json => @tasks.map { |e| e = e.to_json(:include => [:author]) } }
end
end
Do you know any 'clean' solution to properly pass the `:include` option when rendering an array converted to JSON ? | 0 |
5,884,136 | 05/04/2011 13:25:19 | 737,915 | 05/04/2011 11:56:36 | 1 | 0 | ExtJS 4 Change grid store on the fly | Is it posible to change grid's store in ExtJS 4?
For example, i have two models:
User = Ext.define('User',{
extend: 'Ext.data.Model',
[...],
hasMany: 'Product'
});
Product = Ext.define('Product',{
extend: 'Ext.data.Model',
[...]
});
and two grids.
The first grid is linked with Store which uses `User` model and loads nested json data from backend, like
{
users: [{
id: 1,
products: [
{id: 1},
{id: 2}
]
}, {
id: 2,
products: [
{id: 3},
{id: 4},
{id: 5}
]
}]
}
All i want to get is when you click on the row in the first grid, the second grid must show products of the user, without connection to the server.
All i know is that `user.products();` returns a `Ext.data.Store` object.
So the idea is to change second grid's store to `user.products();`, but there is no such method `grid.setStore()` :-)
Thanks in advance
| extjs | grid | extjs4 | null | null | null | open | ExtJS 4 Change grid store on the fly
===
Is it posible to change grid's store in ExtJS 4?
For example, i have two models:
User = Ext.define('User',{
extend: 'Ext.data.Model',
[...],
hasMany: 'Product'
});
Product = Ext.define('Product',{
extend: 'Ext.data.Model',
[...]
});
and two grids.
The first grid is linked with Store which uses `User` model and loads nested json data from backend, like
{
users: [{
id: 1,
products: [
{id: 1},
{id: 2}
]
}, {
id: 2,
products: [
{id: 3},
{id: 4},
{id: 5}
]
}]
}
All i want to get is when you click on the row in the first grid, the second grid must show products of the user, without connection to the server.
All i know is that `user.products();` returns a `Ext.data.Store` object.
So the idea is to change second grid's store to `user.products();`, but there is no such method `grid.setStore()` :-)
Thanks in advance
| 0 |
7,331,344 | 09/07/2011 09:09:40 | 809,395 | 06/21/2011 22:59:11 | 34 | 2 | Create Jabber client in iphone xcode | I am working on Jabber client for iphone that uses xmpp protocol to enable chat on iphone.This involve managing the friends list.I reffered to <http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-xmpp-integration/>
but its not helpful .Any help would be Appreciated.
Thanks
Vikas Ojha
| iphone | xcode | client | xmpp | null | 09/07/2011 13:29:47 | not a real question | Create Jabber client in iphone xcode
===
I am working on Jabber client for iphone that uses xmpp protocol to enable chat on iphone.This involve managing the friends list.I reffered to <http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-xmpp-integration/>
but its not helpful .Any help would be Appreciated.
Thanks
Vikas Ojha
| 1 |
9,532,840 | 03/02/2012 11:52:42 | 1,023,122 | 11/01/2011 05:26:28 | 3 | 0 | Embedding JSON Data into YAML file | I am writing a fixture for my table. And a one of the coloums takes in a JSON string as a value.
The problem is the fixture is not loading failing as:
Fixture::FormatError: a YAML error occurred parsing /home/saurajeet/code/dcbox/test/fixtures/hardware.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html
The exact error was:
ArgumentError: syntax error on line 145, col 73: ` portslist: [{"name":"ob1","port_num":0,"port_type":"network"},{"name":"ob2","port_nu'.....
Any solutions to this.
| ruby-on-rails | ruby | ruby-on-rails-3 | json | yaml | null | open | Embedding JSON Data into YAML file
===
I am writing a fixture for my table. And a one of the coloums takes in a JSON string as a value.
The problem is the fixture is not loading failing as:
Fixture::FormatError: a YAML error occurred parsing /home/saurajeet/code/dcbox/test/fixtures/hardware.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html
The exact error was:
ArgumentError: syntax error on line 145, col 73: ` portslist: [{"name":"ob1","port_num":0,"port_type":"network"},{"name":"ob2","port_nu'.....
Any solutions to this.
| 0 |
5,323,798 | 03/16/2011 10:16:17 | 582,657 | 01/20/2011 08:33:51 | 36 | 0 | What are the biggest challenges/problems yet to solve in computer technology | I need to know which are the biggest problems in computer technology which don't have a proper solution yet. It could be anything like: computer vision, AI etc.
I'm trying to identify the opportunities for research & development.
| computer | technology | science | null | null | 07/08/2011 18:03:20 | not constructive | What are the biggest challenges/problems yet to solve in computer technology
===
I need to know which are the biggest problems in computer technology which don't have a proper solution yet. It could be anything like: computer vision, AI etc.
I'm trying to identify the opportunities for research & development.
| 4 |
8,472,442 | 12/12/2011 09:46:59 | 1,077,350 | 12/02/2011 12:02:39 | 25 | 0 | heading in two or more column design | I believe there's a simple fix to my problem, however I couldn't find any solution.
I have a two or more column design like this:
<fo:simple-page-master master-name="2column">
<fo:region-body margin-bottom="18mm" column-count="2"/>
<fo:region-before extent="20mm"/>
<fo:region-after extent="10mm"/>
</fo:simple-page-master>
Now, I'm trying to place a main heading for a chapter, which should be spanned over all columns.
So placing it in the body of a page-sequence will show it at the beginning of the left column. Placing it in a static content object like region-before will repeat it on all several pages of this chapter. However I only want it to be shown once.
By the way, I'm using FOP.
Is there any possibility?
Regards,
Chris | xsl-fo | fop | null | null | null | null | open | heading in two or more column design
===
I believe there's a simple fix to my problem, however I couldn't find any solution.
I have a two or more column design like this:
<fo:simple-page-master master-name="2column">
<fo:region-body margin-bottom="18mm" column-count="2"/>
<fo:region-before extent="20mm"/>
<fo:region-after extent="10mm"/>
</fo:simple-page-master>
Now, I'm trying to place a main heading for a chapter, which should be spanned over all columns.
So placing it in the body of a page-sequence will show it at the beginning of the left column. Placing it in a static content object like region-before will repeat it on all several pages of this chapter. However I only want it to be shown once.
By the way, I'm using FOP.
Is there any possibility?
Regards,
Chris | 0 |
1,228,146 | 08/04/2009 15:22:54 | 61,654 | 02/02/2009 20:02:32 | 606 | 28 | NHibernate QuerySyntaxException | I am following along with the [Summer of NHibernate Screencast Series][1] and am running into a strange NHibernate Exception.
NHibernate.Hql.Ast.ANTLR.QuerySyntaxException:
Exception of type
'Antlr.Runtime.NoViableAltException' was thrown.
[select from DataTransfer.Person p where p.FirstName=:fn].
I have deviated from the Screencast Series in the following ways:
1. Running against an MS SQL Server Compact Database
2. I am using MSTest instead of MbUnit
I've tried any number of combination of queries always with the same result. My present CreateQuery syntax
public IList<Person> GetPersonsByFirstName(string firstName)
{
ISession session = GetSession();
return session.CreateQuery("select from Person p " +
"where p.FirstName=:fn").SetString("fn", firstName)
.List<Person>();
}
While not a direct query this method works
public Person GetPersonById(int personId)
{
ISession session = GetSession();
return session.Get<Person>(personId);
}
My *hibernate.cfg.xml*
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory name="BookDb">
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
<property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
<property name="connection.connection_string">Data Source=C:\Code\BookCollection\DataAccessLayer\BookCollectionDb.sdf</property>
<property name="show_sql">true</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
<mapping assembly="DataTransfer"/>
</session-factory>
</hibernate-configuration>
*Person.hbm.xml*
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataTransfer" namespace="DataTransfer">
<class name="DataTransfer.Person,DataTransfer" table="Person">
<id name="PersonId" column="PersonId" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<property name="FirstName" column="FirstName" type="String" length="50" not-null="false" />
<property name="LastName" column="LastName" type="String" length="50" not-null="false" />
</class>
</hibernate-mapping>
[1]: http://www.summerofnhibernate.com/ | nhibernate | exception | null | null | null | null | open | NHibernate QuerySyntaxException
===
I am following along with the [Summer of NHibernate Screencast Series][1] and am running into a strange NHibernate Exception.
NHibernate.Hql.Ast.ANTLR.QuerySyntaxException:
Exception of type
'Antlr.Runtime.NoViableAltException' was thrown.
[select from DataTransfer.Person p where p.FirstName=:fn].
I have deviated from the Screencast Series in the following ways:
1. Running against an MS SQL Server Compact Database
2. I am using MSTest instead of MbUnit
I've tried any number of combination of queries always with the same result. My present CreateQuery syntax
public IList<Person> GetPersonsByFirstName(string firstName)
{
ISession session = GetSession();
return session.CreateQuery("select from Person p " +
"where p.FirstName=:fn").SetString("fn", firstName)
.List<Person>();
}
While not a direct query this method works
public Person GetPersonById(int personId)
{
ISession session = GetSession();
return session.Get<Person>(personId);
}
My *hibernate.cfg.xml*
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory name="BookDb">
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
<property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
<property name="connection.connection_string">Data Source=C:\Code\BookCollection\DataAccessLayer\BookCollectionDb.sdf</property>
<property name="show_sql">true</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
<mapping assembly="DataTransfer"/>
</session-factory>
</hibernate-configuration>
*Person.hbm.xml*
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataTransfer" namespace="DataTransfer">
<class name="DataTransfer.Person,DataTransfer" table="Person">
<id name="PersonId" column="PersonId" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<property name="FirstName" column="FirstName" type="String" length="50" not-null="false" />
<property name="LastName" column="LastName" type="String" length="50" not-null="false" />
</class>
</hibernate-mapping>
[1]: http://www.summerofnhibernate.com/ | 0 |
1,811,782 | 11/28/2009 06:33:25 | 194,764 | 10/22/2009 17:21:28 | 123 | 15 | When should I use ConcurrentSkipListMap? | In Java, `ConcurrentHashMap` is there for better `multithreading` solution. Then when should I use `ConcurrentSkipListMap`? Is it a redundancy? | multithreading | map | java | null | null | null | open | When should I use ConcurrentSkipListMap?
===
In Java, `ConcurrentHashMap` is there for better `multithreading` solution. Then when should I use `ConcurrentSkipListMap`? Is it a redundancy? | 0 |
10,956,334 | 06/08/2012 21:38:41 | 58,755 | 01/25/2009 10:02:48 | 125 | 0 | List of Common Bit-wise Checksum Algorithms | I am trying to reverse engineer a serial protocol that uses a checksum. I have captured a number of packets with their checksums. Each packet contains 17 unique data bits followed by 4 checksum bits, but I only have 12 example packets, and my gut feeling is that this is probably not enough to attempt an automated "cracking" procedure.
My next obvious step is to try some common checksum algorithms and see if any of them give the right answers, but the only approaches I know of involve XORing bytes or other operations at byte level, producing byte-size answers.
This protocol, however, shows no recognition of byte-boundaries or clumps of 8 bits, so these approaches are not meaningful.
Are there any common bit-wise checksum algorithms that I could attempt as a starting point? | algorithm | reverse-engineering | bitwise | checksum | null | 06/08/2012 23:25:29 | not constructive | List of Common Bit-wise Checksum Algorithms
===
I am trying to reverse engineer a serial protocol that uses a checksum. I have captured a number of packets with their checksums. Each packet contains 17 unique data bits followed by 4 checksum bits, but I only have 12 example packets, and my gut feeling is that this is probably not enough to attempt an automated "cracking" procedure.
My next obvious step is to try some common checksum algorithms and see if any of them give the right answers, but the only approaches I know of involve XORing bytes or other operations at byte level, producing byte-size answers.
This protocol, however, shows no recognition of byte-boundaries or clumps of 8 bits, so these approaches are not meaningful.
Are there any common bit-wise checksum algorithms that I could attempt as a starting point? | 4 |
10,415,225 | 05/02/2012 13:55:24 | 9,647 | 09/15/2008 19:28:27 | 2,513 | 152 | Mirroring and Availability Groups in SQL2012 | I've been looking at the new features of SQL 2012, and how it can help my current situation.
Currently we're on SQL 2008R2, and replicate two OLTP database servers to a single reporting server via transactional replication. We then use these replicated DBs for reporting.
I'm interested in whether SQL 2012 and the Availability Groups can replace this - So instead of transactional replication, I'd use the new availability groups and mirror the two OLTP servers to the replication server - Where the reporting will be able to access the read-only copies.
I'm unsure if this will work well, or even at all.
Does anyone have any good examples or experience with this? | sql-server | replication | mirroring | sql2012 | null | 05/03/2012 19:54:18 | off topic | Mirroring and Availability Groups in SQL2012
===
I've been looking at the new features of SQL 2012, and how it can help my current situation.
Currently we're on SQL 2008R2, and replicate two OLTP database servers to a single reporting server via transactional replication. We then use these replicated DBs for reporting.
I'm interested in whether SQL 2012 and the Availability Groups can replace this - So instead of transactional replication, I'd use the new availability groups and mirror the two OLTP servers to the replication server - Where the reporting will be able to access the read-only copies.
I'm unsure if this will work well, or even at all.
Does anyone have any good examples or experience with this? | 2 |
11,150,911 | 06/22/2012 06:03:19 | 554,706 | 12/27/2010 06:26:39 | 7 | 0 | How to open external pages in android using java script? | I am Using **jquerymobile** with **cordova 1.8**, and i want to open external webpages using native browser in my app itself, i searched but not got the answer.
Any suggestions? | javascript | phonegap | null | null | null | null | open | How to open external pages in android using java script?
===
I am Using **jquerymobile** with **cordova 1.8**, and i want to open external webpages using native browser in my app itself, i searched but not got the answer.
Any suggestions? | 0 |
7,251,287 | 08/31/2011 00:23:10 | 496,136 | 11/18/2009 20:05:51 | 332 | 3 | Unix domain sockets C++ SDK | All,
I need to design an ultra simplistic socket IPC sdk in C++. I am not using a third party toolkit because what I need is really really simple.
What would you expect to have in such an SDK? What would like to have? Other the obvious ones, one of my requirements is to be able to call select on it, apparently there is a large loop to go through all sockets and call select on them.
Thoughts?
Reza
| c++ | sockets | null | null | null | 08/31/2011 01:03:52 | not constructive | Unix domain sockets C++ SDK
===
All,
I need to design an ultra simplistic socket IPC sdk in C++. I am not using a third party toolkit because what I need is really really simple.
What would you expect to have in such an SDK? What would like to have? Other the obvious ones, one of my requirements is to be able to call select on it, apparently there is a large loop to go through all sockets and call select on them.
Thoughts?
Reza
| 4 |
1,831,280 | 12/02/2009 07:52:16 | 202,335 | 11/04/2009 04:57:55 | 304 | 0 | How to get the number of words in Jquery form validation plugin? | It is tag input box validation.A poster can combine multiple words into single-words, space is used to separate tags. I use Jquery form validation plugin to validate the form. I need to add a customized method to validate the tag input box.
This is the code:
$.validator.addMethod("tagcheck", function(value, element) {
return value && value.split(" ").length < 4;
}, "Please input at most 3 tags.");
But what if there are two spaces between two adjacent words? | jquery-validate | jquery | jquery-plugins | null | null | null | open | How to get the number of words in Jquery form validation plugin?
===
It is tag input box validation.A poster can combine multiple words into single-words, space is used to separate tags. I use Jquery form validation plugin to validate the form. I need to add a customized method to validate the tag input box.
This is the code:
$.validator.addMethod("tagcheck", function(value, element) {
return value && value.split(" ").length < 4;
}, "Please input at most 3 tags.");
But what if there are two spaces between two adjacent words? | 0 |
4,936,615 | 02/08/2011 18:05:19 | 478,573 | 10/17/2010 14:54:01 | 152 | 7 | Uploading a photo with Flickr | I just started working with the Flickr API today and I have a question:
If I allow a person to upload a photo to my website and then in order for me not to store it on my small local server, how can I just upload that photo to Flickr using the PHP Flickr API?
That should be a pretty common use case, correct? I use PHP.
Thanks,
Alex
| php | photo | flickr | flickr-api | null | null | open | Uploading a photo with Flickr
===
I just started working with the Flickr API today and I have a question:
If I allow a person to upload a photo to my website and then in order for me not to store it on my small local server, how can I just upload that photo to Flickr using the PHP Flickr API?
That should be a pretty common use case, correct? I use PHP.
Thanks,
Alex
| 0 |
812,262 | 05/01/2009 17:03:40 | 91,607 | 04/16/2009 12:44:26 | 1 | 0 | creating a Paging List View in MFC |
How can I create a List View (or List Ctrl) with paging ?
that means that whenever there are too many items in the List Ctrl, those items are organised in different pages.
hope u get wht i mean.
It would be better if there is already such control built (for example in Codeproject).
thanks. | mfc | null | null | null | null | null | open | creating a Paging List View in MFC
===
How can I create a List View (or List Ctrl) with paging ?
that means that whenever there are too many items in the List Ctrl, those items are organised in different pages.
hope u get wht i mean.
It would be better if there is already such control built (for example in Codeproject).
thanks. | 0 |
4,122,264 | 11/08/2010 08:33:11 | 500,457 | 11/08/2010 08:25:00 | 1 | 0 | PHP Content Management System | Which is the best CMS that follows PHP MVC design pattern and has many online supports and tutorials to develop modules? | opencms | null | null | null | null | 11/09/2010 00:32:25 | not constructive | PHP Content Management System
===
Which is the best CMS that follows PHP MVC design pattern and has many online supports and tutorials to develop modules? | 4 |
8,697,884 | 01/02/2012 06:03:01 | 380,791 | 07/01/2010 06:29:34 | 1 | 0 | Accessing TreeView in another windows process | I'm trying to write a program in C++ to readout the treeview in another application (Ventrilo). Ultimately I want to access the state of the icon next to a user's name, but right now I'm just trying to access the names. I can get the correct count, but can't read back the names associated with the treeview items. Here is my code (this is my first question, I hope I've formatted it correctly):
The program writes 40 bytes (should be the size of TVITEM) and reads 64, the size of my character buffer. However, the txt variable is always blank (all bytes are 0). I've tried both txt and &txt in the readprocessmemory line.
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
int _tmain(int argc, _TCHAR* argv[])
{
HWND hwnd=FindWindow(NULL, L"Ventrilo"); // Window to find
HWND treeview=FindWindowEx(hwnd, NULL, L"SysTreeView32", NULL); // Treeview to find
HTREEITEM hTreeItem;
int count=(int)SendMessage(treeview, TVM_GETCOUNT, 0, 0);
// correctly returns the number of items
int i;
TVITEM tvi = {0}; // treeview item information
TVITEM *_tvi;
char txt[128] ="test"; // this will hold the text of the tree view item
char *_txt;
unsigned long pid;
HANDLE process;
SIZE_T read=0; // number of bytes that were read / written to Ventrilo
SIZE_T wrote=0;
// open the ventrilo process and allocate memory for our treeview items
// and the text string
GetWindowThreadProcessId(treeview, &pid);
process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|
PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, pid);
_tvi=(TVITEM*)VirtualAllocEx(process, NULL, sizeof(TVITEM), MEM_COMMIT, PAGE_READWRITE);
_txt=(char*)VirtualAllocEx(process, NULL, sizeof(txt), MEM_COMMIT, PAGE_READWRITE);
printf("%d items\n", count); // this returns the correct # of items
hTreeItem = TreeView_GetRoot( treeview ); // get the first treeview item
for(i=0; i<count; i++) {
printf("%d/%d: ", i, count);
tvi.mask = TVIF_TEXT | TVIF_HANDLE; // set masks to return the text
tvi.pszText = (LPTSTR)_txt; // pointer to the text buffer allocated in the process
tvi.cchTextMax = sizeof(txt);
tvi.hItem = hTreeItem; // tree item handle
WriteProcessMemory(process, _tvi, &tvi, sizeof(tvi), &wrote); // write the tvi
TreeView_GetItem(treeview, _tvi); // should put the text into _txt
ReadProcessMemory(process, _txt, &txt, sizeof(txt), &read); // read _txt into local txt
printf("wrote %d; read %d: %s\n", wrote,read,txt);
hTreeItem = TreeView_GetNextSibling(treeview, hTreeItem); // goto the next item in the treeview
}
VirtualFreeEx(process, _tvi, 0, MEM_RELEASE);
VirtualFreeEx(process, _txt, 0, MEM_RELEASE);
scanf_s(test);
return 0;
}
| c++ | null | null | null | null | 01/02/2012 18:48:47 | too localized | Accessing TreeView in another windows process
===
I'm trying to write a program in C++ to readout the treeview in another application (Ventrilo). Ultimately I want to access the state of the icon next to a user's name, but right now I'm just trying to access the names. I can get the correct count, but can't read back the names associated with the treeview items. Here is my code (this is my first question, I hope I've formatted it correctly):
The program writes 40 bytes (should be the size of TVITEM) and reads 64, the size of my character buffer. However, the txt variable is always blank (all bytes are 0). I've tried both txt and &txt in the readprocessmemory line.
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
int _tmain(int argc, _TCHAR* argv[])
{
HWND hwnd=FindWindow(NULL, L"Ventrilo"); // Window to find
HWND treeview=FindWindowEx(hwnd, NULL, L"SysTreeView32", NULL); // Treeview to find
HTREEITEM hTreeItem;
int count=(int)SendMessage(treeview, TVM_GETCOUNT, 0, 0);
// correctly returns the number of items
int i;
TVITEM tvi = {0}; // treeview item information
TVITEM *_tvi;
char txt[128] ="test"; // this will hold the text of the tree view item
char *_txt;
unsigned long pid;
HANDLE process;
SIZE_T read=0; // number of bytes that were read / written to Ventrilo
SIZE_T wrote=0;
// open the ventrilo process and allocate memory for our treeview items
// and the text string
GetWindowThreadProcessId(treeview, &pid);
process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|
PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, pid);
_tvi=(TVITEM*)VirtualAllocEx(process, NULL, sizeof(TVITEM), MEM_COMMIT, PAGE_READWRITE);
_txt=(char*)VirtualAllocEx(process, NULL, sizeof(txt), MEM_COMMIT, PAGE_READWRITE);
printf("%d items\n", count); // this returns the correct # of items
hTreeItem = TreeView_GetRoot( treeview ); // get the first treeview item
for(i=0; i<count; i++) {
printf("%d/%d: ", i, count);
tvi.mask = TVIF_TEXT | TVIF_HANDLE; // set masks to return the text
tvi.pszText = (LPTSTR)_txt; // pointer to the text buffer allocated in the process
tvi.cchTextMax = sizeof(txt);
tvi.hItem = hTreeItem; // tree item handle
WriteProcessMemory(process, _tvi, &tvi, sizeof(tvi), &wrote); // write the tvi
TreeView_GetItem(treeview, _tvi); // should put the text into _txt
ReadProcessMemory(process, _txt, &txt, sizeof(txt), &read); // read _txt into local txt
printf("wrote %d; read %d: %s\n", wrote,read,txt);
hTreeItem = TreeView_GetNextSibling(treeview, hTreeItem); // goto the next item in the treeview
}
VirtualFreeEx(process, _tvi, 0, MEM_RELEASE);
VirtualFreeEx(process, _txt, 0, MEM_RELEASE);
scanf_s(test);
return 0;
}
| 3 |
11,576,460 | 07/20/2012 09:18:42 | 1,533,590 | 07/18/2012 04:26:51 | 32 | 1 | How to implode a string when have character? | For example, here is my array:
$text = "Iphone 4, Iphone 4S; Iphone 5, Iphone 3. Iphone 3S";
And splitting string:
$splitting_strings = array(".", ";", ".");
$result = array (
0 => "Iphone 4",
1 => "Iphone 4S",
2 => "Iphone 5",
3 => "Iphone 3",
4 => "Iphone 3S"
);
I using code:
$regex = '/(' . implode('|', $splitting_strings) . ')/';
implode($regex, explode(", ", $text); | php | null | null | null | null | 07/20/2012 23:13:26 | not a real question | How to implode a string when have character?
===
For example, here is my array:
$text = "Iphone 4, Iphone 4S; Iphone 5, Iphone 3. Iphone 3S";
And splitting string:
$splitting_strings = array(".", ";", ".");
$result = array (
0 => "Iphone 4",
1 => "Iphone 4S",
2 => "Iphone 5",
3 => "Iphone 3",
4 => "Iphone 3S"
);
I using code:
$regex = '/(' . implode('|', $splitting_strings) . ')/';
implode($regex, explode(", ", $text); | 1 |
11,665,147 | 07/26/2012 08:19:17 | 1,213,934 | 02/16/2012 13:31:10 | 404 | 16 | convert a LongBuffer/IntBuffer/ShortBuffer to ByteBuffer | I know a quick way to convert a byte/short/int/long array to ByteBuffer, and then obtain a byte array. For instance, to convert a byte array to short array I can do:
byte[] bArray = { 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 };
ByteBuffer bb = ByteBuffer.wrap(byteArray);
ShortBuffer sb = bb.asShortBuffer();
short[] shortArray = new short[byteArray.length / 2];
sb.get(shortArray);
produces a short array like this: `[256, 0, 0, 0, 256, 0, 0, 0]`.
**How can I do the inverse operation using [java.nio][1] classes?**
Now I am doing this:
shortArray[] = {256, 0, 0, 0, 256, 0, 0, 0};
ByteBuffer bb = ByteBuffer.allocate(shortArray.length * 2);
for (short s : shortArray) {
bb.putShort(s);
}
return bb.array();
And I obtain the original `[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]` byte array. But I want to use a method like ShortBuffer.asByteBuffer(), not a manual loop to do it.
I have found a [request to Sun of 2001][2], but they did not accept it ;-((
[1]: http://docs.oracle.com/javase/7/docs/api/java/nio/package-summary.html
[2]: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4489356 | java | arrays | bytearray | nio | null | null | open | convert a LongBuffer/IntBuffer/ShortBuffer to ByteBuffer
===
I know a quick way to convert a byte/short/int/long array to ByteBuffer, and then obtain a byte array. For instance, to convert a byte array to short array I can do:
byte[] bArray = { 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 };
ByteBuffer bb = ByteBuffer.wrap(byteArray);
ShortBuffer sb = bb.asShortBuffer();
short[] shortArray = new short[byteArray.length / 2];
sb.get(shortArray);
produces a short array like this: `[256, 0, 0, 0, 256, 0, 0, 0]`.
**How can I do the inverse operation using [java.nio][1] classes?**
Now I am doing this:
shortArray[] = {256, 0, 0, 0, 256, 0, 0, 0};
ByteBuffer bb = ByteBuffer.allocate(shortArray.length * 2);
for (short s : shortArray) {
bb.putShort(s);
}
return bb.array();
And I obtain the original `[1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]` byte array. But I want to use a method like ShortBuffer.asByteBuffer(), not a manual loop to do it.
I have found a [request to Sun of 2001][2], but they did not accept it ;-((
[1]: http://docs.oracle.com/javase/7/docs/api/java/nio/package-summary.html
[2]: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4489356 | 0 |
2,841,658 | 05/15/2010 20:34:21 | 316,076 | 04/14/2010 01:54:06 | 1 | 1 | AWK: compare apache dates without using regular expression | I'm writing a loganalysis application and wanted to grab apache log records between two certain dates. Assume that a date is formated as such: 22/Dec/2009:00:19 (day/month/year:hour:minute)
Currently, I'm using a regular expression to replace the month name with its numeric value, remove the separators, so the above date is converted to: `221220090019` making a date comparison trivial.. but..
Running a regex on each record for large files, say, one containing a quarter million records, is extremely costly.. is there any other method not involving regex substitution?
Thanks in advance | awk | regex | apache | logging | null | null | open | AWK: compare apache dates without using regular expression
===
I'm writing a loganalysis application and wanted to grab apache log records between two certain dates. Assume that a date is formated as such: 22/Dec/2009:00:19 (day/month/year:hour:minute)
Currently, I'm using a regular expression to replace the month name with its numeric value, remove the separators, so the above date is converted to: `221220090019` making a date comparison trivial.. but..
Running a regex on each record for large files, say, one containing a quarter million records, is extremely costly.. is there any other method not involving regex substitution?
Thanks in advance | 0 |
2,574,601 | 04/04/2010 13:59:51 | 62,699 | 02/05/2009 00:58:41 | 5,047 | 259 | Replacing "," with a "." in cmd on all files in a directory | The title pretty much says it all. ***What would be the easiest*** (preferably, without installing some extra tools, but I'll settle for something small .... cygwin's not small :) ***way to replace commas in all files it can find in the current directory with dots ?***
| cmd | windows-xp | null | null | null | null | open | Replacing "," with a "." in cmd on all files in a directory
===
The title pretty much says it all. ***What would be the easiest*** (preferably, without installing some extra tools, but I'll settle for something small .... cygwin's not small :) ***way to replace commas in all files it can find in the current directory with dots ?***
| 0 |
5,248,080 | 03/09/2011 15:33:17 | 651,829 | 03/09/2011 15:23:11 | 1 | 0 | python global names | I'm having trouble with python. I keep getting the same error:
Traceback (most recent call last):
File "F:\test4", line 21, in <module>
graph = dict([(label, node(label))] for label in node_labels)
File "F:\test4", line 21, in <genexpr>
graph = dict([(label, node(label))] for label in node_labels)
NameError: global name 'node' is not defined
# open network.txt and populate nodes and close file
network_file = open("network.txt", "r")
lines = [line.strip() for line in network_file]
network_file.close()
print (len(lines))
# edges which will be populated with information in network.txt
edges = [] # list of <label, label, distance> triples
node_labels = set() # set of node labels
graph = {} # dictionary of nodes keyed by labels
for line in lines:
strNode, strNeighbor, strMetric = line.split()[:3]
intMetric = int(strMetric)
edges.append((strNode, strNeighbor, intMetric))
node_labels.update([strNode, strNeighbor])
# create graph
graph = dict([(label, node(label))] for label in node_labels)
up to this line, I can't find any problem with the global variable node, it should work.
Thanks!
| python | global-variables | null | null | null | null | open | python global names
===
I'm having trouble with python. I keep getting the same error:
Traceback (most recent call last):
File "F:\test4", line 21, in <module>
graph = dict([(label, node(label))] for label in node_labels)
File "F:\test4", line 21, in <genexpr>
graph = dict([(label, node(label))] for label in node_labels)
NameError: global name 'node' is not defined
# open network.txt and populate nodes and close file
network_file = open("network.txt", "r")
lines = [line.strip() for line in network_file]
network_file.close()
print (len(lines))
# edges which will be populated with information in network.txt
edges = [] # list of <label, label, distance> triples
node_labels = set() # set of node labels
graph = {} # dictionary of nodes keyed by labels
for line in lines:
strNode, strNeighbor, strMetric = line.split()[:3]
intMetric = int(strMetric)
edges.append((strNode, strNeighbor, intMetric))
node_labels.update([strNode, strNeighbor])
# create graph
graph = dict([(label, node(label))] for label in node_labels)
up to this line, I can't find any problem with the global variable node, it should work.
Thanks!
| 0 |
9,665,909 | 03/12/2012 11:05:33 | 999,382 | 10/17/2011 14:43:10 | 24 | 3 | Cocos2d+Box2d Throw an object like Paper Toss | I am new to cocos2d and box2d. Trying to create a game similar to paper toss. I have several questions regarding this but firstly i am looking for something like throw an object like Paper Toss. I have searched allot seen many Answers over here, also read many tutorials but haven't found an example like this one. So can someone please Guide me to the rite direction or can give me a small example code. Please remember this that i am new to cocos2d and Box2d, so example code would be best for me.
Thankyou!! | iphone | ios | cocos2d-iphone | box2d-iphone | null | 03/13/2012 12:59:20 | not a real question | Cocos2d+Box2d Throw an object like Paper Toss
===
I am new to cocos2d and box2d. Trying to create a game similar to paper toss. I have several questions regarding this but firstly i am looking for something like throw an object like Paper Toss. I have searched allot seen many Answers over here, also read many tutorials but haven't found an example like this one. So can someone please Guide me to the rite direction or can give me a small example code. Please remember this that i am new to cocos2d and Box2d, so example code would be best for me.
Thankyou!! | 1 |
10,258,521 | 04/21/2012 11:32:54 | 1,003,701 | 10/19/2011 17:22:45 | 328 | 6 | Linux NASM - rewriting character stored in .data segment - segfault | probably a very beginner's question, but I'm really interested in how to make it work.
I have following assembly code (heavily inspired from [here][1], the rename() example):
[SECTION .text]
global _start
_start:
mov esi, msg ; saves pointer to string to ESI
xor eax, eax
mov byte [esi+6], al ; terminates first string with NULL char
mov byte [esi+13], al ; terminates second string with NULL char
mov byte al, 38 ; syscall number (38 = rename)
lea ebx, [esi] ; put the adress of /tmp/a in EBX
lea ecx, [esi+7] ; put the adress of /tmp/b in ECX
int 0x80 ; syscall execution
mov al, 0x01 ; prepare to exit!
xor ebx, ebx
int 0x80 ; exit!
[SECTION .data]
msg: db '/tmp/a#/tmp/b#'
Let me explain it: This program calls syscall `rename` to rename file `/tmp/a` to `/tmp/b` The string in section .data contains name of the source file and name of the target file.
Because I want to avoid NULLs, I decided to put # instead of NULLs and change it on runtime. However, the program terminates with SEGFAULT. It really seems that there is a problem with character substitution in .data segment. My question is - how should I deal with it and make it work? I know it's a beginner question, maybe I'm missing something very important.
Thanks for any advice.
[1]: http://www.safemode.org/files/zillion/shellcode/doc/Writing_shellcode.html | linux | assembly | segmentation-fault | nasm | null | 04/22/2012 15:43:45 | too localized | Linux NASM - rewriting character stored in .data segment - segfault
===
probably a very beginner's question, but I'm really interested in how to make it work.
I have following assembly code (heavily inspired from [here][1], the rename() example):
[SECTION .text]
global _start
_start:
mov esi, msg ; saves pointer to string to ESI
xor eax, eax
mov byte [esi+6], al ; terminates first string with NULL char
mov byte [esi+13], al ; terminates second string with NULL char
mov byte al, 38 ; syscall number (38 = rename)
lea ebx, [esi] ; put the adress of /tmp/a in EBX
lea ecx, [esi+7] ; put the adress of /tmp/b in ECX
int 0x80 ; syscall execution
mov al, 0x01 ; prepare to exit!
xor ebx, ebx
int 0x80 ; exit!
[SECTION .data]
msg: db '/tmp/a#/tmp/b#'
Let me explain it: This program calls syscall `rename` to rename file `/tmp/a` to `/tmp/b` The string in section .data contains name of the source file and name of the target file.
Because I want to avoid NULLs, I decided to put # instead of NULLs and change it on runtime. However, the program terminates with SEGFAULT. It really seems that there is a problem with character substitution in .data segment. My question is - how should I deal with it and make it work? I know it's a beginner question, maybe I'm missing something very important.
Thanks for any advice.
[1]: http://www.safemode.org/files/zillion/shellcode/doc/Writing_shellcode.html | 3 |
4,852,960 | 01/31/2011 15:57:22 | 473,763 | 10/12/2010 19:50:07 | 911 | 54 | How to customise Rspec document format | When I do _rspec spec_ I get a report of the tests in this way:
Course Group
Loged in
In the new course group form
Create a new Group course
Create a new Group course with complex name (FAILED - 1)
Create a new Group course with 3 subjects (FAILED - 2)
1) Course Group Loged in In the new course group form Create a new Group course with complex name
Failure/Error: course_groupDB.courses.count.should == 1
expected: 1
got: 0 (using ==)
# ./spec/acceptance/course_group_spec.rb:40:in `block (4 levels) in <top (required)>'
2) Course Group Loged in In the new course group form Create a new Group course with 3 subjects
Failure/Error: course_groupDB.courses.count.should == 3
expected: 3
got: 0 (using ==)
# ./spec/acceptance/course_group_spec.rb:54:in `block (4 levels) in <top (required)>'
Notice the at the end, when failures are listed, the name is quite messy, as it mix all the contexts, describes and examples.
Is there a way to just shown it the same way they are listed before?
Like this:
1) Course Group
Loged in
In the new course group form
Create a new Group course with complex name
Failure/Error: course_groupDB.courses.count.should == 1
expected: 1
got: 0 (using ==)
# ./spec/acceptance/course_group_spec.rb:40:in `block (4 levels) in <top (required)>'
2) Course Group
Loged in
In the new course group form
Create a new Group course with 3 subjects
Failure/Error: course_groupDB.courses.count.should == 3
expected: 3
got: 0 (using ==)
# ./spec/acceptance/course_group_spec.rb:54:in `block (4 levels) in <top (required)>' | rspec | null | null | null | null | null | open | How to customise Rspec document format
===
When I do _rspec spec_ I get a report of the tests in this way:
Course Group
Loged in
In the new course group form
Create a new Group course
Create a new Group course with complex name (FAILED - 1)
Create a new Group course with 3 subjects (FAILED - 2)
1) Course Group Loged in In the new course group form Create a new Group course with complex name
Failure/Error: course_groupDB.courses.count.should == 1
expected: 1
got: 0 (using ==)
# ./spec/acceptance/course_group_spec.rb:40:in `block (4 levels) in <top (required)>'
2) Course Group Loged in In the new course group form Create a new Group course with 3 subjects
Failure/Error: course_groupDB.courses.count.should == 3
expected: 3
got: 0 (using ==)
# ./spec/acceptance/course_group_spec.rb:54:in `block (4 levels) in <top (required)>'
Notice the at the end, when failures are listed, the name is quite messy, as it mix all the contexts, describes and examples.
Is there a way to just shown it the same way they are listed before?
Like this:
1) Course Group
Loged in
In the new course group form
Create a new Group course with complex name
Failure/Error: course_groupDB.courses.count.should == 1
expected: 1
got: 0 (using ==)
# ./spec/acceptance/course_group_spec.rb:40:in `block (4 levels) in <top (required)>'
2) Course Group
Loged in
In the new course group form
Create a new Group course with 3 subjects
Failure/Error: course_groupDB.courses.count.should == 3
expected: 3
got: 0 (using ==)
# ./spec/acceptance/course_group_spec.rb:54:in `block (4 levels) in <top (required)>' | 0 |
10,796,064 | 05/29/2012 09:02:43 | 1,404,967 | 05/19/2012 10:40:37 | 5 | 5 | Is there any way to add time limit on video capturing in 2.1 version Android? | This putExtras avail from API 8, but not in API 7.
i.putExtra("android.intent.extra.durationLimit", 60);
But I really need to implement such functionality for API 7.
Anyone please provide sol/alternative for this. | android | video | android-video-player | null | null | null | open | Is there any way to add time limit on video capturing in 2.1 version Android?
===
This putExtras avail from API 8, but not in API 7.
i.putExtra("android.intent.extra.durationLimit", 60);
But I really need to implement such functionality for API 7.
Anyone please provide sol/alternative for this. | 0 |
9,916,429 | 03/28/2012 22:14:25 | 737,655 | 05/04/2011 09:06:20 | 572 | 36 | Image transformation for Kinect game | I am working on a Kinect game where I am supposed "to dress" the player into a kind of garment.
As the player should always stand directly in front of the device, I am using simple jpg file for this "dressing".
My problem starts when the user, while still standing in the frontal position, **bends the knees or leans right or left**. I am supposed to apply an appropriate transform to this "dress" image so that it still covers player's legs.
At any moment I have information about the following player's body parts positions:
![enter image description here][1]
Is there any library (C++, C#, Java) or a known algorithm that can make such transformation?
[1]: http://i.stack.imgur.com/0wBtP.png | image-processing | kinect | null | null | null | null | open | Image transformation for Kinect game
===
I am working on a Kinect game where I am supposed "to dress" the player into a kind of garment.
As the player should always stand directly in front of the device, I am using simple jpg file for this "dressing".
My problem starts when the user, while still standing in the frontal position, **bends the knees or leans right or left**. I am supposed to apply an appropriate transform to this "dress" image so that it still covers player's legs.
At any moment I have information about the following player's body parts positions:
![enter image description here][1]
Is there any library (C++, C#, Java) or a known algorithm that can make such transformation?
[1]: http://i.stack.imgur.com/0wBtP.png | 0 |
5,399,045 | 03/22/2011 23:16:51 | 672,133 | 03/22/2011 23:16:51 | 1 | 0 | VS SP1 messes up MVC 3? | I installed VS SP1 and intellisense for Razor (MVC3) stopped working. Did numerous searches for a solution and found lots of references to Resharper which I don't use. So I reinstalled MVC3 which didn't fix the problem. I uninstalled MVC 3 then reinstalled and now my project won't load! So I reinstalled MVC twice and still it won't load!
Now all I get is "The project type is not supported by this installation."
Even though I keep successfully installing MVC3, it no longer appears in Add/Remove programs.
If anyone could give me some tips as to what I do next they would be greatly appreciated. | asp.net-mvc-3 | razor | visual-studio-2010-sp1 | null | null | null | open | VS SP1 messes up MVC 3?
===
I installed VS SP1 and intellisense for Razor (MVC3) stopped working. Did numerous searches for a solution and found lots of references to Resharper which I don't use. So I reinstalled MVC3 which didn't fix the problem. I uninstalled MVC 3 then reinstalled and now my project won't load! So I reinstalled MVC twice and still it won't load!
Now all I get is "The project type is not supported by this installation."
Even though I keep successfully installing MVC3, it no longer appears in Add/Remove programs.
If anyone could give me some tips as to what I do next they would be greatly appreciated. | 0 |
9,171,505 | 02/07/2012 05:40:02 | 222,867 | 12/02/2009 12:01:39 | 913 | 61 | Correct implementation of hashcode/equals | I have a class
class Pair<T>{
private T data;
private T alternative;
}
Two pair objects would be equal if
this.data.equals(that.data) && this.alternative.equals(that.alternative) ||
this.data.equals(that.alternative) && this.alternative.equals(that.data)
I'm having difficulty correctly implementing the hashCode() part though. Any suggestions would be appreciated | java | null | null | null | null | null | open | Correct implementation of hashcode/equals
===
I have a class
class Pair<T>{
private T data;
private T alternative;
}
Two pair objects would be equal if
this.data.equals(that.data) && this.alternative.equals(that.alternative) ||
this.data.equals(that.alternative) && this.alternative.equals(that.data)
I'm having difficulty correctly implementing the hashCode() part though. Any suggestions would be appreciated | 0 |
6,258,091 | 06/06/2011 21:13:59 | 241,286 | 12/31/2009 01:30:47 | 17 | 0 | In python how can I iterate through a string splitting it at different spots as I go? | I'm trying to write a quick solve for Kaprekar number's to show a friend of mine how easy it is to implement something like this in Python. I know how to do all the steps except for iterating through the squared number as a string. For example 45 is a Kaprekar number because
45 ** 2 = 2025 and 20 + 25 = 45
What I'm trying to write is code that would take the result of 45 ** 2 = 2025 and let me iterate over the combinations like
['2', '025']
['20', '25']
['202', '5']
| python | string | math | null | null | null | open | In python how can I iterate through a string splitting it at different spots as I go?
===
I'm trying to write a quick solve for Kaprekar number's to show a friend of mine how easy it is to implement something like this in Python. I know how to do all the steps except for iterating through the squared number as a string. For example 45 is a Kaprekar number because
45 ** 2 = 2025 and 20 + 25 = 45
What I'm trying to write is code that would take the result of 45 ** 2 = 2025 and let me iterate over the combinations like
['2', '025']
['20', '25']
['202', '5']
| 0 |
6,660,904 | 07/12/2011 07:38:23 | 421,703 | 08/16/2010 12:07:28 | 127 | 0 | JSP Book advice: Headfirst or Murach? | I'm currently a second year computer science student, with a good grasp of java fundamentals. I recently finished some work for the university and have been offered another job starting in about a month doing web development using jsp.
I have some familiarity with html and css but apart from that have virtually no experience with web development whatsoever. I am however, quite comfortable with Java.
I would like to get a book to brush up on jsp before starting on the project. Most of the recommendations suggest either head first jsp and servlets or Murach's jsp and servlets.
Given my situation, which book would be more appropriate and why?
Thanks very much | java | jsp | books | null | null | 10/03/2011 01:20:53 | not constructive | JSP Book advice: Headfirst or Murach?
===
I'm currently a second year computer science student, with a good grasp of java fundamentals. I recently finished some work for the university and have been offered another job starting in about a month doing web development using jsp.
I have some familiarity with html and css but apart from that have virtually no experience with web development whatsoever. I am however, quite comfortable with Java.
I would like to get a book to brush up on jsp before starting on the project. Most of the recommendations suggest either head first jsp and servlets or Murach's jsp and servlets.
Given my situation, which book would be more appropriate and why?
Thanks very much | 4 |
8,227,537 | 11/22/2011 13:25:03 | 1,046,434 | 11/14/2011 21:42:07 | 45 | 2 | adding ftp to exceptions in xp pro | I am attempting to access ftp through my browser to a network computer using ftp://. I am able to do so only when I disable the firewall completely. I have tried adding tcp ports 20, 21, and 22 to the exceptions. I also made sure that file and printer sharing was checked. What am I missing? I will not work with just these settings. | ftp | windows-xp | firewall | null | null | 11/23/2011 19:39:58 | off topic | adding ftp to exceptions in xp pro
===
I am attempting to access ftp through my browser to a network computer using ftp://. I am able to do so only when I disable the firewall completely. I have tried adding tcp ports 20, 21, and 22 to the exceptions. I also made sure that file and printer sharing was checked. What am I missing? I will not work with just these settings. | 2 |
11,438,239 | 07/11/2012 17:34:28 | 1,287,359 | 03/23/2012 02:29:09 | 1 | 0 | Struts with tiles or struts with templates and common controls? | Can any one suggest me
Which is better to design & maintain.
**A Struts application using tiles ?**
or
**A Struts Application using templates and common controls ?**
| java | struts | tiles | null | null | 07/12/2012 03:46:42 | not constructive | Struts with tiles or struts with templates and common controls?
===
Can any one suggest me
Which is better to design & maintain.
**A Struts application using tiles ?**
or
**A Struts Application using templates and common controls ?**
| 4 |
7,697,495 | 10/08/2011 14:34:51 | 968,698 | 09/28/2011 08:47:50 | 1 | 0 | Language without explicit memory alloc/dealloc AND without garbage collection | I was wondering if it is possible to create a programming language without explicit memory allocation/deallocation (like C, C++ ...) AND without garbage collection (like Java, C#...) by doing a full analysis at the end of each scope?
The obvious problem is that this would take some time at the end of each scope, but I was wondering if it has become feasible with all the processing power and multiple cores in current CPU's. Do such languages exist already?
I also was wondering if a variant of C++ where smart pointers are the only pointers that can be used, would be exactly such a language (or am I missing some problems with that?). | memory | pointers | collections | garbage | null | null | open | Language without explicit memory alloc/dealloc AND without garbage collection
===
I was wondering if it is possible to create a programming language without explicit memory allocation/deallocation (like C, C++ ...) AND without garbage collection (like Java, C#...) by doing a full analysis at the end of each scope?
The obvious problem is that this would take some time at the end of each scope, but I was wondering if it has become feasible with all the processing power and multiple cores in current CPU's. Do such languages exist already?
I also was wondering if a variant of C++ where smart pointers are the only pointers that can be used, would be exactly such a language (or am I missing some problems with that?). | 0 |
9,867,954 | 03/26/2012 07:05:53 | 1,292,365 | 03/26/2012 07:01:24 | 1 | 0 | How to call a new window on click of a pushbutton in Qt? | I am using calculatorform as my main window. But i want total to be displayed in a new window and not the main window. i tried adding a push button through calculatorform.ui and call the window , but i suppose i am not writing the correct code. Could anyone please help me doing this? I am sorry if this is already discussed on the forum before but i dont know what to do. Please help. Thanks in advance. | c++ | qt | null | null | null | 03/26/2012 14:48:50 | not a real question | How to call a new window on click of a pushbutton in Qt?
===
I am using calculatorform as my main window. But i want total to be displayed in a new window and not the main window. i tried adding a push button through calculatorform.ui and call the window , but i suppose i am not writing the correct code. Could anyone please help me doing this? I am sorry if this is already discussed on the forum before but i dont know what to do. Please help. Thanks in advance. | 1 |
4,046,932 | 10/28/2010 20:30:57 | 100,516 | 05/03/2009 22:15:07 | 9,646 | 419 | How to change values of some elements and attributes in an XML file [Java]? | I'm reading an XML file with a SAX-parser (this part can be changed it there's a good reason for it).
When I find necessary properties I need to change their values and save the resulting XML-file as a new file.
How can I do that? | java | xml | sax | null | null | null | open | How to change values of some elements and attributes in an XML file [Java]?
===
I'm reading an XML file with a SAX-parser (this part can be changed it there's a good reason for it).
When I find necessary properties I need to change their values and save the resulting XML-file as a new file.
How can I do that? | 0 |
8,050,158 | 11/08/2011 12:11:47 | 330,670 | 05/02/2010 04:28:38 | 6 | 0 | Server´s Requirements for Web development | i want to buy a server so i can develop web applications (want to install on it Tomcat, Apache...) and I am asking for the requirements i need in this server (CPU speed, RAM, Hard Disc...).
Thanks in advance.
Mouad | webserver | web | development | null | null | 11/09/2011 11:18:50 | off topic | Server´s Requirements for Web development
===
i want to buy a server so i can develop web applications (want to install on it Tomcat, Apache...) and I am asking for the requirements i need in this server (CPU speed, RAM, Hard Disc...).
Thanks in advance.
Mouad | 2 |
8,830,106 | 01/12/2012 04:25:01 | 226,895 | 12/08/2009 05:28:27 | 538 | 21 | Memory leak after persisting the object into GAE Datastore | Could you guys please help me find memory leak ? I'm from C++ world and memory leaks in Java are kinda strange thing to me since according to my code I keep no references to temporary object.
I'm using GAE SDK 1.6.1 and Objectify 3.1.
I have following method which is being executed in backend instance of GAE dev server (which is probably irrelevant info to the issue).
private void loadProtoBufdata() throws Exception
{
ObjectifyDAO dao = new ObjectifyDAO();
for (long count = 0; count < 100; ++count)
{
Visitor visitor = new Visitor();
visitor.setKey(count + 1);
dao.ofy().put(visitor);
}
dao = null;
}
In constructor of ObjectifyDAO it's being initialized as
public ObjectifyDAO()
{
super(new ObjectifyOpts().setSessionCache(false).setGlobalCache(false));
}
And `Visitor` is as simple as
public class Visitor
{
@Id
Long key;
Long ek;
@Unindexed String ip;
Date t;
@Unindexed Long lzVisit;
}
I'm using JProfiler 7.0.1 to catch memory leaks. After running this code I have few megabytes of `com.google.storage.onestore.v3.OnestoreEntity$PropertyValue` and `com.google.storage.onestore.v3.OnestoreEntity$Property`.
I don't want to blow up this post so I uploaded screenshots from JProfiler.
Reference tree is [here][1]. Allocation tree is [here][2].
I found [this bug][3] on Objectify's tracker and also [this thread][4] on Google Ground for GAE. So I'm not sure whose bug this is.
Questions are:
1) How to avoid memory leak?
2) Does it happen in production?
Thanks!!!
PS. Nick, I know you are reading this. Please help :)
[1]: http://i43.tinypic.com/xpy0xy.png
[2]: http://i44.tinypic.com/6jjaps.png
[3]: http://code.google.com/p/objectify-appengine/issues/detail?id=38
[4]: http://groups.google.com/group/google-appengine-java/browse_thread/thread/afc98d9a853601d2 | google-app-engine | memory-leaks | gae-datastore | protocol-buffers | objectify | 01/13/2012 00:04:13 | too localized | Memory leak after persisting the object into GAE Datastore
===
Could you guys please help me find memory leak ? I'm from C++ world and memory leaks in Java are kinda strange thing to me since according to my code I keep no references to temporary object.
I'm using GAE SDK 1.6.1 and Objectify 3.1.
I have following method which is being executed in backend instance of GAE dev server (which is probably irrelevant info to the issue).
private void loadProtoBufdata() throws Exception
{
ObjectifyDAO dao = new ObjectifyDAO();
for (long count = 0; count < 100; ++count)
{
Visitor visitor = new Visitor();
visitor.setKey(count + 1);
dao.ofy().put(visitor);
}
dao = null;
}
In constructor of ObjectifyDAO it's being initialized as
public ObjectifyDAO()
{
super(new ObjectifyOpts().setSessionCache(false).setGlobalCache(false));
}
And `Visitor` is as simple as
public class Visitor
{
@Id
Long key;
Long ek;
@Unindexed String ip;
Date t;
@Unindexed Long lzVisit;
}
I'm using JProfiler 7.0.1 to catch memory leaks. After running this code I have few megabytes of `com.google.storage.onestore.v3.OnestoreEntity$PropertyValue` and `com.google.storage.onestore.v3.OnestoreEntity$Property`.
I don't want to blow up this post so I uploaded screenshots from JProfiler.
Reference tree is [here][1]. Allocation tree is [here][2].
I found [this bug][3] on Objectify's tracker and also [this thread][4] on Google Ground for GAE. So I'm not sure whose bug this is.
Questions are:
1) How to avoid memory leak?
2) Does it happen in production?
Thanks!!!
PS. Nick, I know you are reading this. Please help :)
[1]: http://i43.tinypic.com/xpy0xy.png
[2]: http://i44.tinypic.com/6jjaps.png
[3]: http://code.google.com/p/objectify-appengine/issues/detail?id=38
[4]: http://groups.google.com/group/google-appengine-java/browse_thread/thread/afc98d9a853601d2 | 3 |
8,060,015 | 11/09/2011 03:30:54 | 807,400 | 06/20/2011 21:03:30 | 247 | 9 | how to access cache from other views | I have set up a sharedCache using ASIHttprequest and it is created from the xml I parse in my subview. I was woundering if I can then access that sharedCache from my mainview to do a few things things that will speed my tables up?
any idea, suggestions, thoughts of examples would be greatly appreciated. | iphone | ios | uitableview | caching | asihttprequest | null | open | how to access cache from other views
===
I have set up a sharedCache using ASIHttprequest and it is created from the xml I parse in my subview. I was woundering if I can then access that sharedCache from my mainview to do a few things things that will speed my tables up?
any idea, suggestions, thoughts of examples would be greatly appreciated. | 0 |
2,419,888 | 03/10/2010 19:28:04 | 146,588 | 07/28/2009 18:09:28 | 313 | 1 | How would you go about improving MySQL throughput in this simple scenario? | I have a relatively simple object model:
ParentObject
Collection<ChildObject1>
ChildObject2
The MySQL operation when saving this object model does the following:
- Update the `ParentObject`
- Delete all previous items from the `ChildObject1` table (about 10 rows)
- Insert all new `ChildObject1` (again, about 10 rows)
- Insert `ChildObject2`
The objects / tables are unremarkable - no `strings`, rather mainly `ints` and `longs`.
MySQL is currently saving about 20-30 instances of the object model per second. When this goes into prodcution it's going to be doing upwards of a million saves, which at current speeds is going to take 10+ hours, which is no good to me...
How would you suggest I increase the throughput? | mysql | optimization | null | null | null | null | open | How would you go about improving MySQL throughput in this simple scenario?
===
I have a relatively simple object model:
ParentObject
Collection<ChildObject1>
ChildObject2
The MySQL operation when saving this object model does the following:
- Update the `ParentObject`
- Delete all previous items from the `ChildObject1` table (about 10 rows)
- Insert all new `ChildObject1` (again, about 10 rows)
- Insert `ChildObject2`
The objects / tables are unremarkable - no `strings`, rather mainly `ints` and `longs`.
MySQL is currently saving about 20-30 instances of the object model per second. When this goes into prodcution it's going to be doing upwards of a million saves, which at current speeds is going to take 10+ hours, which is no good to me...
How would you suggest I increase the throughput? | 0 |
11,275,766 | 06/30/2012 16:35:19 | 1,493,257 | 06/30/2012 16:30:40 | 1 | 0 | +what is the best way to learn android programming? | plese help me learning in Android right from basic.
please help me in what is the best book ,website and all the best information about Android | android | null | null | null | null | 06/30/2012 16:57:44 | not a real question | +what is the best way to learn android programming?
===
plese help me learning in Android right from basic.
please help me in what is the best book ,website and all the best information about Android | 1 |
2,370,758 | 03/03/2010 11:31:31 | 285,236 | 03/03/2010 11:31:31 | 1 | 0 | How to access internet on emulator?Am working in a company..so i think i have some firewall to access..so pls help me in detail | **
Am working in a company..so i think i have some firewall to access..so pls help me in detail
** | internet | access | emulator | null | null | 04/10/2011 05:10:35 | not a real question | How to access internet on emulator?Am working in a company..so i think i have some firewall to access..so pls help me in detail
===
**
Am working in a company..so i think i have some firewall to access..so pls help me in detail
** | 1 |
603,890 | 03/02/2009 20:34:14 | 66,575 | 02/15/2009 03:43:37 | 71 | 9 | Serlialize Flex Objects to Save/Restore Application State | Is it possible to serialize a hierarchy of objects in Flex, send the binary data to a URL for storage/retrieval on/from a server, and deserialize the data to restore the objects' original state?
I know it's possible to convert the objects into an XML format (haven't tried it yet), but I'm hoping to avoid parsing XML and rebuilding the objects manually. It would be nice to have functionality which can serialize/deserialize objects to a simple binary format (I did something similar in the past in Java, though not quite as easily as I would have liked). The 'eval' function in Perl is similar to what I'm looking for, sans saving code, of course.
In pseudo-code, here's what I would like to do:
private var contentToSave:HBox = new HBox();
private function saveState(event:Event):void {
var toSave:HBox = this.contentToSave;
var data:? = /* serialize 'toSave' ActionScript classes to binary data*/;
sendDataToServer(data, filename);
}
private function restoreState(filename):void {
var data:? = getDataFromServer(filename);
var savedData:HBox = /* deserialize binary 'data' to ActionScript classes */;
this.contentToSave = savedData;
}
| flex3 | actionscript | null | null | null | null | open | Serlialize Flex Objects to Save/Restore Application State
===
Is it possible to serialize a hierarchy of objects in Flex, send the binary data to a URL for storage/retrieval on/from a server, and deserialize the data to restore the objects' original state?
I know it's possible to convert the objects into an XML format (haven't tried it yet), but I'm hoping to avoid parsing XML and rebuilding the objects manually. It would be nice to have functionality which can serialize/deserialize objects to a simple binary format (I did something similar in the past in Java, though not quite as easily as I would have liked). The 'eval' function in Perl is similar to what I'm looking for, sans saving code, of course.
In pseudo-code, here's what I would like to do:
private var contentToSave:HBox = new HBox();
private function saveState(event:Event):void {
var toSave:HBox = this.contentToSave;
var data:? = /* serialize 'toSave' ActionScript classes to binary data*/;
sendDataToServer(data, filename);
}
private function restoreState(filename):void {
var data:? = getDataFromServer(filename);
var savedData:HBox = /* deserialize binary 'data' to ActionScript classes */;
this.contentToSave = savedData;
}
| 0 |
10,450,138 | 05/04/2012 13:46:08 | 1,023,928 | 11/01/2011 14:53:48 | 110 | 3 | Most efficient sorting algorithm for sorted sub-sequences | I have several sorted sequences of numbers of type long (ascending order) and want to generate one master sequence that contains all elements in the same order. I look for the most efficient sorting algorithm to solve this problem. I target C#, .Net 4.0 and thus also welcome ideas targeting parallelism.
Here is an example:
s1 = 1,2,3,5,7,13
s2 = 2,3,6
s3 = 4,5,6,7,8
resulting Sequence = 1,2,2,3,3,4,5,5,6,6,7,7,8,13
| c# | algorithm | sorting | quicksort | mergesort | null | open | Most efficient sorting algorithm for sorted sub-sequences
===
I have several sorted sequences of numbers of type long (ascending order) and want to generate one master sequence that contains all elements in the same order. I look for the most efficient sorting algorithm to solve this problem. I target C#, .Net 4.0 and thus also welcome ideas targeting parallelism.
Here is an example:
s1 = 1,2,3,5,7,13
s2 = 2,3,6
s3 = 4,5,6,7,8
resulting Sequence = 1,2,2,3,3,4,5,5,6,6,7,7,8,13
| 0 |
7,439,583 | 09/16/2011 02:38:48 | 458,773 | 09/26/2010 15:47:34 | 28 | 0 | What is the best GUI tool for MYSQL? | I am using MySQL Workbench. I can't deny that it's a very good tool. Unfortunately it doesn't have a query builder feature. So I wonder if there is another better then. | mysql | query | gui | mysql-workbench | query-builder | 09/16/2011 04:00:24 | not constructive | What is the best GUI tool for MYSQL?
===
I am using MySQL Workbench. I can't deny that it's a very good tool. Unfortunately it doesn't have a query builder feature. So I wonder if there is another better then. | 4 |
9,585,459 | 03/06/2012 14:20:50 | 831,587 | 07/06/2011 12:42:57 | 76 | 11 | Redirect stdout over ssh | I want to redirect the output of a sed command into a .txt file ( in the remote server), the code is as follows:
ssh -p XXYY -l root $remoteIP | sed '/keyword/d' /etc/fileA > /etc/fileA_temp
I want to update a txt file deleting all the lines that contains a specific keyword and save it in the same file or somewhere where I could after copy it
The first part of the code reply as wanted:
ssh -p XXYY -l root $remoteIP | sed '/keyword/d' /etc/fileA
But the output in the line command says that 'permission denied' to the 'fileA_temp' file and shows all the info about the options for ssh...Because of that I think that 'ssh' is not allowing to update the file in some way.
Thanks so much
| ssh | null | null | null | null | 03/07/2012 14:47:51 | off topic | Redirect stdout over ssh
===
I want to redirect the output of a sed command into a .txt file ( in the remote server), the code is as follows:
ssh -p XXYY -l root $remoteIP | sed '/keyword/d' /etc/fileA > /etc/fileA_temp
I want to update a txt file deleting all the lines that contains a specific keyword and save it in the same file or somewhere where I could after copy it
The first part of the code reply as wanted:
ssh -p XXYY -l root $remoteIP | sed '/keyword/d' /etc/fileA
But the output in the line command says that 'permission denied' to the 'fileA_temp' file and shows all the info about the options for ssh...Because of that I think that 'ssh' is not allowing to update the file in some way.
Thanks so much
| 2 |
8,056,524 | 11/08/2011 20:14:08 | 307,072 | 04/01/2010 16:25:04 | 32 | 4 | How to correct setup IIS express for x64 platform app | I have IIS 7.5 that configure for work with x64 applications.
I want use IIS Express for test my application before deploy to local IIS.
But IIS Express don't want to run my X64 application.
What should I setup for run IIS Express with X64 application ?
Thanks.
| windows-7-x64 | iis-express | null | null | null | 11/24/2011 09:34:02 | off topic | How to correct setup IIS express for x64 platform app
===
I have IIS 7.5 that configure for work with x64 applications.
I want use IIS Express for test my application before deploy to local IIS.
But IIS Express don't want to run my X64 application.
What should I setup for run IIS Express with X64 application ?
Thanks.
| 2 |
3,875,328 | 10/06/2010 17:37:02 | 419,886 | 08/13/2010 18:40:13 | 36 | 3 | Old references never die | I'm able to run an asp.net application using a console host to host my services. This works fine.
When I install the services to a server and then attempt to access them with my application, I get an error when running my search function (it's a search application) I used to be doing it using a stored procedure that is dynamically created which was using Microsoft.SqlServer.Management.Sdk.Sfc.dll to create a sql server object and create a stored procedure. Now I'm doing it without a stored procedure and so I no longer need this reference. However, when I try to run my search function with the services installed on the server, it keeps failing because it can't find this file. I've emptied all my bin and obj directories, cleaned the services solution and the asp.net application solution, but it keeps looking for this reference.
I even searched my computer for this file and it was only found in its original location (C:\Program Files\MicrosoftSqlServer\100\SDK\Assemblies). I don't know what else to do to tell my program I no longer care about this reference.
Please help if you can! Thanks very much in advance. | c# | asp.net | wcf | null | null | null | open | Old references never die
===
I'm able to run an asp.net application using a console host to host my services. This works fine.
When I install the services to a server and then attempt to access them with my application, I get an error when running my search function (it's a search application) I used to be doing it using a stored procedure that is dynamically created which was using Microsoft.SqlServer.Management.Sdk.Sfc.dll to create a sql server object and create a stored procedure. Now I'm doing it without a stored procedure and so I no longer need this reference. However, when I try to run my search function with the services installed on the server, it keeps failing because it can't find this file. I've emptied all my bin and obj directories, cleaned the services solution and the asp.net application solution, but it keeps looking for this reference.
I even searched my computer for this file and it was only found in its original location (C:\Program Files\MicrosoftSqlServer\100\SDK\Assemblies). I don't know what else to do to tell my program I no longer care about this reference.
Please help if you can! Thanks very much in advance. | 0 |
2,244,956 | 02/11/2010 14:13:58 | 271,124 | 02/11/2010 14:13:58 | 1 | 0 | blurry wpf applications | I'm using win XP and recently since the last windows updates (at least that's the time that I noticed this happened) - 11.2.2010 - all WPF applications that I run are blurry.
I first noticed on my own apps, they were suddenly blurry. I first thought if it wasn't something with the SnapsToDevicePixels property. But that was not the case. Because I'm getting the same blurry look on all WPF apps that are run on my computer (e.g. MS Expression Studio Blend looks just terrible).
Could someone give me a hint of what's going on?
Thank you
Marty | wpf | blurry | windows-xp | null | null | 08/23/2011 16:50:26 | too localized | blurry wpf applications
===
I'm using win XP and recently since the last windows updates (at least that's the time that I noticed this happened) - 11.2.2010 - all WPF applications that I run are blurry.
I first noticed on my own apps, they were suddenly blurry. I first thought if it wasn't something with the SnapsToDevicePixels property. But that was not the case. Because I'm getting the same blurry look on all WPF apps that are run on my computer (e.g. MS Expression Studio Blend looks just terrible).
Could someone give me a hint of what's going on?
Thank you
Marty | 3 |
8,104,316 | 11/12/2011 11:59:41 | 1,043,063 | 11/12/2011 11:33:24 | 1 | 0 | Creating a like button when posting an image | Can you please tell me how can I add a Like button to an image that will be posted on the wall ,so that instead of liking the image itself they like the facebook page.
Thanks for your help,
Vicky | facebook | like | null | null | null | 11/13/2011 15:51:22 | off topic | Creating a like button when posting an image
===
Can you please tell me how can I add a Like button to an image that will be posted on the wall ,so that instead of liking the image itself they like the facebook page.
Thanks for your help,
Vicky | 2 |
8,598,006 | 12/22/2011 00:12:45 | 324,243 | 04/23/2010 13:49:50 | 538 | 12 | jquery fadeIn following after() | I was looking to do a fadein animation chained to this after(), but this doesn't appear to be the way of doing it. Any suggestions?
$(clicked_item).parent().parent().parent().after(str).fadeIn("slow"); | jquery | null | null | null | null | null | open | jquery fadeIn following after()
===
I was looking to do a fadein animation chained to this after(), but this doesn't appear to be the way of doing it. Any suggestions?
$(clicked_item).parent().parent().parent().after(str).fadeIn("slow"); | 0 |
3,340,617 | 07/27/2010 03:48:38 | 236,896 | 10/23/2009 06:04:41 | 83 | 1 | How to paste xml tag in this forum? | I have a doubt in pasting xml tag here. How to do that? | xml | null | null | null | null | 10/17/2011 21:04:36 | off topic | How to paste xml tag in this forum?
===
I have a doubt in pasting xml tag here. How to do that? | 2 |
11,590,479 | 07/21/2012 07:54:23 | 1,542,348 | 07/21/2012 07:46:36 | 1 | 0 | Issues Installing Apache and GCC on Linux | I am trying to install Apache on my Linux server, but it only had Java before I started this process. At the moment, I have installed Apache web server, Apr, and Apr-util. I have placed all of these files in a folder called MCVM inside my home folder. I added another folder called gcc and uploaded all of the gcc files to this folder. Here is the log when I try to do ./configure while in the apache directory:
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring Apache Portable Runtime library ...
checking for APR... reconfig
configuring package in srclib/apr now
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring APR library
Platform: x86_64-unknown-linux-gnu
checking for working mkdir -p... yes
APR Version: 1.4.6
checking for chosen layout... apr
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/MCVM/httpd-2.4.2/srclib/apr':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
configure failed for srclib/apr
If someone could tell me what I need to do to get this working, it would be amazing. Thank you for your time and invaluable help! | php | linux | apache | gcc | null | 07/21/2012 12:17:49 | off topic | Issues Installing Apache and GCC on Linux
===
I am trying to install Apache on my Linux server, but it only had Java before I started this process. At the moment, I have installed Apache web server, Apr, and Apr-util. I have placed all of these files in a folder called MCVM inside my home folder. I added another folder called gcc and uploaded all of the gcc files to this folder. Here is the log when I try to do ./configure while in the apache directory:
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring Apache Portable Runtime library ...
checking for APR... reconfig
configuring package in srclib/apr now
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring APR library
Platform: x86_64-unknown-linux-gnu
checking for working mkdir -p... yes
APR Version: 1.4.6
checking for chosen layout... apr
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/MCVM/httpd-2.4.2/srclib/apr':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
configure failed for srclib/apr
If someone could tell me what I need to do to get this working, it would be amazing. Thank you for your time and invaluable help! | 2 |
8,616,311 | 12/23/2011 12:51:42 | 85,140 | 03/31/2009 14:36:58 | 4,246 | 193 | What features and scenarios does the DjangoTestSuiteRunner class have? | I have decided to write a [DjangoTestSuiteRunner][1] for [lettuce][2] just to learn and practice BDD and I am using lettuce itself to write the unit tests.
However, I am unsure what kind of scenarios and features a DjangoTestSuiteRunner have.
You can just run it, run it with some options and that's about it?
Am I missing something here?
Should I just write a scenario for each command line option that the lettuce script provides me?
[1]: https://docs.djangoproject.com/en/dev/topics/testing/#defining-a-test-runner
[2]: http://lettuce.it/index.html | django | bdd | lettuce | null | null | null | open | What features and scenarios does the DjangoTestSuiteRunner class have?
===
I have decided to write a [DjangoTestSuiteRunner][1] for [lettuce][2] just to learn and practice BDD and I am using lettuce itself to write the unit tests.
However, I am unsure what kind of scenarios and features a DjangoTestSuiteRunner have.
You can just run it, run it with some options and that's about it?
Am I missing something here?
Should I just write a scenario for each command line option that the lettuce script provides me?
[1]: https://docs.djangoproject.com/en/dev/topics/testing/#defining-a-test-runner
[2]: http://lettuce.it/index.html | 0 |
724,826 | 04/07/2009 09:34:29 | 82,686 | 03/25/2009 16:29:41 | 2,788 | 228 | JavaScript Tips and Tricks; JavaScript Best Practices | Please, share your tips and tricks related to JavaScript coding. The ones which make code more elegant and faster. | javascript | tips-and-tricks | null | null | null | 03/04/2012 05:36:02 | not constructive | JavaScript Tips and Tricks; JavaScript Best Practices
===
Please, share your tips and tricks related to JavaScript coding. The ones which make code more elegant and faster. | 4 |
10,630,418 | 05/17/2012 05:41:24 | 1,400,221 | 05/17/2012 05:37:45 | 1 | 0 | showing related data using javascript | I have a file and in that i have expression like a=15 and in output html file when i enter a in textbox it should show 15 instead of a is it possible.If possible how is it | javascript | html | null | null | null | 05/17/2012 17:46:06 | not a real question | showing related data using javascript
===
I have a file and in that i have expression like a=15 and in output html file when i enter a in textbox it should show 15 instead of a is it possible.If possible how is it | 1 |
1,749,795 | 11/17/2009 15:48:38 | 181,759 | 09/30/2009 11:17:08 | 170 | 2 | Targeted Simplify in Mathematica | I generate very long and complex analytic expressions of the general form:
(...something not so complex...)(...ditto...)(...ditto...)...lots...
When I try to use [Simplify][1], Mathematica grinds to a halt, I am assuming due to the fact that it tries to expand the brackets and or simplify across different brackets. The brackets, while containing long expressions, are easily simplified by Mathematica on their own. Is there some way I can limit the scope of [Simplify][1] to a single bracket at a time?
[1]: http://documents.wolfram.com/mathematica/functions/Simplify | mathematica | null | null | null | null | null | open | Targeted Simplify in Mathematica
===
I generate very long and complex analytic expressions of the general form:
(...something not so complex...)(...ditto...)(...ditto...)...lots...
When I try to use [Simplify][1], Mathematica grinds to a halt, I am assuming due to the fact that it tries to expand the brackets and or simplify across different brackets. The brackets, while containing long expressions, are easily simplified by Mathematica on their own. Is there some way I can limit the scope of [Simplify][1] to a single bracket at a time?
[1]: http://documents.wolfram.com/mathematica/functions/Simplify | 0 |
6,275,498 | 06/08/2011 07:27:45 | 788,746 | 06/08/2011 07:25:29 | 1 | 0 | Refresh Glassfish realm to update user roles | I use the security annotations in GlassFish (@RolesAllowed, ...) in combination with a custom realm (based on AppservRealm). When the user logs in the realm returns the assigned user roles via getGroupNames(). Now we've a situation that the roles of the currently logged in user changes (e.g. the user does not longer has the role ADMIN).<br>
Is there a way to trigger a reload of the realm data by GlassFish so e.g. the getGroupNames() will be called by GlassFish an returned the new roles of the currently logged in user?
| glassfish | roles | realm | null | null | null | open | Refresh Glassfish realm to update user roles
===
I use the security annotations in GlassFish (@RolesAllowed, ...) in combination with a custom realm (based on AppservRealm). When the user logs in the realm returns the assigned user roles via getGroupNames(). Now we've a situation that the roles of the currently logged in user changes (e.g. the user does not longer has the role ADMIN).<br>
Is there a way to trigger a reload of the realm data by GlassFish so e.g. the getGroupNames() will be called by GlassFish an returned the new roles of the currently logged in user?
| 0 |
11,724,820 | 07/30/2012 15:42:01 | 1,165,232 | 01/23/2012 15:19:40 | 1 | 0 | Duplicate Git Commit? | I'm still pretty new to Git, but I noticed today that a few of my commits are showing up as duplicates with identical SHA-1 and commit messages. What's going on here?
$ git log --pretty=oneline
739ca79856dc1742890b7790c01c23198c312ae3 cleanup unused js
7ced47ade57a1d677288e7c98a20eaf374fc2efe final (hopefully) ie fix for menu js
66af4165df70640c6f65cf1ba58db48f2d89012d v0.5
f2954f57eaf2b8a9261680d2d34fd4022178b539 Final menu style, added sidebar styling
04432e237098cccd464a17b7a50226d55b7b4c48 ie fix for previous commit
476e33937a9f6bc8383cd04d8cfe967e25090bc0 Fixed menu false positive on click for
7ced47ade57a1d677288e7c98a20eaf374fc2efe final (hopefully) ie fix for menu js
66af4165df70640c6f65cf1ba58db48f2d89012d v0.5
f2954f57eaf2b8a9261680d2d34fd4022178b539 Final menu style, added sidebar styling
04432e237098cccd464a17b7a50226d55b7b4c48 ie fix for previous commit
476e33937a9f6bc8383cd04d8cfe967e25090bc0 Fixed menu false positive on click for
I suspect I've been doing something wrong or have otherwise misunderstood my situation. | git | null | null | null | null | 07/31/2012 00:14:13 | not a real question | Duplicate Git Commit?
===
I'm still pretty new to Git, but I noticed today that a few of my commits are showing up as duplicates with identical SHA-1 and commit messages. What's going on here?
$ git log --pretty=oneline
739ca79856dc1742890b7790c01c23198c312ae3 cleanup unused js
7ced47ade57a1d677288e7c98a20eaf374fc2efe final (hopefully) ie fix for menu js
66af4165df70640c6f65cf1ba58db48f2d89012d v0.5
f2954f57eaf2b8a9261680d2d34fd4022178b539 Final menu style, added sidebar styling
04432e237098cccd464a17b7a50226d55b7b4c48 ie fix for previous commit
476e33937a9f6bc8383cd04d8cfe967e25090bc0 Fixed menu false positive on click for
7ced47ade57a1d677288e7c98a20eaf374fc2efe final (hopefully) ie fix for menu js
66af4165df70640c6f65cf1ba58db48f2d89012d v0.5
f2954f57eaf2b8a9261680d2d34fd4022178b539 Final menu style, added sidebar styling
04432e237098cccd464a17b7a50226d55b7b4c48 ie fix for previous commit
476e33937a9f6bc8383cd04d8cfe967e25090bc0 Fixed menu false positive on click for
I suspect I've been doing something wrong or have otherwise misunderstood my situation. | 1 |
9,710,395 | 03/14/2012 21:15:21 | 76,487 | 03/11/2009 04:36:23 | 829 | 17 | Gradle Build Script Samples from real projects? | Just starting off with Graddle. I'm looking for some more complicated sample source code for Gradle Build Scripts used in actual projects. Something more complicated then the sample code available in the tutorials. And definitely something that serves as a good example of proper Gradle coding. | gradle | null | null | null | null | 03/26/2012 18:06:45 | not constructive | Gradle Build Script Samples from real projects?
===
Just starting off with Graddle. I'm looking for some more complicated sample source code for Gradle Build Scripts used in actual projects. Something more complicated then the sample code available in the tutorials. And definitely something that serves as a good example of proper Gradle coding. | 4 |
8,059,169 | 11/09/2011 00:59:21 | 2,942 | 08/26/2008 08:29:31 | 1,911 | 54 | Passing username and password to .NET HttpWebRequest does not work | Running the following code:
var request = HttpWebRequest.Create("http://username:password@savanttools.com/test-http-status-codes.asp?code=401");
var response = request.GetResponse();
... and inspecting the request using Wireshark reveals that no authorization is attempted by my client (the url is a simple service that will always return 401).
This code sends an authorization header after the initial challenge:
var request = HttpWebRequest.Create("http://username:password@savanttools.com/test-http-status-codes.asp?code=401");
request.Credentials = new NetworkCredential("username", "password");
var response = request.GetResponse();
Using the `System.Uri` class has no affect. Why is the username and password passed in the url not used for authentication?
(I'm aware of [this blog post](http://www.west-wind.com/weblog/posts/2010/Feb/18/NET-WebRequestPreAuthenticate-not-quite-what-it-sounds-like) on passing the authorition header without an initial challenge, but that is not the issue at hand) | .net | http | httpwebrequest | uri | null | null | open | Passing username and password to .NET HttpWebRequest does not work
===
Running the following code:
var request = HttpWebRequest.Create("http://username:password@savanttools.com/test-http-status-codes.asp?code=401");
var response = request.GetResponse();
... and inspecting the request using Wireshark reveals that no authorization is attempted by my client (the url is a simple service that will always return 401).
This code sends an authorization header after the initial challenge:
var request = HttpWebRequest.Create("http://username:password@savanttools.com/test-http-status-codes.asp?code=401");
request.Credentials = new NetworkCredential("username", "password");
var response = request.GetResponse();
Using the `System.Uri` class has no affect. Why is the username and password passed in the url not used for authentication?
(I'm aware of [this blog post](http://www.west-wind.com/weblog/posts/2010/Feb/18/NET-WebRequestPreAuthenticate-not-quite-what-it-sounds-like) on passing the authorition header without an initial challenge, but that is not the issue at hand) | 0 |
3,708,961 | 09/14/2010 12:44:59 | 364,367 | 06/11/2010 08:39:21 | 50 | 5 | Overriding internal UIViewController methods because an internal method is giving me bugs | What are the consequences of overriding internal UIViewController methods?
`[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]` is giving me some problems. It resizes my frame to values I do not desire ***sometimes***. I do not even know where it picks off the new frame's values (it is close to the size of the superview to where I am adding it, but is off by 2px). Reference: [this question, which I also need some help with.][1]
I tried defining an empty `- (void)viewDidMoveToWindow:(UIWindow *)window shouldAppearOrDisappear:(BOOL)flag` method in my view controller. Bug is gone. >.<
Does anyone know if overriding `-viewDidMoveToWindow:shouldAppearOrDisappear:` is ok to do? Or some other workaround?
Or, does anyone know when and why `-viewDidMoveToWindow:shouldAppearOrDisappear:` likes to change my frame dimensions ***sometimes***?
Thanks in advance.
[1]: http://stackoverflow.com/questions/3701736/addsubview-modifying-the-added-views-frame | iphone | objective-c | cocoa-touch | ipad | uiviewcontroller | null | open | Overriding internal UIViewController methods because an internal method is giving me bugs
===
What are the consequences of overriding internal UIViewController methods?
`[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]` is giving me some problems. It resizes my frame to values I do not desire ***sometimes***. I do not even know where it picks off the new frame's values (it is close to the size of the superview to where I am adding it, but is off by 2px). Reference: [this question, which I also need some help with.][1]
I tried defining an empty `- (void)viewDidMoveToWindow:(UIWindow *)window shouldAppearOrDisappear:(BOOL)flag` method in my view controller. Bug is gone. >.<
Does anyone know if overriding `-viewDidMoveToWindow:shouldAppearOrDisappear:` is ok to do? Or some other workaround?
Or, does anyone know when and why `-viewDidMoveToWindow:shouldAppearOrDisappear:` likes to change my frame dimensions ***sometimes***?
Thanks in advance.
[1]: http://stackoverflow.com/questions/3701736/addsubview-modifying-the-added-views-frame | 0 |
2,466,070 | 03/17/2010 21:31:53 | 49,294 | 12/27/2008 00:34:17 | 290 | 15 | Javascript data parsing in IE vs other browsers... It seems kinda screwed up. What's the deal? | Firstly, when I say other browsers I really only mean Firefox because that's all I tested in.
Internet Explorer can parse a date followed by a single character as a proper date. Whereas Firefox behaves as I'd expect.
For example...
var dateString = new Date("1/1/2010f");
alert(dateString);
In IE it will alert...
Thu Dec 31 21:00:00 UTC-0900 2009
Whereas in FF is will spit out...
"Invalid Date"
I first noticed this using the jquery validation plug in.
http://docs.jquery.com/Plugins/Validation/Methods/date
It seems like it just subtracts some amount of hours off the actual date in IE when a character is appended. I've tested in IE6 and IE8.
Am I missing something?
| internet-explorer | javascript | date | null | null | null | open | Javascript data parsing in IE vs other browsers... It seems kinda screwed up. What's the deal?
===
Firstly, when I say other browsers I really only mean Firefox because that's all I tested in.
Internet Explorer can parse a date followed by a single character as a proper date. Whereas Firefox behaves as I'd expect.
For example...
var dateString = new Date("1/1/2010f");
alert(dateString);
In IE it will alert...
Thu Dec 31 21:00:00 UTC-0900 2009
Whereas in FF is will spit out...
"Invalid Date"
I first noticed this using the jquery validation plug in.
http://docs.jquery.com/Plugins/Validation/Methods/date
It seems like it just subtracts some amount of hours off the actual date in IE when a character is appended. I've tested in IE6 and IE8.
Am I missing something?
| 0 |
5,658,878 | 04/14/2011 05:17:07 | 670,867 | 03/22/2011 08:58:31 | 6 | 0 | update a sql using subquery and aggregate function | Below is the sql where i am getting the error retuns more than 1 value
update Tab2
set monthly_calls = (select a.month from (select accountid,max(annual_calls)/12 as month from cpo group by accountid) a inner join tab2 on tab2.accountid = a.accountid)
FYI... my select query which is left of = is working fine | sql | sql-server-2005 | null | null | null | null | open | update a sql using subquery and aggregate function
===
Below is the sql where i am getting the error retuns more than 1 value
update Tab2
set monthly_calls = (select a.month from (select accountid,max(annual_calls)/12 as month from cpo group by accountid) a inner join tab2 on tab2.accountid = a.accountid)
FYI... my select query which is left of = is working fine | 0 |
11,614,098 | 07/23/2012 14:02:45 | 466,935 | 10/05/2010 14:26:31 | 97 | 8 | Howto customize pluralisation for Entity Framwork 5 | As my database was designed using german table- and column names, the default pluralisation feature of entity framework doesn't work for me.
I have found a couple of resources where this is discussed, but none of them seem to work.
What i have found:
There is the PluralisationService where i can add the mappings:
PluralizationService pluralizer =
PluralizationService.CreateService(CultureInfo.GetCultureInfo("en-us"));
ICustomPluralizationMapping mapping = ps as ICustomPluralizationMapping;
mapping.AddWord("Tabelle", "Tabellen");
But what's next?
I have tried to:
EntityModelSchemaGenerator generator = new EntityModelSchemaGenerator(container);
generator.PluralizationService = pluralizer;
generator.GenerateMetadata();
and put both of them in my POCO T4 Template. But it throwed the following exception:
<blockquote>The EntityContainer 'ContainerName' is not a store EntityContainer. Parameter name: storeEntityContainer<br>
at System.Data.Entity.Design.EntityModelSchemaGenerator.Initialize(...)<br>
at Microsoft.VisualStudio.TextTemplating...GeneratedTextTransformation.TransformText()<br>
</blockquote>
ANY Help? Please!!! Thanks!!
| entity-framework | entity-framework-4 | poco | entity-framework-5 | pluralize | null | open | Howto customize pluralisation for Entity Framwork 5
===
As my database was designed using german table- and column names, the default pluralisation feature of entity framework doesn't work for me.
I have found a couple of resources where this is discussed, but none of them seem to work.
What i have found:
There is the PluralisationService where i can add the mappings:
PluralizationService pluralizer =
PluralizationService.CreateService(CultureInfo.GetCultureInfo("en-us"));
ICustomPluralizationMapping mapping = ps as ICustomPluralizationMapping;
mapping.AddWord("Tabelle", "Tabellen");
But what's next?
I have tried to:
EntityModelSchemaGenerator generator = new EntityModelSchemaGenerator(container);
generator.PluralizationService = pluralizer;
generator.GenerateMetadata();
and put both of them in my POCO T4 Template. But it throwed the following exception:
<blockquote>The EntityContainer 'ContainerName' is not a store EntityContainer. Parameter name: storeEntityContainer<br>
at System.Data.Entity.Design.EntityModelSchemaGenerator.Initialize(...)<br>
at Microsoft.VisualStudio.TextTemplating...GeneratedTextTransformation.TransformText()<br>
</blockquote>
ANY Help? Please!!! Thanks!!
| 0 |
374,189 | 12/17/2008 10:37:57 | 32,037 | 10/28/2008 11:38:28 | 272 | 35 | Get Client certificate with activeX | I'm struggling to put together a solution that allows security through smartcards.
My clients will have a card reader and a card to identify them in the system(Web Application).
I need to setup an activeX control that will read the card, extract the information I need and send it to the web server.
It's my first time working with smartcards, digital certificates, activeX, ssl and https. As expected my time frame is quite short and I'm the first in my company to work with these items.
I've managed to work with de ssl and HTTPS, smartcards ok, digital certificates ok, activex x also ok.
What I am now facing is this challenge to use my activeX to read the extra information I need from the smartcard.
Can anyone help me out? I would appreciate some insights for this challenge, some links worth reading and if possible some examples.
| activex | smartcard | digital-certificate | null | null | 12/17/2008 14:11:38 | off topic | Get Client certificate with activeX
===
I'm struggling to put together a solution that allows security through smartcards.
My clients will have a card reader and a card to identify them in the system(Web Application).
I need to setup an activeX control that will read the card, extract the information I need and send it to the web server.
It's my first time working with smartcards, digital certificates, activeX, ssl and https. As expected my time frame is quite short and I'm the first in my company to work with these items.
I've managed to work with de ssl and HTTPS, smartcards ok, digital certificates ok, activex x also ok.
What I am now facing is this challenge to use my activeX to read the extra information I need from the smartcard.
Can anyone help me out? I would appreciate some insights for this challenge, some links worth reading and if possible some examples.
| 2 |
2,683,713 | 04/21/2010 14:19:57 | 62,009 | 02/03/2009 16:18:52 | 779 | 39 | How to make a struct maker like CGRectMake (iphone) | i have a struct HLRange with two CGFloat's
struct HOLRange
{
CGFloat min;
CGFloat max;
};
typedef struct HOLRange HOLRange;
but how do i make a function like HLRangeMake(1,2); .. like CGRectMake? | iphone | struct | typedef | make | objective-c | null | open | How to make a struct maker like CGRectMake (iphone)
===
i have a struct HLRange with two CGFloat's
struct HOLRange
{
CGFloat min;
CGFloat max;
};
typedef struct HOLRange HOLRange;
but how do i make a function like HLRangeMake(1,2); .. like CGRectMake? | 0 |
5,493,703 | 03/30/2011 23:31:57 | 684,862 | 03/30/2011 23:16:47 | 1 | 0 | What is the Lanczos function for downsizing by a factor of 2 or less for 4-input values (4 taps)? | I would like to know what the Lanczos function is for downsizing by a factor of 2 or less (that is, the scaling factors of 0.9, 0.8, 0.7, 0.6, and 0.5) for 4-input values (4 taps). I think Lanczos1 function is used:
Lanczos1(x) = 1, if x=0
= (sin(pi))*(sin(pi))/((pi * x)*(pi*x)), if x != 0 and |x| < 1
= 0, if |x| >= 1
Is it correct? What are the coefficients for the 16 phases?
Thanks in advance. | image-resizing | null | null | null | null | null | open | What is the Lanczos function for downsizing by a factor of 2 or less for 4-input values (4 taps)?
===
I would like to know what the Lanczos function is for downsizing by a factor of 2 or less (that is, the scaling factors of 0.9, 0.8, 0.7, 0.6, and 0.5) for 4-input values (4 taps). I think Lanczos1 function is used:
Lanczos1(x) = 1, if x=0
= (sin(pi))*(sin(pi))/((pi * x)*(pi*x)), if x != 0 and |x| < 1
= 0, if |x| >= 1
Is it correct? What are the coefficients for the 16 phases?
Thanks in advance. | 0 |
9,894,619 | 03/27/2012 17:31:49 | 544,193 | 12/16/2010 02:35:51 | 500 | 15 | My twitter button says "Tweeten" | I put a twitter button on my website to allow people to easily tweet pages.
The weird thing is the button says "Tweeten". Is this a language thing? I'm set to English NA on my computer. I'd like it to say "Tweet".
Here's an example: http://www.trainerroad.com/cycling/rides/41452
Here's the script/HTML on the page:
<a href="https://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a>
<script> !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } } (document, "script", "twitter-wjs");</script> | twitter | null | null | null | null | null | open | My twitter button says "Tweeten"
===
I put a twitter button on my website to allow people to easily tweet pages.
The weird thing is the button says "Tweeten". Is this a language thing? I'm set to English NA on my computer. I'd like it to say "Tweet".
Here's an example: http://www.trainerroad.com/cycling/rides/41452
Here's the script/HTML on the page:
<a href="https://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a>
<script> !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } } (document, "script", "twitter-wjs");</script> | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.