Posts

Showing posts from June, 2011

c# - RestSharp ignores response charset encoding -

i'm using restsharp version 105.1.0 (.net 4.5.1) make rest call our own api. api sends responses following header of particular interest: content-type: application/json; charset=iso-8859-1 . can see, charset of response set iso-8859-1. i expect response restsharp uses encoding decode response content. however, when @ restresponse.content property, characters display �. far know means wrong encoding used. when try decoding rawbytes manually using proper encoding, correct string. i tried manually setting iso-8859-1 encoding property on restclient no avail. how can make sure responses restsharp decoded using right encoding? example code: // setting encoding here not change result var client = new restclient(myapiuri) { encoding = encoding.getencoding("iso-8859-1") }; var request = new restrequest(method.get); var restresponse = client.execute(request); console.writeline(restresponse.content) // outputs content string wrong encoding // characters display �

html - Footer sticked to bottom and geting issue with divs -

i have problem footer, want @ bottom of page , works when give fixed position property. don't want footer scroll screen. checked similar problems on stackoverflow , css sticky footer couldn't find 1 works me. html code: <!doctype html> <html> <head> <!--polskie znaki--> <meta charset="utf-8"> <!--responstywność--> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!--[if lt ie 9]> <script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script> <![endif]--> <!--arkusz styli--> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/superslides.css"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link href='https://fonts.googleapis.com/css?family=lato:100,200,300,400,700,900,300italic' rel=

asp.net - integrate radio button list item with text box -

Image
i have radio button , need add radio button followed text box please me integrate this(in aspx page) html content other `

Matlab Spearman Correlation PVAL = 0? -

i conducting spearman's correlation 2 data sets 300 objects. these variables , commands: a = [1:300] b = [1 2 5 11 9 7 24 10 31 23 3 40 6 17 14 20 16 12 33 46 70 37 87 43 98 26 59 58 77 100 35 42 78 80 243 36 33327 4 83 160 163 198 86 94 406 111 28 29 55 113 239 295 110 196 177 32679 229 342 305 300 254 96 210 514 167 172 232 190 117 32081 25 158 19333 241 82 149 159 66 178 24487 68 30 1016 725 266 391 638 348 320 681 242 319 228 381 408 442 202 369 471 821 191 426 8 270 211 2266 619 576 441 680 3431 1167 723 74 318 556 640 395 1059 579 614 212 325 437 323 687 373 599 26637 985 54 84 802 724 154 417 240 1120 818 2309 462 109 104 509 494 427 57 2475 549 396 419 123 580 79 225 1132 351 76 16859 596 862 315 470 992 257 120 409 751 832 285 1534 714 1665 1376 2129 678 416 721 209 31971 183 356 1346 1015 1003 188 1076 1634 608 1056 338 308 145 418 625 1313 121 2484 996 783 329 1185 697 157 1100 175 622 235 456 277 166 2700 1439 461 653 433 540 1191 234 774 1894 1004 741 1062 948 48

git - Github shows incorrect timestamp with commits even when system time is fine -

my github account shows commits time 9hours before actual time of commit. checked system clock , working fine. $> date wed jul 6 15:36:53 ist 2016 $> date +%z +0530 how can fix issue? shouldn't git taking system time commits?

php - Join subquery with doctrine and Symfony 2 -

i saw begining of answer in post zend : join subquery doctrine 2 dbal unfortunately can't manage work. tried aimfeld soltuion that: $qbaudio = $em->createquerybuilder(); $subselect = $qbaudio->select ('a.id_support id_support','sum(a.duration) dureetotale','count(a) nbaudio') ->from('mybundle:audioobject','a') ->groupby('a.id_support') ->where('a.type = :audio_type') ->getquery(); $qb = $em->createquerybuilder(); $qb->select('sp.ref1','sp.title1','count(i) nbimage','sp.nbsupportsaisi','sum(a.duration) dureetotale','count(a) nbaudio','a.sampling') ->from('mybundle:storage', 'st') ->leftjoin('p.sides','si') ->leftjoin('si.support','sp') ->leftjoin('sp.images','i') ->lef

javascript - How to insert a chart with data non-contiguous in Excel using API office.js? -

i know possible excel doing : '--------------------- set a1 = range(cells(10, 1), cells(20, 1)) set a2 = range(cells(10, 8), cells(20, 8)) u = union(a1, a2).address '------------- charts.add activechart.charttype = xlline activechart.setsourcedata source:=sheets('feuil1').range(u), plotby:=xlcolumns but possible office.js api ? thanks in advance ;-) due varying degrees of support creating such charts on excel desktop vs. online vs. ios vs. mac, apis not expose ability bind non-contiguous range. if have noncontiguous data, best bet copy sheet (which can hide if want) in contiguous fashion, in order in want data displayed. , create chart off of (just in regular excel, chart can on different sheet data range).

hadoop - Does single hive application(job) spawn multiple yarn applications? -

does single hive query gets submitted yarn creates multiple jobs (i.e. multiple yarn applications) ? here treat job , application same think in yarn context. from understand -- yarn creates application master (am) per 'application'. here single hive query can treated 'application'. so, resource manager create container on node , start in container. container in turn may create multiple 'tasks' (not applications) i.e. mappers , reducers within other containers reserved (on same or different node -- immaterial here). collection of these application masters engaged in solving single hive query submitted yarn. in fact that's why per application. since submitted 1 hive query, yarn point of view there 1 application. when fire below yarn command, should show me 1 application running:- yarn application -list is understanding correct? or if have several mappers , reducers spawned 1 hive query, multiple yarn applications invoked? you correct in begi

google cloud messaging - Android GCMNetworkManager not executing while device idle -

i've used gcmnetworkmanager schedule service runs every minute. it's working fine while device active, once phone goes idle, i'm getting mixed results. (i tested 3 devices today service running whole day, writes date/time file). galaxy s6, task fired around 4 hours, stopped until turned screen on. htc 1 m9, task fired on , off (but not consistently) around 3 hours, stopped until turned screen on. htc 1 m7, task stopped firing pretty after phone went idle , never ran again day. i want service run while idle, doing wrong? long periodsecs = 60l; // task should executed every 1 minute long flexsecs = 30l; // task can run -30 seconds scheduled time string tag = "task_scan"; periodictask periodic = new periodictask.builder() .setservice(myservice.class) .setperiod(periodsecs) .setflex(flexsecs) .settag(tag) .setpersisted(true) .setrequirednetwork(task.network_state_connect

Jquery UI sorting multiple table row at once -

i have problem jqueryui sorting. now have table sorting on tr , it's working, have sort 2 row @ once. in example below have sort row g1 or g2 or g3. now after having beaten head against wall hours i'm here ask help. queryui sort have option item , try use can't make itwork in table. there way that? can me? i try here https://jsfiddle.net/n29ekt42/ <table> <thead> <tr> <th>t1</th> <th>t1</th> <th>t1</th> </tr> </thead> <tbody> <tr> <td>g1</td> <td>g1</td> <td>g1</td> </tr> <tr> <td>g1</td> <td>g1</td> <td>g1</td> </tr> <tr> <td>g2</td> <td>g2</td> <t

Codeigniter ActiveRecord: Where Clause with custom string -

i search following string using ci active records. click on event or booking code use. my query follows: $this->db->selet("id"); $this->db->where("column_name", "click on event or booking code use."); $this->db->from("table_name") $ret = $this->db->get(); but doesn't work since ci escape string , produce select query follows: select id table_name column_name = 'click on event or booking code you would use.' is there workaround issue? this should work: $this->db->where("column_name = 'click on event or booking code use.'", null, false);

azure - Application Insights Logs Analysis -

i have event logs of application insights events logged , stored json in text files stored in blob storage. need find jsons customproperty meets criteria. number of hit jsons less (around 10 or 20), data logged large. suggestions how can accomplished efficiently? i have read in microsoft documentation hdinsights understand blob storage , efficient. relevant in scenario? if so, provide starting points. hdinsight, being hadoop-compliant implementation, technology logs analysis. being stated on appinsighs page telemetry well. "on larger scales, consider hdinsight - hadoop clusters in cloud. hdinsight provides variety of technologies managing , analyzing big data." on same page, may find information continuous export of appinsights telemetry azure blobs storage. next step use hdinsight analysis of that, need implement kind of algorithm. for uploading data hdinsight azure blob may see that link (and this querying). for understanding on logs processing pip

Android SharedPreferences not working -

i tring solve problem strange i have app working great in of testing devices, after factory reset on nexus 5, when try int sharedpreferences code level_maximo_alcanzado = sp.getint(sp_nivel_juego_maximo, 1); it give me string (but in nexus 5, in other devices give me int in nexus 5 causing exception java.lang.string cannot cast java.lang.integer ) if value of string code string prueba = sp.getstring(sp_nivel_juego_maximo, "1"); i value of 5t+sntivfha= i dont have idea why pass in nexus 5 after factory reset if can give tip follow awesome, lost @ point code - ( ctx context object) public static sharedpreferences sp; public static sharedpreferences.editor editor; if(sp == null) sp = ctx.getsharedpreferences(sp_name, context.mode_private); if(editor == null) editor = sp.edit(); editor.putint(sp_dinero, dinero); editor.commit(); additional info i tryed unistall app , reboot device i used obscuredsharedpreferences class encrypt them , i

python - Why exc_traceback returns None -

sys.exc_info() returns tuple (type , value, traceback). sys.exc_info()[2] our traceback object. why not catch exceptions traceback code: import sys try: 1/0 except zerodivisionerror: print sys.exc_info()[2].tb_frame.f_back tb_frame , f_back usage has been explained here: frame objects you see none because there no outer frame . you're executing directly, current frame last frame. demonstrate this, created demo.py : import sys try: 1/0 except zerodivisionerror: print sys.exc_info()[2].tb_frame.f_back which should familiar, , trivial caller.py : import demo now see difference: $ python demo.py none $ python caller.py <frame object @ 0x10bc34c20> in second case, there outer frame (i.e. caller.py ), don't see none .

node.js - How do I add a Request Model for a POST end point in serverless framework -

how add request model post end point appears in api gateway when export api ios? can manually add request model in aws, since deployed through server less need in there. see there's responsemodels defining endpoints, can't see requestmodels? my s-functions.json has this "endpoints": [ { "path": "blog/graphql", "method": "post", "type": "aws", "authorizationtype": "aws_iam", "authorizerfunction": false, "apikeyrequired": false, "requestparameters": {}, "requesttemplates": { "application/json": "{\"query\" : $input.json(\"$\")}" }, "responses": { "400": { "statuscode": "400" }, "default": { "statuscode": "200", &

Python 3: How do I determine the re-occuring sub-string/pattern within a string? -

i'm working on checkio coding problem involves decoding message. have find key given encrypted , decrypted message i've done; pythonpythonpythonpythonp however, when use same key try , decrypt message longer string fails can start again p, , not y. so, either need find way find substring python within key, or else continue above key starting y. i started off trying find each instance of initial letter of key , trying build string there on assumption each occurrence of first letter start of key.this problem on checkio marked simple i'm missing somewhere. here have doesn't seem terribly efficient , relies on key being single word repeated. falls on if letter repeated within phrase, e.g. checkiocheckioch fails. there better way of doing this? # assumes single word repetition in string def find_string(strtest): = [] x = [] y = [] b in range(0, len(strtest)): a.append(strtest[b]) c in range(0, len(a)): if a[c] == a[0]:

angular - Accessing Select element value in angular2 gives Error -

i'm using angular 2 rc4 view following: <select class="form-control" (change)="selecttestname=this.value;getchartdata()"> <option *ngfor="let st of selecttestnamelist" value="{{st.selecttestname}}">{{st.selecttestname}}</option> </select> after change throws following error: typeerror: cannot read property 'value' of undefined @ debugappview._view_generaltrnd0._handle_change_20_0 (generaltrnd.template.js:367) @ eval (eval @ <anonymous> (vendor.js:25), <anonymous>:316:24) @ eval (eval @ <anonymous> (vendor.js:45), <anonymous>:278:36) @ eval (eval @ <anonymous> (vendor.js:48), <anonymous>:20:93) @ zonedelegate.invoke (zone.js:323) @ object.oninvoke (eval @ <anonymous> (vendor.js:17), <anonymous>:45:41) @ zonedelegate.invoke (zone.js:322) @ zone.runguarded (zone.js:230) @ ngzoneimpl.runinnerguarded (eval @ <anonymo

python - Can a user belong to multiple organizations in github? -

i wondering if user can belong multiple organizations in github. in api, can iterator or organizations, leads me believe can. if true, i'm not sure how tell organization object when iteration on them (in python way). also, i'm using github3.py module. so recap, i'm wondering if user can in multiple organizations, , if yes, how can tell organization when iterating on list.

c# - How to pass an object from the application which hosts the WorkflowApplication to a NativeActivity -

i need talk wf activity host application. host application consists of multiple libs. 1 of libs starts workflowapplication activity contains custom nativeactivity. you use extensions that. register custom class used communicate host. class can expose methods outputs data, example write data console. see http://www.dotnetfunda.com/articles/show/1091/workflow-foundation-40-extension introduction.

fancytree folders never collapse -

fancytree folders never collapsed. children , parents displayed without correct nesting structure. when copy exact same data works in text data source, instead web2py (python) controller folders not collapse display permanently expanded. no js console errors in browser. original data works in text file fancytree copies data python contoller this json_list = [{ "alexlink": "http://example.com/", "kind": "tasks#task", "id": "mtywnzeznjc2oteymdi1mzcwnzm6oduwnjk4ntgzojexmtkyodk2mja", "etag": "\"4qycalf1j510t_-i20nambuhf2k/ltezntgzmtmzodg\"", "title": "task 01", "updated": "2015-04-23t19:25:44.000z", "selflink": "", "position": "00000000002147483647", "status": "needsaction" }] i convert json: json_list = json.dumps(json_list) then use source: // initialize fancytree

node.js - Angular2 ExpressJs - File upload to the server -

angular-2 trying upload files server. following code uploads file server, how can link mongodb documents ? when file uploaded want link specific document. also how can provide link in ui download uploaded file server ? component.ts @component({ selector: 'aptcontent', template: ` <div> <input type="file" (change)="filechangeevent($event)" placeholder="upload file..."></div> <div > <a (click)="upload()">upload docs</a> </div> `, directives: [router_directives] }) export class aptcontentcomponent implements oninit { data: any; filestoupload: array<file>; constructor(private apartmentservice: apartmentservice, private sharedservice: sharedservice, params: routeparams) { this.filestoupload = []; } ngoninit() {} upload(){ console.log('upload button clicked'); thi

ios - application:openURL:sourceApplication:annotation: is not getting called in iOS8 -

i upgraded googlesignin sdk 2.4.0 4.0.0. app works fine in ios9. in ios8.4(which current testing in) after successful login gets redirected app, neither application:openurl:sourceapplication:annotation: nor application:didfinishlaunchingwithoptions: getting called. receiving warning < firanalytics/warning > implementation of application:openurl:sourceapplication:annotation: not found. please add handler app delegate. class: clevertapappdelegatesurrogate but have implemented methods. have idea? read docs , nothing specific mentioned. missing support ios8 well? #if __iphone_9_0 - (bool)application:(uiapplication *)app openurl:(nsurl *)url options:(nsdictionary *)options { return yes; } #else - (bool)application:(uiapplication *)application openurl:(nsurl *)url sourceapplication:(nsstring *)sourceapplication annotation:(id)annotation { return yes; } #endif would direct me in right way? in advance. by using xcode version 7.3. clevertap o

Batch file renaming -

i come little problem :'( : have many txt files , more , more day , need make back-up of them , encrypt them safety reasons made batch script : @echo off /r d:\txtwork %%g in (**.txt **.trt) ( certutil -f -encode "%%g" "%%g.bak" echo. >>d:\txtwork\logs\logbak1.txt %time:~0,-6% - made back-up of file - "%%g" ) ok works want make batch decode them , change extension old 1 (from .txt.bak or .trt.bak .txt or .trt ) tried , made : @echo off /r d:\txtwork %%g in (**.bak) ( certutil -f decode "%%g" "%%g:~0,-4" ) but didn t work tried @echo off /r d:\txtwork %%g in (**.bak) ( set var_1="%%g" certutil -f decode "%var_1%" "%var_1:~0,-4%" ) it didn't work either. ? "%%g:~0,-4" totally wrong; to retrieve value of var_1 variable need enable delayed expansion , use !var_1! instead of %var_1% although doing bring problem: certutil -f decode "!var_1!&

c# - How to make a GET RESTful Request -

i need include curl -h 'context-type:application/json' within url not sure how this, server responce far 404, appreciated, private string requestvehicledata() { string make = ""; string postcode = ""; string registration = (string)(session["regno"]); make = txtmake.text; postcode = txtpostcode.text; //make request var httpwebrequest = (httpwebrequest)webrequest.create(string.format("https://www.check-mot.service.gov.uk/api/v1/mot-history/{0}/{1}/", registration, make)); httpwebrequest.contenttype = "application/json"; httpwebrequest.method = "get"; //get response var httpresponse = (httpwebresponse)httpwebrequest.getresponse(); using (var streamreader = new streamreader(httpresponse.getresponsestream())) { var

Swift - How do I display portions of an hour? -

i have label i'm updating every second shows hours 100ths of hour("1.67", etc.). i'm trying show correctly, having trouble. second = 781 let timeworked = float(second/3600) let timeworkedinhours = (string(format:"%.02f", timeworked)) timeworkedlabel.text = "\(timeworkedinhours)" i've tried few things, nothing has worked yet. solutions? i guess second defined int . define double instead. can rid of float cast too: var second: double = 0 // ... let timeworked = second / 3600.0

In order to make your app's UI compatible with all the devices like tablets,phones or watches which unit is preferred in android? -

i have used dp in xml. it's not giving me accurate ui. for sure dp adequat unit accomplish goal. there in addition that, have define several values folders define dimensions scaling tablets or phones. e.g. define 2 values folders like: values-large values-xlarge now define dimen.xml file inside folders, can put measurements in (unit dp) corresponding screensize. define measurement this: <dimen name="value1">17dp</dimen> then embedd sizes in layout xml, like: android:layout_height="@dimen/value1" depending on screensize, system load correct measurements folders, e.g. if have screen size large defined values in folder values-large loaded. more information, have @ https://developer.android.com/distribute/essentials/quality/tablets.html

php - mysql select statement to pick only newly inserted records after cron job run -

i want select , use new records have been inserted between cron job runs , next run. in sense don't repeat data or records worked on earlier. from select statement below, please direct me, thank you. // select statement should pick fresh records after first cron $sql = "select name,amount, trans_id, msisdn, time_paid customer"; $result1 = mysqli_query($conn, $sql); $resultarr = mysqli_fetch_assoc($result1); // fetch data $name = $resultarr['name']; $amount = $resultarr['amount']; $transaction_id = $resultarr['trans_id']; $date = $resultarr['time_paid']; this important because data used send sms , don't want send sms twice someone. kindly, anyone? if want details of newly inserted data, add new column in table add_date . check add_date equals current date. if yes details of every day's new date. can use below code. $today = date("y-m-d"); $check_new_data = mysql_query("select name,amount, trans_i

Excel VBA - delete recent entry after MsgBox -

i'm struggling excel-vba-code work. want button pop after text entered cell. here, yes leads row being locked , cell being time-stamped, want cancel lead cell entering text being cleared of content. i can't figure out way delete recent entry. can delete activecell, not recent cell (say write text in a1 , press enter, active cell a2 - or if write text , press somewhere cursor, active cell god knows what). i hope can me this. best regards christian private sub worksheet_change(byval target range) if target.column = 2 application.enableevents = false dim ret_type integer dim strmsg string dim strtitle string strmsg = "do approve?" & vbcrlf & "warning: action lock current row." strtitle = "approval" ret_type = msgbox(strmsg, vbyesno + vbquestion, strtitle) select case ret_type case 7 msgbox "your input deleted." exit sub case 6 cells(target.row, 3).value = date + time application.enableevents =

android - SHA-1 already used Google Sign In -

we trying release google sign in in android app. tested app in using debug keystore works fine. when trying release production adding release sha1 here unable add following error: the sha-1 specified used same package name different android oauth2 client. but create android key & webclient not androidclient. but sure there have deleted clientids in 3 accounts , tried adding it. same error. checked projects multiple times in vain. also checked questions on no solution. please help. according answer: the signing fingerprint specified used android oauth2 client remember deleting project takes 7 days remove it. also mentioned in google support article: https://support.google.com/cloud/answer/6251787

angular - Do aux routes work for the root component only? -

Image
i'm having trouble setting auxiliary routes in child components, reason auxiliary routes work start @ root component. here's router setup export const routes: routerconfig = [ { path: 'test1', component: test1component }, { path: 'test2', component: test2component, outlet: 'aux'}, { path: 'shell', component: shellcomponent, children: [ { path: 'department/:id', component: departmentdetailcomponent }, { path: 'test3', component: test3component, outlet: 'aux2' } ] } ]; if navigate to http://localhost:3000/shell/department/1(aux:test2) then output expected, is, test2component rendered inside appcomponent , along shellcomponent , departmentdetailcomponent : primary outlets show in blue, auxiliary outlets in red. if, however, try navigate to http://localhost:3000/shell/department/1(aux2:test3) i error message: platform-browser.umd.js:1900 exception: erro

Rails API with Grape, polymorphic: true, touch: true is not working -

i developing rails 4.2.6 api app number of polymorphic associations, problem touch: true not show updated object. class post < activerecord::base belongs_to :postable, polymorphic: true, touch: true end class event < activerecord::base has_many :posts, as: :postable end class agenda < activerecord::base belongs_to :event, touch: true has_many :sessions, through: :days, class_name: 'agendasession' end class agendaday < activerecord::base belongs_to :agenda, touch: true has_many :sessions, class_name: 'agendasession' delegate :event, to: :agenda end class agendasession < activerecord::base belongs_to :agenda_day, touch: true delegate :event, to: :agenda_day has_many :posts, as: :postable end i trying retrieve event's attribute 'hashtag' through post.postable. sake of argument lets have event hashtag: '#rock_events' , session belongs same event. @event_post = event.first.posts.first @session_post = agenda

ruby - Sensu and Graphite. Configure transmission through AMQP -

i want use sensu monitoring system , graphite backend graphics. i wish configure sensu receiving data rabbitmq via amqp protocol that's why configured carbon in such way: # vim /etc/carbon/carbon.conf # enable amqp if want receve metrics using amqp broker enable_amqp = true # verbose means line logged every metric received # useful testing amqp_verbose = true amqp_host = 10.0.3.16 amqp_port = 5672 amqp_vhost = /sensu amqp_user = sensu amqp_password = kubuntu710 amqp_exchange = metrics_my amqp_metric_name_in_body = true per understanding carbon frequency requests data rabbitmq (via amqp) , save via whisper. on other side sensu saves metrics in rabbitmq, configured in next way: root@sensu_server:/etc/sensu/conf.d# vim graphite_handler_amqp.json { "handlers": { "graphite_amqp": { "type": "transport", "pipe": { "type": "topic", "name": "metrics_my&quo

jquery - Page refreshes on input form field Touch Events - Android, Samsung -

hey guys trying trouble shoot issue seems happening on android devices version 5 or older. what happens is, when touch input field email-address or password login, page refreshes makes impossible ever enter information. this not limited fields, form fields in application. have leave feedback page , form field refreshes page. i had assumed having same issue disabling android's chrome pull-down-to-refresh feature none of solutions seem working me , can't figure out happening. the information on android device: samsung galaxy tab version 5.0.2 happening on firefox, , chrome on device. i little new debugging on android , not find version of touch device using. we using jquery mobile front-end , bootstrap javascript/css forms. so found out, whenever screen resizes refresh event new screen size. what happening on android had css property ` orientation: landscape on landscape mode. happening click form field on android keyboard fires , resizes

apache spark - filtering two RDD in pyspark -

i want simple filtration here rdd are rdd1 = [96,104,112] rdd2 = [112, 30, 384, 96, 288, 352, 104, 368] so result should rdd contains elements rdd2 not in rdd1 so , rdd3 = [30,384,288,352,368] how should achieve this i tried one, rdd3 = rdd1.map(lambda r: r != r in rdd2) but not working. how solve this, thanks in advance you can use subtract method which: return each value in self not contained in other. rdd1 = sc.parallelize([96,104,112]) rdd2 = sc.parallelize([112, 30, 384, 96, 288, 352, 104, 368]) rdd2.subtract(rdd1).collect() ## [384, 352, 368, 288, 30]

c# - Using PostMessage to send Unicode characters -

i using postmessage send input flash object in application. works fine until try send unicode character. in example: michael’s book the apostrophe not that, not ascii 39, rather unicode u+2019. time sent across 1 character @ time, lost unicode value , lands raw characters making unicode michael’s book if copy , paste window moves fine, , if load text file window loads fine. receiving window able receive unicode, way sending must not correct. appreciated. private void sendkeystoform(string message) { (int = 0; < message.length; i++) { postmessage(hwnd, wm_char, (intptr)message[i], intptr.zero); } } per msdn documentation , send unicode, need use postmessagew . it's same method signature, import name postmessagew , execute that. update as hans stated, better approach set charset of dllimport : [dllimport("user32.dll", charset=charset.unicode, setlasterror=true)] private static extern bo

r - Delete grouped rows from a dataframe -

i have dataframe 48503 rows. dataframe has multiple user ids can make multiple simulations or 1 , way tell looking @ time difference between simulations user did. if difference in time on 20 secs long assume guy simulations done in different sessions. i want make new column session number of simulation each user (id) (simulation number) (simulation-time-difference) (session) 1 0:00:00.00 1 2 0:00:08.22 1 3 0:00:20.67 2 4 0:00:05.38 2 b 5 0:00:00.00 1 b 6 0:00:03.32 1 b 7 0:00:28.45 2 here 1 method using ave , cumsum after extracting seconds: # extract seconds df$seconds <- as.numeric(gsub("^0:00:([0-9]{2}\\.[0-9]{2})", "\\1", df$v3)) # calculate session number df$session

java - Android Object Serializes itself from method -

i need , object containing settings in primitive types able load , save , android shared preferences calling load or save method object. i have created class called thepreferences.java, class has few primitive fields. have created 2x methods within class load , save class , sharedpreferences. see below code used in class: import android.content.context; import android.content.sharedpreferences; import com.google.gson.gson; import com.google.gson.jsonserializer; import android.content.sharedpreferences; import android.support.v7.app.appcompatactivity; import android.util.log; import java.io.serializable; public class thepreferences extends appcompatactivity implements serializable { private static final string prefs_name = "thepreferences"; private static final string pref_text = "pref_text"; public static final string tag = "wpc"; public boolean loggedin = false; public int deviceid = 0; public int userid = 0; publ

git - How to maintain repositories into a single repository -

i have repository each micro-services ('a', 'b', ..). structure of repository looks : a |-dockerfile |-src |-java |-groovy since of these repositories belongs project called 'wholeproject', want maintain repository 'wholeproject' looks : wholeproject |-docker-compose.yml |-µs |-a |-b |-.. so maintain docker-compose file , repository contains revelant things project. is idea ? how can perform ? you consider using git submodules with: cd /path/to/wholeproject git submodule -- /url/to/repo/a µs/a git submodule -- /url/to/repo/b µs/b that way, can clone wholeproject a: git clone --recursive and a , b @ last recorded sha1.

html - Why .doc automaticly downloads, but not shown in <iframe>? -

the problem - when input url .png or .pdf has been shown in iframe>. can scroll it, read etc. when insert url has docx or xls file (ex. " http://www.exampleimage.docx ") - automatikly aploads browser, , not shown in iframe>.but want see content of .docx file in iframe pdf. or search guys? here part of code: <iframe src={{attachmenturl}} width="468" height="468" frameborder="0"> click on attachment please. </iframe>