Posts

Showing posts from March, 2014

wix - How to show erros occuring during installation of prerequesites -

using wix 3.10 when installing .net 4.6 on windows 8.0, microsoft package returns error since computer missing anothger kb microsoft. that's ok far, want show message net-installer in custom wpf-ui, didn't figured out event trigger. in viewmodel have current instance of bootstrapperapplication , first approach not log anything: internal mainviewmodel(bootstrapperapplication model, action<loglevel, string> onloggeraction, (....)) { this.model = model; this.model.detectpackagecomplete += this.detectpackagecomplete; this.model.detectrelatedbundle += new eventhandler<detectrelatedbundleeventargs>(this.model_detectrelatedbundle); this.model.detectpriorbundle += new eventhandler<detectpriorbundleeventargs>(this.model_detectpriorbundle); this.model.detectrelatedmsipackage += new eventhandler<detectrelatedmsipackageeventargs>(this.model_detectrelatedmsipackage); this.model.detecttargetmsipackage += new eventhandler<detecttargetmsipackag...

javascript - Event binding on dynamically created elements? -

i have bit of code looping through select boxes on page , binding .hover event them bit of twiddling width on mouse on/off . this happens on page ready , works fine. the problem have select boxes add via ajax or dom after initial loop won't have event bound. i have found plugin ( jquery live query plugin ), before add 5k pages plugin, want see if knows way this, either jquery directly or option. as of jquery 1.7 should use jquery.fn.on : $(staticancestors).on(eventname, dynamicchild, function() {}); prior this , recommended approach use live() : $(selector).live( eventname, function(){} ); however, live() deprecated in 1.7 in favour of on() , , removed in 1.9. live() signature: $(selector).live( eventname, function(){} ); ... can replaced following on() signature: $(document).on( eventname, selector, function(){} ); for example, if page dynamically creating elements class name dosomething bind event parent exists, document . $(document...

angularjs - How to manipulate data from ngResource query() before returning it? -

i'm trying comprehend how can modify data $resource.query() returns - turned out - not promise $q empty object/array filled when async call done. i defined service i'd modify data came $resource (filter precise), nothing gets filtered. whole array back. i'm sure there trivial thing i'm missing here. in advance. here's service (employee $resource ): factory('report', ['employee', function(employee) { var query = function(id, cb) { return employee.query({}, function(data) { return cb(data, id); }); }; var findbymanager = function(employees, employeeid) { return employees.filter(function(element) { console.log(element); return employeeid === element.managerid; }); }; return { query: function(employee) { retu...

php - Elastiquent Elasticsearch in Laravel 5.2 -

after days of searching, have decided come here , ask. i have used package before, , literally copy-pasted code still wont work in project. i trying use elasticquent package elasticsearch in laravel 5.2 . the error is: invalid argument supplied foreach() being thrown in /vendor/elasticsearch/elasticsearch/src/elasticsearch/clientbuilder.php file on line 111 . this happens whenever try use package (ie: using search , addalltoindex , etc.). from can tell, config null, maybe there setting in elasticquent missed? any ideas on how fix this? edit my config/elasticquent.php file (exact same `vendor/elasticquent/elasticquent/src/config/elasticquent.php): <?php return array( /* |-------------------------------------------------------------------------- | custom elasticsearch client configuration |-------------------------------------------------------------------------- | | array passed elasticsearch client. | see configuration option...

How to generate (paint) EAN-128 barcode with ZXing in Android -

i'm using zxing paint ean-13 barcodes in app , requested paint ean-128 also. i've read ean-13, called gs1-128 descendant code-128, zxing library supports. the question is, if have ean-128 numeric code, , paint barcodeformat.code_128 correct, or ean-128 , code-128 different ways of painting it? any appreciated, in advance

python - How to check anaconda's version on mac? -

i installed anaconda while ago, , want know if need re-install catch new updates. however, don't know how check current version of anaconda in command line, type anaconda -v gives anaconda command line client (version 1.2.2) for anaconda -v returns anaconda: error: few arguments try conda -v make sure "v" uppercase.

entity framework 4.1 - i am creating new database via code first and i got error the summary is below -

hello creating new database in sqlserver 2012 code first entity framework 4.1 error occurs system.data.sqlclient.sqlexception:invalid object name "dbo.blogs" whole error summary below system.data.entity.infrastructure.dbupdateexception unhandled hresult=-2146233087 message=an error occurred while updating entries. see inner exception details. source=entityframework stacktrace: @ system.data.entity.internal.internalcontext.savechanges() @ system.data.entity.internal.lazyinternalcontext.savechanges() @ system.data.entity.dbcontext.savechanges() @ consoleapplication1.program.createblog() in c:\wcfserver\mt\pluralsight\consoleapplication1\program.cs:line 28 @ consoleapplication1.program.main(string[] args) in c:\wcfserver\mt\pluralsight\consoleapplication1\program.cs:line 15 @ system.appdomain._nexecuteassembly(runtimeassembly assembly, string[] args) @ system.appdomain.executeassembly(string assemblyfile, evidence...

ios - Spacing in CollectionView Cells -

how remove spacing in collectionview cells. want 18 rows , 22 columns should fit according frame height , width. override uicollectionviewflowlayout there space after last column in collection view. can 1 please me solve this. there 2 ways it---- - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } #pragma mark - collection view -(nsinteger)numberofsectionsincollectionview:(uicollectionview *)collectionview { return 1; } -(nsinteger)collectionview:(uicollectionview *)collectionview numberofitemsinsection:(nsinteger)section { return 30; } -(uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { magazinecell *mcell = (magazinecell *)[collectionview dequeuereusablecellwithreuseidentifier:cellid forindexpath:indexpath]; mcell.backgroundcolor = [uicolor lightgraycolor]; return mcell; } #pragma mark collection view layout t...

javascript - How to use ng-messages with such a input like <input name='user[name]'> -

i new angular, , try use ng-messages form-validate. now, have no problem when use ng-message in following situation: <form name='loginform' novalidate> <input name='user' required> <div ng-messages=loginform.user.$error> <div ng-message='required'> field required...</div> </div> <form> but when change name attribute of input, <input name='user[name]' required> , ng-message not work again. there can me? form name attributes can populated dynamically. remember, name attribute reads string, , ng-messages reads angular expression should evaluated reference $error object. since reference obtained through angular expression, can method returns reference. in case, assuming name attribute looks this: <form name="loginform"> <input name="{{ user.name }}" required /> </form> the correct syntax should be: <div ng-messages=...

Overriding image version in docker-compose file -

Image
i'm working on overriding default docker-compose.yml file using docker-compose.override.yml shown in link , , can able specify ports , volumes in override file. in similar way, possible specify version of image needs deployed? if no, best way handle such circumstance need specify different version image? any on great. docker having feature. tried override image name simple docker-compose, working. for example, docker-compose.yml content, my-httpd: image: httpd:latest ports: - "1110:80" and docker-compose.override.yml content, my-httpd: image: httpd:2.4 after execution of docker-compose -d , here docker ps info, it uses ports docker-compose.yml (not overrided) , image docker-compose.override.yml getting overridden here. note : have different names , location, use following command instead of docker-compose -d , docker-compose -f <docker compose location> -f <override file location> -d edit 2: overri...

php - Hide certain Advanced Custom Fields from non admins -

Image
i've used acf's "flexible content" create advanced "page builder" authors can create "section" (basically wrapping element css class name , id) , add flexible content (images, wysiwyg etc) it. what i'd hide fields non admins. don't want old editor able go in , change section's id or class names (as mess layout). i'm aware of "rules" panel in acf admin can choose display field group 1 type of user role, want same thing individual fields. it doesn't appear doable admin interface, i'm wondering if knows how done functions.php file? perhaps filter or action can hook , disable fields based on current user's role? i've attached 2 screenshots showing i'd hidden: i'd hide these choices "add row" menu: and i'd these panels invisible non admins: edit: while we're @ it, wouldn't mind hiding individual fields repeatable too. you'll notice "modifiers" fi...

Fatal error: Call to undefined method Upload::do_upload() -

i error when trying upload file. this code class upload extends ci_controller { function __construct() { parent::__construct(); $this->load->model(array( 'm_campaign' ,'m_upload' ) ); $this->load->helper(array( 'form' ,'url' ) ); } public function index() { $data = array( 'select_campaign' => $this->select_campaign(), 'view' => 'upload', 'js' => 'script_upload' ); $this->load->view('admin/template', $data); } function selec...

java - JDK fails to start up in intellij with gradle on a spring boot app -

i run on osx el capitan web service uses spring boot 1.3.2 release app developed in intellij latest nightly build version 145.970 , using latest jdk 1.8.0_92-b14 , gradle version 2.13 the app used bootstrap fine gradle bootrun , stopped running , message in both terminal , idea terminal: gradle bootrun applying lego release plugin incremental java compilation incubating feature. :compilejava up-to-date :processresources up-to-date :classes up-to-date :findmainclass :bootrun objc[2323]: class javalaunchhelper implemented in both /library/java/javavirtualmachines/jdk1.8.0_92.jdk/contents/home/bin/java , /library/java/javavirtualmachines/jdk1.8.0_92.jdk/contents/home/jre/lib/libinstrument.dylib. 1 of 2 used. 1 undefined. info 2016-05-09t10:43:25,976 l.application main initializing application :bootrun failed failure: build failed exception. * went wrong: execution failed task ':bootrun'. > process 'command '/library/java/javavirtualmachines/jdk1.8.0_92.jdk/...

jquery - Is it possible to pass keyword arguments via Django's {% url %} template tag? Keyword agument value should be from the html tags -

i have template file , want use url tag in template file. html tag <input type="text" id="test_id" value="12" /> the url url(r'^check/(?p<code>[a-za-z\d]+)/(?p<test_value>[a-za-z\d]+)/$', 'test_code', name='test_code' ), template file javascript code in it. `var value1 = $('#test_id').val()`; `var value2 = $('#test_id').val()`; '{% url "test_code" code=value1 test_value=value2 %}' you can see have use url tag , not able set value1 , value2 html tags values. there way can pass html tag values keyword arguments of url tag. not in way. because template rendered before it's sent user. @ time of rendering, value of input not known yet. also, template rendering won't run javascript. what assign url javascript on client side. similar did, have connect action. $(document).ready if input filled, or $(value1).on('change') if waiting u...

3d - Detecting Memory leak in Metro application using CRT library -

i developing 3d game windows store. have detected memory leaks in game not able see file name , line number of memory leaks in output while debugging. following lines of code have included detect memory leaks: #define _crtdbg_map_alloc #include <stdlib.h> #include <crtdbg.h> _crtdumpmemoryleaks(); the following output on debugging application: detected memory leaks! dumping objects -> {1686} normal block @ 0x06fd72e8, 8 bytes long. data: < > 08 f5 fe 03 00 00 00 00 {1685} normal block @ 0x03fef500, 40 bytes long. data: < x r > 20 e5 b4 01 78 ee fe 03 e8 72 fd 06 00 a9 03 04 {1684} normal block @ 0x0403a900, 64 bytes long. data: <w n d o w s . > 57 00 69 00 6e 00 64 00 6f 00 77 00 73 00 2e 00 {1676} normal block @ 0x0406c858, 36 bytes long. data: < k > ff ff 00 00 ff ee 82 ee ff 4b 00 82 ff 00 00 ff {1658} normal block @ 0x06fd7208, 8 bytes long. data: < > 80 ee fe 03 00 00 00 00 {1657} no...

ios - XCode - Unable to attach Debugger to Action Extension -

for ios application, have created action extension . when run app , extension, here's happens: simulator: launch app - xcode attaches debugger launch extension - xcode attaches debugger actual device: launch app - xcode attaches debugger launch extension - xcode not able attach debugger it working fine few days back, it's showing behavior. also, using same device, used before. before, every time when connected device mac, used alert confirmation on device, don't that. though, can still see device in xcode. my configuration: xcode: 7.3.1 os: osx el capitan (version 10.11.4) is there can done? not able find how unpair device xcode/mac , pair again confirmation screen again. this screwed in xcode 8.1 i've filed 29064806 apple. the recorse fallback version of xcode works. in case that's 8.0 (where not frequently) disabling system integrity protection not help. it's bug in xcode (lldb or whatever)

javascript - new array from csv data -

i have following csv data: id,v1,v2,v3,v4,v5 lo,32,45,37,53,22 i want create new array looks way: id2,value v1,32 v2,45 v3,37 v4,53 v5,22 to use following code: d3.csv("datasbar1.csv", function(error, data) { if (error) throw error; var values = d3.keys(data[0]).filter(function(key) { return key !== "id";}); data.foreach(function(d) { (var = 0; <= values.length; i++) { d.value = +d[values[i]]; return d;}}); /*---------- create new array ----------*/ var array = $.map(data, function (d) { for( var i=0; i<=values.length; i++){ return { id2: values[i], value: d[values[i]] } } }); it returns me 0: object id2: "v1" value: "32" and nothing more. doing wrong? thanks in advance! don't need many loops below: d3.csv("my.csv", function(error, data) { if (error) throw error; //get values without id var values = d3.keys(data[0]).f...

mongodb - how to copy a collection from one from another in robomongo -

i have collection named dashboard in 1 db , want copy collection db using robomongo. how can this? tried creating new collection in 2nd db , tried copying failed. please me another db - connection. robomongo works 1 connection in 1 period of time. why impossible. i suggest use mongoimport/mongoexoprt tools task. comes mongo, located in same folder mongod.exe , allows move collections via databases, exporting , importing json file. code sample: mongoexport --db testfrom --port portfrom --username userfrom --password passwordfrom --collection yourcollection --out test.json mongoimport --db testto --port portto --username userto --password passwordto --collection yourcollection --file test.json

javascript - Using Node Parse API for self-hosted Parse Server -

i finished building parse server on parse platform. in old parse app, utilize rest api library nodejs how should configure (in parse initialization or parse library module) send rest request newly built parse server. example, configuration of parse server contains: { "appid": my_app_id, "masterkey": my_master_key, "port": "1337", "serverurl": my_server_url, "publicserverurl": my_server_url, "mountpath": "/parse", "databaseuri": my_database_uri" } the node module specify serverurl api.parse.com, , origin mount path '1'. https://github.com/leveton/node-parse-api/blob/master/lib/parse.js try these 2 step. 1. set parse._api_host host. 2. change mountpath '1'. another parse rest api util kaiseki, there pr fit open source parse not been merged. https://github.com/shiki/kaiseki/pull/35

When I use Chinese as URL parameter,it doesn't work with python -

Image
url='https://www.bing.com/search?q=你好&qs=n&form=qblh&pq=你好&sc=2-0&sp=-1&sk=&cvid=8f0865226c' urllib.request.urlopen(url) then console shows this: you need encode double byte chars quote urllib.parse. import urllib.request urllib.parse import quote url='https://www.bing.com/search?q=%s&qs=n&form=qblh&pq=%s&sc=2-0&sp=-1&sk=&cvid=8f0865226c'%(quote('你好'),quote('你好')) urllib.request.urlopen(url) you can read more : how deal unicode string in url in python3?

web services - Incoming connection queue on WebSpehere -

i've application exposes 1 web service running on websphere. want limit maximum clients available x connection queue. i've read " connection pool " it's outgoing connection. any advice? thanks. you can limit maximum amount of tcp connections allowed following tcp channel setting: maximum open connections you can find how set here: https://www.ibm.com/support/knowledgecenter/sseqtp_8.5.5/com.ibm.websphere.base.doc/ae/urun_chain_typetcp.html?lang=en this limit connection not ones webservice, if serving more 1 webservice in server may not setting change limit connections was. by default allows 20,000 open connections. can limit lets 1,000 if maximum want serve.

angular2 routing - Setting up authentication Angular 2 for new router (>= rc1) -

i got authentication , running angular 2 app trying upgrade new router, removing router-deprecated. problem strategy doesn't work anymore. in old router, extended router-outlet check if url able activate. if wasn't, redirected login page. in new router however, router-outlet doesn't exist anymore. new best strategy? one option subscribe router in order evaluate whether user logged in whenever route changes, in appcomponent: constructor (private _router: router) {} ngoninit(){ this._router.subscribe( next => { if (!userisloggedinorwhatever) { this._router.navigate(['login']); } } ) } https://angular.io/api/router/router

sql server - SQL Table Integrity -

Image
i'm using sql server 2014 i'm looking design solution. i have 3 tables need connect ensure integrity. i'm removed tables , columns sake of clarity. group parent of type. group: widgets types: blue widgets, red widgets i want store data @ group/category level, instance: group: widgets categories: widgets men, widgets women categories should contrained @ type level type: blue widgets category: widgets men type: red widgets category: widgets women therefore i'm trying ensure data enter typecat valid in category , type's group exist in groupcat. i'm sure there kind of pattern this, non db guy, i'm not sure how work out. at risk of spending far time on question, i'm going try show how difficult untangle. use thicket of abstract nouns -- type, category, group -- in varying combinations. change nomenclature between illustrated tables , question text. don't state keys are. make declarations, , expect reader make right as...

html - use model attribute from spring controller in ng-show -

using spring boot,angualrjs html view using in index.html <a ng-show="permission=='write'"> from spring boot controller returning permission in model @requestmapping(value = "/", method = requestmethod.get) public string getindex(model model) { model.addattribute("permission","write"); return "index"; } tab tag not visible in view.while console has no error. how use model attribute value in ng-show? in javascript, while checking equals condition should === change ng-show <a ng-show="permission==='write'"> also there similar post, have on how model attribute value in angularjs spring controller

arrays - Wordpress: Continues(loop) page navigation with get_permalink() -

i turn page navigation in loop. i'm quit close problem i'm not able switch between categories. @ moment have loop inside of category i'm not able jump next category. as information: have different post categories. my script: <?php $prev_post = get_adjacent_post( true, '', true ); $next_post = get_adjacent_post( true, '', false ); $prev_post_id = $prev_post->id; $next_post_id = $next_post->id; ?> <?php if(($prev_post_id === '') || ($prev_post_id === null)) : $query = new wp_query(array('order' => 'desc', 'posts_per_page' => '1', 'cat=4')); if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); $prev_post_id = get_the_id(); endwhile; endif; wp_reset_postdata(); endif; if(($next_post_id === '') || ($next_post_id === null) ) : $query = new wp_query(array('order' => 'asc', 'posts_per_page' => '1', 'c...

maven - How do I get readyapi (formerly soapui) to respect the values I specify in pom.xml? -

Image
my pom.xml looks <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.cvent</groupid> <artifactid>soa-readyapi</artifactid> <packaging>pom</packaging> <version>1.0-snapshot</version> <name>onsite solutions readyapi tests</name> <properties> <soapui.environment/> <soapui.test-suite/> <soapui.test-case/> </properties> <build> <plugins> <plugin> <groupid>com.smartbear</groupid> <artifactid>ready-api-maven-plugin</artifactid> <version>1.2.1</version> ...

ios - Have unknown length of navigation controllers in swift -

Image
we making application use api returns array of tree structured json objects. objects have childs of same type, have childs of them self. wanna show these within tableview inside navigationcontroller. so question how can make use of navigationcontroller recursively? don't know how many children's children they'll have. example json format pastebin update trying explain better, i've created picture my question how can dynamically add more uitableviewcontrollers? instead of creating hundreds of view controllers (picture shows 3) you gave answer: recurse. delete table view controllers except first one. point push segue first table view controller at itself . pushing create instance of same kind of table view controller, want.

orchardcms - Invalid path errors with long URLs in Orchard CMS 1.9 -

scenario: multitenant orchard 1.9.3 deployment running in single instance azure web app settings & media stored in azure blob storage. after enabling file system output cache (so cache items stored in app_data\outputcache folder, see entries being added folder fine. appears items long urls throwing errors , causing 500's thrown. it's long url, common campaign management links (utm codes google analytics) causing issues make long urls querystring options. error, can see below, invalid path when tries find file in cache. here few of errors (note links in errors work i've disabled cache , errors have gone away). i noticed there changes file system output cache in 1.9.x release... long urls issue? 2016-05-09 00:00:17,596 [19] orchard.outputcache.filters.outputcachefilter - default - unexpected error occured while reading cache entry http://www.andrewconnell.com/archive/2012/07/30/sharepoint-2010-metadata-based-navigation-in-publishing-sites-series-overview.a...

linux - why in shell script, $? can't echo twice? -

i have 2 simple scripts: #!/bin/sh echo "this script return sth" exit 105 and: #!/bin/sh echo "this script print last script return" echo "first run script" ./this_script_return_sth.sh echo "previous script return value: $?" echo $? the run result is: this script print last script return first run script script return sth previous script return value: 105 0 anything did wrong? means if want use it, better first store variable? $? expands last statement's return code. so, 0 says last echo statement (i.e. echo "previous script return value: $?" ) sucessful. from bash manual: ? ($?) expands exit status of executed foreground pipeline. if need value in multiple places, can store in variable: ./this_script_return_sth.sh rc=$? echo "previous script return value: $rc" echo $rc

Adding Contact using Intent in Android -

i'm making application in user can add users application contacts. intent intent = new intent(contactscontract.intents.insert.action); intent.settype(contactscontract.rawcontacts.content_type); intent.putextra(contactscontract.intents.insert.phone, bean.getmobileno()); intent.putextra(contactscontract.intents.insert.name, bean.getname()); intent.putextra(contactscontract.intents.insert.email, bean.getemailid()); startactivity(intent); so adding not issue issue when goes add contact screen , if user presses button contact getting saved if user doesn't want save contact. i want using intent not through app. there solution or device specific? try this /** * open add-contact screen pre-filled info */ intent intent = new intent(intent.action_insert); intent.settype(contactscontract.contacts.content_type); intent.putextra(contactscontract.intents.insert.name, bean.getname()); intent.putextra(contactscontract.intents.insert.phone, bean.getmobileno()); intent....

android - How to close realm opened by Realm.getDefaultInstance? -

i using realm store , retrieve data. when open realm store data like: realm realm = realm.getdefaultinstance(); realm.begintransaction(); // copy object realm realm.copytorealm(myobject); realm.committransaction(); realm.close(); in above case closing realm. but when retrieving data like: realmresults<myclass> results = realm.getdefaultinstance().where(myclass.class).findall(); how close realm? need closed? doing one-liners means cannot close realm, advice against that. not closing realm in best case cause leak memory , have higher chance of being killed system if in background. worst case see high increase in disk usage because realm has keep track of versions of opened realm instances (due being mvcc database). i highly advice using first pattern. more information controlling realm instances can read this: https://realm.io/docs/java/latest/#controlling-the-lifecycle-of-realm-instances , https://realm.io/news/threading-deep-dive/

obfuscation - What is the proper way to obfuscate the lisence key of an android app -

i upload app use in app purchases , says carefull lisence key how can obfuscate properly? idea have in pieces , join later in oncreate not enough? shall put pieces of key in strings.xml? the more distribute key in time , space harder replace it. not join @ single place (oncreate) - distribute pieces through code. make hard find pieces of key in code - never store them xored value. more security obscurity - , how store key should secret. use obfuscation. remember protecting license key replacement. think how easy (fast) 1 can change key having sources of application. also, modify source code dealing key, unique app. example google in-app billing comes in sources , relatively easy find 1 in decompiled sources hack.

Finding a Encryption Algorithm to encrypt users personal data -

there personal service need encrypt user's data archived password able make database saved secret data.it meaningful can make sure software developer , manager can't users data. it's easy can choice algorithm let user's password factor link encrypted data.but how user change password? on 1 hand, can't save user's password straightly(password encrypted md5 irreversible), on other hand, can't encrypt data again if password changed. able do?thanks update hit situation when user forget password.it seems presupposition unreality.>_< please consider haven't think of idea. make question fallback "how use encrypted data in database make sure data owner can achieve it." if not consider forget password, @samgak give idea @ question comment. , now, can continue use users password key or find way deal new problem?

html - Zoom Effect using css but the size of the div should be fixed -

edit: if don't know width size ? js fiddle demo please go above link. want zoom effect take place without div zooming on. image should zoom inside div.`i don't know going wrong. can ? .img-container { position: relative; overflow: hidden; margin:0; padding:0; height: 100px !important; } .img-container img{ height: 100px; -moz-transition:all .8s;-webkit-transition:all .8s;transition:all .8s } .img-container:hover img{ max-width:100% -moz-transform: scale(1.4); -webkit-transform: scale(1.4); transform: scale(1.4); } <div class="container"> <div class="row"> <div class="col-sm-4"> <div class="img-container"> <img src="http://www.macforensicslab.com/images/icon_googlesearch.jpg"/> </div> </div> <div class="col-sm-4"> <div class="img-container"> <img src=...

jquery - Uploading a file using hidden input field -

i'm trying call upload file function href link , though browse box being displayed, can't run validation on selected file. here code have: <a href="#" onclick="$('input[id=formmedia]').click();"><div class="sidebarsectionlink">click here add files</div></a> //calls browse box <input type="file" id="formmedia" style="display: none;"> //hidden input //post photo jquery $('#formmedia').blur(function() { var pic=$("#formmedia").val(); if(pic.length < 1){ $('.sidebarsectionlink').html("please add photo").removeclass("success").addclass("error"); picok = 2; } else if(pic.indexof('jpg') === -1 && pic.indexof('jpeg') === -1 && pic.indexof('png') === -1 && pic.indexof('gif') === -1){ $('.sidebarsectionlink').html("invalid file format").rem...

input - Simple cube and square sum function won't run (C) -

learning c, trying code program outputs sum of cube , square of inputted number. #include <stdio.h> main() { int a; scanf("%d",a); printf("%d",cube(a)+sqr(a)); } cube(int x) { return(x*x*x); } sqr(int arg) { return(arg*arg); } when run program outputs seemingly random string of numbers after input number. way fix without changing usage of returns assign variables? scanf needs pointer: scanf("%d",&a); instead of scanf("%d",a);

jquery - Date range without an inline datepicker -

i'm trying in thread: date range picker on jquery ui datepicker but dont want datepicker inline, , code works inline datepicker. i need datepicker when selecting #date1 or #date2 inputs. i must easy, i'm stuck here , solutions find google plugins or inline datepicker. jquery ui's datepicker dropdown default, example found little out of date think. https://jsfiddle.net/groberts/z4j227h6/ $( "#from" ).datepicker({ defaultdate: "+1w", changemonth: true, numberofmonths: 3, onclose: function( selecteddate ) { $( "#to" ).datepicker( "option", "mindate", selecteddate ); } }); $( "#to" ).datepicker({ defaultdate: "+1w", changemonth: true, numberofmonths: 3, onclose: function( selecteddate ) { $( "#from" ).datepicker( "option", "maxdate", selecteddate ); }, beforeshowday: function (date) { var date1 = $.datepicker.parsedate($.da...

angularjs - Angular 2.0 Routing Issue -

in main.ts code this. import {provide, enableprodmode} 'angular2/core'; import {bootstrap} 'angular2/platform/browser'; import {router_providers} 'angular2/router'; import {http_providers} 'angular2/http'; import {app_base_href} 'angular2/platform/common'; import {appcomponent} './app/components/app.component'; enableprodmode(); bootstrap(appcomponent, [ router_providers, http_providers, provide(app_base_href, { usevalue: '<%= app_base %>' }) ]); in app.component.ts file have follwing code. import {component} 'angular2/core'; import {enableprodmode} 'angular2/core'; import {router, router_directives, router_providers, routeconfig, routeparams} 'angular2/router'; import {sportslivefeedservice} '../shared/index'; import {maincomponent} '../main/index'; import {resultscomponent} '../results/index'; @component({ selector: 'sd-app', viewproviders: [sport...

php - strtotime() and easter_date() won't work together -

i'm trying day after easter date: date("d-m-y", strtotime(easter_date(), '+1 day')); i don't understand, date showed still same, when try this: date("d-m-y", strtotime('+1 day')); it works. how can do? that's because easter_date() produces unix timestamp: 1364713200 and strtotime() meant 'today' , 'tuesday next week' ; if want add day it, add 86400 (this how many seconds in day) easter_date() ; so: date("d-m-y", easter_date() + 86400);

Which folders appear in Gallery of an Android device? -

im building application , i've made folder inside home directory of device (where folder music, movies, download are) in i've placed photos. problem these photos don't appear in "gallery" of device. where should place photos displayed in gallery? folders scanned appeared in gallery?

linux - unix java classpath cp adding -

this seemingly simple problem stumping me. have jar set of dependencies cannot seem working in linux. jars , script reside in same directory. this 1 picks , tries run main class java -cp myjar.jar com.mylib.mymainclass but of course throws classnotfoundexception on 1 of dependency classes. try add 1 of dependencies so java -cp myjar.jar:mydependencyjar.jar com.mylib.mymainclass then says classnotfoundexception com.mylib.mymainclass ! i tried these various same problems java -cp . com.mylib.mymainclass and this java -cp *.jar com.mylib.mymainclass and this java -cp .:*.jar com.mylib.mymainclass any idea please ? try one: java -cp /path/to/jar1.jar:/path/to/jar2.jar:. com.mylib.mymainclass note should not omit final . in classpath, represent current working directory, because using -cp override previous classpath setting.

ios - Swift : View in a UIScrollView is unable to detect touch -

Image
so have uibutton in uiview within uiscrollview within uiviewcontroller within uiscrollview .. whole lot of layers know required. result got uibutton cannot tapped because touch can't detected on button. scrollviews working elements in final layer not detecting touches. the layers follow: uiviewcontroller ~uiscrollview ~~uiviewcontroller ~~~uiscrollview ~~~~uiview ~~~~~uibutton kindly tell me how can detect touch on last uiview? you should debug view hierarchy clicking debug view hierarchy button this. so come know button touch events or hidden other views. update : i uploading screenshot you have run project able see button above console pane. you can refer apple documentation more details. hope :)

android - Can I add a marker to an ArrayList and a HashMap at the same time? -

i have code working want. mean have map fragment displays 5 marker category, can filter them want category , works fine. might observe marker 1 , marker 8 appear in more 1 category. here code , continue problem afterwards: boolean msetcameraposition; boolean checkbox1checked, checkbox2checked, checkbox3checked, checkbox4checked, checkbox5checked; private int maptypeselected; checkbox cballday, cbbefore12, cbbetween1216, cbbetween1620, ccbafter20; alertdialog dialog; list<marker> firstcategorylist = new arraylist<>(); list<marker> secondcategorylist = new arraylist<>(); list<marker> thirdcategorylist = new arraylist<>(); list<marker> fourthcategorylist = new arraylist<>(); list<marker> fifthcategorylist = new arraylist<>(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); ...

android - Calculating data rate per second but the result always the same -

iam calculating cellular data rate per second using handler, code being executed every second , overall traffic been calculated suppose subtract old traffic since boot current traffic since boot current data rate per second. the problem i'm facing current data rate value not correct, giving me total overall traffic since boot. may did wrong, i'm still beginner android. code below. public class mainactivity extends appcompatactivity { private double rxold; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final handler handler = new handler(); handler.postdelayed(new runnable() { @override public void run() { ////////////////////////code executed every second//////////////////////////////////////// calendar c = calendar.getinstance(); int seconds = c.get(calendar.second); double overalltraffic =...