https://search.twitter.com/search.json?q=doug
How do I read this like VIEW SOURCE, so that I know what I'm looking at?
Is there a website that can prettify it for me?
BTW, I use python
Possible Duplicate:
Android: Voice Recording and saving audio
I mean ;
I use voice recognition classes on android and I succeed voice recognition.
But I want to real voice data not words instead of it.
For example I said 'teacher' and android get you said teacher.Oh ok its good but I want to my voice which include 'teacher'.Where is it ? Can I take it and save another location?
I use this class to speech to text :
package net.viralpatel.android.speechtotextdemo;
import java.util.ArrayList;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.view.Menu;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends Activity {
protected static final int RESULT_SPEECH = 1;
private ImageButton btnSpeak;
private TextView txtText;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txtText = (TextView) findViewById(R.id.txtText);
btnSpeak = (ImageButton) findViewById(R.id.btnSpeak);
btnSpeak.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(
RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "en-US");
try {
startActivityForResult(intent, RESULT_SPEECH);
txtText.setText("");
} catch (ActivityNotFoundException a) {
Toast t = Toast.makeText(getApplicationContext(),
"Ops! Your device doesn't support Speech to Text",
Toast.LENGTH_SHORT);
t.show();
}
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case RESULT_SPEECH: {
if (resultCode == RESULT_OK && null != data) {
ArrayList<String> text = data
.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
txtText.setText(text.get(0));
}
break;
}
}
}
}
Thanks.
I have to create a C# application which displays unicode data in a textbox.
But the SQL server column storage has varchar data which contains unicode data. But since varchar is non-unicode based it displays character strings like "????????".
Well the problem i am facing is i cant change the column type as there are other dependent application running on it.
<?
$xml="<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<Document>
<pain.001.001.02>
<books>
<book>
<qty>12</qty>
<title>C++</title>
</book>
<book>
<qty>21</qty>
<title>PHP</title>
</book>
</books>
<books>
<book>
<qty>25</qty>
<title>Java</title>
</book>
<book>
<qty>32</qty>
<title>Python</title>
</book>
<book>
<qty>22</qty>
<title>History</title>
</book>
</books>
</pain.001.001.02>
</Document> ";
$doc = new DOMDOcument;
$doc->loadxml($xml);
$xpath = new DOMXpath($doc);
$arr = array(
array(
'12;C++',
'21;PHP'),
array(
'25;Java',
'32;Python'
)
);
# Remove elements based on qty and title
foreach($arr as $items) {
foreach($items as $item) {
list($qty, $title) = explode(';', $item);
foreach($xpath->query('//pain.001.001.02/books/book[title="'.$title.'"][qty="'.$qty.'"]') as $book) {
$book->parentNode->removeChild($book);
}
}
}
# Remove empty <books>
foreach($xpath->query('pain.001.001.02/books[count(book)=0]') as $empty) {
$empty->parentNode->removeChild($empty);
}
header('Content-type: text/xml');
echo $doc->savexml();
?>
If I put <Document> in the xml document , get the expected result BUT If change <Document> to
<Document
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02">
get UNEXPECTED RESULT?
Do you have any idea?
thanks
I have written a console application in Delphi that queries information from several locations. This application will be launched by another process, and the output to STDOUT will be captured by the launching process.
The information I am retrieving is to be interpreted by the calling application for reporting purposes. What is the best way to output this data to STDOUT so that it can be easily parsed? JSON? XML? CSV? The data, specifically, is remote workstation information, so it will pull things back like running processes, and details about each process.
Does anyone have any experience with this or suggestions?
I need to be able to display a money field as $XX,XXX.XX, but without converting to varchar using total_eval = '$' + CONVERT(varchar(19),total_eval.opvValueMoney,1)
My project uses sorting of the information after I pull this to sort the column and it doesn't sort correctly when the column is a varchar.
Is there anyway to do this?
I'm trying to display the output image onto the C++ interface instead of creating another window to display the image.
For example: cvNameWindow("Window A",0);
cvShowImage("Window A", imgA);
This will create an window and display the imgA on it.
My question is that can i display my imgA onto my C++ interface together with all my other button and textbox.
I'm using Borland C++ Builder 6 and OpenCV.
i have one default.xml file where i am storing all default values.suppose if invalid file with the same default.xml name exists i have to display message in the status bar.
Hi,
I'm trying to use PHP to create a file containing a list of phone numbers.
It's working OK however if the phone number begins with zero, the digit is dropped from the excel file.
Does anyone know how to set the formatting correctly so that it remains in place?
Any advice appreciated.
Thanks.
I have an xls sheet called Tickers (matrix 1 column 500 rows) with yahoo tickers. I want matlab to download the historical data for last 5 years for each stock ticker into a separate xls spreadsheet and save it in a given directory with title of the sheet = ticker. So that means i want a code that will create and save 500 tickers worth of data in 500 separate spreadhseets :) can anyone help or direct?
Hello,
I'm building an iPhone app that is essentially a book, it will be bundled with a lot of text-heavy content.
I considered bundling the data as XML and load it when the application starts but the XML would contain a lot of nested structures and be a bit of a pain to parse.
Would it be better to use a plist? I'm concerned about memory usage and plists are loaded entirely into memory - can they be parsed in chunks? Is there a maximum size to a plist and how efficient are they?
I'm not sure how big the bundled content is going to be yet but I should imagine it could be anywhere from 500k to 4MB.
Thanks in advance.
I'm doing a web application for articles
Articles must be shown by month, with its published date stored as mm/yyyy
Now:
1- Should I use a DATE type field for storing?
2- Will jQuery UI datePicker be useful for showing mm/yyyy?
3- How could I sort by mm/yyyy?
I guess it will be more complicated if I store date normally and extract the day from date each time I want to do something, right?
Thanks,
// .net 2.0 and vs2005 used.
I find some code below.
I am not sure I can extended the sample code or not? thank you.
if (radioButton.Checked)
{
MemoryStream ms=new MemoryStream();
byte[] data=ASCIIEncoding.ASCII.GetBytes(textBox1.Text);
ms.Write(data,0,data.Length);
reader = new XmlTextReader(ms);
//some procesing code
ms.Close();
reader.Close();
}
BTW, Could you please help me to do some dissection about the line below.
byte[] data=ASCIIEncoding.ASCII.GetBytes(textBox1.Text);
When I first started writing CSS, I was writing it in an expanded form
div.class {
margin: 10px 5px 3px;
border: 1px solid #333;
font-weight: bold;
}
.class .subclass {
text-align:right;
}
but now I find myself writing css like this: (Example from code I'm actually writing now)
.object1 {}
.scrollButton{width:44px;height:135px;}
.scrollButton img {padding:51px 0 0 23px;}
.object2 {width:165px;height:94px;margin:15px 0 0 23px;padding:15px 0 0 10px;background:#fff;}
.featuredObject .symbol{line-height:30px; padding-top:6px;}
.featuredObject .value {width:90px;}
.featuredObject .valueChange {padding:5px 0 0 0;}
.featuredObject img {position:absolute;margin:32px 0 0 107px;}
and I'm beginning to worry because a lot of the time I see the first form done in examples online, while I find the second form a lot easier for me to work with. It has a lower vertical height, so I can see all the classes at a glance with less scrolling, the tabulation of the hierarchy seems more apparent, and it looks more like code I'd write with javascript or html. Is this a valid way of doing code, or to keep with standards when putting it online should I use the vertical form instead?
Im not sure how to output MySQL data into formats below. (eg: timelist, usersex, userage from table users.)
timeList = new Array(),
userSex = new Array('female','male','male'),
userAge = new Array('21','36'),
userMid = new Array('liuple','anhu');
Thanks!
I want to put space between punctuations and other words in a sentence. But boost::regex_replace() replaces the punctuation with space, and I want to keep a punctuation in the sentence!
for example in this code the output should be "Hello . hi , "
regex e1("[.,]");
std::basic_string<char> str = "Hello.hi,";
std::basic_string<char> fmt = " ";
cout<<regex_replace(str, e1, fmt)<<endl;
Can you help me?
Given a path to a REST style URL:
http://site.com/rest/customer/foo/robot/bar/1
When you GET it, it returns a PDF to the foo-customer containing page 1 of the bar-URL.
While foo is the name of the customer bar is an URL. The URL usually contains slashes and might look something like this:
http://anothersite.com/interestingarticle.html
As REST URL's separate arguments by slashes I can't just put it into the REST URL above. Which encoding should I use? I can't use Base 64 as it utilizes the slash as well.
As a technical note I will encode the URL in a .NET-application and decode it in PHP.
Is there any option available to align the aspx page tags properly.and it should avoid empty lines in the source page.
I am spending my time on tags aligning.
I'm trying to generate email messages. The recipient's email address and name are specified by a user. What is the correct way to do this with PHP:
$to_header = "To: $name <$email>" # incorrect!
I already use a decent method for validating the email addressess (let's not go to that now...), but how do I properly encode $name with eg. QP when needed? For example, if the recipient is called "Foo Bär", I should produce (eg.) something like:
To: =?utf-8?Q?Foo_B=C3=A4r?= <[email protected]>
Is there any option available to allign the aspx page tags properly.and it should avoid empty lines in the source page.
I am spendingmy time on tags allining.
I have code written both ways and I see flaws in both of them. Is there another way to write this or is one approach more "correct" than the other?
def functionOne(subscriber):
try:
results = MyModelObject.objects.filter(
project__id=1,
status=MyModelObject.STATUS.accepted,
subscriber=subscriber).values_list(
'project_id',
flat=True).order_by('-created_on')
except:
pass
def functionOne(subscriber):
try:
results = MyModelObject.objects.filter(
project__id=1,
status=MyModelObject.STATUS.accepted,
subscriber=subscriber)
results = results.values_list('project_id', flat=True)
results = results.order_by('-created_on')
except:
pass
I have a series of times that are coming to me as strings from a web service. The times are formated as HH:MM:SS:000 (3 milisecond digits). I need to compare two times to determine if one is more than twice as long as the other:
if ( timeA / timeB > 2 )
What's the simplest way to work with the time strings?
If I was writing in Python this would be the answer to my question:
Difference between two time intervals in Python
Edit: What I'm really looking for is a way to get the ratio of timeA to timeB, which requires division, not subtraction. Unfortunately, the DateTime structure doesn't appear to have a division operator. Updated the question title to reflect this.