Posts

Showing posts from January, 2012

iis - Invalid postback or callback argument when using loadbalancer and webgate -

hi have developed asp.net website deployed on 2 server. site working fine when access site using ip address of servers in url https://123.123.123.12/pagename.aspx . when access site using loadbalancer dns name ( https://dnsname/pagename.aspx ) , webgate of pages throwing following exceptions "invalid postback or callback argument" or "the serialized data invalid." this happending intermittently. same page, time shows correct data , throws exception. when stopped website(iis) on 1 of server pages works excepted without throwing above exceptions. i verified machine keys on both servers, machine key value same on both servers. there others websites on same servers working fine loadbalancer dns url (//dnsname/pagename.aspx) , webgate. can me this? below stacktrace <description>an exception of type 'system.argumentexception' occurred , caught.</description> <exceptiontype>system.argumentexception, mscorlib, version=4.0.0.0,

xml - XSLT: how to access previous group -

i'm struggeling on piece of code, appreciated. to make story short, in xslt(2.0) file have 2 nested loops. first 1 performs grouping based on year value. each of these group, inner loop performs operations. in particular loop, while performing tasks in current group, need know size(the number of elements) of previous group. of course, can't figure out how achieve this. here piece of xslt code : <xsl:for-each-group select=" ... " group-by="year"> <xsl:for-each select="current-group()"> <!-- here want know number of elements of previous group --> </xsl:for-each> </xsl:for-each-group> for first group, of course size needs 0 because there no previous group yet. following group (second, third, ...), need know number of elements of previous one. so example, if have 2 groups : 2007 group elements data1 data2 data3 data4 2009 group elements data5 data6 when inner loop perf

bash - How do I take the output of recursive grep and split it into an array like variable? -

i'm trying create shell search , replace function replace occurrences of string in directory. problem how take output of recursive grep , use find files use sed? i've got following pipeline grep -r protal ./ | sed 's/:.*//g' | sed 's/\/\//\//g' . produces output: ./settings.py ./settings.py ./settings.py ./urls.py ./wsgi.py ./wsgi.py i want take , split array or can (pseudo-code): for [[ $file in $file_list ]]; sed -i 's/$input_string/$replace_value/g' $file done how that? instead of trying parse file list (which problem when have whitespaces or newlines in file names), i'd whole thing find , -exec filter: find . -type f -exec grep -q protal '{}' \; -exec sed -i "s/$input_string/$replace_value/" '{}' \; the trick that the -exec filter passes if command returns exit status 0 , that grep -q protal file.txt returns exit status 0 if file.txt contains protal , , that the second -exec filt

Pivoting string fields in SQL Server 2008 R2 -

i need create dataset based on 1 generated series of sql sub-queries. results of sub-queries can replicated using following code: create table table1 (`stayid` varchar(3), `incidentorder` int, `txdetails` varchar(73)) ; insert table1 (`stayid`, `incidentorder`, `txdetails`) values ('ip1', 1, 'ward: a9999 - 01/01/2015 - 15:23'), ('ip1', 2, 'consultant: joe bloggs specialty :geriatric medicine - 02/01/2015 - 08:17'), ('ip1', 3, 'discharge - 06/02/2015 - 16:40'), ('ip2', 1, 'consultant: joe bloggs - 01/01/2015 - 09:02'), ('ip2', 2, 'consultant: joe bloggs specialty :geriatric medicine - 02/01/2015 - 12:56'), ('ip2', 3, 'ward: a9999 - 02/01/2015 - 19:39'), ('ip2', 4, 'consultant: joe bloggs - 05/01/2015 - 08:22'), ('ip3', 1, 'ward: a9999 - 02/01/2015 - 04:58'), ('ip3', 2, 'consultant: joe bloggs speci

swift - Scroll View & UIGestureRecogniser Conflict -

i have uiimageview subview in scrollview. i want able pan up/down on uiimage adjust color of uiimage. also want able pan/zoom around image(that's why implemented scrollview). i have adjustcolor ibaction uibutton adds uipangesturerecogniser target , executes function below: func panned(gesture: uigesturerecognizer){ ... } my problem adjustcolor button ignored scrollview's scroll behaviour. if delete scrollview , add uiimage, adjustcolor button activates color adjustment function , gestures work perfectly. on other hand, if have scrollview , image subviewimage, adjustcolor button has no functionality. any appreciated. thank you. make sure connect uigesturerecognizer iboutlet scrollview.

objective c - iOS selector crashes the App -

Image
i created simple httpclient afnetworking. httpclient *client = [[httpclient alloc] initwithtarget:(id)target before:(sel)before success:(sel)success failure:(sel)failure timeout:(sel)timeout] so controller can register callback function when perfroms http request. , here how wrote callback functions: - (void)successmethod:(id)response { // logdebug(@"success: %@", response); self.lock = false; if (self.target == nil || self.successcallback == nil) { return; } if ([self.target respondstoselector:self.successcallback]) { [self.target performselector:self.successcallback withobject:response]; } } but here found problem. when request comes fast, works fine. if request comes after longtime , meanwhile, user changes view. crashes app , throw exception like, se

jquery - Website javascript faulty when collapsing on load -

if click link follow website pay close attention how header slider loads. if noticed, collapses after 100% loading div, before expanding images. images , slides consist of background-images , css gradiets. in js script, sets header div auto height, i'm not familiar how set set height after loading div, prevent collapse. you add min-height in css element that's equal height of div while it's loading images. shouldn't need mess js. this way, it'll expand height of element, not collapse , expand.

python - Scraping data and inputting it into two different tables -

i have scraped squad data following website: http://www.espnfc.us/club/real-madrid/86/squad i created dictionary each player , wondering if can save goalkeeper data in different file outfield players data for i'm using following code input data 1 output file without knowing how data structured, it's hard help. if data list of dicts, 1 each player, elements describing each column in web table, use list comprehensions filter position: with open('goalkeepers.json','wb') goalkeeper_file: json.dump( [player player in data if player['pos'] == "g"], goalkeeper_file) open('outfielders.json','wb') outfield_file: json.dump( [player player in data if player['pos'] != "g"], outfield_file)

go - Decoding json in Golang -

i cannot figure out what's wrong in code decode json. returns empty struct. go playground here: http://play.golang.org/p/k8wznlt5m0 package main import ( "encoding/json" "fmt" ) type apiparams struct { accesstoken string `json:access_token` tokentype string `json:token_type` expiresin int64 `json:expires_in` } func main() { data := `{ "access_token": "asdfasdf", "token_type": "bearer", "expires_in": 5173885 }` var apiparams apiparams err := json.unmarshal([]byte(data), &apiparams) if err != nil { fmt.println(err) } fmt.println(apiparams) } add double quotes tags: type apiparams struct { accesstoken string `json:"access_token"` tokentype string `json:"token_type"` expiresin int64 `json:"expires_in"` }

html - CSS not loading after refresh in Rails -

i'm new rails, have created app in user has profile , can edited edit profile option. in controller have, profilescontroller in views have, index.html.erb edit.html.erb it works fine index page, edit page it's cool first load , after refreshing it, css files not loading. url looks http://localhost:3000/profiles/25/edit everything works right index page no matter how many refreshes, it's disappointing edit page.i have inspected elements in browser, says get http://localhost:3000/profiles/25/assets/bootstrap.min.css [http/1.1 404 not found 650ms] i.e searches files in localhost:3000/profiles/25/assets/ doesn't exists instead of searching in localhost:3000/assets/ edit : structure: app/assets/stylesheets application.css bootstrap.min.css style.css in application.html.erb , link application.css as, <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> and other css fil

c++ - Cannot kill Qt thread with CryptoPP FileSink running in the thread run method -

i have ui app in c++ , qt5.4, im using cryptopp 5.6.2 encrypt files. ran following problem: when encrypt button hit, new thread started based on this tutorial . // new thread cryptoworkerthread = new qthread; this->worker = new cryptoworker(filename.c_str(), newfilename.c_str(), key, keylength, iv); this->worker->movetothread(cryptoworkerthread); connect(worker, signal(error(qstring)), this, slot(errorstring(qstring))); connect(cryptoworkerthread, signal(started()), worker, slot(process())); connect(worker, signal(finished()), cryptoworkerthread, slot(quit())); connect(worker, signal(finished()), this, slot(on_cryptoworker_finished())); connect(worker, signal(finished()), worker, slot(deletelater())); connect(cryptoworkerthread, signal(finished()), cryptoworkerthread, slot(deletelater())); cryptoworkerthread->start(); i store pointer thread , worker in mainwindow class (parent of encrypt button , slot) worker class: class cryptoworker : public qobject { q_

python - Why is this lxml.etree.HTMLPullParser leaking memory? -

i'm trying use lxml's htmlpullparser on linux mint i'm finding memory usage keeps increasing , i'm not sure why. here's test code: # -*- coding: utf-8 -*- __future__ import division, absolute_import, print_function, unicode_literals import lxml.etree import resource io import default_buffer_size _ in xrange(1000): open('stackoverflow.html', 'r') f: parser = lxml.etree.htmlpullparser() while true: buf = f.read(default_buffer_size) if not buf: break parser.feed(buf) parser.close() # print memory usage print((resource.getrusage(resource.rusage_self)[2] * resource.getpagesize())/1000000.0) stackoverflow.html homepage of stackoverflow i've saved in same folder python script. i've tried adding explicit deletes , clears far nothing has worked. doing wrong? elements constructed parsers leaking, , can't see api contract violation in code that's causing it. since objects survive man

How to create a camel route that references a specific Java method? -

i want write camel route reads xml files in specific directory, calls process java method of class implements processor , print result screen. for example java class named scriptprocessor, , has process method: public class scriptprocessor implements processor{ final script script ; public scriptprocessor(script script){ this.script = script; } @override public void process(exchange exchange) throws exception { //do ... } } so, have camel context route this: <camelcontext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="file:?noop=true"/> <to uri="mock:result"/> </route> </camelcontext> i suppose xml files in same directory of file camel context definition ("from" tag), , use mock element specify destination of route. don't know how call process method of scriptprocessor class inwards camel route.

asp.net - Determining url for Ajax WebMethod (in Sitefinity) -

i'm trying figure out how determine baseurl should ajax webmethod post. according sitefinity thread , baseurl path sitefinity project folder. in case, path should along lines of: "c:\inetpub\website\public" path not in same format "mywebform.aspx/webmethod" this seems simple problem before go testing out, want make sure i'm doing right thing. i'd appreciate suggestions , feedback. thanks in advance. function buttonclick(e) { e.preventdefault(); $.ajax({ type: "post", url: baseurl + "mywebform.aspx/webmethod", data: 1, contenttype: "application/json; charset=utf-8", datatype: "json", success: function() { alert('success'); }, error: function (msg) { alert('sorry, there error, please try again later'); } }); } if have .aspx file

node.js - How to query nested array -

let's have documents like { name: "name1", friends: [ { name: "name2", thingswedo: [ { name: "running", like_it: true }, { name: "swimming", like_it: false } ] } ] } so if want know name of friend both love swimming, how do it? i know schema design better, if want query schema, how do it? is possible chain $elemmatch ? you should $unwind friends , thingswedo in aggregation , use $match match criteria. check below query : db.collectionname.aggregate({ "$unwind": "$friends" // first unwind friends array }, { "$unwind": "$friends.thingswedo" // second unwind friends.thingswedo }, { "$match": { "friends.thingswedo.name": "swimming", /

Java JPA write object to binary file -

database (user) id     name 1         ali 2        abu 3      ahmad writebinaryfile.java entitymanagerfactory emf = persistence.createentitymanagerfactory("userpu"); entitymanager em = emf.createentitymanager(); query query1 = em.createnativequery("select * user",user.class); list<user> list = query1.getresultlist(); for(user userlist: list){ fileoutputstream fos = new fileoutputstream("test.dat"); objectoutputstream oos = new objectoutputstream(fos); oos.writeobject(userlist); oos.close(); } readbinaryfile.java fileinputstream fis = new fileinputstream("test.dat"); objectinputstream ois = new objectinputstream(fis); user user1 = (user) ois.readobject(); ois.close(); system.out.println(user1.getid+" "+user1.getname()); when read readbinaryfile.java, can output following: 3 ahmad my expected output: 1 ali 2 abu 3 ahmad what doing wrong? how can solve it? aren't overwriting fi

mysql - SQL Select only rows with Minimum Value on a Column with Where Condition -

table: | id | productid | orderindex | rejected | ------------------------------------------ | 1 | 1 | 0 | 1 | | 2 | 1 | 1 | 0 | | 3 | 1 | 2 | 0 | | 4 | 2 | 0 | 0 | | 5 | 2 | 1 | 1 | | 6 | 3 | 0 | 0 | how can select 1 row per productid minimum orderindex not rejected? expected result: | id | productid | orderindex | rejected | ------------------------------------------ | 2 | 1 | 1 | 0 | | 4 | 2 | 0 | 0 | | 6 | 3 | 0 | 0 | i tried query, don't recieved correct result: select id, productid, min(orderindex) table rejected = 0 group productid this 1 don't work also: select id, productid, min(orderindex) ( select id, productid, orderindex table rejected = 0 ) t group productid you can start selecting minimum orderinde

javascript - How can I embed a simple, type JSON, web service into my website using JS -

i having trouble trying work out how embed simple web service website. url of web service example.com/movie-trivia.php . displays randomly generated json type string such as: {"movie-trivia":"for american release, first 20 minutes of trainspotting had re-dubbed make scottish accents more intelligible."} i need embed on 1 of web pages every time page refreshed, 1 of many randomly generated movie trivia's source displayed. add, every time source url page refreshed displays 1 random trivia every time, wish do. i new web development technologies if kind , provide me solution of how directly implement 1 of pages. i solved question using php solution. <?php # http request $url = 'http://www.example.com/movie-trivia.php'; $ch = curl_init($url); curl_setopt($ch, curlopt_timeout, 5); curl_setopt($ch, curlopt_connecttimeout, 5); curl_setopt($ch, curlopt_returntransfer, true); $data = curl_exec($ch); curl_close($ch); echo $data; ?>

c# - Linking/assigning one EF class to other - virtual ICollection isn't present in migrations file -

i have class called "collection". represents data stored in entity framework database. here part of class: public class collection { [...] [foreignkey("primarycollection")] public int? primarycollectionid { get; set; } public virtual collection primarycollection { get; set; } public virtual icollection<collection> collectionsbasedonthisone { get; set; } } what wanted accomplish: collection can have "parents" or "children", in "primarycollection" parent , "collectionsbasedonthisone" children. i called "add-migration" function, visual studio generated is: addcolumn("dbo.collections", "primarycollectionid", c => c.int()); createindex("dbo.collections", "primarycollectionid"); addforeignkey("dbo.collections", "primarycollectionid", "dbo.collections", "id"); i think something's missing. there nothing &

octave - Reading a Float Line from a File W/o Knowing Its Length -

i relatively new octave, question is: how can read each line containing numbers file without knowing length? line lengths vary. i know how many lines there are. each line has 2 or more float values, can't use "fgetl" because mean string, need array. there many options , depends hoe want have data stored. 1 way: yourfile: 3.14 5.2 6.4 1.2 8.4 9.2 10.5 12.4 the code fid = fopen ("yourfile", "r"); while ((tmp = fgetl (fid)) != -1) c = strread (tmp, "%f") #process c here endwhile fclose (fid); gives: c = 3.1400 5.2000 6.4000 c = 1.2000 8.4000 c = 9.2000 c = 10.500 12.400

javascript - HTML table with fixed headers? -

is there cross-browser css/javascript technique display long html table such column headers stay fixed on-screen , not scroll table body. think of "freeze panes" effect in microsoft excel. i want able scroll through contents of table, able see column headers @ top. i looking solution while , found of answers not working or not suitable situation, wrote simple solution jquery. this solution outline. clone table needs have fixed header , place cloned copy on top of original remove table body top table remove table header bottom table adjust column widths. (we remembering original column widths) below code. here's demo fixed header demo <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"> </script> <script> function scrolify(tblasjqueryobject, height){ var otbl = tblasjqueryobject; // large tables can remove 4 lines below // , wrap

javascript - Jquery Autocomplete results link not working on click -

i using jquery autocomplete.i getting search results database. when start typing in search box getting suggestions.i have given link results using <a href="results.html> . when click on suggestions not getting results.html i need redirect results.html page onclick on suggestions how can that? code:jquery $().ready(function() { $("#search").autocomplete("php/getvalues.php", { width: 383, matchcontains: true, //mustmatch: false, //minchars: 0, //multiple: true, //highlight: true, //multipleseparator: ",", selectfirst: false }); }); getvalue.php <?php require_once "config.php"; $q = strtolower($_get["q"]); if (!$q) return; $sql = "select file_name,img_url,captions completer"; $rsd = mysql_query($sql); while($rs = mysql_fetch_array($rsd)) { $fname = $rs['file_name']; $iurl = $rs ['img_url']; $caption = $rs ['captions']; echo '

ios - MKMapView zoom to fit annotations while locking center -

i'm trying zoom fit annotations on map while locking center , providing insets. - (void)fitannotations:(nsarray *)annotations edgeinsets:(uiedgeinsets)insets { cllocationcoordinate2d originalcenter = self.centercoordinate; mkmaprect maprect = mkmaprectnull; (id<mkannotation> annotation in annotations) { mkmappoint p = mkmappointforcoordinate([annotation coordinate]); maprect = mkmaprectunion(maprect, mkmaprectmake(p.x, p.y, 0, 0)); } maprect = [self maprectthatfits:maprect edgepadding:insets]; mkcoordinateregion mapregion = mkcoordinateregionformaprect(maprect); // try go original center, while increasing span neccessary amount mkcoordinatespan centeringdelta = mkcoordinatespanmake(fabs(mapregion.center.latitude - originalcenter.latitude), fabs(mapregion.center.longitude - originalcenter.longitude)); mapregion.center = originalcenter; mapregion.span.latitudedelta += centeringdelta.latitudedelta * 2.0; mapreg

javascript - String compare with node.js -

i doing project using tessel read text file on server , perform function based upon value. new node.js, , have managed of items running, having issue getting comparison work. i know reading value (which either "1" or "0") fine because when incorporate console.log(//variable) in code, console shows value. the basic code have been playing is: var http = require('http'); setinterval(function() { var options = { host: 'www.users.wfleitz.com', path: '/fleitzwc/example.txt' }; callback = function(response) { var str = ''; response.on('data', function (chunk) { str += chunk; }); response.on('end', function () { console.log(str) if (str == "1"){ console.log("it reads fine ") } }); } http.request(options, callback).end(); }, 1000); i have tried moving "if" statement around, , wording "if" statement: if (str.tostring == "1&qu

javascript - How do I read a cookie created in jquery from code behind in vb.net? -

i have created cookie in javascript... (document).ready(function () { $.cookie("test", "hello michael"); alert($.cookie("test")); }); the alert displays cookie content expected. , trying read in vb.net code behind... dim cookie httpcookie cookie = httpcontext.current.request.cookies.get("test") if isnothing(cookie) txtcookie.text = "cookie not found" else txtcookie.text = cookie.value end if i 'cookie not found". i missing something... please advise! you need add path value cookie, $.cookie("test", "hello michael", { path : "/" }); and, request.cookies("test") work. also, (document) , $ missing.

c# - Launch SharePoint app from Visual Studio takes forever -

i'm trying develop sharepoint application using default template visual studio provides c# using mvc, whenever try launch it, compiles without error takes forever in following step: installation in progress (00:26:51) installation in progress (00:26:52) ... already 26 minutes , counting... looking @ sharepoint site displays app i've created following message: sharepointapp1 we're adding app, click here cancel. any clue why taking long?

java - Hive: Kryo Exception -

i'm executing 1 of hql query has few joins, union , insert overwrite operation, working fine if run once. if execute same job second time, i'm facing issue. can me identify in scenario exception? error: java.lang.runtimeexception: org.apache.hive.com.esotericsoftware.kryo.kryoexception: encountered unregistered class id: 107 serialization trace: rowschema (org.apache.hadoop.hive.ql.exec.mapjoinoperator) parentoperators (org.apache.hadoop.hive.ql.exec.selectoperator) parentoperators (org.apache.hadoop.hive.ql.exec.mapjoinoperator) parentoperators (org.apache.hadoop.hive.ql.exec.filteroperator) parentoperators (org.apache.hadoop.hive.ql.exec.selectoperator) parentoperators (org.apache.hadoop.hive.ql.exec.unionoperator) childoperators (org.apache.hadoop.hive.ql.exec.tablescanoperator) aliastowork (org.apache.hadoop.hive.ql.plan.mapwork) @ org.apache.hadoop.hive.ql.exec.utilities.getbasework(utilities.java:364) @ org.apache.hadoop.hive.ql.exec.utilities.getmapwork(ut

apache - Remove path & extension on URL via htaccess -

i know should easy beating me. after site move want able remove path file along extension (if any) , query string (if any) , index.php (if any) leave file name. eg: http://www.example.com/folder1/folder2/helloworld.html 301 >> http://www.example.com/helloworld http://example.com/anotherpath/apage.html 301 >> http://www.example.com/apage http://example.com/index.php/blurb/noextension 301 >> http://www.example.com/noextension http://www.example.com/longpath/withsome/morefolders/more.html?dkdhghjghjk 301 >> http://www.example.com/more there many different paths in original site (with , without www), if file ends in .html (with possibility of query has go well) want redirecting 301 domain/filename but... make matters more complex, can't redirect http://www.example.com/category/something this because category part of new system (it's wordpress). thanks this! ============ update - having few issues there! adjusted regex suggested , remo

c# - HttpRequestMessage UserAgent with Colon -

i'm trying send request has user agent set colon in it, httprequestmessage complaining colon invalid character. the exact code looks this: httpclient client = new httpclient(); var request = new httprequestmessage() { requesturi = new uri("some-uri"), method = httpmethod.post }; request.headers.add("user-agent", "sample:text"); // send request... i looked through this post can see ebnf of user agent , this rfc specifies ctl is. the first link says following valid user agent: token = 1*<any char except ctls or separators> and second link defines ctl as: any us-ascii control character (octets 0 - 31) , del (127) but, colon ( : ) 58 on ascii table, don't see why problem. i assumed httprequestmessage not colons in because it's not escaped -- thinks it's separator. tried escaping in single quotes, double quotes, etc. is there way escape i'm missing? or in other words, how send c

python - Static linking with boost pyhthon -

i'm trying create boost python extension prefer statically link boost python libraries. otherwise need exact same version of boost installed on every machine use python module. i'm not using bjam though. this works in linux (ubuntu) results in dynamic linking: g++ -o python_example.o -c python_example.cpp -wall -fpic -i/usr/include/python2.7 g++ -shared -o python_example.so python_example.o -lpython2.7 -lboost_python -lboost_system python_example.cpp basic example code: #include <python.h> #include <boost/python/module.hpp> #include <boost/python/def.hpp> #include <boost/python.hpp> char const* greet() { return "hello, world"; } boost_python_module(python_example) { using namespace boost::python; def("greet", greet); } lots of google results out there gave me lot of things try nothing quite worked.

c# - Caliburn.Micro and virtual methods -

i updating project written else. project written in c#, wpf , implements mvvm pattern of caliburn.micro. data access layer written using orm nhibernate , database sql db. i noticed project using eager loading every fetch, want change lazy loading. stumbled upon problem trying fix on week now, hence question here on stackoverflow. some information: a shorter version of poco class: using caliburn.micro; namespace kassaopm.domain { public class klant : propertychangedbase { private int _id; private string _naam; public virtual int id { { return _id; } set { _id = value; notifyofpropertychange(() => id); } } public virtual string naam { { return _naam; } set { _naam = value; notifyofpropertychange(() => naam); } } } the propertychangedbase comes caliburn.micro.propertychangedbase. when nhibernate wants use lazy loading requir

admin - Moodle: How to Assign One Teacher for One Course only -

i want assign 1 teacher 1 course - specific teacher specific course , course enrolled students manage. how can admin panel? kindly suggest. assigning teacher course has done in course page. there, use administration block , , click course administration > users > enrolled users . this can assign teacher adding user role "teacher" using enrol user button.

Custom Attribute in c# to give Custom data-attribute in html -

i'd able make data attribute in c# object in model. when displayed. i'd html render value in data attribute within html itself. in head, code looks similar this. public class affectsattribute:attribute { public string[] departments { get; set; } } [emailaddress] [required(errormessage = "email required")] [affects(departments = new string[]{"coaches"})] public string email {get; set;} then in html, after being called razor this @html.editorfor(model => model.email) <input class="text-box single-line" data-affects="coaches" data-val="true" data-val-email="the email field not valid e-mail address." data-val-required="email required" id="email" name="email" type="email" value=""> i have no clue how specify additional data attribute added when item rendered on page. can help? it can done through validationattribute . if inherit this

swipe - Android - Create SwipeViews inside another SwipeView -

Image
need create nested swipe views, example in facebook android application. appreciated newbie. below link started... android swipe views example swipe views

Pre Trained Models in R Shiny -

i making r shiny app , wanted know if possible pre train models input models variable in server.r can render result of predict(selected_model, input$data)? it not feasible me train models live take long train. cheers, matt you can save r object save function save("myobject" file = "myobject.rdata") then load later with load("myobject.rdata")

android - LoopJ AndroidAsyncHttp is returning response in OnFailure -

i new androidasynchttp. i created class httptester : private static asynchttpclient client = new asynchttpclient(); public static void get(string url, requestparams params, asynchttpresponsehandler responsehandler) { client.get(getabsoluteurl(url), params, responsehandler); } public static void post(string url, requestparams params, asynchttpresponsehandler responsehandler) { client.post(getabsoluteurl(url), params, responsehandler); } private static string getabsoluteurl(string relativeurl) { return relativeurl; } and in activity did following: requestparams params = new requestparams(); params.put("ftid", httprequestuserauthentication.appid); params.put("uuid", mainactivity.uuid); params.put("type", "11"); params.put("datetimestamp", datetimestamp); params.put("sdfversionnb", sdfversionnb); httptester.post(mainac

c# - How to redraw revealed windows on (custom) window resize -

i have strange issue in wpf, have created custom window type (comes notification icon , custom chrome, mainly). under normal circumstances works fine (e.g. resizing using handles etc). however, when trying make window automatically size content, i've ended situation can resize smaller without redrawing windows behind it. when window moved (via dragmove() ), correctly repaints behind it, until either moves or hidden, nothing happens. can tell me messages dragmove() generating cause area hidden window client area invalidate , repaint correctly? i've tried wm_paint pointed @ custom window, either nothing (e.g. windows doesn't expect wm_paint message me) or repaints current client area, not previous one. whilst not able identify why issue occurring, , isn't answer question posed, able resolve problem taking different approach. previously, had been binding on maxheight , minheight ; worked using sizetocontent instead (which doesn't suffer same inabi

loadrunner - Error -26612: HTTP Status-Code=500 (Internal Server Error) -

when run script facing bellow error in loadrunner. error -26612: http status-code=500 (internal server error) kindly me out in resolving error. you need explicitly checking expected results on each , every request. check actual affirmative content, not page titles. test101, each step there expected result. you need branching code exit gracefully when positive expected page not appear.

html5 - How can I forward UDP packets to the browser (node.js? webRTC? other?) while processing it on the way there? -

i want send , later display video in browser. have application takes video camera , converts bytes, later on - sends through udp specific port. - have node.js script receives bytes: var port = 19777; var multicast_group = "224.0.0.251"; var dgram = require("dgram"); var payload = new buffer('a wild message appears'); var client = dgram.createsocket("udp4"); client.on("message", function(message, rinfo) { console.log("received: ",message,rinfo); }); client.on("listening", function() { console.log("listening on ",client.address()); client.setbroadcast(true); client.setttl(64); client.setmulticastttl(64); client.setmulticastloopback(true); client.addmembership(multicast_group); client.send(payload, 0, payload.length, port, multicast_group, function(err,bytes) { console.log("err: "+err+" bytes: "+bytes); // client.close();

mysql - Join two table with multiple references and two values to add -

i have following tables: table article id v1 ========= 0 10 1 7 2 0 3 0 4 5 5 0 table article_details id articleid v2 ====================== 0 0 2 1 4 7 2 4 3 3 5 1 4 1 2 5 4 2 as can see, table "article" contains entry have column "v1" stands "value1". the table "article_details" contains reference article , 2nd value ("v2"). however, reference article can appear multiple times in "article_details". the query looking results in table first column articleid (which can appear once in result). 2nd column needs contain "v1" + of "v2"s can found in "article_details" reference articleid. from sample data above, need query join 2 tables have following result (v3 = v1 + v2 (+v2') + (v2'')): table joined articleid v3 ================ 0

jquery - Modal dialog boxes -

how dynamically change content of dialog box. i have table has user information.for every record user email made hyperlink. when user clicks on of email, dialog has open details of clicked record. how that? please guide me. regards, sitaram ajax! snubbed out of methods, should in motion. $('.email_link').click(function(e){ e.preventdefault(); var id = $this.data('email_identifier'); data = dosomeajaxcallwiththisuniqueid(id); //have ajax call email based data openmodal() //create modal. $(.modal-body).html(data); // after, populate it. })

javascript - Kendo ui grid dropdown editor does not load data -

can not load data kendo dropdown list. gets data backend list empty. backend looks like: [httppost] public actionresult getcities(datasourcerequest command) { var citymodel = _uow.cities.getall().tolist(); var gridmodel = new datasourceresult { data = citymodel.select(preparecitymodelforlist), total = citymodel.count }; return json(gridmodel); } front end schema: { data: "data", total: "total", errors: "errors", model: { id: "id", fields: { name: { editable: true, type: "string" }, city: { defaultvalue: { cityid: 0, cityname: "select city" } }, address: { editable: true, type: "string" }, tel: { editable: true, type:

c - recursive quicksort, count swap and comparison issue -

i want compare how many swaps , comparisons (<, >, ==, !=) took bubblesort vs. quicksort function sort array of unique numbers. problem quicksort function use recursive , bit unsure how keep track of swaps comparisons. tried use pointers keep track of count unsuccessful. me? my bubblesort: void bubble_sort(int arr[], int max) { int i=0, j, temp, flag; int swap=0, comp=0; while(1) { flag = 0; (j = 0 && comp++; j < max - - 1; j++) { comp++; if (arr[j] > arr[j+1]) { swap++; /* swapping */ temp = arr[j]; arr[j] = arr[j+1]; arr[j+1] = temp; flag=1; } } i++; comp++; if (flag == 0) { printf("number of swaps: %d\n",swap); printf("number of comparisons: %d \n\n",comp); break;

java - Unable to view Hystrix metrics in Dropwizard app via hystrix-metrics-event-stream servlet -

i have dropwizard 0.8.1 app have added number of hystrixcommand classes calling out various external services. want visualize stats related calls services, can't seem app play nice hystrix dashboard . documentation seems imply if hystrix-metrics-event-stream servlet working in app should work, when call servlet endpoint directly ( curl http://localhost:8080/hystrix.stream ) long stream of ping: lines, implying there no metrics available published. have cron job repeatedly calling hystrixcommand objects try generate stats, no avail. is there i'm not doing? have added dependency pom.xml : <dependency> <groupid>com.netflix.hystrix</groupid> <artifactid>hystrix-metrics-event-stream</artifactid> <version>1.4.5</version> </dependency> i have integrated servlet dropwizard in app.java : public void run(final appconfig configuration, final environment environment) throws exception { ... environment.getapplicati

ajax - CakePHP3.0+Jquery Section Reorderable list -

i developing app in cakephp3.0 makes use of ajax, , it's first go @ this, appreciate feedback on how code written. this 1 part of larger part of app, before go on rest of ajax other parts of app, want make sure jquery/ajax code optimal , well-structured. red flags going me because see few places code copy/pasted, , makes me think better organized/structured. here 's code view. here 's code controller. here 's looks in action. i'm looking improvements/optimizations/structuring code can make, both view , controller. there should maybe move model layer? way optimize queries? maybe should implement technique or feature improve performance? plan on adding code editing button ajax , update new code when that. fair ask , posting working code , asking isn't bad thing! if want structure , organized shuold read good practices jquery , , can more information pactices javascript o jquery want. can result expect, maybe can read clean code. what have

javascript - event.preventDefault() Causing :hover pseudo class to stick -

i trying implement document navigation, similar on bootstrap site documentation. i've got working on whole, there 1 little aspect of bugging me. like on bootstrap, using combination of affix.js , scrollspy.js, , working. see following jsfiddle . $('#doc_nav').on( "click", "a", function( e ){ // e.preventdefault(); var target = this.hash; var $target = $(target); var offset = $target.offset().top; console.log(offset); offset = offset - 100; console.log(offset); $('html, body').scrolltop( offset ); }); with e.preventdefault() commented out, behavior of navigation menu expected. scrolling down window results in displayed div being highlighted on menu. clicking on item in menu list, takes directly corresponding div on page , when scroll away section on page, menu updates accordingly. on 'real' page, have fixed header

mysql - conversion from string to double is not valid -

imports mysql.data.mysqlclient public class bookingform dim mysqlconn mysqlconnection dim command mysqlcommand dim valid boolean = false private sub button1_click(sender object, e eventargs) handles button1.click call input_validation() mysqlconn = new mysqlconnection mysqlconn.connectionstring = "server = localhost; database = venuesdb; user id = root; password = " dim reader mysqldatareader try mysqlconn.open() dim query string query = "insert venuesdb.event(venueid, eventname, eventdate, eventstarttime, eventendtime, eventid, customerid) values ('" & textbox1.text & "', '" & textbox2.text & "', '" & datetimepicker1.text & "', '" & textbox4.text & "', '" & textbox5.text & "', '" & textbox6.text & "', '" & textbox7.text & "')"