Posts

Showing posts from August, 2013

windows - VB6 New form/msgbox pops up behind parent form On Win7 -

i have window form application written in vb6. works fine until our users upgraded workstation winxp win7. hers detail of issue: a child form or message box opens behind parent form. users cannot because application focused on child form/messagebox. have kill whole application using task management. also, issue happens randomly (one or twice day). cannot replicate issue in development workstation. have similar issue? or suggestion helpful? i tried following things on users' machines, none of them works: set application run in compatibility mode windows xp (service pack 3). grant users local admin right on workstations. make sure references , components on users' machine same version our development workstation. thank much below code popup child window: frmclinicalquestion2.txtcqtwocomments.text = trim(m_qviolcomm) frmclinicalquestion2.txtcqtwohistorycomments.text = trim(m_qviolhistcomm) call setvalues(txtq2, optq2, m_qviol) call setvalues(frmclinicalq...

html - transform: translateY Not Working in Safari -

translatey not working in safari browser, though works fine in other browsers. have played around white spacing, , tried -webkit-transform:-webkit-translatey(-420px) no luck. missing step? i've never had issue before. .animate-up { -webkit-transorm:translatey(-420px); -moz-transorm:translatey(-420px); -ms-transorm:translatey(-420px); -o-transorm:translatey(-420px); transform:translatey(-420px) } http://codepen.io/jessekevon/pen/myjzjb?editors=010 you forgot f in transform .animate-up { -webkit-transform:translatey(-420px); -moz-transform:translatey(-420px); -ms-transform:translatey(-420px); -o-transform:translatey(-420px); transform:translatey(-420px); } it works in other browsers because transform:translatey(-420px) is spelled correctly.

Php , jQuery and html combined -

<script> $(".boxer").boxer({ formatter: formatcaptions }); function formatcaptions($target) { return '<p><span></span><?php the_field('price')?>' + $target.attr("title") + '</p>'; } </script> i'm using jquery lightbox. fact in localhost worked well, i'm online doesn't show need. site www.automediarent.it ( go page "autoveicoli" under "le mie auto" ) hope me. lightbox 1 formstone you not appear printing result of php function. try this: <script> $(".boxer").boxer({ formatter: formatcaptions }); function formatcaptions($target) { return '<p><span></span><?php echo the_field('price'); ?>' + $target.attr("title") + '</p>'; } </script>

c++ - How can i make snake elongate when colliding with an object? -

i have controllable snake head shape responds input , have shapes drawn onto game board. have @ code , me out additions/amendments can make make snake grow when intersects 1 of spawned shapes? all project files on pastebin: http://pastebin.com/u/addsy thanks. you store snake's body parts in linked list in snake's class. rendering boil down iterating on list , rendering each part separately. moving, once have direction, move head, , move every body part in list position of 1 before it. example, head moves first, first part moves previous position of head, second part position of first part , forth. elongate snake, on move, create 1 more node @ end of list, position of tail before movement.

asp.net - SQL Insert NOT always creating row in table -

i have aspx.vb program checks table see if session exists , if not connects our ecm software, consumes license, , updates table sessions information. if user tries log in again should find existing session , still consume 1 license. this works 99% of time except user consume 2 licenses creates 1 row in table, in turn leaves duplicate session caught in limbo , has manually disconnected release license. i added logging , hitting code should , variables passing correct values. possible code running through logic fast before connection can established database? lvsql = "insert onbase_sessions values (@dbseqnum,@sid,@uname,@lastactivity,@ccseqnum)" x = new sqlcmds(lvsql, "onbaseapi") x.addintparameter("@dbseqnum", sqldbtype.int, 4, lvdatasourceseq) x.addstrparameter("@sid", sqldbtype.varchar, 40, lvsession) x.addstrparameter("@uname", sqldbtype.varchar, 15, user.username) ...

range - javascript contentEditable - wrap cross-tag selections -

i'm experimenting bit contenteditable , encountered issue: have following js snippet var range = document.getselection().getrangeat(0); var newnode = document.createelement("span"); newnode.classname = "customstyle"; range.surroundcontents(newnode); and html fragment: <ul> <li>the <b>only entry</b> of list</li> </ul> <p>some text here in paragraph</p> the js code allows wrap current selection <span> tag. it works when selection includes whole html tags (e.g. selecting 'the entry of') not, of course, when selection includes 1 of endings (e.g. selecting 'entry' 'some', both included). though i'm aware problem not trivial, i'm looking suggestions best approach. in advance! the basic approach if you're interested in wrapping text parts is: get selection range for each range boundary, if lies in middle of text node, need split text node in 2 @ ...

xcode - How to configure NSTreeController in Interface Builder -

when select nstreecontroller in interface builder (in xcode 4.6.3) , @ attributes inspector, see 2 sections named tree controller , object controller. tree controller part makes sense, i'm having trouble finding explanation of object controller section. first item "mode", options "class" , "entity name", , think use latter when using core data , former when not. i'm not using core data. so, what's meaning of next item, class name? defaults nsmutabledictionary , thought standard tree node type nstreenode . specifically, if want tree node nstreenode represented object nsmutabledictionary , how fill in object controller section? post-answer afterthought: although see 1 can use nodes of type nsmutabledictionary build content tree outline view, there advantages making subclass of nstreenode . first, nstreenode automatically keeps track of parent links, can useful in cases. second, can define data members properties, , access the...

vba - How can I check if a string only contains letters? -

i'm using function allows me review string of text , evaluate if composed of letters. housed in module called "general". general module exists house public functions , variables. function code listed below: public function isalpha(strvalue string) boolean dim intpos integer intpos = 1 len(strvalue) select case asc(mid(strvalue, intpos, 1)) case 65 90, 97 122 isletter = true case else isletter = false exit end select next end function next have 2 "if" routines evaluate first 2 characters of textbox in userform. first routine asks if 1st character numeric , second routine asks if 2nd character alpha. currently, second "if" routine ejecting me sub-routine when isalpha tests true, rather generating msgbox. isalpha function not being called correctly? if routines code listed below: private sub cmdmap_click() txtdxcode if isnumeri...

php - Services not loaded at Resources/config/services.yml, why? -

i'm running issue here , don't know why or failing, perhaps miss configuration or so, anyway, have code @ dependencyinjection\appextension.php file: use symfony\component\dependencyinjection\containerbuilder; use symfony\component\config\filelocator; use symfony\component\httpkernel\dependencyinjection\extension; use symfony\component\dependencyinjection\loader; class appextension extends extension { /** * {@inheritdoc} */ public function load(array $configs, containerbuilder $container) { $configuration = new configuration(); $config = $this->processconfiguration($configuration, $configs); $loader = new loader\yamlfileloader($container, new filelocator(__dir__.'/../resources/config')); $loader->load('services.yml'); } } then @ resources/config/services.yml have this: services: pdone.twig.extension: class: groupdca\pdonebundle\extension\pdonetwigextension tags: ...

dojo - Best practices when defining JavaScript variables -

when setting dojo application, recommended best practice initiating variables in reference dom objects? i've found need reference parent , children objects on top of widget , have been creating global placeholders following code. var formitems = ["item_1", "item_2", "item_3", ... "item_15"]; formitems.foreach(function(formitem) { var items = ["frm", "dom", "dijit"]; items.foreach(function(item) { var x = item + formitem; window[x] = undefined; }); }); vs var frmitem_1, frmitem_2, frmitem_3, ... frmitem_15; var domitem_1, domitem_2, domitem_3, ... domitem_15; var dijititem_1, dijititem_2, dijititem_3, ... dijititem_15; the variables populated later in dojo application after has been parsed @ "save", jshint becomes upset due no actual explicit variables being defined. i don't either of options. prefer have few global variables absolutely necessary. i...

Gulp convert directory of files and their contents to a JavaScript file -

i able setup gulp build system following: scan directory of files , store each file's contents value in javascript object. for example, if have following directory structure: templates/ a.html b.html c/ x.html the following javascript generated: templates["a.html"] = "<contents of templates/a.html>"; templates["b.html"] = "<contents of templates/a.html>"; templates["c/x.html"] = "<contents of templates/c/x.html>"; does know of gulp plugin this? may you: gulp-concat-util . usage: var concat = require('gulp-concat-util'); gulp.task('concat:dist', function() { gulp.src('scripts/{,*/}*.js') .pipe(concat('combined.js') .pipe(concat.header('templates["<%= file.path %>"] =')) .pipe(concat.footer(';\n')) .pipe(gulp.dest('dist')); });

rails 4 sending "no-cache" for most (but not all) js and css assets -

i'm trying debug issue rails 4 server of js , css assets being sent clients cache-control header of "no-cache". despite having digest appended. i'm not certain, may assets included other assets "no-cache" header. the ones don't have "no-cache" (correctly) getting "public, max-age=31536000". is there step need take included assets make them use right cache-control directive? i'm not rails expert nor person set particular server. trying debug issue after fact. edited add: it turns out js files being handled correctly (i.e. "public, max-age=31536000") ones explicitly listed in assets/javascripts/application.js. file looks like: //= require jquery //= require jquery_ujs //= require datatables/jquery.datatables //= require jquery-ui //= require turbolinks //= require_tree . all js files not working correctly located @ at paths form: /assets/javascripts/datatables/extras/file.js

php - Accessing Parent relations Laravel -

i have situation need iterate through models relationships (1 many) , call function on children. i.e. $parent = parentclass::find(1) $children = $parent->children; foreach($children $child) { $child->function(); } the function inside child needs access fields parent model. i.e. public function function() { if($this->parent->attribute) return "true!"; return "false"; } executing above, ends n+1 query problem. each child ends executing "select * parents id = 1". i've had 3 thoughts on how fix this, though 2 of them feel awful, , last 1 doesn't seem great me, i'm asking there better solution have considered? solution 1: eager load parent onto child models. i.e. ... $children = $parent->children; $children->load('parent'); foreach($children $child) ... i think it's pretty obvious why awful, tremendous memory hog have parent model stored in memory n+1 times. solution 2: pass par...

php - Email content having = unwantedly -

i send mail using codeigniter.. when receive mail having unwanted "=" everywhere. below are, phasellus dictum sapien neque luctus cursus. pellentesque sem do=or, fringilla et pharetra vitae. consequat vel lacus. sed iaculis pulvinar=igula, ornare fringilla ante viverra et. in hac habitasse platea dictumst=. donec vel orci mi, eu congue justo. integer eget odio est, eget malesuada=orem. aenean sed tellus dui, vitae viverra risus. nullam massa sapien, pu=vinar eleifend fringilla id, convallis eget nisi. mauris sagittis dui. p=llentesque non lacinia mi. fusce sit amet libero sit amet erat venenatis s=llicitudin vitae vel eros. cras nunc sapien, interdum sit amet porttitor u=, congue quis urna. code: $config = array( 'protocol' => 'smtp', 'smtp_host' => 'mail.****.com', 'smtp_port' => 587, 'smtp_user' => '*****@****.com', 'smtp_pass' ...

unix - Change user id of all running process without stopping them -

i have presently process running user1 id on server . have new user user2 , want process running user1 run user2 . done consistency other host uses user2 should things should follow , must things ? note user1 , user2 both have root privileges. number of processes running currenyly user1 half of process running on server. i don't believe possible. process can call setuid() itself, trying change user identity on running process have disastrous effects: process requiring privileges loses them causing exceptions, or process shouldn't have privileges (and poorly written) damage system upon gaining them. historical log data process may no longer make sense, , if process has kind of cache @ related user name (say file in home directory) or privileges cache become invalidated without process having way of knowing that. the 'real' way restart processes new user.

ios - AFHTTPSessionManager Delegate issue -

here issue: have afhttpsessionmanager file, singleton, , manage api requests server. once got answer server responseobject , pass uiviewcontroller asked using delegate. my problem : since manager singleton, if api request made in meantime uiviewcontroller , delegate set controller , when first request responseobject received can't pass first uiviewcontroller anymore. i hope it's easy understand. what right way solve problem ? here method looks in afhttpsessionmanager class : - (void)getstaffforcompany:(int)companyid { if ([[nsuserdefaults standarduserdefaults] objectforkey:@"currentuser"]) { nsmutabledictionary *parameters = [nsmutabledictionary dictionary]; parameters[@"apikey"] = agendizeapikey; parameters[@"token"] = [[agzusermanager sharedagzuser] currentapplicationuser].token; [self get:[nsstring stringwithformat:@"scheduling/companies/%d/staff", companyid] parameters:parame...

Xamarin iOS app SIGSEGV -

i getting occasional sigsegv errors below in app (c# xamarin ios app latest version of xamarin studio=5.8.3, xamarin.ios=8.9.1.3 it looks in crashed in uikit , own app "obymobimobileappios" it's in "main". what kind of problem is? how can more info or debug it? i can reproduce using app 5 mins. stacktrace: at <unknown> <0xffffffff> @ (wrapper managed-to-native) uikit.uiapplication.uiapplicationmain (int,string[],intptr,intptr) <0xffffffff> @ uikit.uiapplication.main (string[],intptr,intptr) [0x00005] in /developer/monotouch/source/monotouch/src/uikit/uiapplication.cs:62 @ uikit.uiapplication.main (string[],string,string) [0x0001c] in /developer/monotouch/source/monotouch/src/uikit/uiapplication.cs:45 @ obymobi.mobile.app.ios.application.main (string[]) [0x000b9] in /users/billbatchelor/documents/mobile development/allinone/obymobi.xamarin/obymobi.mobile.app.ios/main.cs:52 @ (wrapper runtime-invoke) object.runtime_invoke_dynamic (i...

java - Gson with static type, or runtime type -

i serializing class hierarchy gson, , proof-of-concept code: import com.google.gson.gson; class { public string afield; } class b extends { public string bfield; } class main { static public void main(string[] args) { b b = new b(); b.afield = "field a"; b.bfield = "field b"; a = b; gson gson = new gson(); system.out.println(gson.tojson(a)); } } with prints out: {"bfield":"field b","afield":"field a"} so can see gson uses fields dynamic type of object going serialize (class b). but. there way make gson use static type of object (class a)? want someting like {"afield":"field a"} thanks. as @njzk2 posted, have use tojson(object src, type srctype) a's class in gson.tojson(a, a.class) . for other folks didn't see little detail me: you have use a.class, , not a.getclass(). former identifier of class, latter r...

c# - Wpf facebook app errors: -

currently i'm making wpf facebook application , in code continuously 2 errors coming: first error 'facebookapi namespace used type' second error the type or namespace name jsonobject not found (are missing using directive or assembly reference)?

wkhtmltopdf - wicked_pdf gem throws Runtime error on Windows -

runtimeerror @ /reports/1/print bad wkhtmltopdf's path: bundler: command not found: install missing gem executables `bundle install` error happening when render pdf: "pdf_name" called inside controller. gems using - rails 4.2 , wkhtmltopdf-binary 0.9.9.3 , wicked_pdf 0.11.0 . i don't understand error means , how can resolve it. in advance. after downloading , installing wkhtmltopfd directly in c drive (move out if inside program files), make wicked_pdf.rb in intializers dir code in it: wickedpdf.config = { #:wkhtmltopdf => '/usr/local/bin/wkhtmltopdf', #:layout => "pdf.html", :exe_path => 'c:\wkhtmltopdf\bin\wkhtmltopdf.exe' } restart rails server , must fixed :)

mysql - How do i join 3 different types of sql queries into 1 -

i have 1 main query , based on it's results have create 3 more in order display data need. loop, however, creates many queries server. understand it's possible avoid sql joins, i'm not how work in case. select * `newloads` `id` '%".$term."%' or `loadnumber` '%".$term."%' order `pudate` desc //this main query , every result produces query following in **while** loop: select count(*) `newstops` idload = '".$load['id']."' select newstops.idconsignee, consignees.name, consignees.address `newstops` inner join `consignees` on newstops.idconsignee = consignees.id idload = '".$load['id']."' order stopnumber asc limit 1 //the last 1 same previous it's ordered stopnumber desc select newstops.idconsignee, consignees.name, consignees.address `newstops` inner join `consignees` on newstops.idconsignee = consignees.id idload = '".$load['id']."' order stopnumber ...

c - Drawing images compensation algorithm -

Image
in old/regular environments choice render image using base drawing functions putpixel(x, y); (puts pixel in x/y location of canvas) lineto(x, y); (draws line offset x/y location of canvas) moveto(x, y); (moves offset x/y location of canvas) setpen(r, g, b, transp, size); but slow, if lot has drawn @ once. i willing invent compensation algorithm accords picture exemplified: what can see predict more appropriate use lineto instead putpixel save iterations. in example, skips more 50% of iterations. (the red line indicates offset not drawn putpixel, part of already-drawn line) decides whether vertical or horizontal line better. hard , slow buffering if has done sin/cosin functionions determine angle? is there advice can receive simplify work (or if there existing similar mechanisms), before start? what kind of crazy api processing involved apply such algorithm more compensates api calling overhead? more restrictive tricks had use during days of single...

vbScript - Using Select/Case with an array -

i need following: dim reportesta(2) reportesta(0) = "report1" reportesta(1) = "report2" i want execute actions each item in array list. thinking of working select/case. tried didn't work: select case reportesta case 0 //do stuff case 1 //do stuff end select is there way cases switch? switch/case? has better way work each item of array? much. dim reportesta(2) reportesta(0) = "report1" reportesta(1) = "report2" = lbound(reportesta) ubound(reportesta) select case reportesta(i) case "report1" msgbox "report1" case "report2" msgbox "report2" end select next explanation: in "for" cycle passing through of elements in array, starting first 1 till last one. function "lbound" return lowest id of available element in array. function "ubound" return highest id of available element in array. in "select...

Excel VBA move select items from listbox to a listbox in a differnt form that will be another popup userform -

i have workbook has listbox people can select multiple rows. want take information once selected listbox in new form pop once selected. i found examples transfer between listboxes in same userform, need moving them between different forms. this code shows how pass information between 2 user forms on same form. need modify move between 2 different forms. if click submit button , listbox textboxes pops up. option explicit 'move listbox items in userform 'code dave peterson 'posted on www.contextures.com private sub btn_moveallleft_click() dim ictr long ictr = 0 me.listbox2.listcount - 1 me.listbox1.additem me.listbox2.list(ictr) next ictr me.listbox2.clear end sub private sub btn_moveallright_click() dim ictr long ictr = 0 me.listbox1.listcount - 1 me.listbox2.additem me.listbox1.list(ictr) next ictr me.listbox1.clear end sub private sub btn_moveselectedleft_click() dim ictr long ictr = 0 me.listbox2.listcount - 1 if...

label - c# controls flash on startup -

i have standard desktop form picture background , various labels on it. when run project have following output result: form appear drawing background nicely 1/3 second labels white, color of label background white, it's set transparent. i tried set visibility of form false or opacity 0% , after few seconds make visible, same result, nothing changed. i tried use double buffered graphic problem not flickering nothing changed too. any idea on how bypass this? move heavy logic form load event handler form shown event handler. might want have labels visible property set false in designer , set them true on form shown event.

concurrency - QTP/UFT: How to find # of concurrent users using a script? -

we have 10 licenses of antiquated qtp / uft , we'll kick off test when of licenses being used causes issues. i've been trying find way query qtp in order find # of concurrent users @ given time. commandline, batch, python, powershell, whatever works fine. that way, prior running test, can check how many users there , if equals 10, can send off email or ping off. do think possible? the qtp cd-rom/installable directory has licenseserver\utils folder. under can find exe wlmadmin.exe it can give information of users (user id, ip, machine name etc ) has launched qtp/uft connecting license server. not sure if has api information programmatically. you can check in qtp's help.

ios - Obj-C get JSON key name -

hi trying create link between php , ios, , using json. although json array strange, not creator, in closed api, cannot change it. the json looks this: {"success":true,"errors":[],"data":{"servers":{"6":"name here"}}} the 6 id of server, , other 1 name. as can see key id , value name, how id in objective-c? know how receive server name, need find server id. here current code: nsdictionary *json = [[nsdictionary alloc] init]; nserror *error; json = [nsjsonserialization jsonobjectwithdata:_responsedata options:kniloptions error:&error]; nsdictionary *test = [datadict objectforkey:@"servers"] nslog(@"%@", [test objectforkey:@"6"]); // server name (id of server 6) _responsedata json data received php script. you like: [test enumeratekeysandobjectsusingblock:^(nsstring* serverid, nsstring *servername, bool *stop) { // process data here. }]; ...

asp.net web api2 - Web Api 2 Post - UrlHelper.Link must not return null -

i have basic web api 2 setup basic routing. below default route , post inserts. when call post record created in database "createdatroute" call returns 500 error stating: exceptionmessage: "urlhelper.link must not return null." exceptiontype: "system.invalidoperationexception" why receive error? [routeprefix("api/casenotes")] public class casenotecontroller : apicontroller... // post api/casenote [route("")] [responsetype(typeof(client_admission_casenote))] public async task<ihttpactionresult> postclient_admission_casenote (client_admission_casenote client_admission_casenote) { request.getrequestcontext().includeerrordetail = true; if (!modelstate.isvalid) { return badrequest(modelstate); } db.client_admission_casenote.add(client_admission_casenote); await db.savechangesasync(); return createdatroute("defaultapi", new { id = client_admission_casenote.casenote_id }, c...

xpath - How to use substring() with Import.io? -

i'm having issues xpath , import.io , hope you'll able me. :) the html code: <a href="page.php?var=12345"> for moment, manage extract content of href ( page.php?var=12345 ) this: ./td[3]/a[1]/@href though, collect: 12345 substring might solution not seem work on import.io use it... substring(./td[3]/a[1]/@href,13) any ideas of problem is? thank's lot in advance! try using xpath: (have field selected text) .//*[@class='oeil']/a/@href then use regex: ([^=]*)$ this isbn number looking for. import.io support functions in xpath when return node list

sql - Relational data structure in python -

i'm looking sql-relational-table-like data structure in python, or hints implementing 1 if none exist. conceptually, data structure set of objects (any objects), supports efficient lookups/filtering (possibly using sql-like indexing). for example, lets objects have properties a , b , , c , need filter by, hence define data should indexed them. objects may contain lots of other members, not used filtering. data structure should support operations equivalent select <obj> <datastructure> a=100 (same b , c ). should possible filter more 1 field ( where a=100 , b='bar' ). the requirements are: should support large number of items (~200k). items must objects themselves, , not flattened version of them (which rules out sqlite , pandas ). insertion should fast, should avoid reallocation of memory (which pretty rules out pandas ) should support simple filtering (like example above), must more efficient o(len(data)) , i.e. avoid "full table scans...

vb.net - VB .net datetimepicker reporting wrong value -

ok, i'm experiencing strange behavior in datetimepicker fields in program. use short format usually, , use pair of them date range selections. problem i'm experiencing if user using keyboard input. can tab , arrow through field normal key in date. if date part entering doesn't fill it's section of mask , press enter activate formdefault without shifting focus away portion of date, value of dtp when ok_button.click event run whatever value had in before typed change. give specific example: user tabs date field. default date in field today's date, 4/14/2015. type in 1, arrow day, put in 1, arrow year , type 14, press enter. reported value of dtp going 1/1/2015. had instead typed out 2015, or used arrow move date part or tab shift focus control, dtp auto update fill in rest of year. same problem exist if had typed in 1 month , hit enter, not happen if put in 12 month. solution can think of, , haven't yet tried implement because sounds real kludge ,...

php - Compile Error: Cannot use isset() on the result of an expression -

i'm getting error in app migrating sf2.0.x sf2.7: [1] symfony\component\debug\exception\fatalerrorexception: compile error: cannot use isset() on result of expression (you can use "null !== expression" instead) @ n/a in /var/www/html/reptooln_admin/app/cache/dev/twig/68/7f/63589dd3687cb849dd68e6b6c10aa99eda1d82f95a5f3ac52a864d200499.php line 39 i don't know failing or how fix need advise. line @ cache file stacktrace reported: if ((((empty((isset($context["form_action"]) ? $context["form_action"] : $this->getcontext($context, "form_action"))) == true) || (isnull((isset($context["form_action"]) ? $context["form_action"] : $this->getcontext($context, "form_action"))) == true)) || (isset((isset($context["form_action"]) ? $context["form_action"] : $this->getcontext($context, "form_action"))) == false))) { echo " "; ...

osx - Why does Command + V behave like Page Up? -

on os x 10.10 (yosemite), keyboard shortcut paste clipboard command ⌘ + v behaves page up. right i'm able reproduce issue in mail , evernote. pressing super + v , super + v pageup, paste though. i use karabiner remap keys, never command ⌘ keys. if close karabiner doesn't change anything. i have @ point used vim, pbcopy terminal command, , os configuration https://github.com/mathiasbynens/dotfiles/blob/master/.osx but don't see why problem. does know how fix or why happens? are able replicate issue in multiple users on machine? if so, issue have modifications outlined above (such karabiner or vim), or larger operating system related issue. if you're not able replicate problem in multiple users, related problematic preference file. if open finder window , navigate ~/library/preferences, try moving com.apple.hitoolbox.plist desktop, logging out, logging in , testing again. let know if either of suggestions help!

javascript - Hide and show div in a form using java script -

this question has answer here: javascript show/hide based on dropdown 2 answers i have 2 fields in form, first field drop down menu shown below. second date picker. <div class="form-group"> <label for="customername" class="col-sm-3 control-label">requires fpc? :</label> <div class="col-sm-7"> <select class="col-sm-12 form-control" id="fpc" name="fpc" required> <option value="yes">yes</option> <option value="no">no</option> </select> </div> </div> <div class="form-group"> <label for="internal_ship_date_label" class="col-sm-3 control-label" id="internal_ship_date_label" name="internal_ship_date_label">internal ship date:</label> <div cla...

cakephp 3 bin/cake Bake sets user model/controller owner to root -

i have tried new quick start tutorial in cakephp docs. i have noticed user files have owner permissions set root , therefor locked when try edit in phpstorm. even directory template/users set root. all other files set logged in username. is expected result? not see in docs. should change owner of files? when install cakephp composer, sets directory/file permissions appropriately web server can access files needs. bake runs shell, when bake, creates models, controllers, , views (templates), , whatever else baked using permissions of user logged in when ran bake. if run bake again logged in standard user (not root or sudo), phpstorm should able access files writable.

sql - How to dynamic update columns in Ruby on Rails -

i have array of desired columns edit (wich dynamic), this: toedit = ["last_name_required", "email_required", "phone_required"] remember, dynamic can have phone. example: toedit = ["phone_required"] i have model sql columns like: last_name_required email_required phone_required those columns accept boolean values. i want generate code edit columns array values parameters. this: o = model.fist o.last_name_required = true o.phone_required = true o.save i've tried like: o = model.first o.toedit[0] = true o.toedit[1] = true o.save but understand wrong because trying use string object. i don't know what's appropriate syntax. any ideas? thanks o = model.new toedit.each |key| o.send "#{key}=".to_sym, true end o.save

java - Can't transfer a file with a binary transfer with a FTP client -

have ftp client transfer files byte array. in console says transferred doesn't transfer , these errors: exception in thread "main" java.net.connectexception: connection refused: connect @ java.net.dualstackplainsocketimpl.connect0(native method) @ java.net.dualstackplainsocketimpl.socketconnect(unknown source) @ java.net.abstractplainsocketimpl.doconnect(unknown source) @ java.net.abstractplainsocketimpl.connecttoaddress(unknown source) @ java.net.abstractplainsocketimpl.connect(unknown source) @ java.net.plainsocketimpl.connect(unknown source) @ java.net.sockssocketimpl.connect(unknown source) @ java.net.socket.connect(unknown source) @ java.net.socket.connect(unknown source) @ java.net.socket.<init>(unknown source) @ java.net.socket.<init>(unknown source) @ ftp.ftp.connect(ftp.java:110) @ ftp.test.main(test.java:12) i want files tranferred filepath: c:/users/username/desktop/ftp this program: package ftp; import java.io.bufferedreader; import ja...

angularjs - Sharing data from multiple instances of a directive -

i have custom directive re-usable throughout application. directive uses ui-grid , i'm trying determine "angular way" of allowing access grid api anywhere in application. if single instance, i'd use service share data across controllers: var attachments = angular.module('attachments', ['ui.grid']); // accessible of controllers attachments.factory('attachments', function() { return {}; }); attachments.directive('attachments', function() { return { restrict: 'e', templateurl: 'attachments.html', // template has ui-grid, among other elements controller: ['$scope', 'attachments', function($scope, attachments) { $scope.gridoptions = { // ui-grid code here onregisterapi: function( gridapi ) { attachments.grid = gridapi; } }; }] }; }); however, there multiple insta...

Calling apps script function from drive UI -

i implemented function operates on file object in google drive(*). long story short: function dosomething(file) { ... } exists (in standalone google apps script) , tested. i want call drive ui, e.g. using context menu -> open ... (but sensible means ok). is there straightforward way achieve this? prefer not go through 'registering app in chrome store' whole shebang when need glorified macro myself. i finished listening https://www.youtube.com/watch?v=0hvjmieb3ae comes closest far seems skip technical details of need. (*) there rather frustrating repetitive per-file workflow within organization whereby 1 needs switch write accesses read-only, assign ownership given user change own rights read-only. this can absolutely done in apps script. there bit of set-up. video posted 1 used figure out. when app attached drive ui registered mime-types have app in right-click menu. i made barebones framework highly commented process. shows how handle cases of bei...

sql - Combining multiple VARCHAR fields as 1 DATE when inserting from one table to another in Oracle? -

i'm attempting create short script take of fields table1 , insert them table2. basic fields (col1, col2, col3, etc.) have got covered this: insert table1 (col1, col2, col3, col4, col5, col6, col7) select col1, col2, col3, col4, col5, sysdate, user table2 for col8 , col9 in table1 i'm little stuck though. col8/col9 instance date datatypes need inserted combining col6/col7/col8 , col9/col10/col11 table1 respectively together. each of these defined follows: col6/col9 -- varchar2 (2byte) // month col7/col10 -- varchar2 (2byte) // day col8/col11 -- varchar2 (4byte) // year looking online tried below, receive "not valid month" : insert table1 (......) select ...., to_date(tochar(col6, '00') || to_char(col7, '00') || to_char(col8, '9999'), 'mm/dd/yyyy'), ..... table 2 does know how i'm after here , combine 3 specific varchar fields date insertion 1 field in table1? if invalid values in columns z...

Compiling header using C, instead of C++ -

i have c++ project have configured using cmake use eclipse. problem have added static c library (namely, svm-struct/svm-light) doesn't seem compile- , guess it's compiling c++ instead of c. i added library project follows: set(svm_light_src_dir "../../libraries/svm_rank") include_directories(${svm_light_src_dir}) add_library( svm_rank_lib static ${svm_light_src_dir}/svm_light/svm_learn.c ${svm_light_src_dir}/svm_light/svm_common.c ${svm_light_src_dir}/svm_light/svm_hideo.c ${svm_light_src_dir}/svm_struct/svm_struct_learn.c ${svm_light_src_dir}/svm_struct/svm_struct_common.c ${svm_light_src_dir}/svm_struct/svm_struct_classify.c ${svm_light_src_dir}/svm_struct_api.c ${svm_light_src_dir}/svm_struct_learn_custom.c ) add_executable(${project_name} ${sources}) target_link_libraries(${project_name} svm_rank_lib) cmake configures fine seems. within output of configuration specifies finds c , c++ compilers , "work". add...

query optimization - MySQL slow group by date_format -

i have table daloradius: {create table `radacct` ( `radacctid` bigint(21) not null auto_increment, `acctsessionid` varchar(64) not null default '', `acctuniqueid` varchar(32) not null default '', `username` varchar(64) not null default '', `groupname` varchar(64) not null default '', `realm` varchar(64) default '', `nasipaddress` varchar(15) not null default '', `nasportid` varchar(15) default null, `nasporttype` varchar(32) default null, `acctstarttime` datetime default null, `acctstoptime` datetime default null, `acctsessiontime` int(12) default null, `acctauthentic` varchar(32) default null, `connectinfo_start` varchar(50) default null, `connectinfo_stop` varchar(50) default null, `acctinputoctets` bigint(20) default null, `acctoutputoctets` bigint(20) default null, `calledstationid` varchar(50) not null default '', `callingstationid` varchar(50) not null default '', `acctte...

plugins - Liferay search in several portlets -

the user see 4 portlets: 1. custom github portlet possible see different commits user in repository 2. custom jira portlet shows tasks user 3. nas server documents ordered users 4. database documents ordered users i want "main search field" possible enter username , update portlets search. is possible? if yes, how done? good tutorials custom portlets in general nice the best way this, "public render parameters", , easy. this example: <?xml version="1.0"?> <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"> <portlet> <portlet-name>p1</portlet-name> <display-name>p1</display-name> <portlet...

css - Get SVG child element width in scss -

given html svg shapes: <svg id="shapes"... <g id="myshape" class="myclass"> <g> <path fill="#e9eef1"... and output css scss: svg g { -moz-transform-origin: 50% 50%; -ms-transform-origin: 50% 50%; -webkit-transform-origin: 50% 50%; transform-origin: 50% 50%; } how svg child shape width (in pixels) css? i'm able javascript: var shape = document.getelementbyid('myshape'); console.log(shape.getbbox()); but need rotate svg child shape using transform-origin . using @include transform-origin(50%); , cannot use 50% chrome , firefox interpret % differently. need width of svg shape css can transform it.

PHP search array and return only first value that meets criteria -

i have directory of files labeled yyyy-mm-dd.jpg . using php, trying search through array of these files , print filename (without jpg) of latest date before today. for example: today 2015-04-14 files: 2015-04-20.jpg <-in future 2015-04-11.jpg <-first file has date before today's date 2015-04-02.jpg 2015-04-01.jpg i want return "2015-04-11". i've been working on couple days, trying piece things multiple posts. so, i've gone through lot of iterations. here one: $scan = scandir($comic_path,1); //go through directory desc $last_comic = substr($scan[0],0,10); //substr scan date function lastcomic(){ foreach ($scan $acomic) { if ($acomic < $last_comic) { echo $acomic . "\n"; } $last_comic = $acomic; }} lastcomic($last_comic); thanks in advance help. well, code in way: $today = date("y-m-d"); $last_comic = substr($scan[0],0,10); foreach ($scan $acomic) { $only_date = substr($acomic,0,...

javascript - Setting and getting value of select with jQuery -

i have question setting value of select drop down jquery i've written code // should find option want , set selected jquery('[name=' + obj.name + ']').val(obj.value) .find("option[value=" + obj.value + "]").attr('selected', true); // should set value of select same above jquery('[name=' + obj.name + ']').val(obj.value); providing obj.name = "selmanufacturer" , obj.value of option values of below select, have problem: the first piece of code seem work. can see option selected. when want .val() of select empty string. idea why? <select style="display:none;" class="js-manufacturerlist" name="selmanufacturer" id="manufacturerlist"> <option value=""></option> <option selected="selected" value="apple">apple</option> <option value="microsoft">microsoft</option> ...

RelativeLayout : android:layout_height has no effect -

for reason android:layout_height="200sp" attribute not have effect. preview gets drawn correctly in android studio if run app list items not changing size according android:layout_height="200sp" . using relativelayout list item listview . any suggestions? <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="120dip" android:background="#ffffff" > <imageview android:id="@+id/icon" android:src="@drawable/ic_launcher" android:layout_width="50dip" android:layout_height="50dip" android:layout_alignparentbottom="true" android:layout_alignparenttop="true" android:layout_gravity="center" /> </relativelayout> @edit: i've made simpler example. assume list items 120dip ...