Posts

Showing posts from June, 2012

windows - Batch file with simple FC command runs forever -

why simple batch file run forever printing out only line inside .bat file on , over my fc.bat file contents fc "%userprofile%\desktop\file1.txt" "%userprofile%\desktop\file2.txt" my desktop dir/ fc.bat file1.txt file2.txt! here image of cmd prompt after double clicking fc.bat output is ... c:\users\a\desktop>fc "%userprofile%\desktop\file1.txt" "%userprofile%\desktop\file2.txt" c:\users\a\desktop>fc "%userprofile%\desktop\file1.txt" "%userprofile%\desktop\file2.txt" c:\users\a\desktop>fc "%userprofile%\desktop\file1.txt" "%userprofile%\desktop\file2.txt" c:\users\a\desktop>fc "%userprofile%\desktop\file1.txt" "%userprofile%\desktop\file2.txt" c:\users\a\desktop>fc "%userprofile%\desktop\file1.txt" "%userprofile%\desktop\file2.txt" c:\users\a\desktop>fc "%userprofile%\desktop\file1.txt" "%userprofile%\desktop\file2.

c++ - How to check alignment of returned data in the malloc() implementation? -

malloc(sz) returns memory alignment works object. on 32-bit x86 machines, means address value returned malloc() must evenly divisible 4. in practice, 32-bit malloc implementations return 8-byte aligned memory, meaning returned addresses evenly divisible 8. should too. (on x86-64/ia-64 machines, maximum data alignment 8, malloc implementations return 16-byte aligned memory.) i have test situation // check alignment of returned data. int main() { double* ptr = (double*) malloc(sizeof(double)); assert((uintptr_t) ptr % __alignof__(double) == 0); assert((uintptr_t) ptr % __alignof__(unsigned long long) == 0); char* ptr2 = (char*) malloc(1); assert((uintptr_t) ptr2 % __alignof__(double) == 0); assert((uintptr_t) ptr2 % __alignof__(unsigned long long) == 0); } my malloc code allocate more space user requested. first part of space used store metadata allocation, including allocated size. sizeof(metadata) % 8 == 0 but heap static char he

c# - How to return generic object that could be from two different types -

i’m trying create middle layer allow me connect either live service or test service without making changes client. i need return generic object called product use in client. middle layer don't need know how or it's from. middle layer connects live , test service , call method stuff need. the problem returning product got whichever service client. method expecting product it's trying send liveservice.product or testservice.product . is there way convert these types generic product type can returned client? below have created far. client connection conn = new connection("test"); iserviceimplementation service = conn.getserviceimplementation(); product prod = service.getproductusingid(123); middle layer public interface iserviceimplementation { product getproductusingid (int productid); } public class connection { private string mode; public connection(string _mode) { mode = _mode; } public iserviceimplement

asp.net - Prevent users from changing the parameter ID in the Edit action method -

so url on edit/details method looks http://localhost:1234/movies/edit?id=3 . if db table contains records belongs else 1, 2, 4, 5, 6. there nothing stopping user directly typing , accessing record 6 (eg /movie/edit/6). how can prevent happening? // get: /movie/edit/id public actionresult edit(int id = 0) { movie movie = db.movies.find(id); if (movie == null) { return httpnotfound(); } return view(movie); } // // post: /movie/edit/id [httppost] public actionresult edit(movie movie) { if (modelstate.isvalid) { db.entry(movie).state = entitystate.modified; db.savechanges(); return redirecttoaction("index"); } return view(movie); } well depends want restrict , want them restrict editing privileges, i'm going give generic answer. can request authorization each of methods or entire class. can give

c++ - Qt - multimedia button events not being forwarded to the OS -

i've created default qt application in visual studio 2013 qt add-in. there's no event filter. multimedia button events not being forwarded windows. i've tried override qmainwindow::event , see output: bool mainwindow::event(qevent *event) { cout << event->type() << endl; return qmainwindow::event(event); } press: 51 - qevent::shortcutoverride 51 - qevent::shortcutoverride 6 - qevent::keypress release: 7 - qevent::keyrelease they registered qt application. what's blocking them? i have notebook multimedia buttons separated function keys , work except volume , volume down buttons. notification (from driver) pops on key-down, volume doesn't change i'm holding button down.

postgresql - How to configure gitlab to use existing postgres server -

when installing gitlab default nginx , postgres .. among other things installed regardless of whether have them or not. since have these 2 already, trying configure gitlab use them, have done nginx, using: $ vi /etc/gitlab/gitlab.rb: # disable gitlab's nginx nginx['enable'] = false # set external web user 'nginx' on centos 7 web_server['external_users'] = ['nginx'] but need know how same postgres . according this doc , put in /etc/gitlab/gitlab.rb : # disable built-in postgres postgresql['enable'] = false # fill in values database.yml gitlab_rails['db_adapter'] = 'postgresql' gitlab_rails['db_encoding'] = 'utf8' gitlab_rails['db_host'] = '127.0.0.1' gitlab_rails['db_port'] = '3306' gitlab_rails['db_username'] = 'foo' gitlab_rails['db_password'] = 'bar' and run command apply values : sudo gitlab-ctl reconfigure . need seed

python - How to edit text file through iPython Notebook connected to remote server? -

i'm exploring new workflow interacting remote server , ipython has many attractive properties session logging , scripting. 1 thing have not figured out yet how effective text file manipulation on remote machine. i'm aware of %load , %writefile magic commands, that's quite awkward general use. is there way %edit work when using notebook connected remote (*nix) server? best solution simple editor opens in web browser similar panes created command_name? viewer. search seems suggest doesn't exist. have found pep requesting it. i figure it's possible have %edit trigger x-windows editor open on local machine, don't see how make happen. fine answer if there's way it. i should clarify i'm not interested in executing python code in files, want edit file. i.e. %edit -x general use case.

regex - Only match if surrounded by quotes -

Image
this question has answer here: regex: grabbing values between quotation marks 14 answers i need match words of criteria, only if within quotes*. i'd wish via regex. i think there's "jquery plugin that". google jquery basic arithmetic plugin. let's have above text subject of regex search, , i'd wish find word "plugin" , if inside quotes . not need match second "plugin" word @ end of sentence, since it's not within quotes, (edit) need match multiple occurrences of "plugin" , enclosed quotes (even if there multiple occurrences inside single quotation block). with working expression, following words (highlighted bold text) should matched: i think there's "jquery plugin that". google jquery basic arithmetic plugin. i have theoretical solution use positive lookahead determine i

java - Finding the Number of Times an Expression Occurs in a String Continuously and Non Continuously -

i had coding interview on phone , asked question: given string (for example): "aksdbaalaskdhfbblajdfhacccc aoudgalsaa bblisdfhcccc" and expression (for example): "a+b+c-" where: +: means char before repeated 2 times -: means char before repeated 4 times find number of times given expression appears in string operands occurring non continuously , continuously. the above expression occurs 4 times: 1) aksdbaalaskdhfbblajdfhacccc aoudgalsaa bblisdfhcccc ^^ ^^ ^^^^ aa bb cccc 2) aksdbaalaskdhfbblajdfhacccc aoudgalsaa bblisdfhcccc ^^ ^^ ^^^^ aa bb cccc 3) aksdbaalaskdhfbblajdfhacccc aoudgalsaa bblisdfhcccc ^^ ^^ ^^^^ aa bb cccc 4) aksdbaalaskdhfbblajdfhacc

javascript - Hover over data point on leaflet-heatmap.js heatmap to get value -

i'm following tutorial , have modified meet needs (mapping air quality index zip-code). want hover on data point value. here code tutorial, close ended with: var testdata = { max: 8, data: [{lat: 24.6408, lng:46.7728, count: 3},{lat: 50.75, lng:-1.55, count: 1},{lat: 52.6333, lng:1.75, count: 1},{lat: 48.15, lng:9.4667, count: 1},{lat: 52.35, lng:4.9167, count: 2},{lat: 60.8, lng:11.1, count: 1},{lat: 43.561, lng:-116.214, count: 1},{lat: 47.5036, lng:-94.685, count: 1},{lat: 42.1818, lng:-71.1962, count: 1},{lat: 42.0477, lng:-74.1227, count: 1},{lat: 40.0326, lng:-75.719, count: 1},{lat: 40.7128, lng:-73.2962, count: 2},{lat: 27.9003, lng:-82.3024, count: 1},{lat: 38.2085, lng:-85.6918, count: 1},{lat: 46.8159, lng:-100.706, count: 1},{lat: 30.5449, lng:-90.8083, count: 1},{lat: 44.735, lng:-89.61, count: 1},{lat: 41.4201, lng:-75.6485, count: 2},{lat: 39.4209, lng:-74.4977, count: 1},{lat: 39.7437, lng:-104.979, count: 1},{lat: 39.5593, lng:-105.006, count: 1},{lat:

java - Get Words out of a Trie Data Structure -

i have following trie data structure: public class cdictionary implements idictionary { private static final int n = 'z' -'a'+1; private static class node { private boolean end = false; private node[] next = new node[n]; } private int size = 0; private node root = new node(); @override public boolean contains(string word) { node node = this.contains(root,word,0); if (node == null) { return false; } return node.end; } private node contains(node node, string str, int d) { if (node == null) return null; if (d == str.length()) return node; char c = str.charat(d); return contains(node.next[c-'a'], str, d+1); } @override public void insert(string word) { this.root = insert(this.root, word, 0); this.size++; } private node insert(node node, string str, int d) { if (node == null) node = new node(); if (d == str.length()) { node.end = true; return node; } char c = str.ch

android - imageview in actionbar with navigationdrawer -

i'm using navigation drawer , define theme change actionbar color. want add image menu (bell) actionbar receive notification. problem application crush log point @ imageview imageview bell= (imageview)badgelayout.findviewbyid(r.id.bell); this log: 04-29 16:38:14.835 10481-10481/com.project e/androidruntime﹕ fatal exception: main java.lang.nullpointerexception @ com.nearby.project.princ.main.oncreateoptionsmenu(main.java:520) @ android.app.activity.oncreatepanelmenu(activity.java:2553) @ android.support.v4.app.fragmentactivity.oncreatepanelmenu(fragmentactivity.java:275) @ android.support.v7.app.actionbaractivity.superoncreatepanelmenu(actionbaractivity.java:276) @ android.support.v7.app.actionbaractivitydelegate$1.oncreatepanelmenu(actionbaractivitydelegate.java:79) @ android.support.v7.app.actionbaractivitydelegatebase.preparepanel(actionbaractivitydelegatebase.java:979) @ android.support.v7.app.actionbaractivitydel

Steroids: supersonic.ui.drawers.init rejected: {} -

i'm new steroids , want navigation drawer automatically opened once initialized (angularjs module drawer named "profile-filter-drawer"). here code: angular .module('profile-list') .controller('indexcontroller', function($scope, supersonic) { var draweroptions = { side: "left", width: 150 } supersonic.ui.drawers.init("profile-filter-drawer#index", draweroptions).then(function() { supersonic.ui.drawers.open("left"); }); }); i keep getting log in steroids connect , dont understand why or how fix it. supersonic.ui.drawers.init rejected: {} note: navigation drawer working (the angularjs module valid) if instantiated in structure.coffee not angularjs controller. thanks if still have drawer code in structure.coffee trying instantiate drawer of same type rejected. wrong on this, same happens when trying push views exist on stac

javascript - How to deal with mutli level drop down menu by touch devices -

i designed website using html , css. includes 3 levels of navigation menu , worked on desktop. problem occurs in touch devices (smartphone , tablet) sub menu isn't still shown when element of parent menu touched, because there no crosser hover on item. how can solve problem? here code menu: <!doctype html> <html> <head> <title>document</title> <meta chrset="utf-8"> <meta name="author" content="ralph phillips"> <style> * {margin:0px; padding:0px;} body {font-family:verdana;background-color:#abc;} h1{text-align:center;border-bottom:2px solid #009;margin-bottom:50px;} ul#navmenu, ul.sub1, ul.sub2{list-style:none;font-size:9pt;} ul#navmenu li{width:125px;text-align:center;position:relative;float:left;margin-right:4px;} ul#navmenu a{text-decoration:none;display:block;width:125px;height:25px;line-height:25px;background-color:#fff;border:1px solid #ccc;border-radius:5px;} ul#navmenu .s

PHP JQuery - Multiple fields post -

i looking advice on how this, concept confusing me. not looking exact solution, logic. i have html form this: | name | price | comment which pass php script updates record inside database. problem being that, going going creating multiple entries (through jquery) , don't know how pass these 1 through php file. know can this: <input type="name" id="name[]" value="" /> and handle each of posts array, and, can of fields inside form. there efficient way link them up? for example: if have 5 new rows array going be: $_post['names'] = {"name1", "name2", "name3", ...} $_post['cost'] = {"cost1", "cost2", "cost3", ...} $_post['comments'] = {"comment1", "comment2", "comment3", ...} i hope makes sense , can me! this can done html alone, , values structured better suggest. <form> <div class="row&q

rest - API Authentication Method - am I doing it correctly? -

i'm incredibly new building api authentication - wanted ensure i'm going correct way there major security flaws i'm not aware of. it's based on secret/private key pair, both client , server know secret key, it's never passed along wire. any feedback, insights or holes in method appreciated. step 1: the client wants make request api, asks nonce server - passing public key. step 2: the server lookups users private key (using provided public key) , hashes (sha256) random 32 character string (the nonce). the hashed nonce , public key stored local array. the server responds client un-hashed version of nonce. step 3: the client takes nonce response , hashes it's private key (which client has locally). it makes request server (along api task wants perform) , sends version of hashed nonce , public key. step 4: the server takes clients public key , hashed nonce, checks local array see if public key/nonce pair exist. if pair ex

r - Duplicate legend with geom_vline() in ggplot -

Image
i want create graphic: aux_graf = structure(list(lines = structure(c(2l, 2l, 1l, 3l), .label = c("h0", "ic", "median"), class = "factor"), values = c(21.19755, 23.06978, 24, 22.13366)), .names = c("lines", "values"), row.names = c(na, -4l), class = "data.frame") dadosgraf = structure(list(dados = c(18.7997, 20.5035, 18.6214, 19.9192, 21.117, 20.8353, 17.527, 17.078, 17.6197, 21.4255, 18.7545, 19.2026, 18.4187, 20.7641, 21.0553, 17.5905, 18.7561, 18.9772, 20.3084, 18.8988, 19.1688, 19.2898, 22.059, 18.5854, 17.8896, 21.1609, 26.1371, 21.4737, 30.9934, 22.8421, 24.4133, 20.4137, 25.5475, 21.8791, 22.6706, 24.7531, 25.7219, 22.6389, 26.2308, 26.7998, 28.4708, 26.9941, 25.1489, 24.6179, 27.0194, 25.0589, 22.1119, 20.3069, 23.6758, 27.1201, 29.6136, 25.9948, 18.223, 23.7336, 22.4208), y2 = 1:55), .names = c("dados", "y2"), class = "data.frame", row.names = c(na, -55l)) gp2

c# - synchronously show and hide controls in windows phone 8 -

in windows phone 8 app want show message before loading items database. after loading want hide message again. for examle xamlcode this: <grid name="layoutroot"> <button content="load more..." click="loadmore_clicked"/> <textblock name="loadingmessage" visibility="collapsed" text="loading..." /> <phone:longlistselector itemssource="{binding students}"> <phone:longlistselector.itemtemplate> <datatemplate> <textblock margin="10" text="{binding name}" /> </datatemplate> </phone:longlistselector.itemtemplate> </phone:longlistselector> </grid> and in c# code trying this: private void loadmore_clicked(object sender, routedeventargs e) { loadingmessage.visibility = visibility.visibl

rest - Cannot filter by string from remote url -

created wcf data service pull data oracle database , when debugging in vs can use ?$filter syntax filter returned sets. however, using remote url cannot. point note: can filter integers , dates, cannot filter strings. also, cannot filter string field in code. filter ignored. sample item below: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <feed xml:base="http://localhost:61905/campaignersvc.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/atom"> <title type="text">contacts</title> <id>http://localhost:61905/campaignersvc.svc/contacts</id> <updated>2015-04-29t15:06:48z</updated> <link rel="self" title="contacts" href="contacts" /> <entry> <id>http://

Regex search and replace substring in Python -

i need regular expression in python. i have string this: >>> s = '[i1]scale=-2:givenheight_1[o1];' how can remove givenheight_1 , turn string this? >>> '[i1]scale=-2:360[o1];' is there efficient one-liner regex such job? update 1: regex far not working: re.sub('givenheight_1[o1]', '360[o1]', s) you can use positive look around re.sub : >>> s = '[i1]scale=-2:givenheight_1[o1];' >>> re.sub(r'(?<=:).*(?=\[)','360',s) '[i1]scale=-2:360[o1];' the preceding regex replace thing came after : , before [ '360' . or based on need can use str.replace directly : >>> s.replace('givenheight_1','360') '[i1]scale=-2:360[o1];'

android - GCM MultiCastResult Approach -

this approach use gcm more 1000 devices. right way? cannot try unless have more 1000 users feedback appreciated , importantly checking errors correctly? , updating database in right way? public class messagingendpoint { private static final logger log = logger.getlogger(messagingendpoint.class.getname()); /** * api keys can obtained google cloud console */ private static final string api_key = system.getproperty("gcm.api.key"); private list<registrationrecord> records; private list<string> getregistrationid() { records = ofy().load().type(registrationrecord.class).list(); list<string> records_id = new arraylist<string>(); (int = 0; < records.size(); i++) { records_id.add(records.get(i).getregid()); } return records_id; } private list<list<string>> regidinthousands(list<string> list, final int l) { list<list<string>

javascript - How can I trigger jQuery fadeIn() fadeOut() from a <div> element -

i have hidden element on page: <div id="hidden"></div> i have element on page want button trigger: <div id="trigger"></div> i want this: $('#trigger').on('click', function(){ if($(this).val() == 'clicked') { $('#hidden').fadein(700); $('#trigger').fadeout(250); } }); do have trigger element in css , how listen event of clicking trigger ? element div doesn't have attribute value , don't need if($(this).val() == 'clicked') condition. that's , code work.

How to enable logging in XStream? -

i struggling load manually converted xml file xstream. no longer receive exception on unmarshalling it, in resulting objects, paths null not expect null. is there way enable debug logging in xstream me identify problem (jvm arguments or via logger config)? if not, suggestions on set breakpoints appreciated. thanks!

javafx - How to resize WorldWind Panel? -

i want put worldwindowgljpanel pane, , want make resizable , can't, when call resize or setsize method. here's what i'm doing : wwd = new worldwindowgljpanel(); wwd.setpreferredsize(new java.awt.dimension(300, 300)); wwd.setmodel(new basicmodel()); swingnode = new swingnode(); swingnode.setcontent(wwd); wwdpane = new pane(); wwdpane.getchildren().add(swingnode); then use wwdpane display world wind. i want world wind panel have size of pane contains it, , want make world wind panel resizable. i thought give size world wind panel of pane setsize(panedimenson) , bind size of worldwindpanel pane , setsize function doesn't work . edit : found alternative solution not using pane, directly swingnode, resize automatic. if want use pane there's still problem, , you're force use group. the setsize working, try code: scene.widthproperty().addlistener(new changelistener<number>() { @override public void changed( observa

java - Find an appropriate queue-consumer pair -

i need implement of spring-intagration libraries message pipeline. @ beginning, see now, needs contain several elements: a. messaging gateway, @messaginggateway(name = "entrygateway", defaultrequestchannel = "requestchannel") public interface messagegateway { public boolean processmessage(message<?> message); } which called when want start pipeline: messagegateway.processmessage(message); b. channel transmitting messages: @bean public messagechannel requestchannel() { return new directchannel(); } c.router decides flow messages @messageendpoint @component public class messagetyperouter { logger log = logger.getlogger(messagetyperouter.class); @router(inputchannel="requestchannel") public string processmessagebypayload(message<?> message){...} there can many incoming messages in small period of time, wanted realize channel (b) queuechannel: @bean public messagechannel requestchannel() { r

xml - Simpler than YAML, better than CSV -

i need simple input language customers' needs. among know ( xml , json , yaml , csv ), xml , json can't used ("not damn human-readable"). csv simple tasks (there hierarchies, , attributes maybe attached "items") , yaml complicated. ("documentation? tl;dr ") is there known standard can fill gap between yaml , csv ? or i'll need myself? the question arose because have no time reinvent wheels. upd : (after discussion) my "language" should similar csv, not simple. there definition (schema, template, pattern) of tree structure (somwhere, it's not deal). have define human-readable language it's data storage. informal examples of various "patterns": class -> kind -> species menu -> submenu -> sub-submenu panel -> subpanel -> control examples of corresponding content animals [cat, dog, elephant {big, gray}], plants [deciduous [oak, maple, baobab], other [fir, ca

java - How to get message from a queue hosted in another queue manager in IBM MQ cluster -

according this: ibm mq issue cluster queue cant message queue hosted on queue manager code: mqqueue = mqqueuemgr.accessqueue("queue name", mqc.mqoo_input_shared); is there way message without connecting queue manager? it not problem code. mq design applications directly connected queue manager can messages. it useful if can explain scenario little more see if there alternatives.

ruby on rails - display the field even though it is empty for some objects -

i'm trying display school name users. when sign users can select school belong (not though column left blank). at moment have: if user.is_a? student %td= user.school end which finds schools students belong to, displays activerecord record. each of schools has name , if select single student , do: @student.school.name gives me name of school no issues. however if do: if user.is_a? student %td= user.school.name end it keeps throwing undefined method name' nil:nilclass` i pretty sure because of students don't have school. have tried add if statement can't seem make work. tried variations of: if user.is_a? student && !user.school.blank? with .any? , .empty? none of them work, no method .blank? etc. any please? i 1 of these things a) quickest %td= user.school && user.school.name b) cleanest (or, @ least, cleaner) #in user class def school_name self.school && self.school.name end #in view %td= user.sc

objective c - sprite kit physicsBody around circles -

Image
so guy , girls got sprite , wounding how create circle physics body around it. maybe using alpha. what have ball.physicsbody = [skphysicsbody bodywithrectangleofsize:ball.size]; bodywithrectangleofsize puts square on sprite right? to create circular physics body can either use: mynode.physicsbody = [skphysicsbody bodywithcircleofradius:10.0]; or mynode.physicsbody = [skphysicsbody bodywithcircleofradius:10 center:cgpointmake(0, 0)]; you specify center if looking physics body have offset node's center.

Connecting to different schema while executing oracle scripts via Ant -

basically ant sql task following: deletes tables present in schemaa creates table schemaa deletes tables present in schemab creates table schemab <target name="exexcuteoracle"> <sql driver="oracle.jdbc.driver.oracledriver" url="jdbc:oracle:thin:@hostname:1521:orcl" userid="username" password="pass" print="yes"> <classpath> <pathelement location="${src.driversdir}/oracle/ojdbc6.jar" /> </classpath> <transaction src="${src.sqldir}/oracle/drop_tablesschemaa.sql" /> <transaction src="${src.sqldir}/oracle/create_tablesschemaa.sql" /> <transaction src="${src.sqldir}/oracle/drop_tablesschemab.sql" /> <transaction src="${src.sqldir}/oracle/create_tablesschemab.sql" /> <transaction src="${src.sqldir}/oracle/count_table_script.sql" /> </sql> the prob

gruntjs - /build dir on a Yii2 app (advanced template) -

i'm working on frontend of yii2 app , want implement grunt perform small number of tasks compiling .sass files , concatenate , minify .js files. i know don't need push node-modules folder repo, wants can npm install have packaged properly, there's no need team mates have node-modules folder if don't touch frontend side of app whatsoever. question is, should push build folder, have .sass , .js files before they're compiled? or better yet, know don't need push should want there backup in case want pull project different computer or so? there downside having /build dir on repo? i don't want clutter repo else, yet feel should have there backup, or if else wants edit files, common practice? also, familiar yii2 advanced template, should said /build folder go? thank you.

ruby on rails - Why am I getting this TypeError? "no implicit conversion of Module into Integer" -

i'm getting typeerror in cwintegratoraccountscontroller#create . i'm calling script ( cwgetcompanyintegrator.call ) in create method of controller. cwintegratoraccountscontroller: require 'apis/cw_get_company_integrator' class cwintegratoraccountscontroller < applicationcontroller skip_before_filter :require_company, :only => [:create,:new] # /cw_integrator_accounts # /cw_integrator_accounts.json def create unless cwintegratoraccount.count >= 1 @cw_integrator_account = cwintegratoraccount.new(params[:cw_integrator_account]) respond_to |format| if @cw_integrator_account.save # run cw integrator cwgetcompanyintegrator.call format.html { redirect_to root_url, notice: 'cw_integrator success' } #format.json { render json: @cw_integrator_account, status: :created, location: @cw_integrator_account } else format.html { render action: 'new' }

jquery - Zoom and move/drag interactive SVG in a responsive page -

i'm making responsive page floorplan (interactive svg). when image resized viewport, small on mobile phones. want image height height of viewport, width overflow. link draft of page should like i think svg should load in iframe, because i'm working cms (concrete5) i tried many things, zoomooz plugin , zynga scroller.. interfere interactivity of svg. i considered making viewport user-scalable="yes", it's not solution, , conflicted fullscreen overlay on page. // used on template page resize iframe div (viewport - div position - margin var calcheight = function() { var x = $("#viv-content"); var position = x.position(); $('#kaart-frame').height($(window).height() - position.top - 5); $('#kaart-frame').width($(window).width() - position.left - 20); } $(document).ready(function() { calcheight(); }); $(window).resize(function() { calcheight(); }).load(function() { calcheight(); }); <!-- t

linux - Obtaining file names from directory in Bash -

i trying create zsh script test project. teacher supplied input files , expected output files. need diff output files myexecutable expected output files. question: $if contain string in following code or kind of bash reference file? #!/bin/bash inputfiles=~/project/tests/input/* outputfiles=~/project/tests/output if in $inputfiles ./myexecutable $if > $outputfiles/$if.out done note: any tips in fulfilling objectives nice. new shell scripting , using following websites write script (since have focus on project development , not wasting time on stuff): grammar bash language begginer guide bash as code is, $if contains full path of file string. n.b: don't use for if in $inputfiles use for if in ~/project/tests/input/* instead. otherwise code fail if path contains spaces or newlines.