Posts

Showing posts from May, 2015

install4j - Is there anyway to have different destination name of the installing file at than the source name? -

i want have different file name @ destination side after installing it. there anyway it? did not option in add files , directories action under define distribution tree. please advise. the "install files" action has "directory resolver" script change installation directory each file, there's no facility change file name. you have use "move files , directories" action purpose.

c# - How to convert nested sql statement to linq to entities? -

i'm trying create basic room availability statement use linq entity framework. have 2 tables: 'room' including columns roomid/roomsize , 'booking' including bookingid/roomid/startdate/enddate. i have got working sql statement: select roomid, roomsize room roomid not in (select roomid booking ('08/01/2015' >= [start] , '08/01/2015' <= [end]) or ('08/20/2015' >= [start] , '08/20/2015' <= [end])) i have got far linq entity statement: var rooms = (from r in db.rooms !(((from b in db.bookings (startdate >= b.startdate && enddate <= b.enddate) || (enddate >= b.startdate && enddate <= b.enddate)).contains(r.roomid)) select new availableroom { id = r.roomid, size = r.roomsize }); i error @ last bracket before .con

ios - MVVM, dependency injection and too many constructor parameters -

i have been doing ios development using mvvm , dependency injection couple of months , happy results. code clear , easier test. have been stragling problem haven't found solution felt confortable with. in order understand problem want give little bit of context. last app have been working architectured in following way / layers: model view models view / view controllers services : classes know how deal external services twitter, facebook, etc. repositories : repository class knows how interact resource of application's rest api. lets have blog application, have users resources , posts resources. each of thoses resources have several method. there 1-to-1 relation between resources , repositories. when applications starts have bootstrap class initializes app , creates main view model. have restriction view models can create other view models. example in case of having view contains list of elements (in ios represented uitableview) , detail view each of thoses elem

how to configure apache 2.4.10 to run python code in it -

the sites-enabled ,000-default.conf file changed apache 2.4.10 not able configure apache due this, there 1 can give step step description in how configure? this 000-default.conf file: <virtualhost *:80> # servername directive sets request scheme, hostname , port t$ # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used last resort host regardless. # however, must set further virtual host explicitly. #servername www.example.com serveradmin webmaster@localhost documentroot /var/www # available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # possible configure loglevel particular # modules, e.g. #loglevel info ssl:warn errorlog ${apache_log_dir}/error.log customl

objective c - setInitialText not work with IOS 8.3 (facebook,social,SLComposeViewController) -

the functionality of slcomposeviewcontroller no longer works expected newest facebook iphone app update of april 24th. initial text specified ignored, though setinitialtext method returns true if successful. dialog returns "done" whether hit "done" or "cancel". realize apple call , i'm not using facebook sdk, have verified works previous version of facebook app installed when upgrade facebook app on iphone, functionality no longer works expected. note result of completion handler returns "done" - when hit "cancel" , also, setinitialtext: nothing now. verified same code worked pre-the april 24th release. if([slcomposeviewcontroller isavailableforservicetype:slservicetypefacebook]) { controller = [slcomposeviewcontroller composeviewcontrollerforservicetype:slservicetypefacebook]; [controller setinitialtext:@"hiiiiiii"]; [controller setcompletionhandler:^(slcomposeviewcontrollerresult result) {

validation - How to offline check SSL certificate chain? -

prologue i periodically uploading & updating ssl certificates aws' elastic load balancers. the annoying point is, submit certificate, private key , certificate chain , configure load balancer interface not validating certificate on-the-fly. when press "create load balancer" receive error messages regarding missing intermediate certificates or similar. not able go , correct configuration. have start whole process again. not cool. ;) question so looking offline- or online-service can post certificat-chain tell me complete chain. or not. there websites sslshopper.com offer nice services check existing websites, dont know tool can post certificate-chain plain text. any appreciated, in advance! i found solution / workaround myself: create aws ec2 load balancer without https-listener - don't need upload certificate then edit created listener , try add certificate (private key, certificate, intermediate certificate) if error occurs, can go (th

php - Can't unset rows in my array -

i'm trying delete empty rows in arrays, can achieve that. need help. here's i've tried : $specialites = serialize($_post['specialite']); foreach($specialites $specialite) { if($specialite=='') unset($specialites[$specialite]); } but every time, error (blank page). need please. thank ! i check 1 problem serialize called first before foreach , actual problem. need this:- $specialites = $_post['specialite']; foreach($specialites $key=> $special) { if(empty($special) || $special == '') unset($specialites[$key]); } $specialites = serialize($specialites); note:- if called serialize on variable no more array type variable.

php - Why aren't my session's persisting after setting session.cookie_lifetime -

i have line, added couple of days ago: ini_set('session.cookie_lifetime',60*60*24*7); and can confirm in phpinfo it's set 604800. but in /var/lib/php/session folder have no files older 25 minutes. so something's pruning them out, against wishes. idea what? thanks

load balancing - signalR negotiate request returns origianl url in reponse instead of overriden url -

i trying change hub connection url in signalr requests go through custom load balancer. the load balancer redirects original signalr web application , gives response. for trying create new hub connection changing url this var signalr = $.signalr; signalr.hub = $.hubconnection("http://localhost:64071/loadbalancer.web/notificationweb/signalr", { usedefaultpath: false }); the signalr tries connect url , in negotiate request returns response { "url":"/we.abcd.web/signalr", "connectiontoken":"raydztwhwmp50fyixa4mxrtr8xzamuhhdlxreyvlb3meo+2vezsk4wmedbkcbveazo/+gfynofqv ...... then can see in response, url contains original url (i.e. we.abc.web) communications happens directly we.abcd.web instead of passing through load balancer. web after overriding urls. how can force negotiate request return me loadbalancer.web url instead of original url? i think long signalr generating negotiate response url using request.localpath

sql server - Replacing non-ascii characters in MSSQL -

i have done quite bit of research , can not seem find answers. need following: replace characters in mssql column non ascii characters ascii equivalents. example: ë --> e ï --> ñ --> n i have read through following may seem similar are, instead of replacing, eliminating/removing these characters (which not ideal). how remove extended ascii characters string in t-sql? purpose of [^\x20-\x7e] in regular expressions http://jamesveitch.com/t-sql-function-replace-non-printable-ascii-chars/ http://www.sqlservercentral.com/forums/topic853088-149-1.aspx thanks @eric below , selected answer. (helpful reference: how remove accents , chars <> a..z in sql-server? ) you cannot other way old-fashioned, "hard" way (in language, even, not sql). since in many (spoken/written) languages, accented characters not same non-accented ones, it's visual similarity, there no true correspondance. letters can same symbol added, have different "sou

sql server - SQL select distinct by 2 or more columns -

Image
i have table lot of columns , need write select take unique values. main problem need check 3 columns @ same time , if 3 columns have same values in columns(not between them, in own column) distinct . idea should distinct(column1 , column2 , column3) any ideas? or need more information, because i'm not sure if gets have in mind. this example. select should return 2 rows this, 1 last column have yes , other row with no`. this distinct keyword for: select distinct col1, col2, col3 mytable

python - If I open this URL in one of the popular browsers, will I probably get a HTTPS error? -

i need write python 3 script answers question in title. by "https error" mean both obvious error page advising user not proceed , errors visible in browser console, “blocked loading mixed active content”. so far tried ghost.py, did not report errors (with ignore_ssl_errors=false ) while loading page caused “blocked loading mixed active content”. is there way fix in ghost.py / pyside? there tool should use? i rather not use tool selenium requires actual browser, if there other way.

c++ - Conditional transitive link libraries -

i'm struggling cmake "config"-based package description when using 2 depending packages upstream package has optional link libraries. suppose have liba optionally uses zip functionality (say option use_zlib in liba 's cmakelists.txt ). means liba optionally have -lz in interface_link_libraries (exported liba-config.cmake ). now, if have libb using liba via find_package(liba) , how know if liba has been built or without zlib support when both libraries installed , exported cmake's package config system? i know link library information treated transitively , propagated link libraries of libb , hence -lz appear whenever linking against libb . however, path libz included; consequently, link fails "could not find library z" unless magically knew libz link library of liba , include from. including absolute path libz in liba 's config not way go, ruins portability on different systems. edit: i've been getting replies suggesting us

How to use strstr() function to compare content in character arrays in C? -

the purpose of small program compare strings in 2 separate files (file1.csv , file2.csv), , gives results file3.csv. if strings in file2.csv found in file1.csv, program copies strings in file1.csv file3.csv. content of file1.csv (with 6 columns): 10000001 text1 text1 text1 text1 text1 10000002 text2 text2 text2 text2 text2 10000003 text3 text3 text3 text3 text3 10000004 text4 text4 text4 text4 text4 10000005 text5 text5 text5 text5 text5 10000006 text6 text6 text6 text6 text6 10000007 text7 text7 text7 text7 text7 10000008 text8 text8 text8 text8 text8 10000009 text9 text9 text9 text9 text9 10000010 text10 text10 text10 text10 text10 10000011 text11 text11 text11 text11 text11 10000012 text12 text12 text12 text12 text12 10000013 text13 text13 text13 text13 text13 10000014 text14 text14 text14 text14 text14 10000015 text15 text15 text15 text

php - Codeigniter - value in subquery being ignored -

not sure i'm going wrong query, value dateread being ignored , getting error message: undefined property: stdclass::$dateread. select `id`.`id`, `id`.`name`, `id`.`deleted`, `id`.`filepath`, `id`.`createddate`, (select createddate dateread documents_users iu id.id = iu.docs_id , iu.users_id = 2346) (`documents` id) join `documents_years` iy on `id`.`id` = `iy`.`docs_id` can help?` just update query , fetch value of $dateread need define dateread after completion of sub_query , not within sub_query else it'll (select createddate documents_users iu id.id = iu.docs_id , iu.users_id = 2346) select `id`.`id`, `id`.`name`, `id`.`deleted`, `id`.`filepath`, `id`.`createddate`, (select createddate documents_users iu id.id = iu.docs_id , iu.users_id = 2346) dateread (`documents` id) join `documents_years` iy on `id`.`id` = `iy`.`docs_id`

What are the possible reasons for rendering error in android studio? -

Image
i using android studio 5.0. when open activity layout preview, layout doesn't appear , give error "render problem". knows how can solved? try change android version on designer preview , render xml.

why does variable hoisting occurs in JavaScript, in terms of execution context -

i came know variable hoisting because of steps in execution context. why variable hoisting occurs in javascript, in terms of execution context. here pseudo-overview of how interpreter evaluates code: find code invoke function. before executing function code, create execution context. initialize scope chain. create variable object: create arguments object, check context parameters, initialize name , value , create reference copy. scan context function declarations: for each function found, create property in variable object exact function name, has reference pointer function in memory. if function name exists already, reference pointer value overwritten. for each variable declaration found, create property in variable object variable name, , initialize value undefined. if variable name exists in variable object, nothing , continue scanning. determine value of "this" inside context. run / interpret

Pentaho Report Designer resource message -

i'm using pentaho 5.2. i have 1 data field comes .ktr file ( organization_name ) have 1 resource-label ( org_name ) text/translated in report itself. i wondering how combine fields 1 field. advised me fill in resource-message field, i'm not sure how , wiki doesn't have information: http://wiki.pentaho.com/display/reporting/resource-message any advice? in advance. if combine 2 fields, using concatenate can achieve requirement. eg:- have 2 fields i.e, field1,field2 now, can combine 2 fields these. => take field i.e, text field , select text field , go attributes tab , find out value , press + button , add these line. =concatenate([field1];" - ";[field2]) thank you.

javascript - Setting ng-model inside ng-repeat not working -

i have list of questions , each question have options checkbox. i'm using ng-repeat list questions , ng-repeat list options. how should set ng-model answer option checkbox selected options questions. i tried setting ng-model answers[qst.id][ans.id] , returning error typeerror: cannot set property '*' of undefined <div ng-repeat="qst in questions"> <div>{{qst.question}}</div> <div> <ul> <li ng-repeat="ans in answers"> <span> <input type="checkbox" ng-model="answers[qst.id][ans.id]"> </span> <span> {{ans.ansoption}} </span> </li> </ul> </div> </div> what perfect way ? dont know structure of answers, object (key-value pair), binded checkbox key checked in answer. <di

Writing plugin dissector for Wireshark -

i have write 1 wireshark dissector plugin protocol. i've 1 captured file having hexadecimal bytes code input dissected through dissector/plugin . how ? i've built 1 basic wireshark plugin per https://www.wireshark.org/docs/wsdg_html_chunked/chdissectadd.html and doc/readme.plugins so know basic steps build wireshark plugin (custom extension). don't know put file analyze , function needed write in packet-dissector.c ? suggestions ? thanks. there lot of packet-xxx.c files in epan tree. depending on base protocol (udp/tcp/other) select 1 of protocol dissectors , have been used dissect protocol. should template dissector. further should consider dissector can sophisticated showing lot of details, flow analysis, protocol violation indication, , on. required depends on expectation dissector , can't answered in general.

javascript - Khan academy Algorithm: Binary Search Solution -

i working towards algorithms in khan academy : https://www.khanacademy.org/computing/computer-science/algorithms/binary-search/p/challenge-binary-search of code below results in -1 ? why that? binary search wont work efficiently ? var dosearch = function(array, targetvalue) { var min = 0; var max = array.length - 1; var guess; while(min < max) { guess = math.floor((max + min) / 2); if (array[guess] === targetvalue) { return guess; } else if (array[guess] < targetvalue) { min = guess + 1; } else { max = guess - 1; } } return -1; }; var primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]; for(var i=0;i<primes.length;i++){ var result = dosearch(primes,primes[i]); console.log("found prime @ index of " + primes[i] +" @ " + result); } results: found prime

Send Json Data using Volley from android to server -

i'm trying send array against key server android using volley http client. instead of sending array sends string. here data want send server. {"id": "1231241234312", "steps":[{"id":"123","title":"start"}, {} ] } steps key contain array on server side, received string.. here android code. final map<string, string> params = new hashmap<string, string>(); jsonobject data = new jsonobject(); try { data.put("id", item.getid()); data.put("status", 3); data.put("_action", 1); } catch (jsonexception e) { e.printstacktrace(); } params.put("id", task.getid()); params.put("steps", data.tostring())

c# - Umbraco Cannot render a macro when there is no current PublishedContentRequest -

hope can me.i encountered error upon calling view umbraco razor page using rendermvccontroller. it's seems can't render created macro inside layout page. line 4: } line 5: line 6: @umbraco.rendermacro("externalredirect") line 7: line 8: source file: c:\working\git\id\umb packages\website\views\default.cshtml line: 6 stack trace: [invalidoperationexception: cannot render macro when there no current publishedcontentrequest.] umbraco.web.umbracohelper.rendermacro(string alias, idictionary 2 parameters) +142 asp._page_views_default_cshtml.execute() in c:\working\git\id\umb packages\website\views\default.cshtml:6 system.web.webpages.webpagebase.executepagehierarchy() +280 system.web.mvc.webviewpage.executepagehierarchy() +125 system.web.webpages.webpagebase.executepagehierarchy(webpagecontext pagecontext, textwriter writer, webpagerenderingbase startpage) +196 system.web.webpages.webpagebase.write(helperresult result) +89

javascript - how do i query a field in mongodb with a boolean value and return a boolean whether its true or false -

check simple collection: {_id: "01", name: "jimmy", candrive: false } what want once document found, manipulate dom , show <div class="driving-tutorial> if field candrive value false , hide if value true like in meteor: template.profile.rendered = function() { if (<query>,<field> == true){ $('.driving-tutorial').hide(); else { $('.driving-tutorial').show(); } you implement logic findone() method finds first document matches selector/query object in arguments. can call findone() mongo selector, object specifies required set of attributes of desired document match document. example, selector var doc = model.findone({ candrive: false }); will match document { _id: "01", name: "jimmy", candrive: false } you can use above logic in template function check existence of document , field, bearing in mind findone() return null if fails find m

How to enable the Gzip compression in jBoss EAP server -

i using jboss eap 6.1 sevrer in want enable gzip compression html, css , javascript files. i entirely new compression technology, can suggest me tutorial or can directly give me step wise process enable compression on jboss eap 6.1 server. apart these have following doubts: 1) need compress files on workspace or if jboss server compression enabled take care of compression , need deploy war. 2) when server respond request , need explicitly convert or decode or decompress files use them or interpret them? gzip compression web resources optional, can't compress of them , hope every web client able handle it. that's why it's enabled @ runtime when client (might web browser) says "gzip ok me" accept-encoding: gzip, deflate header. see https://en.wikipedia.org/wiki/http_compression on server side, magic handles http filter intercepts request, notes header, sends request on rest of app, intercepts response , compresses accordingly. jboss has bu

sql - How to insert records as break times in a select in a Stored Procedure -

having table in sql server 2012 , need return break times inserted in right position. i able use temporary tables if necessary. break: difference between times, need new record representing gaps. table: ╔════════════════╦════════════════╦══════════╦════════╗ ║ start ║ end ║ duration ║ type ║ ╠════════════════╬════════════════╬══════════╬════════╣ ║ 1/06/2015 1:00 ║ 1/06/2015 1:30 ║ 0:30 ║ logged ║ ║ 1/06/2015 2:00 ║ 1/06/2015 3:00 ║ 1:00 ║ logged ║ ║ 1/06/2015 3:20 ║ 1/06/2015 4:00 ║ 0:40 ║ logged ║ ║ 1/06/2015 4:00 ║ null ║ ║ logged ║ ╚════════════════╩════════════════╩══════════╩════════╝ result: ╔════════════════╦════════════════╦══════════╦════════╗ ║ start ║ end ║ duration ║ type ║ ╠════════════════╬════════════════╬══════════╬════════╣ ║ 1/06/2015 1:00 ║ 1/06/2015 1:30 ║ 0:30 ║ logged ║ ║ 1/06/2015 1:30 ║ 1/06/2015 2:00 ║ 0:30 ║ break ║ ║ 1/06/2015 2:00 ║ 1/06/2015 3:00 ║ 1:0

javascript - Creating Custom directive do not work -

i trying create custom directive.. <head> <script type="text/javascript" src="../scripts/angular.min.js"></script> <script type="text/javascript" src="../scripts/datadirectives.js"></script> </head> <body style="overflow: hidden" > <div ng-app="myapp"> <sampledata></sampledata> </div> </body> in separate javascript file called datadirectives.js followung code present.. var app = angular.module('myapp', []); app.directive('sampledata', function () { return { restrict: 'e', template: '<div>sample div,to test angular directives</div>' }; }); so when run page,i cannot see text on page of of div element.what wrong above code. in advance... :) you have 2 ng-app not following required naming convensions var app = angular.module

oracle - XML value cannot convert to BLOB -

when retrieve xml file front-end try put data xml blob column in oracle table. following error; ora-01465: invalid hex number front end sending binary object type. here xml tags contain following details. <contents>mzevmdcvmjaxna0kms4grmluzcbhihdhesb0bybzdg9wihbvc3riywnrigluifryzwugr3jpzcbpbibdywhydcbpzibby2nvdw50cybnb2r1bguglsbeb25ldqoylibjcybeaxnidxjzzsbgb3jtdwxhihnhbwugyxmgrm9ybxvsyq0kmdyvmdgvmjaxna0kms5dagfuz2ugrgviaxrdcmvkaxqgdg8grgviaxrdcmvkaxrob3rldqoyos8woc8ymde0dqoxllnhbgvzic0gqxv0agvudgljyxrpb24gcmvxdwlyzwqgzm9yig1vcmugb3b0aw9ucw0kmi5iaxn0b3j5ic0gt3b0aw9uihrvihzpzxcgaxrlbsbsaxn0dqozlknhc2huawxsic0gt3b0aw9uihrvihnwzwnpznkgsw4vt3v0dqowmy8wos8ymde0dqoovg8gq2fzacbuawxskq0kms5bzgqgq2xlyxigqnv0dg9ucyb0bybidxr0b25zihn0cmlwic0grg9uzq0kmi5tzwfyy2ggbm90ihdvcmtpbmcncjmurg91ymxlignsawnrigzlyxr1cmugdg8gaw5jcmfzzsbpdgvtcyatiervbmuncjquqwrkienszwfyicygumvtb3zligj1dhrvbib0bybrzxkgcgfkic0grg9uzq0kns5haxzligfuig9wdglvbib0bybjagfuz2ugy29sb3igyw5kigltywdligr5bmftawnhbgx5lg0

ios - Navigating between two viewController -

i have set initial viewcontroller rootviewcontroller in appdelegate because don't use storyboard. looks way: var window: uiwindow? var mainnavigationcontroller: uinavigationcontroller? func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { self.mainnavigationcontroller = uinavigationcontroller() var maincontroller: uiviewcontroller? = tinelineviewcontroller() self.mainnavigationcontroller!.pushviewcontroller(maincontroller!, animated: true) self.window = uiwindow(frame: uiscreen.mainscreen().bounds) self.window!.rootviewcontroller = maincontroller self.window!.makekeyandvisible() ... ... my application running , tinelineviewcontroller shows up. i have in class uibutton call method: func postleft(_sender: anyobject?) { println("go secound view..") let secondviewcontroller = postcreatecontroller() let appdelegate = (uia

load a downloadable link into a browser in android -

i have downloadable link https://drive.google.com/uc?id=0bw6vr2lnxb3iufjrtk5ozdljata&export=download works on browser. if open link using mobile browser using this intent intent = new intent(intent.action_view, uri); intent.setflags(intent.flag_activity_no_history); startactivity(intent); then automatically download file. is possible download file using webview instead of default browser?? i tried public class showdownload extends activity { private webview webview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.show_download); bundle extras = getintent().getextras(); if (extras.getstring("url") != null) { //do string url=extras.getstring("url"); toast.maketext(getapplicationcontext(), "__", toast.length_short).show(); webview = (webview) findviewbyid(r.id.w

python - Getting digits in an order (left to right) after OCR from x,y coordinates -

Image
so wrote ocr script grabs image , performs ocr , return x,y coordinates digit , when plot underlying image. the x,y coordinates digits not predicted sequentially contours detected (almost randomly). is there way them arrange in readable left right order? if able x, y coordinate pairs, can sort y, x values. xy_list = ((2, 1), (1, 2), (0, 1), (1, 0), (0, 0), (2, 2), (1, 1), (0, 2), (2, 0)) xy_list = sorted(xy_list, key=lambda tup: (tup[1], tup[0])) print(xy_list[:3]) print(xy_list[3:6]) print(xy_list[6:]) gives [(0, 0), (1, 0), (2, 0)] [(0, 1), (1, 1), (2, 1)] [(0, 2), (1, 2), (2, 2)] this won't account slight variations in y values should considered on same line, off-center. edit this lets y vary specified offset. (so set 10.0, in case). note i'm using python 3, if you're using 2, make sure make offset float. offset = .5 xy_list = ((2, 1), (1, 2.1), (0, 1), (1, 0.1), (0, 0), (2, 1.6), (1, 1.3), (0, 2), (2, 0.3)) xy_list

javascript - Changing a number upon every refresh? -

how generate random number every refresh using html , javascript? i have javascript generate decimal number. function decimalgenerate() { var min = 1.03, max = 5.99, numberresult = math.random() * (max - min) + min; alert(parsefloat(numberresult).tofixed( 2 )); }; decimalgenerate(); how display actual code using html? you can call fucntion on jquery.( document ).ready(). have displayed random generated number in text box html <input type='text' id='text1'> jquery function decimalgenerate() { var min = 1.03, max = 5.99, numberresult = math.random() * (max - min) + min; $('#text1').val(parsefloat(numberresult).tofixed( 2 )); }; $( document ).ready(function() { decimalgenerate(); }); you can check demo

python - CX_ORACLE TNS:listener does not currently know of service requested in connect descriptor -

i trying connect database server python using cx_oracle . have constructed connection string as dbconfig['schema']+"/"+dbconfig['password']+"@"+dbconfig["ip"]+"/"+dbconfig['sid'] where dbconfig dictionary necessary credentials database connection i able connect 1 of server using vpn connection . when try connect 1 of server in local network displays "tns:listener not know of service requested in connect descriptor" error. i modified tnsnames.ora file appropriate sid though not required in other case . after that, able login using sqlplus . had no luck python code. you connecting database using hostname connection type or called "easy connect" - ezconnect forget tnsnames.ora in scenario. not in use when doing hostname connection. you need service_name right. service_name not same sid. sid name of server-side-processes on dbnode. fixed dbnode. service_name abtraction. let'

javascript - creating an ember-data application serialzer -

i've been trying use ember data few days now. problem api have not match strcuture ember-data receive. item: { "data": { "id": 1, "username": "rodzzlessa", "slug": "rodzzlessa" } } collection: { "data": [ { "id": 34, "name": "hdg common nails 50lbs", "slug": "hdg-common-nails-50lbs4569", "description": "accusantium ipsam impedit omnis sint dolorum.", "image_src": "nail-box-angle.png", "categories": { "data": [ { "id": 2, "name": "nails", "image_src": "nails-icon.png" } ] } } ] } from i've seen need modify extractsingle , e

c# - parallel.for loop giving timeout exception -

i using parallel.for make concurrent calls following. sqlconnection connection = new sqlconnection(connectionstring); connection.open(); sqlcommand cmd = new sqlcommand(); //sqldatareader reader; cmd.commandtype = commandtype.text; cmd.connection = connection; parallel.for(0, 100, delegate(int i) { //insert database; cmd.commandtext = string.format("insert service_loadtest(id,servicecallcount) values ({0},'call_{1}')", i, i); cmd.executenonquery(); }); after inserting counts upto 70 ,i getting timeout exception "timeout expired. timeout period elapsed prior completion of operation or server not responding.".i have set connetion string timeout property,but of no luck. please help. your code isn't thread-safe. try moving code loop: parallel.for(0, 100, delegate(int i) { using (sqlconnection connection = new sqlconnection(connectionst

javascript - JS: looping function through checkbox array not counting properly -

i want validate input on series of checkboxes. there must @ least 1 checkbox selected, otherwise user gets alert select one. however, alert appears unless of checkboxes selected. i realize issue how loop params set, cannot figure out how fix it. for(var i=0;i<7;i++){ if( !checkboxes[i].checked ){ alert( 'you need select @ least 1 day!'); checkboxes[i].focus(); return false; } } you can use flag set validation status , set true if atleast 1 item checked. then after loop check whether flag set else there no checkboxes selected. var valid = false; (var = 0; < checkboxes.length; i++) { if (checkboxes[i].checked) { valid = true; break; } } if (!valid) { alert('you need select @ least 1 day!'); checkboxes[0].focus(); return false; }

ios - How can I drag my UIView only from a specific area of this UIView? -

Image
this uiview have. of hidden , dragged out dragging little visible part. i thought drawing view let 90% of container , on top, draw little rectangle (the visible part) faced 2 problems: i can drag view out dragging visible part of view (and not little rectangle) , i need able see/interact view behind visible part of hidden view (except little rectangle) how can achieve that? override pointinside:withevent: return false when point in part of view don't want receive touches.

ios - UIPickerView Column Offset -

Image
i have uipickerview 2 columns simple timer application. 2 columns minutes , seconds. works fine except right column not aligned correctly seen here: i did change widthforcomponent half of screenbounds.width improved issue bit still, right column closer screen's brink left. is there way change , make nicer? in advance :)

sql - How to SELECT number of hours worked in specifc weeks using postresql -

i'm trying find out how many hours employees worked on specific weeks in april , march. when trying find total hours worked (numeric value), i'm given "date out of range" error. i'm sure made simple mistake in select queries. point out me what's wrong? how make select query if wanted number of hours worked 2015-04-05 2015-04-11? if can figure out how numbers specified week, that'll me other weeks need well. pardon newbish questions, i'm still new sql little experience. select sum(case when hours_worked between dateadd(ww,-1,'2015-04-05') , dateadd(ww,-00,'2015-04-05') r.hours_worked end) hours_worked sum(case when hours_worked between dateadd (wk,-1,'2015-3-14') , dateadd(wk,-0,'2015-3-20') r.hours_worked end) hours_worked here's 1 way write query similar yours: select name, sum( case when hours_worked between (to_date('2015-04-05', 'yyyy-mm-dd') - interval

yaml - Local translation symfony -

i have problem in logout , wont detect local language , return default 1 here firewall logout: path: logout target: /%locale%/siivt/ and here root logout: pattern: /{_locale}/deconnection it return fr local while connexion work fine more clear when navigate in english version of site , after loging off return site in french local want keep local it because %locale% point default locale configured in parameters.yml . if %locale% (default locale) equals fr route fr/siivt always. to solve problem recommend store locale in session , generate urls independent of current locale. , make controller switch locale , return last viewed page.

Capybara - Selenium - Ruby - testing dynamic id -

i have following element (radio-button)which need select input class="pull-left" data-class="then-radio-button" id="condition_fields_24934_condition_action_hide" name="condition_fields[24934][condition_action]" type="radio" value="hide" how select considering part of id name dynamic - particularly in example it's 24934 changes every time run test? i use ruby writing tests. thank in advance! have consider using cssselector instead? in such case css best option , can use partial search that. [id^='condition_fields_'][data-class='then-radio-button'] translation: id->starts condition_fields_ , having data-class then-radio-button edit for additional filtering adding value may helpful well. [id^='condition_fields_'][data-class='then-radio-button'][value='hide']

java - How to click song list (Now Playing activity) to playing without (Music Preview) startActivity -

how click , send ( intent + putextras + startactivity ) in main activity (music preview activity) , playing song without showing it. song list stays, clicking list song --> refresh music preview activity. want stay activity (song list) music priview activity intent , refreshing , playing new song. http://www.pixentral.com/pics/1mpvijtxbybnffasiz0ufi2sbks11.jpg http://www.pixentral.com/pics/1mpvijtxbybnffasiz0ufi2sbks11.jpg song list : public void onclick(view v) { intent intent = new intent(mcontext, musicpreview.class); intent.putextra("pos", position).putextra("names", songsname).putextra("songlist", songsuri); mcontext.startactivity(intent); } you use broadcastreceiver this. private final broadcastreceiver mhandlemessagereceiver = new broadcastreceiver(){ @override public void onreceive(context context, intent intent) { //get music data intent

angularjs - how do i avoid $scope.$apply() in the callback -

below code works fine. trying see if there better way write can avoid $scope.$apply() in controller. when user clicks on "sign up" button, call goes controller , service along callback method. in service, calling parse cloud code create user , calling callback after receive response. the problem have call $scope.$apply() in callback method in order apply changes vm.m.resp property bound span. is there way can run whole signup process single transaction , avoid callback? or is there way avoid calling $scope.$apply() ? this how ui looks like: <ion-view title="sign up"> <ion-content class="has-header"> <div class="list"> <label class="item item-input"> <span class="input-label">username</span> <input type="text" ng-model="vm.m.username"> </label> <label class="item item-input">

c - algorithim for calculating the nth root of a number from Wikipedia -

could please tell me what's wrong bit of code below.... i'm trying write program calculate nth root of number output calculation i'm writing keeps coming 0. put numbers in see if result of calculation , assign ans2 0 gets assigned. have ideas? #define _crt_secure_no_warnings #include <stdio.h> void main(){ int n = 2; double = 4.0, ans = 1.0, ans2 = 1.0, pow = 1.0; ans2 = (1/n)*((n-1)*ans+(a/pow)); printf("\n%lf\n", ans2); printf("\n%lf\n", ans); printf("\n%lf\n", pow); printf("\n%lf\n", a); printf("\n%d\n", n); } thank you! arp you have either: write ans2 equation ans2 = (1.0/n)*((n-1.0)*ans+(a/pow)); declare n double. with way have written, compiler interpret 1/n signed integer. in integer form, 1 just: 00000000000000000000000000000001 so when divide positive integer n > 1 , right shift least significant bit off of end, causing result truncated 0.

php - Fetch subcategory in fetched category -

what trying build next. fetch menu categories , display them, fetch subcategories each category special display also. hope understand want , saying. got lost in code , don't how this. here code, hope can me. here table structure. subcategory table | id | subcategory_name | id_category | category table | id | category | id_category connected id in category table <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-left"> <?php $pdo = connect(); $sql = "select * category"; $query = $pdo->prepare($sql); $query->execute(); $row = $query->fetchall(); foreach ($row $rs) { ?> <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="fa

python - Latent Dirichlet Allocation using Gensim on more than one corpus -

i have 2 questions related usage of gensim lda. 1) how can create model using 1 corpus, save , perhaps extend later on corpus training model on ? possible ? 2) can lda used classify unseen document, or model needs created again including in corpus ? there online way , see changes on fly ? i have basic understanding of lda , have used topic modeling on simple corpus using lda , gensim libraries. please point out conceptual inconsistencies in question. ! i found helpful. gensim allow corpus added(updated) existing lda model. module allows both lda model estimation training corpus , inference of topic distribution on new, unseen documents. described here - https://radimrehurek.com/gensim/models/ldamodel.html additionally, algorithm streamed , can process corpora larger ram. has multicore implementation speed process. lda = ldamodel(corpus, num_topics=10) lda.update(other_corpus) this how model can updated.

c++ - Adding arrays to vector in for loop with random_shuffle -

i'm trying add int-array permutations vector in loop, when leave loop, every vector element same. task_number = 6; vector<int*> p_0; int* order = new int[task_number]; (int k = 0; k < task_number; k++) order[k] = k; (int = 0; < 3; i++) { random_shuffle(order, order+task_number); cout << endl; p_0.push_back(order); (int j = 0; j < task_number; j++) cout << p_0[i][j] << " "; } ////////////////////////////////////// cout << endl<<endl; std::vector<int*>::iterator it; (it = p_0.begin(); != p_0.end(); ++it) { (int j = 0; j < task_number; j++) cout << (*it)[j] << " "; cout << endl; } output: 1 3 0 2 5 4 1 4 5 3 2 0 1 3 5 4 0 2 1 3 5 4 0 2 1 3 5 4 0 2 1 3 5 4 0 2 what problem? i'm doing wrong? you have allocate k number of times integer pointer. if change code follows work int task_number = 6; vector<int*> p_0;

python - Retrieving cookies from a Steam OAuth login site -

trying grab cookies http://www.tf2outpost.com in order necessary cookie (it's called uhash ), 1 must logged on steam oauth + getting past dual factor authentication. my current method of getting cookie first logging in on browser, go chrome's dev tools, , going network tab grab uhash cookie. since want automate everything, not valid solution. my question - how i, using python, programmatically capture cookies if site requires me log in?

angularjs - DRYing controllers with directives vs. service -

the app i'm building has multiple views, each own controller. controllers start in same way , differ in 1 methods; $scope.a = ... // same controllers $scope.b = ... // same controllers $scope.c = function(){...} // same controllers $scope.d = function(){...} // different each controller they keep controllers thin , factorise them services. if put a, b, c in service shared among controllers, wherease want each controller keep own a, b, c in own scope. i'm not trying share data, code. so created directive references parent scope , declares common stuff in own controller. solves problem there best practice recommend? if define controller methods scope properties, can use simple mixin approach extend each of scope objects common methods. say define object reusable methods: var mixin = { a: function() { return this.name; }, b: function() {}, c: function() {} }; and when need methods mix them current $scope : app.co