PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,734,877 | 07/31/2012 07:07:05 | 1,182,982 | 02/01/2012 15:06:20 | 526 | 41 | Remove HTML formatting in Razor MVC 3 | I am using MVC 3 and Razor View engine.
**What I am trying to do**
I am making a blog using MVC 3, I want to remove all HTML formatting tags like `<p> <b> <i>` etc..
For which I am using the following code. (it does work)
@{
post.PostContent = post.PostContent.Replace("<p>", " ");
post.PostContent = post.PostContent.Replace("</p>", " ");
post.PostContent = post.PostContent.Replace("<b>", " ");
post.PostContent = post.PostContent.Replace("</b>", " ");
post.PostContent = post.PostContent.Replace("<i>", " ");
post.PostContent = post.PostContent.Replace("</i>", " ");
}
I feel that there definitely has to be a better way to do this. Can anyone please guide me on this. | asp.net-mvc-3 | razor | null | null | null | null | open | Remove HTML formatting in Razor MVC 3
===
I am using MVC 3 and Razor View engine.
**What I am trying to do**
I am making a blog using MVC 3, I want to remove all HTML formatting tags like `<p> <b> <i>` etc..
For which I am using the following code. (it does work)
@{
post.PostContent = post.PostContent.Replace("<p>", " ");
post.PostContent = post.PostContent.Replace("</p>", " ");
post.PostContent = post.PostContent.Replace("<b>", " ");
post.PostContent = post.PostContent.Replace("</b>", " ");
post.PostContent = post.PostContent.Replace("<i>", " ");
post.PostContent = post.PostContent.Replace("</i>", " ");
}
I feel that there definitely has to be a better way to do this. Can anyone please guide me on this. | 0 |
11,734,878 | 07/31/2012 07:07:06 | 1,564,414 | 07/31/2012 00:30:54 | 1 | 0 | python "memory puzzle game" | <pre>
<code>
import random, pygame, sys
from pygame.locals import *
</code>
</pre>
I've a problem with this "memory puzzle" game.....
the script is from eBook I've got, I just about try learn the very basic..
I've try to type all of them after I double checked it and never found the typos..
Maybe it was my fault to get the mistake, but I wanna know what mistakes I've made...
So here's a problem..
When I'm done select the first board, of course it'll reveal, but after the second board I had choose and it'll check if it doesn't match the both of board are re-cover again...
while I'd choose another board, the board won't revealed because its stuck with the first board I had choose...
So, the third selection I'd choose as quickly cover and won't revealed..
How do I fix this, please your guidance guys | python | null | null | null | null | null | open | python "memory puzzle game"
===
<pre>
<code>
import random, pygame, sys
from pygame.locals import *
</code>
</pre>
I've a problem with this "memory puzzle" game.....
the script is from eBook I've got, I just about try learn the very basic..
I've try to type all of them after I double checked it and never found the typos..
Maybe it was my fault to get the mistake, but I wanna know what mistakes I've made...
So here's a problem..
When I'm done select the first board, of course it'll reveal, but after the second board I had choose and it'll check if it doesn't match the both of board are re-cover again...
while I'd choose another board, the board won't revealed because its stuck with the first board I had choose...
So, the third selection I'd choose as quickly cover and won't revealed..
How do I fix this, please your guidance guys | 0 |
11,734,870 | 07/31/2012 07:06:28 | 1,244,529 | 03/02/2012 07:22:11 | 21 | 0 | How to use remote aidl service in android? | **I want to know ,how write service outside app.**
Means, If application is stop then service must be running in background. | android | aidl | null | null | null | null | open | How to use remote aidl service in android?
===
**I want to know ,how write service outside app.**
Means, If application is stop then service must be running in background. | 0 |
11,734,871 | 07/31/2012 07:06:43 | 1,556,649 | 07/27/2012 04:44:21 | 121 | 20 | Dojo Issue: FilteringSelect , required: "false" , not working | Dojo : FilteringSelect , required: "false" , not working
**My code structure is,**
var user_search = new FilteringSelect({
id: "user_search",
name: "user_search",
searchAttr: "displayName",
type: "text",
required: "false",
autoComplete: true,
labelFunc: formatLabel,
labelType: "html",
invalidMessage: "No user found",
style: "width: 166px;height:28px;background-color:white"
}, this.user_search);
Can any one help?.
Thanks! | javascript | html | autocomplete | dojo | null | null | open | Dojo Issue: FilteringSelect , required: "false" , not working
===
Dojo : FilteringSelect , required: "false" , not working
**My code structure is,**
var user_search = new FilteringSelect({
id: "user_search",
name: "user_search",
searchAttr: "displayName",
type: "text",
required: "false",
autoComplete: true,
labelFunc: formatLabel,
labelType: "html",
invalidMessage: "No user found",
style: "width: 166px;height:28px;background-color:white"
}, this.user_search);
Can any one help?.
Thanks! | 0 |
11,731,409 | 07/31/2012 00:06:32 | 1,175,338 | 01/28/2012 15:06:02 | 1 | 0 | Validation and last value of textbox on MVVM | I have such textbox declaration:
<TextBox x:Name="InputTextBox">
<Binding Path="Input" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<validators:ValidationRule
ErrorMessage="Invalid" />
</Binding.ValidationRules>
</Binding>
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding Path=AddCommand}"/>
</InputBindings>
</TextBox>
If I entered "valid" and then "invalid", When command was executed, property Input will be set in "valid" value state.
I tried another way with UpdateSourceTrigger="Explicit" and using TextChanged event - was still same result.
Without ValidationRule - all works good.
P.S. I cannot change class from model layer.
| c# | wpf | mvvm | null | null | null | open | Validation and last value of textbox on MVVM
===
I have such textbox declaration:
<TextBox x:Name="InputTextBox">
<Binding Path="Input" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<validators:ValidationRule
ErrorMessage="Invalid" />
</Binding.ValidationRules>
</Binding>
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding Path=AddCommand}"/>
</InputBindings>
</TextBox>
If I entered "valid" and then "invalid", When command was executed, property Input will be set in "valid" value state.
I tried another way with UpdateSourceTrigger="Explicit" and using TextChanged event - was still same result.
Without ValidationRule - all works good.
P.S. I cannot change class from model layer.
| 0 |
11,734,880 | 07/31/2012 07:07:47 | 1,393,064 | 05/14/2012 05:52:34 | 27 | 2 | cakephp two submit buttons and redirect | trying to create a form that has two submit buttons in cakephp.
task_1 submit button when clicked creates this in the address bar '/fields/add' and sends the information added to the database.
task_2 submit button when clicked creates this in the address bar '/fields/add/add' and sends the entered information to the database`.
task_1 is meant to allow users to keep creating new fields, where task 2 is meant to take them to a different page, at the moment we just chose a page at random.
here is the code for the add function in controller
function add(){
$this->set('title_for_layout', 'Please Enter Your Invoice Headings');
$this->set('stylesheet_used', 'style');
$this->set('image_used', 'eBOXLogo.jpg');
$this->Session->setFlash("Please create your required fields.");
if($this->request->is('post')){
$this->Field->create();
if ($this->Field->save($this->request->data))
{
if($this->params['form']['task_1'] == "task_1")
{
$this->Session->setFlash('The field has been saved');
$this->redirect( array('controller' => 'Fields','action' => 'add'));
}
if($this->params['form']['task_2'] == "task_2")
{
$this->Session->setFlash('The template has been saved');
$this->redirect( array('controller' => 'Invoices','action' => 'add'));
}
}
else
{
$this->Session->setFlash('The field could not be saved. Please, try again.');
}
}
}
here is the code for the add view
<form enctype="multipart/form-data" method="post" action="add/">
Name: <input type ="text" name="name" /> <br />
Description: <input type ="text" name="description" /> <br />
Account ID: <input type ="number" name="accounts_id" /> <br />
<br />
<input type="submit" name="task_1" value="Continue adding fields" />
<input type="submit" name="task_2" value="Finish adding fields" />
</form>
| forms | cakephp | submit | null | null | null | open | cakephp two submit buttons and redirect
===
trying to create a form that has two submit buttons in cakephp.
task_1 submit button when clicked creates this in the address bar '/fields/add' and sends the information added to the database.
task_2 submit button when clicked creates this in the address bar '/fields/add/add' and sends the entered information to the database`.
task_1 is meant to allow users to keep creating new fields, where task 2 is meant to take them to a different page, at the moment we just chose a page at random.
here is the code for the add function in controller
function add(){
$this->set('title_for_layout', 'Please Enter Your Invoice Headings');
$this->set('stylesheet_used', 'style');
$this->set('image_used', 'eBOXLogo.jpg');
$this->Session->setFlash("Please create your required fields.");
if($this->request->is('post')){
$this->Field->create();
if ($this->Field->save($this->request->data))
{
if($this->params['form']['task_1'] == "task_1")
{
$this->Session->setFlash('The field has been saved');
$this->redirect( array('controller' => 'Fields','action' => 'add'));
}
if($this->params['form']['task_2'] == "task_2")
{
$this->Session->setFlash('The template has been saved');
$this->redirect( array('controller' => 'Invoices','action' => 'add'));
}
}
else
{
$this->Session->setFlash('The field could not be saved. Please, try again.');
}
}
}
here is the code for the add view
<form enctype="multipart/form-data" method="post" action="add/">
Name: <input type ="text" name="name" /> <br />
Description: <input type ="text" name="description" /> <br />
Account ID: <input type ="number" name="accounts_id" /> <br />
<br />
<input type="submit" name="task_1" value="Continue adding fields" />
<input type="submit" name="task_2" value="Finish adding fields" />
</form>
| 0 |
11,730,571 | 07/30/2012 22:23:24 | 1,564,244 | 07/30/2012 22:15:57 | 1 | 0 | How to i pull the info from a string and fut the info into a varable in C? | lets say i had a string that contains:<br>
{"ticker":{"high":8.976,"low":8.843,"avg":8.9095,"vol":2096.78,"last":8.845,"buy":8.946,"sell":8.843,"server_time":1343686701}}<br>
how would i take the numbers and put them into a separate variable? for example :<br>
int high = 8.976<br>
int low = 8.843<br>
ect. ect.<br>
Thank you in advance :) | c | string | null | null | null | null | open | How to i pull the info from a string and fut the info into a varable in C?
===
lets say i had a string that contains:<br>
{"ticker":{"high":8.976,"low":8.843,"avg":8.9095,"vol":2096.78,"last":8.845,"buy":8.946,"sell":8.843,"server_time":1343686701}}<br>
how would i take the numbers and put them into a separate variable? for example :<br>
int high = 8.976<br>
int low = 8.843<br>
ect. ect.<br>
Thank you in advance :) | 0 |
11,730,572 | 07/30/2012 22:23:25 | 404,385 | 07/28/2010 10:24:48 | 155 | 15 | Injecting a bean to use in Controllers throughout the application | I'm using spring mvc 3.1.x and jets3t.
I have a dao that i instantiate as a Singleton bean..
I managed to get it working through extending the applicationcontextloader class and adding it to the web.xml
| spring | dependency-injection | controller | practice | null | null | open | Injecting a bean to use in Controllers throughout the application
===
I'm using spring mvc 3.1.x and jets3t.
I have a dao that i instantiate as a Singleton bean..
I managed to get it working through extending the applicationcontextloader class and adding it to the web.xml
| 0 |
11,373,666 | 07/07/2012 08:59:50 | 1,031,666 | 11/05/2011 23:27:20 | 1 | 0 | how to retrieve user info in facebook developer? | how to retrieve user info in facebook developer?
To help me learn the developers side of Facebook I have made a very basic canvas app.
To be able to use the app the user has to permit the app access to their friends birthdays.
Ok, so everything is working fine.
How do I now retrieve the information the user has granted me access to?
eg. a list of their friends birthdays?
Im after some advice or step by step tutorial.
I find the facebook tutorial rather complicated.
Many thanks. | facebook | user-permissions | null | null | null | 07/28/2012 23:52:30 | not a real question | how to retrieve user info in facebook developer?
===
how to retrieve user info in facebook developer?
To help me learn the developers side of Facebook I have made a very basic canvas app.
To be able to use the app the user has to permit the app access to their friends birthdays.
Ok, so everything is working fine.
How do I now retrieve the information the user has granted me access to?
eg. a list of their friends birthdays?
Im after some advice or step by step tutorial.
I find the facebook tutorial rather complicated.
Many thanks. | 1 |
11,373,674 | 07/07/2012 09:01:44 | 1,405,021 | 05/19/2012 11:45:59 | 1 | 0 | jquery append doesn't work with CakePHP's JsHelper | I want to dinamically append some form elements using cakephp's form helper.
What am i missing?
<script type="text/javascript">
$("a#megyeAdd").click(function(){
$("div#moreCounty").append(
<?php echo $this->Form->input('ColleaguesCounty.1.county_id',array('label' => 'Megye')); ?>
);
});
</script> | jquery | cakephp | formhelper | null | null | null | open | jquery append doesn't work with CakePHP's JsHelper
===
I want to dinamically append some form elements using cakephp's form helper.
What am i missing?
<script type="text/javascript">
$("a#megyeAdd").click(function(){
$("div#moreCounty").append(
<?php echo $this->Form->input('ColleaguesCounty.1.county_id',array('label' => 'Megye')); ?>
);
});
</script> | 0 |
11,373,321 | 07/07/2012 07:54:30 | 1,508,419 | 07/07/2012 07:47:02 | 1 | 0 | get a thread from another class | I have a java class:
public class httpd implements Runnable
{
public void createHttpdStatistics
{
httpdStatistics stats = new httpdStastics(this);
}
}
Now I would get in another class the object `stats` created inside httpd. When httpd object starts, it execute in the jvm. I tought to build get method inside httpd class but when I'm in the other class how I get the exact httpd object to call get method to retrieve stats object? | java | multithreading | null | null | null | null | open | get a thread from another class
===
I have a java class:
public class httpd implements Runnable
{
public void createHttpdStatistics
{
httpdStatistics stats = new httpdStastics(this);
}
}
Now I would get in another class the object `stats` created inside httpd. When httpd object starts, it execute in the jvm. I tought to build get method inside httpd class but when I'm in the other class how I get the exact httpd object to call get method to retrieve stats object? | 0 |
11,373,678 | 07/07/2012 09:02:45 | 1,278,192 | 03/19/2012 09:00:52 | 131 | 0 | down arrow in HTML | here is the code for right arrow in HTML (`»`) and it will looks like ».Like this any other html code for down arrow and up arrow? | asp.net | html | css | null | null | null | open | down arrow in HTML
===
here is the code for right arrow in HTML (`»`) and it will looks like ».Like this any other html code for down arrow and up arrow? | 0 |
11,373,679 | 07/07/2012 09:03:08 | 938,541 | 09/10/2011 19:53:37 | 38 | 3 | Session array with productids | I'm adding product ids to a session array with:
if (isset($_GET["add"]) && (int)$_GET["add"]>0)
{
$_SESSION['products'][] = $_GET["add"];
}
How would I loop the array and add a class to all the products with the ids that are in the array?
p.s. Why won't this work to remove a productid:
if (isset($_get['remove']))
{
$index = array_search($_GET["remove"],$_SESSION["products"]);
unset($_SESSION["products"][$index]);
}
Thanks | php | arrays | session | session-variables | null | null | open | Session array with productids
===
I'm adding product ids to a session array with:
if (isset($_GET["add"]) && (int)$_GET["add"]>0)
{
$_SESSION['products'][] = $_GET["add"];
}
How would I loop the array and add a class to all the products with the ids that are in the array?
p.s. Why won't this work to remove a productid:
if (isset($_get['remove']))
{
$index = array_search($_GET["remove"],$_SESSION["products"]);
unset($_SESSION["products"][$index]);
}
Thanks | 0 |
11,373,681 | 07/07/2012 09:03:28 | 742,775 | 05/07/2011 06:04:02 | 453 | 38 | Include Foreign Key Properties in DataObjects.Net | I'm recently concerned in the problems we have with Entity Framework and we may need to find a replacement. According to ORMBattle, the best candidate is DataObjects.Net, the result of my initial investigations are very promising, except one feature that we need in our structure:
Consider two classes: Order and Customer, in class "Order" I have a "Customer" navigation property (and probably an "Orders" navigation property in the Customer class). I also need a property CustomerID in class Order.
this is totally possible in lowly EF4.
How can I achieve this goal? | entity-framework | foreign-keys | dataobjects.net | null | null | null | open | Include Foreign Key Properties in DataObjects.Net
===
I'm recently concerned in the problems we have with Entity Framework and we may need to find a replacement. According to ORMBattle, the best candidate is DataObjects.Net, the result of my initial investigations are very promising, except one feature that we need in our structure:
Consider two classes: Order and Customer, in class "Order" I have a "Customer" navigation property (and probably an "Orders" navigation property in the Customer class). I also need a property CustomerID in class Order.
this is totally possible in lowly EF4.
How can I achieve this goal? | 0 |
11,373,686 | 07/07/2012 09:04:16 | 1,448,859 | 06/11/2012 11:43:13 | 11 | 0 | NSTableView display selected row into NSTextField | I'm a still newbie in cocoa and I've already created NSTableView with buttons to add and remove selected rows. I added NSTextField label to display the values from selected row of the two columns.
Can anyone point me into right direction how to achieve this? I guess that it should work like this:
1. get selected row index number
2. get string value of both identifiers in selected row
3. set string value
also there should be if nothing is selected the string is empty i guess.
Many thanks | objective-c | cocoa | nstableview | null | null | null | open | NSTableView display selected row into NSTextField
===
I'm a still newbie in cocoa and I've already created NSTableView with buttons to add and remove selected rows. I added NSTextField label to display the values from selected row of the two columns.
Can anyone point me into right direction how to achieve this? I guess that it should work like this:
1. get selected row index number
2. get string value of both identifiers in selected row
3. set string value
also there should be if nothing is selected the string is empty i guess.
Many thanks | 0 |
11,373,688 | 07/07/2012 09:04:40 | 1,508,477 | 07/07/2012 08:55:48 | 1 | 0 | GWT Event Service Multiple / shared sessions | I build a simple chat with GWT Event Service.
When i open the chat in two tabs of a browser, only one tab catches the event.
I think i can solve this problem by adding this line to the properties:
eventservice.connection.id.generator = de.novanic.eventservice.service.connection.id.SessionExtendedConnectionIdGenerator
Now, only the last tab, i open, catches the events.
Can someone help me?
| events | gwt | service | multiple | shared | null | open | GWT Event Service Multiple / shared sessions
===
I build a simple chat with GWT Event Service.
When i open the chat in two tabs of a browser, only one tab catches the event.
I think i can solve this problem by adding this line to the properties:
eventservice.connection.id.generator = de.novanic.eventservice.service.connection.id.SessionExtendedConnectionIdGenerator
Now, only the last tab, i open, catches the events.
Can someone help me?
| 0 |
11,373,689 | 07/07/2012 09:05:02 | 1,505,962 | 07/06/2012 06:46:37 | 1 | 0 | Android JSon Array is not working with Maplocations class | I am developing a map application in android i have made maplocation class to pass latitude and longitude and using Json Array to fetch data from MYSQl to display in map.But When I run application it crashed unfortunantely here is my log cat
07-07 14:02:26.423: E/AndroidRuntime(366): FATAL EXCEPTION: main
07-07 14:02:26.423: E/AndroidRuntime(366): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.icons.draw.view/com.icons.draw.view.DrawIcons}: android.view.InflateException: Binary XML file line #6: Error inflating class com.icons.draw.view.LocationViewers
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.os.Handler.dispatchMessage(Handler.java:99)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.os.Looper.loop(Looper.java:130)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Method.invokeNative(Native Method)
07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Method.invoke(Method.java:507)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-07 14:02:26.423: E/AndroidRuntime(366): at dalvik.system.NativeStart.main(Native Method)
07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.icons.draw.view.LocationViewers
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.Activity.setContentView(Activity.java:1657)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.DrawIcons.onCreate(DrawIcons.java:16)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-07 14:02:26.423: E/AndroidRuntime(366): ... 11 more
07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: java.lang.reflect.InvocationTargetException
07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Constructor.constructNative(Native Method)
07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
07-07 14:02:26.423: E/AndroidRuntime(366): ... 21 more
07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: java.lang.NullPointerException
07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)
07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONTokener.nextValue(JSONTokener.java:90)
07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONArray.<init>(JSONArray.java:87)
07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONArray.<init>(JSONArray.java:103)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.getMapLocations(LocationViewers.java:102)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.init(LocationViewers.java:65)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.<init>(LocationViewers.java:45)
07-07 14:02:26.423: E/AndroidRuntime(366): ... 24 more
And Here is My JSOn Array and loop code to make markers
double LAT;
double LANG;
String INFO;
public List<MapLocation> getMapLocations() {
if (mapLocations == null)
{
try{
jArray = new JSONArray(result);
JSONObject json_data=null;
for(int i=0;i<jArray.length();i++){
json_data = jArray.getJSONObject(i);
LAT=json_data.getDouble("lat");
LANG=json_data.getDouble("lang");
INFO=json_data.getString("info");
mapLocations = new ArrayList<MapLocation>();
mapLocations.add(new MapLocation(INFO,LAT,LANG));
}
}
catch(JSONException e1){
Toast.makeText(getContext(), "No Vehicles Found" ,Toast.LENGTH_LONG).show();
} catch (ParseException e1) {
e1.printStackTrace();
}
}
return mapLocations;
}
Please Help to Remove this error | android | json | google-maps | null | null | null | open | Android JSon Array is not working with Maplocations class
===
I am developing a map application in android i have made maplocation class to pass latitude and longitude and using Json Array to fetch data from MYSQl to display in map.But When I run application it crashed unfortunantely here is my log cat
07-07 14:02:26.423: E/AndroidRuntime(366): FATAL EXCEPTION: main
07-07 14:02:26.423: E/AndroidRuntime(366): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.icons.draw.view/com.icons.draw.view.DrawIcons}: android.view.InflateException: Binary XML file line #6: Error inflating class com.icons.draw.view.LocationViewers
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.os.Handler.dispatchMessage(Handler.java:99)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.os.Looper.loop(Looper.java:130)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Method.invokeNative(Native Method)
07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Method.invoke(Method.java:507)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-07 14:02:26.423: E/AndroidRuntime(366): at dalvik.system.NativeStart.main(Native Method)
07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.icons.draw.view.LocationViewers
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.Activity.setContentView(Activity.java:1657)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.DrawIcons.onCreate(DrawIcons.java:16)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-07 14:02:26.423: E/AndroidRuntime(366): ... 11 more
07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: java.lang.reflect.InvocationTargetException
07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Constructor.constructNative(Native Method)
07-07 14:02:26.423: E/AndroidRuntime(366): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
07-07 14:02:26.423: E/AndroidRuntime(366): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
07-07 14:02:26.423: E/AndroidRuntime(366): ... 21 more
07-07 14:02:26.423: E/AndroidRuntime(366): Caused by: java.lang.NullPointerException
07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)
07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONTokener.nextValue(JSONTokener.java:90)
07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONArray.<init>(JSONArray.java:87)
07-07 14:02:26.423: E/AndroidRuntime(366): at org.json.JSONArray.<init>(JSONArray.java:103)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.getMapLocations(LocationViewers.java:102)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.init(LocationViewers.java:65)
07-07 14:02:26.423: E/AndroidRuntime(366): at com.icons.draw.view.LocationViewers.<init>(LocationViewers.java:45)
07-07 14:02:26.423: E/AndroidRuntime(366): ... 24 more
And Here is My JSOn Array and loop code to make markers
double LAT;
double LANG;
String INFO;
public List<MapLocation> getMapLocations() {
if (mapLocations == null)
{
try{
jArray = new JSONArray(result);
JSONObject json_data=null;
for(int i=0;i<jArray.length();i++){
json_data = jArray.getJSONObject(i);
LAT=json_data.getDouble("lat");
LANG=json_data.getDouble("lang");
INFO=json_data.getString("info");
mapLocations = new ArrayList<MapLocation>();
mapLocations.add(new MapLocation(INFO,LAT,LANG));
}
}
catch(JSONException e1){
Toast.makeText(getContext(), "No Vehicles Found" ,Toast.LENGTH_LONG).show();
} catch (ParseException e1) {
e1.printStackTrace();
}
}
return mapLocations;
}
Please Help to Remove this error | 0 |
11,542,777 | 07/18/2012 13:40:28 | 1,531,782 | 07/17/2012 12:32:17 | 1 | 0 | How to automate .doc\.docx file using Pywinauto in python | I have a document "hello doc.doc" wanted to automate save/edit operation using pywinauto | python-2.7 | null | null | null | null | null | open | How to automate .doc\.docx file using Pywinauto in python
===
I have a document "hello doc.doc" wanted to automate save/edit operation using pywinauto | 0 |
11,542,597 | 07/18/2012 13:30:43 | 779,111 | 06/01/2011 09:35:01 | 1,158 | 4 | Why would I need threads for implementing a 'named pipe based on shared memory'? | While trying to implement the `Named pipe` (e.g. two **independent** unrelated processes that are using the same shared memory) I keep reading that I'd to use `pthread_atfork` and `atexit` .
I'm fully agreeing with the use of mutexes and semaphores - using them we can decide when `process A` would read/write and when `process B` would read/write .
But for what reason would I want to use `pthread_atfork` and threads for that ?
Much appreciated | c | homework | operating-system | pipe | shared-memory | null | open | Why would I need threads for implementing a 'named pipe based on shared memory'?
===
While trying to implement the `Named pipe` (e.g. two **independent** unrelated processes that are using the same shared memory) I keep reading that I'd to use `pthread_atfork` and `atexit` .
I'm fully agreeing with the use of mutexes and semaphores - using them we can decide when `process A` would read/write and when `process B` would read/write .
But for what reason would I want to use `pthread_atfork` and threads for that ?
Much appreciated | 0 |
11,542,789 | 07/18/2012 13:41:08 | 1,382,104 | 05/08/2012 12:52:20 | 121 | 0 | confusion regarding XMPP xep-0065 and xep-0096 | I am currently working on xmppframework, Requirements are to transfer the file between two iPhones. I searched for XEPs and found 0065 and 0096
XEP-0065 says:
> XMPP is designed for sending relatively small chunks of XML between
> network entities and is not designed for sending binary data. However,
> sometimes it is desirable to send binary data to another entity that
> one has discovered on the XMPP network (e.g., to send a file).
> Therefore it is valuable to have a generic protocol for streaming
> binary data between any two entities on an XMPP network. **The main
> application for such a bytestreaming technology is file transfer as
> specified in SI File Transfer [1] and Jingle File Transfer [2].**
> However, other applications are possible, which is why it is important
> to develop a generic protocol rather than one that is specialized for
> a particular application such as file transfer.
Please see the line in bold, its confusing me if file transfer XEPs are SI File Transfer(0096) and Jingle File Transfer(0234), then what is the purpose of this 0065 XEP? why people on net referring sep-0065 for file transfer?
| xmpp | xmppframework | null | null | null | null | open | confusion regarding XMPP xep-0065 and xep-0096
===
I am currently working on xmppframework, Requirements are to transfer the file between two iPhones. I searched for XEPs and found 0065 and 0096
XEP-0065 says:
> XMPP is designed for sending relatively small chunks of XML between
> network entities and is not designed for sending binary data. However,
> sometimes it is desirable to send binary data to another entity that
> one has discovered on the XMPP network (e.g., to send a file).
> Therefore it is valuable to have a generic protocol for streaming
> binary data between any two entities on an XMPP network. **The main
> application for such a bytestreaming technology is file transfer as
> specified in SI File Transfer [1] and Jingle File Transfer [2].**
> However, other applications are possible, which is why it is important
> to develop a generic protocol rather than one that is specialized for
> a particular application such as file transfer.
Please see the line in bold, its confusing me if file transfer XEPs are SI File Transfer(0096) and Jingle File Transfer(0234), then what is the purpose of this 0065 XEP? why people on net referring sep-0065 for file transfer?
| 0 |
11,542,794 | 07/18/2012 13:41:25 | 1,062,331 | 11/23/2011 16:31:31 | 1 | 1 | tee and pipelines inside a bash script | i need to redirect stout and stderr in bash each to separate file.
well i completed this command:
<pre>
((/usr/bin/java -jar /opt/SEOC2/seoc2.jar 2>&1 1>&3 | tee --append /opt/SEOC2/log/err.log) 3>&1 1>&2 | tee --append /opt/SEOC2/log/app.log) >> /opt/SEOC2/log/combined.log 2>&1 &
</pre>
which works fine running from a <b>command line</b>.
trying to put the very same command into <b>bash script</b>
<pre>
...
12 cmd="(($run -jar $cmd 2>&1 1>&3 | tee --append $err) 3>&1 1>&2 | tee --append $log) >> $combined 2>&1"
...
30 echo -e "Starting servis..."
31 $cmd &
32 pid=`ps -eo pid,args | grep seoc2.jar | grep -v grep | cut -c1-6`
33 if [ ! -z $pid ]; then
...
</pre>
leads to error like this:
<pre>
root@operator:/opt/SEOC2# seoc2 start
Starting servis...
/usr/local/bin/seoc2: line 31: ((/usr/bin/java: dir or file doesn't exist
</pre>
tried to cover this command by $( ), \` \` etc but with no effect at all :(
any suggestion or advice would be very appreciated, playing around for hours already :/
thanx a lot
Rene
| bash | script | stdout | stderr | tee | null | open | tee and pipelines inside a bash script
===
i need to redirect stout and stderr in bash each to separate file.
well i completed this command:
<pre>
((/usr/bin/java -jar /opt/SEOC2/seoc2.jar 2>&1 1>&3 | tee --append /opt/SEOC2/log/err.log) 3>&1 1>&2 | tee --append /opt/SEOC2/log/app.log) >> /opt/SEOC2/log/combined.log 2>&1 &
</pre>
which works fine running from a <b>command line</b>.
trying to put the very same command into <b>bash script</b>
<pre>
...
12 cmd="(($run -jar $cmd 2>&1 1>&3 | tee --append $err) 3>&1 1>&2 | tee --append $log) >> $combined 2>&1"
...
30 echo -e "Starting servis..."
31 $cmd &
32 pid=`ps -eo pid,args | grep seoc2.jar | grep -v grep | cut -c1-6`
33 if [ ! -z $pid ]; then
...
</pre>
leads to error like this:
<pre>
root@operator:/opt/SEOC2# seoc2 start
Starting servis...
/usr/local/bin/seoc2: line 31: ((/usr/bin/java: dir or file doesn't exist
</pre>
tried to cover this command by $( ), \` \` etc but with no effect at all :(
any suggestion or advice would be very appreciated, playing around for hours already :/
thanx a lot
Rene
| 0 |
11,542,780 | 07/18/2012 13:40:33 | 633,224 | 02/24/2011 22:22:15 | 422 | 2 | Read an xml file from different computer on the network? | To begin with ,i developed a web application which reads an XML file from specific location and displays the contents on editable web page of the application,which is executed perfectly when the xml file is on the same machine/computer.When i try to read the same file on different computer on the network i cannot read the contents onto my web page.
**My Observation:**
When i access that file from run window in the computer by entering \\xxx.xxx.xx.xx\c$ it gives me the window to connect to the machine asking for credentials and i guess the session is open.So i close the window and when i access the xml file from the web application its able to read the content .
Is there a way to bypass this authentication mechanism which is part of windows when i use my web app to read the xml file or is there a way to accommodate the extra step to configure the authentication in my application ?
I would be glad if some one can guide me to the solution ?
| c# | asp.net | xml | windows-xp | null | null | open | Read an xml file from different computer on the network?
===
To begin with ,i developed a web application which reads an XML file from specific location and displays the contents on editable web page of the application,which is executed perfectly when the xml file is on the same machine/computer.When i try to read the same file on different computer on the network i cannot read the contents onto my web page.
**My Observation:**
When i access that file from run window in the computer by entering \\xxx.xxx.xx.xx\c$ it gives me the window to connect to the machine asking for credentials and i guess the session is open.So i close the window and when i access the xml file from the web application its able to read the content .
Is there a way to bypass this authentication mechanism which is part of windows when i use my web app to read the xml file or is there a way to accommodate the extra step to configure the authentication in my application ?
I would be glad if some one can guide me to the solution ?
| 0 |