Posts

java - Why my gadget is not receiving data? -

i have application on appspot. on personal domain account. i have put igoogle gadget on igoogle page of gmail account. i sending ajax request gadget : $(document).ready(function(){ jquery.ajax({ type: "get", url: "http://searcegadget2.appspot.com/requestservlet", success: function(msg){ alert(msg); if(msg.search('tr') != -1){ id = msg.split('</tr>').length - 1; //alert(id); $('#amounttable').append(msg); difference(); }else if(msg.search('form') != -1){ $('#gadget').css('display', 'none'); document.write(msg); }else if(msg.search('http') != -1)...

How to sync schema continuously in two databases in Sql Server (for unit testing) -

we have database against run unit tests components require database (for several reasons not mocking dal everywhere). we using sql server 2008 r2 , in development db server have our development database (applicationname_dev) , our testing db (applicationname_ut). the unit tests create test data need , delete afterwards tables could/should empty when no tests running. the problem keeping schema of unit test database date. the best solution me (to limited knowledge) have sql server agent job run once night (or when manually started) drops tables in ut database, generate create script tables, indexes , relationships in dev-database, , run create scripts on ut-database. note don't need insert data. is there way of programmatically (t-sql, smo etc) generating create scripts tables including indexes , relationships ? in management studio can right click database->tasks->generate scripts...->choose objects->tables , scripts want (except "use [applicationn...

c# - filtering a list using LINQ -

i have list of project objects: ienumerable<project> projects a project class property called tags . int[] i have variable called filteredtags int[] . so lets filtered tags variable looks this: int[] filteredtags = new int[]{1, 3}; i want filter list ( projects ) return projects have of tags listed in filter (in case @ least tag 1 , tag 3 in tags property). i trying use where () , contains () seems work if comparing against single value. how compare list against list need match on items in filtered list ?? edit: better yet, that: var filteredprojects = projects.where(p => filteredtags.all(tag => p.tags.contains(tag))); edit2: honestly, don't know 1 better, if performance not critical, choose 1 think more readable. if is, you'll have benchmark somehow. probably intersect way go: void main() { var projects = new list<project>(); projects.add(new project { name = "project1", tags = new int[] { 2,...

java - Any Idea/guess of how twitter saves its tweets in the database and updates it real-time -

i making twitter type of website (not big twitter:), without using twitter api), have decide kind of database should use , how maintain in consistent state. the main problem: suppose website twitter clone(that make question easier understand), if have user "a" has 100 friends , friends tweet same time "a" logs in @ point in time tweets fetched database, database being updated friends tweets => database in inconsistent state q1> best solution it? maintain 2 database, use multi-threading etc? can explain in detail. q2>what best database particular usage. twitter uses nosql database called cassandra. take closer here: apache cassandra

r - How do you combine multiple boxplots from a List of data-frames? -

this repost statistics portion of stack exchange. had asked question there, advised ask question here. here is. i have list of data-frames. each data-frame has similar structure. there 1 column in each data-frame numeric. because of data-requirements essential each data-frame has different lengths. want create boxplot of numerical values, categorized on attributes in column. boxplot should include information data-frames. i hope clear question. post sample data soon. sam, i'm assuming follow this question? maybe sample data illustrate nuances of needs better (the "categorized on attributes in column" part), same melting approach should work here. library(ggplot2) library(reshape2) #fake data <- data.frame(a = rnorm(10)) b <- data.frame(b = rnorm(100)) c <- data.frame(c = rnorm(1000)) #in list mylist <- list(a,b,c) #in melting pot df <- melt(mylist) #separate boxplots each data.frame qplot(factor(variable), value, data = df,...

ssl - Android: opending a keystore as an asset to make an SSLSocketFactory -

have bouncy castle keystore, i'd use connect sslsocketfactory. doing in "desktop" java easy, how do on android. it doesn't seem make difference whether put in assets or res/raw - problem comes when trying open , instantiate instance of keystore (java.security.keystore in case) pass sslsocketfactorys constructor. has had success before? what's best way of "reading" , opening it? pointers or code snippets welcome. many thanks don this should do: import android.content.context; import org.apache.http.conn.clientconnectionmanager; import org.apache.http.conn.scheme.plainsocketfactory; import org.apache.http.conn.scheme.scheme; import org.apache.http.conn.scheme.schemeregistry; import org.apache.http.conn.ssl.sslsocketfactory; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.impl.conn.singleclientconnmanager; import java.io.inputstream; import java.security.keystore; public class myhttpclient extends defau...

MongoDB C# offic. List<BsonObject> query issue and always olds values? -

i have not issue during query using 2 criterials id , other. use repository storing data id,iso,value. have created index("_id","iso") performs queries queries returning cursor if use 1 criterial _id, returning nothing if use 2 (_id, iso) (commented code). index affecting response or query method failing? use :v1.6.5 , c# official. sample. //getting data public list<bsonobject> get_object(string id, string iso) { using (var helper = bsonhelper.create()) { //helper.db.repository.ensureindex("_id","iso"); var query = query.eq("_id", id); //if (!string.isnullorempty(iso)) // query = query.and(query, query.eq("iso", iso)); var cursor = helper.db.repository.findas<bsonobject>(query); return cursor.tolist(); } } data: { "_id": "2345019", "iso": "uk", "data": "some data...