Posts

Showing posts from January, 2011

c# - NetworkStream ReadAsync cancellation -

this question has answer here: networkstream.readasync cancellation token never cancels 4 answers i trying add "timeout" readasync method networkstream . i want cancel readasync after specific time. for example: ctstimeout.cancelafter(10); int bytesread = await nsstream.readasync(newarr, 0, newarr.length, ctstimeout.token); but method still waiting response server. is possible cancel method in reading state? networkstream (or stream inheritance) doesn't support cancellation. readasync method accepts cancellation token, sure; allows know if cancellation requested before read completed. readasync wraps beginread , endread --which offer no way cancel read operation. to cancel read need dispose or close networkstream object.

c# - DataClassesDatacontext Stackoverflow when submitting changes -

Image
i trying update values in database. code worked flawlessly until i've added new value database. have updated dataclasses1.dbml , shows new column have added database. still getting stackoverflowexception when context.submitchanges() gets called. changeset contains 2 objects should updated (update 5 columns per row in case) var customers = new list<customer>(); using (var context = new dataclasses1datacontext()) { var result = custs in context.customer custs.action_id == desrequest.first().action_id && !custs.archivated select custs; inputvalidation.setaddresslines(ref result); context.submitchanges(); customers = result.tolist(); } context.getchangeset shows: {{inserts: 0, deletes: 0, updates: 2}} deletes: count = 0 inserts: count = 0 updates:...

php - ISPConfig 3 - mod_fcgid: error reading data from FastCGI server -

i restored server backup , following error trying access website (including ispconfig admin interface): mod_fcgid: error reading data fastcgi server end of script output before headers: index.php i have tried set opcache.enable = 0 in php.ini seems have worked some, still same results. i using ispconfig 3 on centos 7 php 5.4.16 , apache/2.4.6

javascript - pdfmake - using own fonts not working -

i using pdfmake create pdf's on client side. have wysiwyg editor allows users created pdf. parsed work pdfmake. however, cannot normal fonts work. plugin uses vfs_fonts.js create font on pdf, default roboto. i trying work likes of times new roman etc etc. i have tried alter file this: window.pdfmake = window.pdfmake || {}; window.pdfmake.vfs = { roboto: { "roboto-italic.ttf": "base 64 here", "roboto-medium.ttf": "base 64 here", "roboto-regular.ttf": "base 64 here" }, timesnewroman: { "roboto-italic.ttf": "base 64 here", "roboto-medium.ttf": "base 64 here", "roboto-regular.ttf": "base 64 here" } } i have used same fonts roboto test still doesn't work. here error back uncaught error: no unicode cmap font here code below. paste string pdf tester here , see result { ...

http - MQTT communication for IOT devices with cloud Server -

Image
i'm designing system there 100,000 appliances , user able send/receive data appliance on mqtt. device app communication: there mac address based unique topic , device id of each appliance . each appliance publish data topic of server . server send data corresponding app on http. app device communication app send data server on http , server forward data corresponding appliance on mqtt. now can please guide me correct way ? or better way server should subscribe unique topics of appliances ? following flow diagram above mentioned procedure ibm bluemix offers iot electronics service may of interest you. uses watson iot platform connect smart electronic appliances applications develop. helps analyze , understand data appliances.

javascript - Global Exception handling in angular js using promises : Exception handling: $q promises not catching Error code -

Image
i have plan implemented err handling service globally existing application. not send error code server. have plan implement error code in angular using response error codes, need show custom bootstrap alert user. implementation 1: loginservice.afterlogin(uname, encodeuricomponent(password)) .then(function (response) { }, function (response) { console.log(response + "response login"); alert(response.message); }); var loginservice = function ($http, $q, configapi) { this.afterlogin = function (username, password) { var result = $q.defer(); $http({ method: 'post', url: // api call headers: { 'content-type': 'application/json' } }) .success(function (response) { result.resolve(response); }) .error(function (response) { result.reject(response); ...

google admin sdk - AdminDirectory.Groups.aliases.list undefined -

i trying use google api google scripts. can data google apps example by: var result = admindirectory.groups.get(optionalargs); when try same with: var result = admindirectory.groups.aliases.list(optionalargs); receive typeerror: cannot call method "list" of undefined how can , update list of google apps groups aliases using google scripts? doing wrong sample? the alias property should capitalised. var result = admindirectory.groups.aliases.list(optionalargs);

gulp - Wait prev task before starting next tasks -

i'd create watcher watch files , compile them. i have 2 tasks : mincss compile i'd execute compile in first , wait end before executing mincss ... seem's not working. my code : var scsstocompile = [ './public/sass/themes/adms/adms.scss', './public/sass/themes/arti/arti.scss', './public/sass/themes/avantage/avantage.scss', './public/sass/themes/basique/basique.scss', './public/sass/themes/mairie/mairie.scss', './public/sass/themes/vehik/vehik.scss', './public/sass/themes/concept/concept.scss', './public/sass/themes/news/news.scss', './public/sass/components/*.scss', './public/sass/_functions.scss', './public/sass/_settings.scss', './public/sass/app.scss', './public/sass/bottom.scss' ]; gulp.task('compile', function(){ return gulp.src(scsstocompile) .pipe(sassglob()) .pipe(sass({includepaths: ['...

unable to checkout files in git directory -

i'm starting use git, , i'm having files , folders being modified , unable reset or checked out. have tried command they're still stuck unstaged changes! here config file: [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true ignorecase = true precomposeunicode = true autocrlf = false safecrlf = false eol = crlf i have tried checkout each file , reset hard, going on here? thanks do have .gitignore file somewhere in repository files? if file contains path/filename of file(s) want add, not succeed, because ignored.

pass column name in data.table using variable in a for loop in R -

i want loop through selection of columns data table , summarise data column. i'm able pass column name in variable using quote() , eval() , works fine library("data.table") dt <- data.table(x=c("b","b","b","a","a","c","c"), y = c("x","y","z","x","y","z","x"), v=rnorm(7)) splitby <- quote(y) sdt <- dt[,list(meanv = mean(v)),by=. (eval(splitby))] however when try put loop this library("data.table") dt <- data.table(x=c("b","b","b","a","a","c","c"), y = c("x","y","z","x","y","z","x"), v=rnorm(7)) mylist <- c("x","y") (i in mylist){ splitby <- quote(i) sdt <- dt[,list(meanv = mean(v)),by=. (eval(splitby))] } it doesn't wo...

VS 2015 Update KB3165756 missing or corrupt -

almost 2 weeks, keep getting error while installing "cumulative servicing release microsoft visual studio 2015 update 3 (kb3165756)". have inspecting various topics same problem on this, , lot of other websites, followed advises found , still, cant install update. list attempts : 1) reinstalling windows 10 - twice, 2) reinstalling visual studio 2015 enterprise/pro 10 times iso installer, 3) trying install target installer update, attempting "retry" downloading internet n times, 4) disabling antivirus, cleaning temp , system files 4) trying of above on 3 different machines. can hear make work, cause starts out of hand. thanks

html - ionic: how to change the size of FAB icon -

i new cross-platform dev. struggling changing size of fab. have now: <ion-fab center middle> <button ion-fab color="blue" class="fabstartbtn"><ion-icon name="start">start</ion-icon></button> </ion-fab> .fabstartbtn { font-size: 72px; } but size still same. how can access button attribute? tried id, name, #name, :before - didn't work. try use this: <ion-fab center bottom> <button ion-fab mini><ion-icon name="add"></ion-icon></button> </ion-fab> if use mini attribute can modify size this: .fab[mini] { margin: 8px; width: 40px; height: 40px; line-height: 40px; } if modify class can make fab button bigger or smaller.

java - Can't debug anything in eclipse "Source not found" -

Image
i can't debug since yesterday , don't know is. programs run fine, , there no error whatsoever. doesn't matter program debug, can make hello world-program , debugger wont start. get: source not found, confirm perspective switch if click yes; debugger info if click no, nothing happens. i've tried configuring debugger adding projects "source", doesn't it. :/ i've searched web more solutions nothing works me. if don't have source jar code you're trying step into, can't see code, because it's executable version. meaning, example, if you're trying debug code in json.jar file, should have json-source.jar can attach file can step , see what's happening. if can elaborate more on situation, might able more.

c# - When the mouse buttons are swapped in the OS, do the mouse click event handlers still work correctly with respect to which button was clicked? -

Image
working in it, encounter users left-handed , prefer use mouse left hand, , switch mouse buttons right button becomes "primary" instead of left button. here's configuration looks in windows: how affect .net applications (e.g. wpf, winforms, etc.) have code relies on specific mouse buttons? with wpf previewmousedown event , example, mousebuttoneventargs has changedbutton property yields mousebutton enum value. description left "the left mouse button." there nothing said "primary" or "secondary" buttons. similarly winforms mouseclick event , there mouseeventargs button property yielding mousebuttons enum ; description left "the left mouse button pressed.", , again there no mention of "standard" or "secondary" buttons. in fact, of documentation i've seen related mouse , buttons refer buttons location on standard mouse setup. none of documentation refers "primary" or "secon...

javascript - React Maximum Callstack when adding component -

i have list component getting information local json file if following works expected. import react 'react'; import casestudies './case-studies.json'; import casestudyitem './case-study-list'; const casestudylist = () => { const casestudyitems = casestudies.map( casestudy => { console.log(casestudy); return ( <div key={casestudy.name}>{casestudy.name}</div> ); }); return ( <ul> {casestudyitems} </ul> ); } export default casestudylist; the expected number of case studies printed out no problem. if replace div inside of casestudies.map statement following <casestudyitem key={casestudy.id} casestudy={casestudy} /> i "maximum callstack size exceed error" if add log statement in there shows spitting out hundred , hundreds of items. cause this? in case needed here casestudyitem component, blank testing purposes. import ...

c# - Error when creating a new record in asp.net Razor Engine -

i have 2 tables in database. first 1 mystudent , other 1 mycourse. use entityframework of .net , in visual studio created model called "bestmodel". here classes; mystudent.cs namespace tt.models { using system; using system.collections.generic; using system.componentmodel.dataannotations.schema; public partial class mystudent { [system.diagnostics.codeanalysis.suppressmessage("microsoft.usage", "ca2214:donotcalloverridablemethodsinconstructors")] public mystudent() { this.mycourse = new hashset<mycourse>(); } public int id { get; set; } public string name { get; set; } [foreignkey("mycourse")] public nullable<int> courseid { get; set; } [system.diagnostics.codeanalysis.suppressmessage("microsoft.usage", "ca2227:collectionpropertiesshouldbereadonly")] public virtual icollection<mycourse> m...

jquery - How do I set the character limit for .load -

i'm pulling in body of text page, want limit amount of characters .load event pulls. how control amount of characters pulled class ".paragraph"? here have far: $("document").ready(function(){ // blog descriptions $( ".blog-description-3" ).load( "/blog.html .blog-post:nth-of-type(3) .blog-content .paragraph"); }); you can't limit number of characters method pulls in. can manipulate returned string , cut needs substr() $(".blog-description-3").load("/blog.html .blog-post:nth-of-type(3) .blog-content .paragraph", function() { var txt = $(".blog-description-3").text().substr(0, 20); $(".blog-description-3").text(txt); });

string - What's the relationship between str and bytes in python? -

consider following typescript: >>> s = 'a' >>> isinstance(s, bytes) true >>> isinstance(s, str) true >>> isinstance(s, unicode) false >>> isinstance(s.decode('utf-8'), unicode) true how come s both str , bytes ? 1 of descendant of other one? how did run it? trying find description of decode method in docs. couldn't find str , able bytes . you looking @ wrong documentation. this equivalence true in python 2.7. there, bytes introduced alias str in order ease migration python 3. in python 3, str called unicode , bytes type called str . the documentation str.decode python 2 here .

wordpress - wp_cron scheduled but not firing -

i trying run background script fired on user action using wp_schedule_single_event, , although have confirmed event being scheduled , wp_cron recognizes scheduled time has passed, not fire event handler. further complicate things, code runs fine on local wp install, nothing on server. to schedule event, using: if ( ! wp_next_scheduled( 'my_action_name' ) ) { wp_schedule_single_event( time(), 'my_action_name' ); } my handler action defined as: add_action('my_action_name', 'my_action_handler'); function my_action_handler () { // stuff } i have testing wp core files , found following block (from wp-includes/cron.php:322) script terminates: var_dump('test1'); $cron_request = apply_filters( 'cron_request', array( 'url' => add_query_arg( 'doing_wp_cron', $doing_wp_cron, site_url( 'wp-cron.php' ) ), 'key' => $doing_wp_cron, 'args' => array( 'timeou...

android - Volley gives a Protocol Exception error, 21 too many followups -

this function call: public static void senddata(final integer type , final string url, final context context, final crudstatecallback back){ stringrequest jr = new stringrequest(type, url, new response.listener<string>() { @override public void onresponse(string response) { system.out.println(response.substring(0,100)); log.i("","wscalls response is: " + response); if(back != null) back.onresponse(200, response); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { log.i("","wscalls went wrong!"); error.printstacktrace(); string errors = "error null"; int code = 0; try { if (error != null) { errors = error.getmessag...

ios - XCode adds duplicate constraints? -

well, in code added 4 constraints. when run app, in ui debugger, shows additional 6 constraints? should clear these 4 added, dont know doing wrong? let leftconstr = nslayoutconstraint(item: image, attribute: .leading, relatedby: .equal, toitem: cell.contentview, attribute: .leading, multiplier: 1.0, constant: 0.0) let bottomconstr = nslayoutconstraint(item: image, attribute: .bottom, relatedby: .equal, toitem: cell.contentview , attribute: .bottom, multiplier: 1.0, constant: 0.0) let highthconstr = nslayoutconstraint(item: image, attribute: .height, relatedby: .equal, toitem: nil, attribute: .notanattribute, multiplier: 1, constant: 15) let widthconstr = nslayoutconstraint(item: image, attribute: .width, relatedby: .equal, toitem: nil, attribute: .notanattribute, multiplier: 1, constant: 50) cell.contentview.addconstraints([highthconstr, widthconstr, bottomconstr, leftconstr]) here screenshot of ui debugger https://i.stack.imgur.com/3fzc2.png maybe can try add line o...

Denied email permission with Facebook authentication through Owin -

how re-ask user accept email permission after denied? my code is: startup.auth.cs app.useexternalsignincookie(defaultauthenticationtypes.externalcookie); var facebookoptions = new facebookauthenticationoptions { appid = "0000", appsecret = "0000", backchannelhttphandler = new facebookbackchannelhandler(), userinformationendpoint = "https://graph.facebook.com/v2.4/me?fields=id,name,email,first_name,last_name,location", provider = new facebookauthenticationprovider { onauthenticated = context => { context.identity.addclaim(new system.security.claims.claim("facebookaccesstoken", context.accesstoken)); return task.fromresult(true); } } }; facebookoptions.scope.add("email"); app.usefacebookauthentication(facebookoptions); using helper class extract info need: /* have taken validation , error handling out */ public static class externallogin { pu...

python - Read csv while grouping rows -

i have csv file exported external application such 15/07/2008 2:48:53 pm measurement device:; dvp3445 field detector:; diode reference detector:; undefined scan mode:; continuous points [mm]: x; y; depth; normalized field; current field; ratio 0.0; -109.0; 20.0; 1.3; 0; 0.0 0.0; -108.7; 20.0; 1.3; 0; 0.0 0.0; -108.4; 20.0; 1.3; 0; 0.0 0.0; -108.0; 20.0; 1.3; 0; 0.0 0.0; -107.7; 20.0; 1.3; 0; 0.0 15/07/2008 5:28:50 pm measurement device:; dvp3445 field detector:; diode reference detector:; undefined scan mode:; continuous points [mm]: x; y; depth; normalized field; current field; ratio 0.0; -108.7; 40.0; 1.3; 0; 0.0 0.0; -108.4; 40.0; 1.4; 0; 0.0 0.0; -108.1; 40.0; 1.4; 0; 0.0 0.0; -107.8; 40.0; 1.4; 0; 0.0 0.0; -107.5; 40.0; 1.5; 0; 0.0 0.0; -107.2; 40.0; 1.6; 0; 0.0 0.0; -106.9; 40.0; 1.6; 0; 0.0 15/07/2008 5:28:50 pm measurement device:; dvp3445 field detector:; diode reference detector:; undefined scan mode:; continuous points [mm]: x; y; depth; normalized field; cur...

nested - How to implement “efficient generalized fold” in F#? -

in paper of martin et al. read efficient generalized folds nestet data types. paper talks haskell , want try in f#. so far managed follow nest example including implementation of gfold . type pair<'a> = 'a * 'a type nest<'a> = nil | cons of 'a * nest<pair<'a>> let example = cons(1, cons((2, 3), cons(((4, 5), (6, 7)), nil ) ) ) let pair (f:'a -> 'b) ((a, b):pair<'a>) : pair<'b> = f a, f b let rec nest<'a, 'r> (f:'a -> 'r) : nest<'a> -> nest<'r> = function | nil -> nil | cons(x, xs) -> cons(f x, nest (pair f) xs) //val gfold : e:'r -> f:('a * 'r -> 'r) -> g:(pair<'a> -> 'a) -> _arg1:nest<'a> -> 'r let rec gfold e f g : nest<'a> -> 'r = function | nil -> e | cons(x, xs) -> f...

Python shallow/deep copy error -

no, not duplicate. i have following classes: -board -player when player instantiated, creates new board object player. i have function switches current , latent players: from copy import deepcopy switch_players(self): temp_val = deepcopy(self.current_player) # self.current_player = none self.current_player = deepcopy(self.latent_player) # self.latent_player = none self.latent_player = deepcopy(temp_val) temp_val = none this works fine players' names when call self.current_player.name , when use self.current_player.board.display , or write it, references same board both players . i added code create deepcopy() of board switch this, i'm still experiencing same issue. fundamentally wrong way this? or approach correct, , should elsewhere in code? (i have way of doing this, i'm not understanding theory behind why current approach doesn't work.) it works so, because name string, board class instance copied, 1 level deeper, ...

Dynamic replyToEmail of receiver in Powermail (TYPO3) -

i need following setup receiver email in powermail 2: the receiver.sender email should noreply@mydomain.de , never email of user the receiver.replytoemail should email address of user sends form. i found possibility: plugin.tx_powermail { settings.setup.receiver { overwrite.sendername.value = myname overwrite.senderemail.value = no_reply@mydomain.de overwrite { replytoemail > # reply address replytoemail = text replytoemail.data = gp:tx_powermail_pi1|field|marker_w084sua5 replytoname = text replytoname.value = name } } } it works expected ... line: replytoemail.data = gp:tx_powermail_pi1|field|marker_w084sua5 has different in every form. have 50 forms , in every form marker variable email different. in examples found this: replytoemail.data = gp:tx_powermail_pi1|field|e_mail where e_mail should super global fields contains email of user. not work. is there possibility individual replytoema...

design patterns - How many rows to insert per notification in a notification system? -

following on this question looking @ building similar notification system , have question (which has obvious answer think i'd prefer have other opinions): if particular post generated million likes, , adds comment post, need notify million people liked post comment added. way achieve write million rows notificationread table has notificationid , 'send' them various users? i can't visualise other approach let me keep track of read notifications , potentially inserting million rows per post per notification sounds daunting , expensive. is there other way it? using sql server 2014 , application server coldfusion 2016 first off, if need push notifications, there's no escaping fact need somehow notify each of million users. don't need store notifications on server. one make reasonable assumptions: most activity occur on recent posts (say, posts less week old) most users not respond notification immediately with this, can skip storing no...

ios - GameOver screen position swift -

i have implemented game on screen pop when player loses, height in middle of screen images stretches edge of screen don't want do. want image offset screen slightly. have attached code game on screen below. height set need setting width. gameoverscreen = skspritenode(texture: gameoverscreentexture) gameoverscreen.position = cgpoint(x: self.frame.midx, y: self.frame.midy) gameoverscreen.size.height = self.frame.height / 3 gameoverscreen.zposition = 0 self.addchild(gameoverscreen) managed sort out. changed line: gameoverscreen = skspritenode(texture: gameoverscreentexture) to this: gameoverscreen = skspritenode(texture: gameoverscreentexture, size: cgsize(width: 600, height: 600))

Vba Excel picture pastes over text in outlook mail -

i new vba coding , i'm having issues macro. i'm trying copy range in excel picture outlook mail , add text in body well. however, code adding text , pasting picture on top of it. how can paste under text? here's code: dim outapp object dim outmail object dim myfilelist(1) string dim long set outapp = createobject("outlook.application") set outmail = outapp.createitem(0) set rngcopied = worksheets("daily volume summary").range("volumerange") myfilelist(0) = "y:xyz\sales.pdf" myfilelist(1) = "y:xyz\sales.xlsx" 'on error resume next outmail .to = "abc@xyz.com" .cc = "def@xyz.com" .bcc = "" .subject = "pbc daily sales " & format(date, "mm/dd/yyyy") .body = "good morning," & vbnewline & vbnewline & "attach daily sales report " & format(date, "dddd,mmmm,dd,yyyy") & "." & ...

Java stream file to socket as fast as possible -

i have file of bytes mybytes.dat , , i'm writing tcp server/client, server sends contents of mybytes.dat client on socket. if mybytes.dat read memory, application can send data @ 160mb/s on local network stack. however, i'm trying stream datafiles > 1gb, , shouldn't read memory. this related solution sending file in chunks seems appropriate; however, more efficient read large chunks of file memory (ie. maybe 1mb @ time in buffer) , write these smaller chunks (32kb) socket? if reasonable, how can 1 use bufferedfilereader read large chunks, , write smaller chunks outputstream? started, let me declare @ least variables: bufferedinputstream blobreader = new bufferedinputstream(newinputstream("mybytes.dat"), 1024*1024); outputstream socketwriter = socket.getoutputstream(); what correct way connect blobreader socketwriter, such maintain enough bytes in memory ensure application not limited disk reads? or offbase line of reasoning?

UnsatisfiedLinkError - com.datumdroid.android.ocr.simple couldn't find "libjpgt.so" -

i'm new android studios , doing ocr http://swlock.blogspot.com/2016/07/ocr-tesseract-2.html image convert text everytime take image app close , got error. can guide me fix error? thanks e/androidruntime: fatal exception: main process: com.datumdroid.android.ocr.simple, pid: 2425 java.lang.unsatisfiedlinkerror: com.android.tools.fd.runtime.incrementalclassloader$delegateclassloader[dexpathlist[[dex file "/data/data/com.datumdroid.android.ocr.simple/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.datumdroid.android.ocr.simple/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.datumdroid.android.ocr.simple/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.datumdroid.android.ocr.simple/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.datumdroid.android.ocr.simple/files/instant-run/dex/slice-slice_5-classes.dex", dex file ...

solr6 - Solr 6.1: UpdateRequestProcessor to Append to Field Name Based on Field Name -

the goal have field names match following schema of fields: <field name="_version_" type="long" indexed="true" stored="true" /> <field name="_root_" type="string" indexed="true" stored="false" /> <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="text" type="text_general" indexed="true" stored="false" required="false" multivalued="true" /> <dynamicfield indexed="true" name="*_is" stored="true" type="int" multivalued="true" /> <dynamicfield indexed="true" name="*_ls" stored="true" type="long" multivalued="true" /> <dynamicfield indexed="true" name="*_fs" stored="true" type="float...

selenium - Update response.body in scrapy(without reload) -

i use scrapy , selenium crawl! site use ajax pagination! actully , url no change , response.body no change! want click selenium (for pagination) , self.driver.page_source , use instead response.body! writed code : res = scrapy.http.textresponse(url=self.driver.current_url, body=self.driver.page_source, encoding='utf-8') print(str(res)) //nothing print! quote in res.css("#ctl00_contentplaceholder1_grd_dr_dxmaintable > tr.dxgvdatarow_office2003blue"): = i+1 item = dict() item['id'] = int(quote.css("td.dxgv:nth-child(1)::text").extract_first()) and no error ! you can replace body of original response in scrapy using response.replace() method: def parse(self, response): response = response.replace(body=driver.page_source)

c# - Saving data from a html form to List -

i have 2 create methods 1 decorated httpget , , other httppost . have create view first 1 looking : @{ viewbag.title = "create"; } <h2>create</h2> <form action="/" method="post"> <input type="text" name="txt" value="" /> <input type="submit" /> </form> the methods : list<string> mylist = new list<string> { "element1", "element2", "element3" }; public actionresult create() { return view(); } [httppost] public actionresult create(string txt) { //mylist.add(request.form["txt"]); mylist.add(txt); return view(); } i simly trying pass data form on button second create() , save mylist . i need advice on how make work. once you've fixed form (in you're posting application's default route (by default homecontroller.index() method)...

Cassandra - unable to parse list of Tuple with Java driver -

i trying access tuple data structure have stored in cassandra mapper. but, unable to. haven't found example online. this table , data have created. cqlsh:test> create table test.test_nested (id varchar primary key, address_mapping list<frozen<tuple<text,text>>>); cqlsh:test> insert test.test_nested (id, address_mapping) values ('12345', [('adress 1', 'pin1'), ('adress 2', 'pin2')]); cqlsh:test> cqlsh:test> select * test.test_nested; id | address_mapping -------+---------------------------------------------- 12345 | [('adress 1', 'pin1'), ('adress 2', 'pin2')] (1 rows) my mapped class(using lombok builder, getter, setter): @builder @table(keyspace = "test", name = "test_nested") public class testnested { @partitionkey @column(name = "id") @getter @setter private string id; @column(name = "address_mapping...

javascript - how to find the number of followers In Instagram through selenium web driver Java -

Image
i trying following code running out error "unable locate element" system.out.println(driver.findelement(by.xpath("//*[@id='react-root']/section/main/article/ul/li[2]/span/span")).gettext()) the following working out :-) system.out.println(driver.findelement(by.xpath(".//*[@id='react-root']/section/main/article/header/div[2]/ul/li[2]/span/span")).getattribute("title")); shorter xpath : system.out.println(driver.findelement(by.xpath("//span[@id='react-root']//span[@title]")).getattribute("title"));

shell - How to develop this sort script further -

i have small interactive unix script takes terminal command input chosen file type , upon receiving such iterates through large folder of unsorted files on desktop , pulls files of chosen selection new sorted folder. i.e. user types jpg in command , jpg files pulled out of unsorted folder , sorted folder. it works terrific stands, develop script further instead of file types being pushed communal sorted folder, have jpg files being pushed dedicated folderjpg, png files pushed in folderpng , docx files moved docxfolder. how can achieve such in leanest possible manner assuming these dedicated folders file types mentioned have been created on desktop. #!/bin/bash echo "good morning, please enter file type name sorting [enter]:" read extension mv -v /users/christopherdorman/desktop/unsorted/*.${extension} /users/christopherdorman/desktop/sorted/ if [[ $? -eq 0 ]]; echo "good news, files have been processed" fi i write way: read -p "goo...

html - CSS - unexpected floating issue -

Image
i learning floating elements in css , encountered following peculiar behavior. here code <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <style> #one { background-color: red; width: 200px; height: 200px; margin: 10px; } #two { background-color: yellow; width: 200px; height: 205px; margin: 10px; } #three { background-color: lightpink; width: 200px; height: 200px; margin: 10px; } #four { background-color: green; width: 200px; height: 200px; margin: 10px; } #five { background-color: coral; width: 200px; height: 200px; margin: 10px; } #six { background-color: #b1ffea; width: 200px; height: 200px; margin: 10px; } div{ /*display: inline-block;*/ float: left; vertical-align: central; } </style> </head> <body> <div i...

matrix - How to create nested data in R - Nest multiple columns in different categories -

my data looks this: > str(tab2) 'data.frame': 36 obs. of 22 variables: $ organisationunitname : factor w/ 38 levels "all ous","angola",..: 2 3 4 5 6 7 8 9 10 11 ... $ cd4_perform_result : num 24 6 7 1 1 1 5 3 2 1 ... $ cd4_participate_result : num 1 8 8 1 1 1 5 3 2 1 ... $ cd4_pass_result : num 1 4 19 1 1 1 5 3 2 1 ... $ eid_perform_result : num 2 1 7 1 1 1 1 9 1 1 ... $ eid_participate_result : num 2 1 5 1 1 1 1 8 1 1 ... $ eid_pass_result : num 2 1 5 1 1 1 1 7 1 1 ... $ vl_perform_result : num 2 1 3 1 1 1 1 9 1 1 ... $ vl_participate_result : num 2 1 7 1 1 1 1 7 1 1 ... $ vl_pass_result : num 2 1 7 1 1 1 1 7 1 1 ... $ hiv_perform_result : num 19 29 14 1 1 1 26 21 10 1 ... $ hiv_participate_result : num 19 28 14 1 1 1 22 20 4 1 ... $ hiv_pass_result : num 20 28 14 1 1 1 18 22 7 1 ... $ tbafb...

laravel - How can I search a paginator and find the page of an item? -

in application, have comment section each post , reply section each comment. since there can many comments, have setup 2 paginators: a comment paginator (?page=...) a reply paginator each comment (?comment-(id)-page=...) for purpose of redirecting specific comment or reply calling method, how can find position of comment in comment paginator , same replies? calling $post->commentpaginator()->currentpage() works inside views, how can perform search find exact page of item? a method such as: $post->getcommentpage($comment) (eg. 2) return page comment located @ convenient. assuming you're paginating timestamp, created_at , try following. public function getcommentpage($comment, $reply) { // how many items per page $repliesperpage = 10; // replies comment $replies = $comment->replies()->sortbydesc('created_at'); // find rely position id $position = array_search($reply->id, array_keys($replies->toarray(...

javascript - ng-model value $scope on controller is "undefined" -

on studies of ionic framework i'm learning controllers, so, got simple code html (above , below following code code generated ionic, didn't touch it) <div ng-controller="controller"> <ion-content> <img class="indeximg" src="img/saludoindex.jpg"> <br><br> <div class="item item-input-inset"> <label class="item-input-wrapper"> <i class="icon ion-at placeholder-icon"></i> <input type="text" placeholder="dirección de email" ng-model="mail"> </label> </div> <div class="item item-input-inset"> <label class="item-input-wrapper"> <i class="icon ion-locked placeholder-icon"></i> <input type="text...