Posts

Showing posts from February, 2012

javascript - Why facebook does not use public key to encrypt password before sending it to the server? -

Image
as shown in screen shot above facebook showing users password in request headers. i curious know why facebook not hiding password using public key. edit: even if work of https encrypt data https can broken using fiddler applications. what's wrong in encrypting password before sending server? as @wizkid have commented password encrypted using https before sent browser, console checking in gets data before encrypted. can try using tool fiddler see sent

angularjs - Convert json object in to array to iterate through ng-repeat using Javascript? -

this question has answer here: what easy way convert object in array angular js? 3 answers here sample json , getting json obj firebase have convert list in array bind in html trough ng-repeat. my json object is { "cats1": { "name": "cricket", "imgurl": "some url", "list1": { "bat": { "name": "bat", "imgurl": "some url", "price": "$100" }, "pads": { "displayname": "pads", "imgurl": "some url", "price": "$50" } } }, "cats2": { "name": "football", "imgurl": "some url" } } how required this array structure re

c# - How to find word hyperlink with OpenXML -

am trying fetch hyperlinks address word document every paragraph using openxml . public static string getaddressfrompara(paragraph paras) { ienumerable<hyperlink> hplk = paras.descendants<hyperlink>(); if (hplk != null) { foreach (hyperlink hp in hplk) { //string address = ???????; } } } i believe should foreach (hyperlink hp in hplk) { hyperlinktext = new stringbuilder(); foreach (text text in hp.descendants<text>()) hyperlinktext.append(text.innertext); hyperlinkrelationshipid = hp.id.value; externalrelationship hyperlinkrelationship = doc .maindocumentpart .externalrelationships .single(c => c.id == hyperlinkrelationshipid); hyperlinkuri = new stringbuilder(hyperlinkrelationship.uri.absoluteuri); }

java - Exception in thread "main" org.postgresql.util.PSQLException: ERROR: relation "ActivitySession" does not exist -

i have function in postgres parse json records called thirdpartydataparse() , looks below create or replace function thirdpartydataparse() returns text $$ declare sessionid no scroll cursor select asn."id",asn."userid",asn."activityid",pd."datasourceid",ad."dump" "development"."activitysession" asn inner join "development"."persondatasource" pd on pd."userid" = asn."userid" inner join "development"."activitysessiondump" ad on asn."id"=ad."activitysessionid" asn."createdat" between now() - interval '5 days' , now() , pd."datasourceid"=1 read only; titles text default ''; rec record; jsonrec record; begin open sessionid; loop fetch sessionid rec; if not found exit ; end if; if rec."activityid"=1 , rec."datasourceid"=1 execute 'select $1::json#&

ibm mobilefirst - unable to call a java class from HTTP Adapter in Worklight Liberty server -

we developing mobilefirst hybrid banking application. implemented encryption mechanism. request mobile client encrypted , sent server , @ worklight adapter request dectypted using rsa. decryption process have used java class decryption process. http adapter method i'm directly calling java class passing request parameter following function decryptrequest(param){ var result = com.myapp.decrypt.decrypt(param); wl.logger.error("result "+result); return { result:result }; } the above thing working fine on standalone worklight server(on desktop worklight server). problem when put java class on worklight liberty profile server(which uat box) i'm getting error [error ] fwlse0099e: error occurred while invoking procedure [project myapp]businessadapter/parsereqestfwlse0100e: parameters: [project myapp] typeerror: cannot call property decrypt in object [javapackage com.myapp.decrypt]. not function, "object". i have java c

excel - VBA how to remove string line in pragraph? -

for example , want remove string in line 10 below . vba code can use? limitation: quality metrics not available limitation cause: https connection service bearer: lte data radio bearer: lte impairment free: yes is multi rab: no lte serving cell count average: 1 number of video session interruptions: 0 maximum duration of video session interruptions: 0.0 s total duration of video session interruptions: 0.0 s clip length: 100.704 s the simplest approach go menu developer, click "record macro" , action want (that remove string in row 10). click "stop recording", click "macros", select macro1 , click button edit. new window opens vba code recorded. in case code sub macro1() range("a10").select selection.clearcontents end sub this start. can play code , further adjust needs.

outlook - How to delete pst file after deleting store using c# -

i m removing store , delete .pst file associated it. developing vsto addin, in once user logout delete .pst file created it. again when user login, create new store , new .pst file associated it. pst provider keeps pst file open 30 minutes (or until process terminates) performance , sharing purposes after removed profile. you might want play registry key mentioned in http://support.microsoft.com/default.aspx?kbid=222328 make sure file closed sooner. if temporary pst file end user not need see, can create auxiliary exe processes pst. after process exits, pst file can deleted. note need use extended mapi (c++ or delphi only) or redemption (any language, use rdosession . logonpststore ) outlook object model calls still marshalled outlook.exe address space addin running.

r - How can I actually see the raw query generated by DBI::dbWriteTable? -

i wondering if there way retrieve sql query dbwritetable sends dbms. example, following example. there way query? library(dbi) con <- dbconnect(rsqlite::sqlite(), ":memory:") dbwritetable(con, "mtcars", mtcars[1:10, ]) dbdisconnect(con) edit: 2016-11-11 as postgres user, interested in commands sent using rpostegresql . following @krlmlr, figured there function postgresqlcopyindataframe which calls c function rs_postgresql_copyindataframe . hit dead-end here c beyond skills. ideas welcome... the development version of rsqlite , hit cran, uses dbi::sqlcreatetable() . function returns sql creates particular table: con <- dbconnect(rsqlite::sqlite(), ":memory:") sqlcreatetable(con, "mtcars", mtcars[1:10, ]) dbdisconnect(con) for other drivers method definition in driver's source code, e.g., via showmethods("dbwritetable", includedefs = true) , proceed there.

Scala & Spark: Limitations of IntelliJ IDE's "Evaluate Expression" window -

i ran across unexpected behaviour in intelli j ideas ( v.2016.2 ) "evaluate expression" window: while works, both compiled code , using "evaluate expression" window val df1 = spark.read.json("/examples/src/main/resources/people.json") df1.columns.foreach(println) // outputs "age" , "name" console another dataset[row] ( dataframe ) involves columns generated expressions works compiled code, while in "evaluate expression" window following exception displayed: com.intellij.debugger.engine.evaluation.evaluateexception: type mismatch can't assign org.apache.spark.sql.dataset scala.runtime.objectref both dataframes of class class org.apache.spark.sql.dataset . according intelli js documentation limitations are: a method can invoked within expression evaluation dialog if debugger has stopped @ breakpoint, has not been paused. expression evaluation can "single-level". in other words,

Use of function application operator in Haskell -

what following expression means in haskell? ($ 3) ghci shows following type ($ 3) :: num => (a -> b) -> b. ($ 3) section, , equivalent \f -> f 3 , takes function argument , applies 3. if considered 3 integer, have type of f int -> b (for b ), type of ($ 3) (int -> b) -> b . things in haskell bit more complex, since 3 can of numeric type, don't need f :: int -> b , it's enough if f :: -> b a numeric type. hence ($ 3) :: num => (a -> b) -> b .

python - ufunc.at for cases where target indices are unique (buffered call possible then) -

i use ufunc.at similar sparse matrix multiplication or better, flow in graph. c[:, 0] denotes target index each element denoted source index c[:, 1] summed up c = np.array([[0, 1], [0, 2], [1, 1]) # sum 1 , 2 0, , 1 1 src = ... # source vector targ = ... # target vector, not 0 in beginning np.add.at(targ, c[:, 0], src[c[:, 1]]) # sum bins one write: targ[c[:, 0]] += src[c[:, 1]] that approach work if target indices c[:, 0] unique, else there sort of race conditions. expect, bit faster because not need care accumulation internally, can 'one shot' addition, way more efficient when comes vectorization. numpy calls buffered/unbuffered operation. is there similar syntax buffered version unique target indices? (basically convenience , more consistently looking code.)

redshift jdbc driver not returning SQL line numbers in errors -

i'm building small sql client amazon redshift, , want display line number when there sql syntax/semantics error. problem redshift's jdbc driver doesn't seem return position or line number (i'm using redshiftjdbc42-1.1.17.1017). my code extracting syntax error message looks this: try { preparedstatement statement = conn.preparestatement(sql); resultset rs = statement.executequery(); ... } catch(sqlexception ex) { if(ex.getcause() instanceof errorexception) { //redshift error errorexception e = (errorexception)ex.getcause(); // no line numbers :( // e.getcolumnnumber() returns -1 // e.getrownumber() returns -1 return e.getmessage(); } return ex.getmessage(); } this returns messages like: invalid operation: relation "user" not exist; but display: invalid operation: relation "user" not exist; (line 9) any ideas/suggestions?

vb.net - Install WIndows updates on remote computer using WUApiLib -

i succesfully able update windows locally unauthorized exception when update remotely. updating windows service running system account perform impersonation before calling methods. type of impersonation use works other remote options. is there special wuapilib , remote calls? dim t type = type.gettypefromprogid("microsoft.update.session", strhostname) try session = ctype(activator.createinstance(t), updatesession) catch ex unauthorizedaccessexception throw new exception("not allowed access: " & strhostname & " - please use credential.") catch ex exception if ex.message.contains("800706ba") throw new exception("wrong hostname or firewall not open. https://msdn.microsoft.com/en-us/library/windows/desktop/aa387288(v=vs.85).aspx") else throw ex end if end try

Simple Socket Server-One Client communication - Python -

i having problems code in simple one-client -- server communication. running local machine (desktop pc) seems run fine, but, when used desktop server , laptop client getting winerror 10061... "no connection made because machine actively refused it" i followed advice other questions here , this question , here still have questions. code below: server: import socket s = socket.socket(socket.af_inet, socket.sock_stream) s.bind(("myipaddress", 4000)) s.listen(5) . . . #rest of code client: import socket s=socket.socket(socket.af_inet, socket.sock_stream) host = "myipaddress" s.connect((host, 4000)) . . . #rest of code what want server detect , bind client's ip address, , client connect server without having specify ip address. possible? worked following ways: putting in bind (server.py) , connect(client.py) ip address. putting ip address in client , using socket.gethostname() in server it didn't work with: bi

java - Apache websocket reverse proxy -

i have implemented apache websocket api in project, working fine on local. on http , https, when moved project upper environment don't use ip address of machines directly instead refer them using url. earlier used open websocket connection follows websocket = new websocket("ws://myapp(ip)/endpointname"); or websocket = new websocket("wss://myapp(ip)/endpointname"); but after moving on other evironments it's not working anymore there might part of reverse proxy (i dont know apache server sertup). have included ws_tunneling module web socket reverse proxy work. still not able find proper solution. what want is, should able open web socket using websocket = new websocket("wss://myapp.com/endpointname"); have tried following links ws_tunneling , ws_tunneling please let me know

sql server - sql query to delete and return message -

i want write thing query: begin declare @unaloacte varchar(200); declare @total int; declare @flag int; set @unaloacte =( select count(pd.propertydetailid) propertydetail pd join sitedetail sd on pd.sitedetailid=sd.sitedetailid pd.customerid<1 , pd.sitedetailid=27); set @total= (select count(propertydetailid) total_count propertydetail sitedetailid=27) ; if( @unaloacte = @total) delete , display message print"delete"; else print"not able delete" end i hope understand problem. you can try this: declare @msg varchar(200) if( @unaloacte = @total) begin begin tran delete select @msg = cast(@@rowcount varchar(10)) + ' deleted' raiserror (@msg, 0, 1) nowait commit end else begin select 'not able delete' end also recommend use begin tran , commit if going use in production.

Custom Animation Component Ionic 2 RC0 and Angular 2 -

since moving ionic 2 rc0, i'm trying create custom component animate list of objects in ngfor loop. here code component. import { component, trigger, keyframes, animate, transition, style, ngzone } '@angular/core'; @component({ selector: 'animation-target', templateurl: 'animation-target.html', animations: [ trigger('zoomin', [ transition('inactive => active', animate(1000, keyframes([ style({ transform: 'opacity(0) scale3d(.3, .3, .3);', offset: 0 }), style({ transform: 'opacity(1)', offset: .50 }), ]))), ]) ] }) export class animationtarget { title = 'app works!'; public zoomstate: string; constructor(public zone: ngzone) { } triggeranimation() { this.zoomstate = "active"; } reset() { this.zone.run(() => { this.zoomstate = "inactive";

sql - How to connect to database with specified Security Identifier SID using SQLCMD -

i can't find how connect database specified security identifier sid using sqlcmd. right have this: sqlcmd -s serverip,port -u username -p password is there possibility put sid there? without can not connect. thanks help!

javascript - Closing a div when clicking on a button which is inside of the same div -

make simple answer unable me make work... title says maybe can me out. _doc.on('click','.settings',function() { $('.icon-bar').fadein(200); }); _doc.on('click','.close_btn',function(e) { $('.icon-bar').hide(e.currenttarget.id); $('.icon-bar').fadeout(200); }); the button opens called 'settings' , 1 should closing div called 'close_btn'. let me try explain. when user clicks on button our event trigger _doc.on('click','.close_btn',function(e) { }); here can use closest() _doc.on('click','.close_btn',function(e) { jquery(this).closest('div').hide(); }); if want use class selector _doc.on('click','.close_btn',function(e) { jquery(this).closest('.parent_div').hide(); }); it hide button , parent element class="parent_div". let me know if more explanation needed.

ios - how to display Tab Bar Controller in all UIViewControllers -

Image
my iphone app display tab-bar 3 tabs on button click. works fine initial 3 uiviewcontrollers. when try push new uiviewcontroller within tab, tab bar disappears. tried other solution mention here http://stackoverflow.com/questions/31087181/tab-bar-controller-is-not-in-all-uiviewcontrollers see blank space no tab bar options... i tried without navigation pushing uiviewcontroller normal way. pushing uiviewcontroller tab bar (having navigation controller uiviewcontroller ) of ways not giving me desired result. not want 2 navigation item or pushing new view without tab bar. all uiviewcontroller's should display within 1 navigation , tab bar. please help note: load tabbar click of button on home uiviewcontroller like -(ibaction)btnreceivepressed:(id)sender { tabbarviewcontroller *about_vc = (tabbarviewcontroller*)[[uistoryboard storyboardwithname:@"main" bundle:[nsbundle mainbundle

Ruby sort by hash and value -

i have data this: hash_data = [ {:key1 => 'value4', :sortby => 4}, {:key1 => 'valuesds6', :sortby => 6}, {:key1 => 'valuedsd', :sortby => 1}, {:key1 => 'value2_data_is_here', :sortby => 2} ] i want sort key sortby hash_data = [ {:key1 => 'valuedsd', :sortby => 1}, {:key1 => 'value2_data_is_here', :sortby => 2}, {:key1 => 'value4', :sortby => 4}, {:key1 => 'valuesds6', :sortby => 6} ] i have tried using bubble sort, there inbuilt function in hash class such purposes? enumerable# sort_by rescue: hash_data.sort_by { |hash| hash[:sortby] } #=> [{:key1=>"valuedsd", :sortby=>1}, {:key1=>"value2_data_is_here", :sortby=>2}, {:key1=>"value4", :sortby=>4}, {:key1=>"valuesds6", :sortby=>6}] if don't care initial object, suggest using array# sort_by! modify inplace - more re

bash: redirected file seen by script as 'does not exist ' -

i want check if there errors last command, hence redirecting stderr file , checking file "error" string.(only 1 possible error in case.) my script looks below: #aquire lock rm -f /some/path/err.out myprogramme 2>/some/path/err.out & if grep -i "error" /some/path/err.out ; echo "error while running myprogramme, check /some/path/err.out error(s)" #release lock exit 1 fi 'if' condition giving error 'no such file or directory' on err.out, can see file exists. did miss ?.. appreciated. thanks! ps: couldn't check exit code using $? running in background. in addition file possibly not existing when call grep , call grep once, , sees whatever data in file. grep not continue reading file when reaches end, waiting myprogramme complete. instead, recommend using named pipe input grep . cause grep continue reading pipe until myprogramme does, in fact, complete. #aquire lock rm -f /so

r - How to scrape mutiple tables indexing both year+page? -

thanks post https://stackoverflow.com/a/7775721/7140722 but how scrape multiple years? this structure of query: http://aviation-safety.net/database/dblist.php?year=1994&lang=&page=1 http://aviation-safety.net/database/dblist.php?year=1994&lang=&page=2 i want scrape more years. code: year <- 1990:1994 url1 = 'http://aviation-safety.net/database/dblist.php?year=' url3 = '&lang=&page=' getpage <- function(page){ require(xml) url = paste(url1, year, url3, page, sep = "") tab = readhtmltable(url, stringsasfactors = false)[[1]] return(tab) } pages = llply(1:3,getpage, .progress = 'text') crash_all_years = do.call('rbind', pages) but doesn't work. suggestions? i think better construct list of urls first , loop on list lapply (or ldply plyr package) pages. you can improve code follows: # load 'xml' package library(xml) # set variables needed construct urls years &

java - Authy Authentication is throwing UnknownHostException -

i'm trying implement 2 phase authentication application using authy authentication. while trying verify token generated in authy mobile app m getting unknownhostexception . package tes.resource; import com.authy.*; import com.authy.api.*; public class sampleauthenticator { authyapiclient client=null; public void init(){ string apikey = "api_key"; string apiurl = "http://api.authy.com"; boolean debugmode = true; client = new authyapiclient(apikey, apiurl, debugmode); } public void register(string userid,string phone){ users user=client.getusers(); user.createuser(userid,phone, "57"); } public boolean verify(){ tokens tokens = client.gettokens(); token verification = tokens.verify(27319980, "7983610"); return verification.isok(); } public static void main(string[] args){ sampleauthenticator objsampleauthenticator=new sampleauth

python - Date format is changed to unknown on mongodb -

i getting data 1 collection users contains date field using python , processing , storing in collection pros_fleet_managers . works correctly when key present in collection users . if date field key not present,then in collection pros_fleet_managers date fields saved date(-61833715200000). i use below code data , processing , bulk insert values new collection. fleet_managers = taximongo.users.aggregate([{ "$match": { "role" : "fleet_manager"}}]) fleet_managers = pd.dataframe(list(fleet_managers)) fleet_managers['city_id'] = fleet_managers['region_id'].map({'57ff2e84f39e0f0444000004':'chennai','57ff2e08f39e0f0444000003':'hyderabad'}) pros_fleet_managers.insert_many(fleet_managers.to_dict('records')) example collection users : { "_id" : objectid("57ff35f5f39e0f0444000017"), "sign_in_count" : 20, "name" : "xxx", "region

android - Swipe left/right to kill apps does stop service -

i have tried start_sticky, broadcastreceiver these things not working restart service. there other way restart service in android version 5.0 , above start_sticky restart service take time 10 sec 10 min .. never. depends on android system memory usage. u can implement foreground service create dialog in swipe down.this keep activity running. apps whatsapp,facebook uses push notifications along intent service restart service when message arrives.

Spring Boot health-based load balancing -

i'm using spring boot microservices, , came accross , issue load balancing. spring actuator adds special health , metrics endpoint apps; this, basic information can acquired running instances. what do, create (reverse)proxy (e.g. zuul and/or ribbon?), creates centralized load balancer, selects instances health status. for example, have following microservices client proxy (<- implement this) server 1 server 2 when client sends http request proxy, proxy should able decide, of server instances has least load, , forward request one. is there easy way this? thanks, krisy if want make choice on various load-data, implement custom healthindicator s accumulate kind of 'load on time' data, use in load balancer decide send traffic. all custom health indicators picked spring-boot, , invoked on actuator /health endpoint. @component class loadindicator implements healthindicator { @override health health() { def loaddata = ...

Circular dependency injection angular 2 -

i've been struggling around injecting services each other. following blog circular dependency in constructors , dependency injection kind of confusing says one of 2 objects hiding object c i following error while injecting service class each other can't resolve parameters payrollservice: (siteservice, storageservice, sweetalertservice, ?) //abstractmodal.service.ts @injectable() export abstract class abstractmodel { abstract collection = []; constructor(private siteservice: siteservice, private storageservice: storageservice, private sweetalertservice: sweetalertservice) {} setcollectionempty() { this.collection = []; } } //account-payable.service.ts @injectable() export class accountpayableservice extends abstractmodel { public collection = []; constructor(private ss: siteservice,private sts: storageservice, private sws: sweetalertservice, private accpposervice: payablepurchaseorderservice, pr

sql - is it possible to self join to ask for different dates? -

tried search answer, reading posts this: sql self-join data comparison different days not able quite understand how work in scenario. would appreciate help; i have table userid (number) usertype (string, shows if member or guest) sales_date (datestamp field) (plus other columns bought , cost of item not interested in right now) i trying write query tell me how many people went between being member , being guest, per month. can answer questions "how many people here in september , came in october?" "how many people members in september downgraded become guests in october?" "how many people guests in september upgraded being members in october?" 1: self-join way go when needing ask 2 different date ranges same table/same query? 2: thinking need ask userid,then usertype sept vs usertype october. sound right? not sure how ask 2 different dates select t1.userid, t1.usertype usertypesept, t2.usertype usertypeoct

Django 1.10 add media url to static image file -

Image
after update django 1.10 have problem static file images. django add static file path "media" link... example before "/static/images/avatar.jpeg" "/ media /static/images/avatar.jpeg" admin settings static_url = '/static/' staticfiles_dirs = ( # put strings here, "/home/html/static" or "c:/www/django/static". # use forward slashes, on windows. # don't forget use absolute paths, not relative paths. os.path.join(base_dir, 'static'), 'static', ) media_root = os.path.join(base_dir, 'media/') media_url = '/media/'

parsing - Antlr symbols - Need examples -

i looking @ code base antlr used , many grammars defined. see following being used not clear mean token {one, two} i dont see 1 or 2 defined anywhere. symbols -> , ^ whats purpose of these? see these in both lexer , parser rules symbol [] this used in following token {set} id : ... token1 : .. set[$id] what mean? examples of great help. these items if come antlr3 grammar. first part tokens section (note plural), this: tokens { one, 2 } which defines number of "virtual" tokens. these called "virtual" because have no input match , used in tree rewriting (e.g. changing tokens type depending on conditions, e.g. outcome of predicate). the symbols -> , ^ used tree rewriting when generating ast (and no longer supported antlr4 btw, because doesn't produce ast @ all, parse tree). ^ denotes root node, causes parser create tree of current tokens in active rule , use marked token root of

javascript - d3.js filter force layout by node attributes -

my goal add filter force layout graph based on attributes of nodes, choose "type". have implement filter function, not working. have @ , suggest fix? here jsfiddle regarding question: https://jsfiddle.net/marcelius/j5lmmrcg/1/ //-----------------filter start // call method create filter createfilter(); // method create filter function createfilter() { d3.select(".filtercontainer").selectall("div") .data(["entreprise", "academique", "unknown"]) .enter() .append("div") .attr("class", "checkbox-container") .append("label") .each(function(d) { // create checkbox each data d3.select(this) .append("input") .attr("type", "checkbox") .attr("id", function(d) {return "chk_" +

python - PySide QApplication([]) segfaults, but only in non-interactive ipython session -

i read empty list argument qapplication should work (instead of sys.argv). in case work when running in interactive ipython shell, executing ipython results in segmentation fault. idea why happens? makes difference? this works: [jhennrich@tp-arch qt_test]$ ipython2 python 2.7.12 (default, jun 28 2016, 08:31:05) type "copyright", "credits" or "license" more information. ipython 5.1.0 -- enhanced interactive python. ? -> introduction , overview of ipython's features. %quickref -> quick reference. -> python's own system. object? -> details 'object', use 'object??' details. in [1]: pyside.qtcore import * ...: pyside.qtgui import * ...: ...: app = qapplication([]) ...: /home/jhennrich/.gtkrc-2.0:38: error: scanner: unterminated string constant in [2]: (i tried more code, application shows window , stuff) when executed script doesnt work: segfault1.py: from pyside.qtcore import

swift - How to set UI Local Notification for 21 days with 7 days of pause -

i need set ui local notification once day 21 days in row, after 21 days need these notifications pause 7 days , start again. im developing swift 2.3 application woman menstrual period control , need create pill reminder has each 21 days, wait 7 days 21 days of continuous reminder (per day). i know can schedule using interval how these "breaks" between 21 continuous reminders? consider invalidating first reminder @ 21st day , adding second 1 different action(it should start reminder of first type). here logic: you start reminder repeats every day. on 21st action invalidate reminder , start new one, waits 7 days , fires. start reminder repeats every day. ...

javascript - how to hide table rows in 2 different tables selecting dropdown option -

i want hide table rows when select dropdown option in first table drop down there.options 1.current state 2.future state if select current state according in 2nd , 3rd table rows should show & hide.. using id tr..as current future. < script > $(document).ready(function() { $("#curfut").on("change", function() { $("#future").hide(); $("#current").show(); }); }); < /script> <table> <tr> <td> <select id="curfut"> <option value="select"></option> <option value="current">current</option> <option value="future">future</option> </select> </td> </tr> </table> <table> <div id="current" <tr> <td> <input type=radio name="reditblue" v

oracle - PL/SQL complex stored procedure -

i have stored procedure has 1.3k lines of code. stored procedure has several nested calls other procedures in same package. the total lines of code on package around 13k. there around 25 input parameters (no cursors) , 3 out parameters including 1 cursor. also, stored proc using few global temporary tables , full of dynamic queries. every time try debug stored procedure lost. complex piece of code have ever seen , trying understand exact logic of stored procedure. best way approach understand stored procedure? for ip reason won't able share code on here. if job change job. ;) but seriuos there no , quick approach such problem. way can refactor code. split procedure more smaller procedures following naming convention (i know 30 chars few) give better understanding piece of code do. if have fragments of code duplicated encapsulate them in procedures. if queries long replace dynamically build queries functions generate inside. test such fuctions separately. g

c - Difference scanf vs gets vs fgets in terms of efficiency -

what difference between scanf, gets , fgets (and others?) in terms of efficiency ? example case: imagine reading in list of several thousand integers (per line) this question has been asked more often, responds mentioning buffer overflows (eg: here ), clarify why question not in fact duplicate: know , not care buffer overflows. setting in apply these methods in competitive programming, know input looks , when input not expected (ie. leading buffer overflows) it's not problem.

protractor - Is there a way to import common feature file to another feature file in cucumber -

is there way import 1 cucumber feature file another? can move repeated logics/actions/business validations different flow common feature file. note: using background option few things launching application in every feature file. if consider it, background duplicated. :) many thanks. there no way include 1 feature file in another. if could, gherkin considered programming language. gherkin isn't programming language , lacks features functions or modules. what can repeated backgrounds then? approach see if move common initialization in background down stack. see if implement helpers perform same steps , either minimize background given world prepared in background. or make sure preparation done first in scenarios needed it. maybe hide call done in first step. move background away feature file , hide business stakeholders. one thing consider tho be, background important business stakeholders? care backgrounds or noise them? if important, don't hide backgr

performance - Android 7 GraphicBuffer alternative for direct access to OpenGL texture memory -

the way profit fact, mobile devices have shared memory cpu , gpu using grphicbuffer . since android 7 restrict access private native libs (including gralloc) impossible use more. question - there alternative way direct memory access texture's pixel data? i know, simmilar can done using pbo (pixel buffer object). still additional memory copy, wich undesirable. if know, there way 0 copies. there many apps, wich used feature, because can heavily increase performance. think many developers in stuck problem now.

Using Openui5 UploadCollection with backend java not being able to upload file -

we have developed openui5 application has working except ability upload files. want use uploadcollection in openui5 library, when servlet get's called on backend java side message not multipart/form-data when parsing request. did work when using openui5 fileupload component, not uploadcollection. there need set make multipart, or there different way need parse request. side not servlet called file attached start upload 1 one each file attached thanks in advance ron here front end xml file part uploadcollection <uploadcollection id="uploadcollection" multiple="false" samefilenameallowed="true" showseparators="all" change="onchangeuploadcollection" filedeleted="onfiledeleted" selectionchange="onselectionchange" uploadcomplete="onuploadcompleteuploadcollection" beforeuploadstarts="onbeforeuploadstarts" items="{path : '/record/uploadcollect

php - Yii2 Distinct Rows in gridview -

Image
i unable unique results in grid view. what have done far is: $query = products::find()->select('id_product_provider')->distinct(); $dataprovider = new activedataprovider([ 'query' => $query, 'pagination' => [ 'pagesize' => 100 ] ]); the result wanted, grid view not showing other columns some-column , output: dont know, result wanted be. grid view not showing other required colums name, description etc. i update query following: $query = products::find()->select('other_columns,some_column')->distinct(); the result not unique some_column . controller code: $searchmodel = new productssearch(); $dataprovider = $searchmodel->search(yii::$app->request->queryparams); return $this->render('index', [ 'searchmodel' => $searchmodel, 'dataprovider' => $dataprovider, ]); and vie

unicode - What is alternative for MultibyteToWideChar and WideCharToMultiByte functions in .NET? -

i trying migrate code vc++ .net. vc++ code uses multibytetowidechar , widechartomultibyte functions provided winapi. tried using system.text.encoding class in .net not working encodings. there other way conversion? wrong in below code snippet? here c# code: public static string multibytetowidechar(string input, int codepage) { encoding e1 = encoding.getencoding(codepage); encoding e2 = encoding.unicode; //byte[] source = e1.getbytes(input); byte[] source = mbcstobyte(input); byte[] target = encoding.convert(e1, e2, source); return e2.getstring(target); } public static string widechartomultibyte(string input, int codepage) { encoding e1 = encoding.unicode; encoding e2 = encoding.getencoding(codepage); byte[] source = e1.getbytes(input); byte[] target = encoding.convert(e1, e2, source); return encoding.getencoding(codepage).getstring(target); } private static byte[] mbc

googletest - Errors while compiling GoogleMock on Solaris sparc 5.8 using Sun C++ 5.8 Patch 121017-20 2009/04/22 -

i'm able compile gtest using same compiler (sun c++ 5.8 on sparc) using below cxxflags , cmake cxxflags = '-library=stlport4 -features=tmplife,tmplrefstatic -qoption ccfe -complextmplexp -mt -d_posix_c_source=199506l -d__extensions__' but when try compile gmock following errors: scanning dependencies of target gmock [ 9%] building cxx object cmakefiles/gmock.dir/src/gmock-all.cc.o "/home/vkumar5/gtest_1.7.0/googletest_1_8/googlemock/include/gmock/gmock-generated-nice-strict.h", line 78: error: mockclass not defined. "/home/vkumar5/gtest_1.7.0/googletest_1_8/googlemock/include/gmock/gmock-generated-nice-strict.h", line 84: error: mockclass not defined. "/home/vkumar5/gtest_1.7.0/googletest_1_8/googlemock/include/gmock/gmock-generated-nice-strict.h", line 84: error: operand expected instead of ">". "/home/vkumar5/gtest_1.7.0/googletest_1_8/googlemock/include/gmock/gmock-generated-nice-strict.h", line 166: error:

javascript - Why does .css('fontSize') produce different results in Edge? -

Image
consider code (also in a fiddle ): document.getelementbyid("span").innerhtml += $('#input').css('fontsize'); span input { font-size: inherit; } input { font-size: 15px; } <span id="span" style="font-size: 30px;"> <input id="input"/> </span> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> in chrome , firefox, .css('fontsize') return 30px, in edge , ie it's 15px. why that? dom explorer in edge shows 15px in strikethrough, , therefore should take inherited 30px fontsize: and input rendered 30px font, ie/edge picking rendering purposes. update: bug below fixed; fremycompany says he/she program manager edge team , fix reach customers in 2017. it looks ie , edge bug. not having found it, i reported it . here's update snippet sees ie/edge telling jquery via getcomputedstyle or curr

In jquery how to get a matching element with a defined property(attribute) value -

below jquery code, want li has data-target="5" . loop not enter in if condition if there li data-target="5" . var target = 5; $("ul.menu-content li.collapsed").each(function() { if ($(this).is('[data-target]') == target) { $(this).removeclass('collapsed').find('a').addclass('active'); } }); you need data-target using .data(key) , compare value. if($(this).data('target') == target) or, can directly use attribute value selector , code can improved as $("ul.menu-content li.collapsed[data-target=" + target+"]") .removeclass('collapsed') .find('a') .addclass('active');

Getting a struct variable to show in the UITableView Cell? swift /xcode8 -

im trying struct variable, "title" display cell text label in uitableview, know if possible? i have achieved before using string, i'm not sure how access 1 of struct variables in context this have declared struct import foundation struct note { var title: string var text: string } class notes { var notes:[note] public static let sharedinstance = notes() private init() { self.notes = [] } public func add(title1: string, text1: string) throws { self.notes.append(note(title: title1, text: text1)) } } and controller class, trying add simple values struct , display value of "title" variable in struct override func tableview(_ tableview: uitableview, cellforrowat indexpath: indexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecell(withidentifier: "note1", for: indexpath) let note1 = notes.sharedinstance try? note1.add(title1: "hello", text1: &

amazon web services - High TTFB time on AWS -

i've setup auto scaling group 2 ec2 m1.medium instance behind elb sticky session , rds mysql - multi-az t2.medium (lamp stack). all static files on cloudfront dist. api request beeing served web server. i'm experianceing high ttfb (over 1.20 sec), can please advise? vaibhav

Android development in android studio -

i new android development , have got work creating dialog. thing in ui have textview , edit text , button. when fill required edit view fields, , press button must dialog box contains textview:edit text. please me in coding. thank in advance

"the enablesessionstate attribute on the page directive is not allowed " suddenly on sharepoint application page -

i have moss site working fine, database server migrated , working application page showing error "the enablesessionstate attribute on page directive not allowed on page". here following things tried: check ssp session configuration validated webconfig for: session module , , page enable session state tags. even application page have enablesessionstate page directive set true. asp.net session state service running significant observations: 1. broken site uat site , same code working in production , database migrated both. 2.both environment have same code , same configuration. 3. when using other master page issue resolved setting required masterpage again causing issue. 4.prod masterpage copied on environment giving error. any thought on highly appreciated.

php - Laravel file upload validation doesn't trigger - TokenMismatchException -

i can upload files if fitting validation rule 'user_file' => 'file|max:10240|mimes:xls,xlsx,doc,docx,pdf,zip' all goes fine. i have set upload_max_filesize 32mb , post_max_size 40mb in php.ini but if try upload file bigger 40mb validation rules don't trigger. tokenmismatchexception error.... if can verify trying upload big file (a video file example) when exceed post payload size - dropped, csrf_token not come laravel , upload file empty cannot validated. update to fix need check file size before uploading javascript or jquery here example: how check file input size jquery?

numpy - how to use rpy2 to get n-dim array from python -

i want use python calculations , put array data r plot. for 1-dim array, can use floatvector right answer, n-dim array error (run following code) (2-dim array) import numpy np rpy2.robjects.vectors import floatvector x = np.array([[1, 2], [3, 4]]) x = floatvector(x) error information: `traceback (most recent call last): file "<stdin>", line 1, in <module> file "d:\program\anaconda3\lib\site-packages\rpy2\robjects\vectors.py", line 456, in __init__ obj = floatsexpvector(obj) valueerror: error while trying convert element 0 double.` using numpy2ri make error in plot orders(like ggplot2) i'd doing these in spyder. the conversion mechanism can friend: from rpy2.robjects.conversion import localconverter rpy2.robjects import numpy2ri localconverter(numpy2ri.converter) cv: x = cv.py2ro(x) # convert *py*thon *ro*bjects otherwise, happening because rpy2 trying iterate through sequence x (the default behavior

Remove PostGIS 1.3.3 From Database -

trying upgrade databases 8.3 9.1. in database dumps lot of postgis functions reference postgis files create function st_box2d_in(cstring) returns box2d '/usr/lib/postgresql/8.3/lib/liblwgeom', 'box2dfloat4_in' language c immutable strict; is there utility uninstall postgis 1.3.3 column types, functions etc database?

java - JDBC Autocommit to false in application level -

when of best programming approaches recommend set jdbc auto commit false, rational behind jdbc api design set default value true? what rational behind jdbc api design set default value true? you take transactions under control setting connection.setautocommit(false) when dealing multiple insert/update sql queries (handling through jdbc) within/across database tables atomic operation , needed medium/complex sized applications. now, if transactions have handled explicitly (i.e., suggested if connection.setautocommit(false) default), developers should careful single insert/update sql query (handling through jdbc) ensuring commit () , rollback () have been handled properly, otherwise connection hanging , quite hard debug. if auto-commit mode has been disabled, method commit must called explicitly in order commit changes; otherwise, database changes not saved. you can here following approach i.e., calling commit explicitly each , every transaction unnec

c++ - How to change the extension of a file? -

i working on project need add message @ end of file , want change extension. i know how add message @ end of file; code: _ofstream myfile; _myfile.open("check.txt", std::ios_base::app); _myfile << "thanks help.\n"; how can change file's extension? actualy, simple: #include <iostream> #include <fstream> #include <cstdio> using namespace std; int main(int argc, char* argv[]) { ofstream fout("test.txt", ios_base::app); fout << "my cool string"; fout.close(); rename("test.txt", "test.txt1"); return 0; }