What is the easiest way of paginating data that is in divs? Some jquery library for it? Basically I would only need 1/x pages shoqing and arrow buttons to go throught all the data.
Whats a better way to store textual data, such as comments, user profile fields that require them to type something in, etc? Store the escaped data right away (using htmlspecialchars in php for example), or put it thru the same function before its echoed out?
I have a variable in java which return type is Object(java.lang.Object). I want to store this variable value in MySQL database without casting in any other primitive data type. Is there any data type available in MySQL related to Object? If anybody knows, please reply at your earliest time.
Thanks,
A book beginning linux programming 3ed says "Note that fread and fwrite are not recommended for use with structured data.Part of the problem is that files written with fwrite are potentially nonportable between different machines." What does that mean exactly? what calls should I use if I want to write a portable structured data reader or writer? direct system calls?
How can I plot (a 3D plot) a matrix in Gnuplot having such data structure. I cannot find a way to use the first row and column as a x and y ticks (or to ignore them)
,5,6,7,8
1,-6.20,-6.35,-6.59,-6.02
2,-6.39,-6.52,-6.31,-6.00
3,-6.36,-6.48,-6.15,-5.90
4,-5.79,-5.91,-5.87,-5.46
Is the splot 'data.csv' matrix the correct parameter to use ?
I have an application that I want to represent a users session (just small pieces of data here and there) within a GUID. Its a 16 HEX characters (so 16^16 possible values) string and I want to 'encode' some data within that GUID.
How can I achieve this? I am really after any ideas and implementations here, Ive not yet decided on the best mechanism for it yet.
I would also like encryption to be involved if possible...
Thanks a lot
Mark
How can I get the previous version of data of a Row in a DataTable? The data has only changed but hasn't been saved yet.
The .NET version I'm working on is 1.1
I'm trying to export data to a csv file. It should contain a header (from datastack) and restacked arrays with my data (from datastack). One line in datastack has the same length as dataset. The code below works but it removes parts of the first line from datastack. Any ideas why that could be?
s = ','.join(itertools.chain(dataset)) + '\n'
newfile = 'export.csv'
f = open(newfile,'w')
f.write(s)
numpy.savetxt(newfile, (numpy.transpose(datastack)), delimiter=', ')
f.close()
Hi
In my app I use a ListView to display data from the database. The data changes sometimes, for example when the user applies new filters or changes the sorting method. I use AsyncTask to get the databsase cursor that points to the new data set because sometimes data needs to be loaded from the net which can take some time.
What I do now looks something like this:
private class updateTask extends AsyncTask<Void, Void, Void> {
/*
* runs on the UI thread before doInBackground
*/
@Override
protected void onPreExecute(){
// prepare some stuff...
}
/*
* runs in a separate thread
* used for time-consuming loading operation
*/
@Override
protected Void doInBackground() {
//get new database cursor
mCursor = mDbAdapter.getCursor();
return null;
}
/*
* runs on the UI thread after doInBackground
*/
@Override
protected void onPostExecute(Void result){
if(mCursor!=null){
MyActivity.this.startManagingCursor(mCursor);
mCursorAdapter = new MyCustomCursorAdapter(MyActivity.this, mCursor);
mListView.setAdapter(mCursorAdapter);
}
}
}
This works so far but I realize that creating a new CursorAdapter and calling setAdapter on my ListView each time isn't the correct way to do it.
Also, after setAdapter the scroll position of the list is set back to the top. I found this post which describes how to do it properly. So now I want to do something like this:
onCreate(){
// ...
// create the CursorAdapter using null as the initial cursor
MyCustomCursorAdapter cursorAdapter = new MyCustomCursorAdapter(this, null);
mListView.setAdapter(cursorAdapter);
// ...
}
private class updateTask extends AsyncTask<Void, Void, Void> {
/*
* runs on the UI thread before doInBackground
*/
@Override
protected void onPreExecute(){
// prepare some stuff...
}
/*
* runs in a separate thread
* used for time-consuming loading operation
*/
@Override
protected Void doInBackground() {
//get new database cursor
mCursor = mDbAdapter.getCursor();
return null;
}
/*
* runs on the UI thread after doInBackground
*/
@Override
protected void onPostExecute(Void result){
// this returns null!
MyCustomCursorAdapter cursorAdapter = (MyCustomCursorAdapter)mListView.getAdapter();
Cursor oldCursor = cursorAdapter.getCursor();
if(oldCursor!=null){
MyActivity.this.stopManagingCursor(oldCursor);
oldCursor.close();
}
if(mCursor!=null){
MyActivity.this.startManagingCursor(mCursor);
cursorAdapter.changeCursor(mCursor);
}
}
}
This however doesn't work for me because
(MyCustomCursorAdapter)mListView.getAdapter();
always returns null.
Why does this happen? What am I doing wrong?
Edit:
Some additional information: my adapter implements SectionIndexer. I don't really think that this has anything to do with my problem but it has caused me some troubles before so I thought I'd mention it.
I am trying to use jQuery AJAX. What my requirement is, i wish to load user names from DB in dataset, convert it to JSON format and store it in memory or using jQuery data for use while a user is browsing my site, i.e for a session. This way I can use autocomplete or my own code to display data to user.
Can anyone help me design such a scenario?
Has anyone written a YQL open data table for accessing Wikipedia? I've had a hunt around the internet and found mention of people using YQL for extracting various bits of information from Wikipedia pages such as microformats, links or content but I haven't been able to find an open data table that ties it all together.
Hi experts,
i have an input data in excel which has 2000 rows and 60 columns. I want to read this data in matlab but i need to to interchange the rows and the column so that the matrix will be 2000 column and 60 rows. How can i do this in matlab, because excel only has 256 column which cannot hols 2000 column.
Thanks
I followed the guide here, but for some reason, the table view does not load the data. I know the array exists and there's data in it, but it won't display in the table itself.
I want to produce a JSON file, containing some initial parameters and then records of data like this:
{
"measurement" : 15000,
"imi" : 0.5,
"times" : 30,
"recalibrate" : false,
{
"colorlist" : [234, 431, 134]
"speclist" : [0.34, 0.42, 0.45, 0.34, 0.78]
}
{
"colorlist" : [214, 451, 114]
"speclist" : [0.44, 0.32, 0.45, 0.37, 0.53]
}
...
}
How can this be achieved using the Python json module? The data records cannot be added by hand as there are very many.
I've read similar questions here but I'm still a little confused.
MyCollection extends ArrayList<MyClass>
MyClass implements Data
yet this gives me the "cannot convert from ArrayList to MyCollection"
MyCollection mycollection = somehandler.getCollection();
where getCollection looks like this
public ArrayList<Data> getCollection()
So my assumptions are obviously wrong. How can I make this work like I would like it to
i am trying to store large data more than 255 characters in a string datatype but it truncates after 255. how can i achive this basically i need to pass this data to database
I've read like 10 or so "tutorials", and they all involve the same thing:
Pull a count of the data set
Pull the relevant data set (LIMIT, OFFSET)
IE:
SELECT COUNT(*)
FROM table
WHERE something = ?
SELECT *
FROM table
WHERE something =?
LIMIT ? offset ?`
Two very similar queries, no? There has to be a better way to do this, my dataset is 600,000+ rows and already sluggish (results are determined by over 30 where clauses, and vary from user to user, but are properly indexed of course).
Hi there I have a situation where I need to make to call to a normal .aspx page from asp.net mvc web application. How can I make this request and get data back from the page. the data will be returned on on the page_load event of the .aspx page
Hey guys, is there a way to load XML Data Cross-Domain with JQuery (= client side)?
$.get('http://otherdomain.com/data.xml', function(xml) { }
The above doesn't work - do I have to rely on JSONP, or is there a way to load XML?
Are there any ways to determine what the differences in databases are that affect a SSIS package load performance ?
I've got a package which loads and does various bits of processing on ~100k records on my laptop database in about 5 minutes
Try the same package and same data on the test server, which is a reasonable box in both CPU and memory, and it's still running ... about 1 hour so far :-(
Checked the package with a small set of data, and it ran through Ok
Hi,
I have several files about 15k each of CSV data I need to import into SQL Server 2005.
What would be the simplest way to import the csv data into sql server? Ideally, the tool or method would create the table as well, since there are about 180 fields in it, this would simplify things.
How can display two detail section's data after completion of first detail section in crystal report of vb2005 like
detail of first detailsection
#one row.........................."
#second row........................."
#three row.........................."
detail of second detailsection
#"one row.............."
#"second row..............."
#"data of third row.............."
I have to build unit tests for in environment with a very old version of Test::More (perl5.8 with $Test::More::VERSION being '0.80') which predates the addition of done_testing().
Upgrading to newer Test::More is out of the question for practical reasons. And I am trying to avoid using no_tests - it's generally a bad idea not catching when your unit test dies prematurely.
What is the most idiomatic way of running a configurable amount of tests, assuming no no_tests or done_testing() is used?
Details:
My unit tests usually take the form of:
use Test::More;
my @test_set = (
[ "Test #1", $param1, $param2, ... ]
,[ "Test #1", $param1, $param2, ... ]
# ,...
);
foreach my $test (@test_set) {
run_test($test);
}
sub run_test {
# $expected_tests += count_tests($test);
ok(test1($test)) || diag("Test1 failed");
# ...
}
The standard approach of use Test::More tests => 23; or BEGIN {plan tests => 23} does not work since both are obviously executed before @tests is known.
My current approach involves making @tests global and defining it in the BEGIN {} block as follows:
use Test::More;
BEGIN {
our @test_set = (); # Same set of tests as above
my $expected_tests = 0;
foreach my $test (@tests) {
my $expected_tests += count_tests($test);
}
plan tests = $expected_tests;
}
our @test_set; # Must do!!! Since first "our" was in BEGIN's scope :(
foreach my $test (@test_set) { run_test($test); } # Same
sub run_test {} # Same
I feel this can be done more idiomatically but not certain how to improve. Chief among the smells is the duplicate our @test_test declarations - in BEGIN{} and after it.