Posts

Showing posts from June, 2012

python - I want to eavalute the time needed to perform prediction using a trained model -

this question has answer here: measure time elapsed in python? 18 answers i know timeit can used measure elapsed time, don't how implement in code. example, evaluate model performance follows: scores = model.evaluate(x_test, y_test, verbose=0) how add timeit or other functions measure time needed? here basic setup: import time start_time = time.time() # code print("time - {}".format(time.time()-start_time)) you can make use of python's function wrappers, , make wrapper time functions. eg. import time def getime(func): def func_wrapper(*args, **kwargs): start_time = time.time() func(*args, **kwargs) print("function {} completed in - {} seconds".format( func.__name__, time.time()-start_time)) return func_wrapper # ------------ test example of wrapper --------- # @ge...

batch file - Variable does not change after changing -

@echo off if (%1) == () ( echo.anfangskapital eingeben: set /p anfangskapital = echo %anfangskapital% ) else ( set /a anfangskapital = %1 ) pause the value of anfangskapital 0. why? how can change value?

android - How to insert an image (selection) in an Alert Dialog? -

Image
i'm making app allows user create several entries in listview . have mainactivity floating button starts alertdialog such one: as can see following listview, @ moment each entry has same icon (the green android logo). i make user select icon among set of icons created on purpose before . idea put little image (the default one) next insert package name here text, on left. once user clicks on picture gets displayed list (let's 9) icons available. how can it? hope explained myself well. use seticon(drawable icon) or seticon(int iconid) . if want more customization, can create class extends dialogfragment , create custom layout alertdialog.

vb.net - 'ElseIf' must be preceded by a matching 'If' or 'Elsif' -

hi coding blackjack game school project. have encountered error. when run program code says 'elseif' must preceded matching 'if' or "elsif'. have tried lots of different arrangements cannot figure out. below code msgbox. please help dim responseyouwon = msgbox(youwonmsg, style, youwontitle) dim responseyoulost = msgbox(youlostmsg, style, youlosttitle) dim responseyoudrew = msgbox(youdrewmsg, style, youdrewtitle) if playersum < 21 , playersum > computersum if responseyouwon = msgboxresult.yes btnplayagain.performclick() else btnquit.performclick() end if end if elseif computersum > 21 , playersum < 21 if responseyouwon = msgboxresult.yes btnplayagain.performclick() else btnquit.performclick() end if elseif computersum > 21 , computersum < 21 if responseyouwon = msgboxresult.yes btnplayagain.performclick() else ...

ViewPager postion android studio -

i designed pager contains imageview , put images in assets folder , make arraylist contains image location in assets folder , image number , description each image , when swipe the pager finger should change image , put image number , description in 2 text view 1 image number , second text view description images swipe write no problem problem text views don't show right position displayed image show image number , description next image doesn't show yet problem did. here code public class mainactivity extends appcompatactivity { custompageradapter mcustompageradapter; viewpager mviewpager; int clk=0; textview txtayaname; textview txtpage; linearlayout co1; linearlayout co2; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); txtayaname=(textview) findviewbyid(r.id.textview); txtpage=(textview) findviewbyid(r.id.textview2); co1=(linearlayout) findviewbyid(r.id.c...

ios - How to create a custom designed admob banner -

Image
i've been looking integrating admob banners app iad has shit down of banner ugly , offputting. i saw in other apps people using custom design ad banner works online ui design. see attached images the images below have google admob play logo icon thing must mean admob i've checked docs , found no way of re-creating this. my best thought pull ad data url request , populate class data , when user clicks on take them appstore not sure allowed in admob ios natively. anybody got ideas on do?

uitableview - what replaces indexPathForSelectedRow in Swift 3? -

in projects prior swift 3 - if looking segue indexpath tablecontroller, i'd have line of code let indexpath = self.tableview.indexpathforselectedrow! however, in swift 3, unable write this. can't seem find documentation on apple's site or other questions find workable piece of code. in response frankie's comment, went code (here of current segue swift 3 code) , have tried copy , paste above code snippet... no avail. xcode not auto complete if enter "self.tableview". not recognize indexpathforselectedrow! either. i'm missing something. override func prepare(for segue: uistoryboardsegue, sender: any?) { if segue.identifier == "dinesegue" { if let destinationviewcontroller = segue.destination as? restaurantcontroller { let indexpath = dinecontroller.indexpathforselectedrow! destinationviewcontroller.restaurantindex = index } } } i googled 'indexpathforselect...

awk match() multiple matches -

i have following: echo as:i:0 uq:i:0 zz:z:mus.sup nm:i:0 md:z:50 zz:z:cas.sup co:z:endofline|awk '{match($0,/zz:z[^ ]*/,m); print m[0], m[1]}' which unfortunately outputs first entry (out of two): zz:z:mus.sup it looks me match() function incapable of storing more 1 match array. unless i'm missing here something...? if indeed case, kindly suggest awk-based 'matching' alternative allow obtain 2 zz:z entries. note, these not located each time @ same column(!) - hence need of using match() function. the general idea here obtain @ same awk command values appear @ known column positions (e.g. col1, col2), , values (fetched based on unique signature "zz:z") located @ unknown indexed columns. in addition, following attempt - using gensub() fails output/print 2 zz:z entries, , identify 1 of 2 (and other 1 upon deprecation of reciprocal..) echo as:i:0 uq:i:0 zz:z:mus.sup nm:i:0 md:z:50 zz:z:cas.sup co:z:endofline|awk '{val= ge...

How to export all files and folders in resources folder in java -

Image
how in java code copy src/main/resources directory curent working directory? this found org.bukkit.plugin.java.javaplugin , seems work public void saveresource(string resourcepath, boolean replace) { if (resourcepath == null || resourcepath.equals("")) { throw new illegalargumentexception("resourcepath cannot null or empty"); } resourcepath = resourcepath.replace('\\', '/'); inputstream in = getresource(resourcepath); if (in == null) { throw new illegalargumentexception("the embedded resource '" + resourcepath + "' cannot found"); } file outfile = new file(datafolder, resourcepath); int lastindex = resourcepath.lastindexof('/'); file outdir = new file(datafolder, resourcepath.substring(0, lastindex >= 0 ? lastindex : 0)); if (!outdir.exists()) { outdir.mkdirs(); } try { if (!outfile.exists() || replace) { ...

recursion - Modifying tuples after counting a tree in SML -

i have question i'm working on, have traverse tree once , count how many children each node has. there 2 parts this, datatype, , function itself. datatype the datatype requires internal nodes store value of type , have anywhere 1-3 children. leaves store either real number or string list. datatype leaf = slist of string list | real of real; datatype tree = empty | leaf of leaf | node of leaf * 'a tree | node of leaf * 'a tree * 'a tree | node of leaf * 'a tree * 'a tree * 'a tree function next, have define function takes tree, , returns tuple (n1, n2, n3), n1 number of nodes having 1 child, n2 number of nodes 2 children, n3 number of nodes 3 children. fun mychildren (t:'a tree) = childhelper (t, (0,0,0)); fun childhelper (t: 'a tree, (n1, n2, n3):int*int*int) = case t of empty => 0 | node (x) => childrenhelper(t, (n1 + 1, n2, n3)) | node (x, y) => c...

Throw exceptions without needing to use try in Java -

i have java code want able run. should throw exception if have totally been added more 4 strings, should not needed use try/catch first 4 times addstring method called. foo myfoo = new foo(); myfoo.addstring("string a"); myfoo.addstring("string b"); myfoo.addstring("string c"); myfoo.addstring("string d"); boolean exceptionthrown = false; try { myfoo.addstring("string e"); } catch (noroomformorestringsexception e) { exceptionthrown = true; } asserttrue(exceptionthrown); if add in addstring function, require me use trow/catch statement. public void addstring(string str) throws noroomformorestringsexception { ... if(strings.size() >= 4) { throw new noroomformorestringsexception(); } how can throw exception in addstring method without needing use try/catch statement? how can throw exception in addstring method without needing use try/catch statement ? you need declare noroom...

eclipse - Not seeing a full stack trace from Java Error -

Image
this question has answer here: how avoid arrayindexoutofboundsexception or indexoutofboundsexception? [duplicate] 2 answers background: making simulator 1 of college classes , rather large project. issue: however, whenever type "i" or "c" (details shown in code) arrayindexoutofboundsexception exception java.lang (not custom handler) without any stack trace, , therefore cannot locate problem. photo: code: /** * creates world , starts loop of commands */ public void run() { if(configfile == null) {system.exit(0);} initworld(); if(world == null) { system.out.println("unable read config file."); return; } world.print(); scanner reader = new scanner(system.in); string line = reader.nextline(); while(canrun()) { if(line.equals("p")) { world.print(); ...

unity5 - How do I keep objects on same level on minimap? -

this minimap tutorial i'm using minimap: minimap tutorial i have minimap working link teaches. there problem though. in game, enemies spawn on different heights. want see them on minimap in 1 level (like other games height doesn't matter , shows objects same size on minimap). right now, higher height objects shown closer , bigger minimap camera, while lower height objects shown further , smaller minimap camera. is there way this? (as in, same size on minimap regardless of heights) thank in advance. just realized can re-sizing enemy/playersphere.

JavaScript - using apply to invoke function, but 'this' is not being set to the object passed as first argument -

i'm trying use apply method invoke objectify function, passing array of values , using obj object. however, this not being set object, rather global environment ( window ). the purpose of array of strings, pass strings function objectify . when function invoked, takes array values, splits them, and, if object not have property string value, property created. here code below: let obj = {}; let arr = ["user.name.firstname=john", "user.name.lastname=smith"]; const objectify = x => { let cur = this, v; return x.split('.').foreach(e => /=/g.test(e) ? (v = e.split('='), cur[v[0]] = v[1]) : cur[e] ? cur = cur[e] : (cur[e] = {}, cur = cur[e]))}; objectify.apply(obj,arr); the problem this set window rather object obj . how should rewrite code sets obj this value? the end result should modified obj object becomes: obj = {user: {name: {firstname: 'john', lastname: 'smith'}}}; this (no pun intended) ha...

maven - How to uninstall Jenkins when I installes jenkins by war file? -

i installed jenkins using war file official site, forget admin password reinstall jenkins. then tried uninstall jenkins, didn't find /library/application support/jenkins/uninstall.command , i'm puzzled how uninstall jenkins. do have ideas? thanks.

How to display SQL data in Wordpress? -

does wordpress has orm? how access data sql server mysql , display in wordpress? the best practice interact data in wordpress using wordpress api, don't worry compatible issue. if want query data using sql syntax, can use wpdb .

octave mkdir fails after recursive rmdir -

i have code creates subfolder first removes subfolder if existed. using octave3.6.4_gcc4.6.2 mingw on win7 pro machine. noticed mkdir fails if subfolder existed , contained several files. seems rmdir has not completed in background before next lines of code executed. below sample of test code. parentdir = 'c:\temp\rmdir'; childdir = fullfile(parentdir, 'output'); if (exist(childdir, 'dir') ~= 0) [status] = rmdir(childdir, 's'); disp(status); end; [status] = mkdir(parentdir, 'output'); disp(status); disp(exist(childdir, 'dir')); below octave result when subfolder not exist. works expected. octave:5> testrmdir 1 7 below octave result when subfolder exists , empty. works expected. octave:6> testrmdir 1 1 7 below octave result when subfolder exists , contains 3 png files total size of 349 kb. status 1 both mkdir , rmdir. however, exist function reports folder not exist. confirm windows explorer subfolde...

css - Can't import bootstrap -

i've looked through many solutions still can't find solution problem. i'm using rails 5.0.0.1, running on windows os. i've done bundle install , restarted server, downgrading sass-rails can't seem fix issue. the gems needed this: bootstrap-sass <3.3.7> sass-rails <5.0.6, 3.2.0> in application.scss file: @import "bootstrap-sprockets"; @import "bootstrap"; in application.js file: //= require jquery //= require jquery_ujs //= require turbolinks //= bootstrap-sprockets //= require_tree . the error page please help! thanks! edit here gem list: (it didn't use have 2 versions think might have messed how when downgraded sass-rails , installed autoprefixer-rails gem different solution found.) * local gems * actioncable (5.0.0.1) actionmailer (5.0.0.1, 4.2.6) actionpack (5.0.0.1, 4.2.6, 3.2. actionview (5.0.0.1, 4.2.6) activejob (5.0.0.1, 4.2.6) activemodel (5.0.0.1, 4.2.6, 3.2 activerecord (5.0.0.1...

jetbrains - cut off of the text in pycharm 2016 community edition -

Image
i downloaded pycharm 2016 community edition , see whenever open setting or import settings , of text cut off u can see in picture . googled lot didn't find solution case. can please know setting need change text clear , problem community edition or developer edition ?

javascript - What does ui.draggable.draggable means? -

i new javascript , have stated learn javascript. came across piece of code .i know use , meaning of ui.draggable.dragabble in code shown below drop:function(e,ui){ var drag = ui.draggable; $(this).droppable('option', 'accept', drag); drag.css({'top':$(this).css('top'),'left':$(this).css('left')}); drag.draggable('option', 'revert', function(){return false}); var drop_index=$(this).attr("id").split('_')[1]; i know sites learn drag , drop in javascript,in better way. any appreciated in advance. "ui.draggable" refers object containing elements being dragged on page. the function drop: function(e, ui) { } is executed when draggable object dropped on droppable element. can refer jquery-ui api documentation here: http://api.jqueryui.com/category/interactions/ drag , drop functionalities. point , apt. check demos. start...

Malformed Manifest error happens when I use capital package name in android studio -

i have app started in eclipse. package name starts capital, , compiled , installed correctly. have moved project android studio, while app compile, won't install due malformed manifest. looked problem, , suggestion lowercase package name. dose solve problem, , app installs, makes no sense. why apps compiled in eclipse fine it, same code in android studio not work? large problem, app in play store, , can't lowercase package name, i'm stuck in eclipse. dose know work around?

How to add loop to handle multiple object and multiple file in Python? -

first of all, new python. had question , answer here . form sloth's answer, got code handle single file , single object: import re # so, we're looking object 'heythere' objectname = 'heythere' open('input.txt', 'r+') f: line = f.readline() pos = f.tell() found = false while line: # want alter part # right objectalias, use 'found' flag if 'objectalias ' + objectname in line: found = true if 'endobject' in line: found = false if found , 'beginkeyframe' in line: # found keyframe part, read lines # until endkeyframe , count each line 'default' sub_line = f.readline() frames = 0 while not 'endkeyframe' in sub_line: if 'default' in sub_line: frames += 1 sub_line = f.readline() # si...

lodash - How to filter array of objects from keys in javascript? -

here, have 1 main array called mainarray . in array added multiple users list. can increased. can create many group mainarray , group1, group2 , on. requirement is, want filter objects mainarray , haven't added in groups. array main, var mainarray = [{ userid: "m000001", name: "jhon", companyid: "c0000021" }, { userid: "m000002", name: "leon", companyid: "c0000022" }, { userid: "m000003", name: "thomas", companyid: "c0000023" }, { userid: "m000004", name: "sean", companyid: "c0000024" }, { userid: "m000005", name: "paul", companyid: "c0000025" }, { userid: "m000006", name: "roldan", companyid: "c0000026" }, { userid: "m000007", name: "mike", companyid: "c0000027" }, { userid: "m000008", name: "mia", c...

python - How to keep asking the user for a file -

this question has answer here: asking user input until give valid response 9 answers new programmer here, , let me start off code have. try: f = input("please type in path file , press 'enter'") file = open(f,'r') except filenotfounderror: f = input("file not found please try again.") what i'm trying accomplish, if user enters wrong file, keep asking user try again. maybe shouldn't using try/except? embed statement inside while loop. break if file opened successfully. while true: try: f = input("please type in path file , press 'enter'") file = open(f, 'r') break except filenotfounderror: print('file not found') note: may need handle other exceptions ioerror (even though, there file, may not possible open - because of p...

To convert ruby unpack equivalent in java -

i'm trying understand line of ruby code: token.unpack('m0').first.unpack('h*').first which converting r1ykdh//czkubzla09zivzq5/cxinvmokiacnl3mkj0= to 47560a747fff7192ae6d9940d3d648559439fdcc489ef9a89080029e5dcc289d as far understand this, base64 hex conversion, when try same thing, not matching converted one. i need implement same functionality in java. so i'm going break down. first step token.unpack('m0') . according idiosyncratic ruby unpack('m0') decode base64, built-in base64 libararies base64.decode64(string) function. unpack returns arry here, 1 element, converted base64. use token.unpack('m0').first first (and in case only) element of array returned token.unpack('m0') . if all, you'd correct it's base64. but, unpacked base64 unpacked again, time 'h*' , convert characters hex. , finally, because return array, use first again make string. so in summary, happening first string...

VB.NET ERR: 0x8007000B (Bad Image Format Exception) -

Image
__declspec(dllexport) void __cdecl memcopy(void *pdst, const void *psrc, unsigned int nsize) { __asm { mov esi, psrc mov edi, pdst mov ecx, nsize $l1: movq mm7, [esi] add esi, 8 movq [edi], mm7 add edi, 8 dec ecx jne $l1 }; } this code copyblit8x8.dll i imported .dll c++ console application , copied string 'hello world' char * a, char * b. echoed b succesfully showing 'hello world'. then, generic memory copy routine accepts 2 pointers perform copy, did below; the picture said post title ~ bad image format exception. err code: 0x8007000b. this generic error little information applies variety of scenarios. but, can safely assume, pointers. what want fast asm module perform generic memory copies,but vb.net images. any tips, stack overflow! a...

javascript - Problems with function, firing click() multiple times -

i have problem project i'm doing; https://codepen.io/argestis/pen/glrabq?editors=0001 i have function, simon says game. far want push values of colors array , compare array function. working until empty value array i'm using push values user should enter giu, when go function gameon() , try start pushing values click triggers multiple times. here's reference function, on console of codepen shared above guys can see error i'm getting. function gameon() { game.blue.on("click", function() { game.guesswhat.push(1); console.log("i @ blue") if (game.guesswhat.length !== game.count.length) { } else { verifysequence(); } }); game.red.on("click", function() { console.log("i @ red") game.guesswhat.push(2); if (game.guesswhat.length !== game.count.length) { } else { verifysequence(); } }); game.green.on...

visual studio - UWP - Windows Cannot Register Package 5ddccc63-e1ef-4118-bf08-bbafc1da427d -

Image
i'm having problem designer, cannot render xaml , produced error. , have no idea why happening, in later days rendered project, i'm new vs2015 community. can suggest how solve / or how can rid of error?

enabe CORS form any site/localhost in nginx -

i have configure nginx node, , run simple express app, var express = require('express') var app = express() app.get('/', function (req, res) { res.json({ "name":"rajesh" }) }) app.listen(8010, function () { console.log('example app listening on port 8010!') }) using postman can see request on vpsip:8010 json string successfuly. but when use html+jquery ajax code :: $.ajax({ method: "get", url: "http://vpsip:8010/" }) .done(function( msg ) { alert( "data saved: " + msg ); }); i error no 'access-control-allow-origin' header present on requested resource. origin 'http://anything' therefore not allowed. my nginx default file is location /exapi { proxy_pass http://localhost:8010/exapi; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection 'upgrade'; proxy_set_header host ...

swift - Store CGImage in RAM -

i working 100 large cgimage , can ask application display of them. since delay had wait before image draw on screen annoying, decided load images asynchronously (using operationqueue) if loading completed should, in theory, view image , if loading not completed, application can still asks specific cgimage , waiting in worst case long before implementation of operationqueue. but not get. experiencing reduction in loading time of cgimages still bit annoying. looking @ activity monitor noticed ram usage of application not grow. but when specific cgimage displayed on screen, ram usage grows , consequently if ask again cgimage loading immediate what missing? have maybe got tell os want cgimage stored in ram , not in "chache"?

php - Laravel 5.3: How to save images - Is Intervention still available? -

i began use laravel 5.3, wondering if intervention still compatible or not. i followed the documentation , keep getting error message, saying class 'intervention\image\imageserviceprovider' not found i added intervention\image\imageserviceprovider::class $providers , added 'image' => intervention\image\facades\image::class $aliases . then, began see error message. when using laravel 5.2, didn't happen, far remember. any advice appreciated! you need run following command: step 1 $ composer require intervention/image step 2 in $providers array add service providers package. intervention\image\imageserviceprovider::class step 3 add facade of package $aliases array. 'image' => intervention\image\facades\image::class step 4 $ php artisan config:clear $ php artisan cache:clear step 5 composer dump-autoload

java - How do I add external property file location to Spring Boot application deployed to tomcat 6? -

i have spring boot application configure annotations. have application.properties , application-{profile}.properties files data in them. problem want define war-external location on tomcat 6 server can put configuration files that take precedence . is, settings put in properties files should trump values in application.properties or application-{profile}.properties. how can accomplish in easiest possible way? i have tried add @propertysources has lower priority in properties files order not possible solution. can change property file loading order easily? it not possible add environment variables server, since might affect other deployed applications. war must self-contained , deliver needs (except external properties override file). you configure spring.config.location as described in doc or implement environmentpostprocessor if want apply regardless. there sample in university session @ devoxx we showcase how read file home directory , add after command line...

Access VBA random value from combobox -

i have combobox of client codes links table - clientt. when click button randomcmd random client code appear in combobox. my thought use vba code find maximum number of clients in clientt, rnd function pick number between max , 0, convert number value list. i can't find similar code use. have far number generates randomly. private sub randomcmd_click() clientcodecmb = int(999 * rnd) + 1 end sub please help. if customer id first column of combobox , bound column, do: private sub randomcmd_click() dim maxcustomerid = 1000 ' adjust needed. me!clientcodecmb.value = int((maxcustomerid + 1) * rnd end sub

How to set image in Android -

i want set image programmatically , should pass image constructor . use code when running application show me force close . force close error : fatal exception: main process: ir.mototel.mototel, pid: 12904 java.lang.nullpointerexception: attempt invoke virtual method 'void android.widget.imageview.setimageresource(int)' on null object reference @ com.sepandar.xengine.fragment.homefragment.newinstance(homefragment.java:60) @ com.sepandar.xengine.adapter.homepageradapter.getitem(homepageradapter.java:43) @ android.support.v4.app.fragmentpageradapter.instantiateitem(fragmentpageradapter.java:101) @ android.support.v4.view.viewpager.addnewitem(viewpager.java:1038) @ android.support.v4.view.viewpager.populate(viewpager.java:1186) @ android.support.v4.view.viewpager.populate(viewpager.java:1120) ...

How do I create multiple Facebook bots with a single platform? -

i have facebook bot , have connected facebook page. have publicly available have wait approval facebook. not problem if have make 1 single bot, huge problem if have on scale level (eg: 100+ bots). platform chatfuel or content api allow select page own , connect bot automatically. in minutes bot publicly available , skipping review phase (apparently) in facebook. i didn’t find info on facebook developer guide , there sort of internal api not available everyone? if how can request access that? facebook messenger bots published page (which bot identity ) using 1 or more applications (which defines webhook messages sent). application must reviewed , approved facebook. after that, page can 'attached' application, using standard facebook authorization flow in order access token page approved application. so chatfuel , others alreay have application approved, , page can connected it.

rest - Is there a standard way to define CURIEs in HTTP header fields? -

recently, i've designing restful api, , want use link header field implement hateoas. this fine , works without real problem, want make easier clients of api. the link header example might this: link: <https://api.domain.com/orders/{id}>; rel="https://docs.domain.com/order" in case client have find link searching https://docs.domain.com/order value in rel attribute. this works, since uri docs change it's fragile, , because of length makes bit impractical key search for. so want try , use curie make instead: link: <https://api.domain.com/orders/{id}>; rel="[rc:order]" that way problem of uri changing mitigated part, , it's more compact allowing easier search client. my problem is, since i'm using link header field implement hateoas feel consistent include curie http header field, rather introducing meta data in response body. since entire api uses standard http header fields , status codes of it's meta data...

How to create this matrix in MATLAB -

i have vector such a=[4;3;1;6] and want create matrix elements below a b=[6 5 4 3 2 1;4 3 2 1 0 0;3 2 1 0 0 0;1 0 0 0 0 0]; how can in matlab ? number of columns equal max of a. here 2 ways this: 1 vectorized, , 1 in loop. a=[4;3;1;6]; b = max(bsxfun(@minus, sort(a, 'descend'), 0:(max(a)-1)), 0); or s = sort(a, 'descend'); m = numel(a); n = s(1); c = zeros(m,n); k = 1:m c(k,1:s(k)) = s(k):-1:1; end results: b = 6 5 4 3 2 1 4 3 2 1 0 0 3 2 1 0 0 0 1 0 0 0 0 0

swift - Best practice in terms of storing profile images in app -

i'm creating app each user has profile image around 30 kb. i'm quite sure best way store these images, store them in realm object nsdata , guess not ideal. otherwise save in disk cache or memory cache, ideal way here? using alamofireimage downloading images. i use sdwebimage stores images in memory/disk, 1 can cache image manually in image cache or has extension set image via url uiimageview, downloads , caches image automatically (and call completion block if want). clears images old (say week old), or can clear cache manually. kingfisher great , written in swift.

javascript - How can I tell Babel to ignore an es6 import when using the Rollup Babel plugin? -

is there way me tell babel ignore imports, example don't want babel touch es5 imports polyfills. i have tried exclude option doesn't anything. here dev dependancies: "devdependencies": { "babel-preset-es2015-rollup": "^1.2.0", "rollup": "^0.36.3", "rollup-plugin-babel": "^2.6.1" } also here index.js comments showing want babel ignore: /* babel don"t touch these please */ import "parties/promise.js"; import "parties/fetch.js"; import "parties/domtastic.min.js"; /* end babel no touchy */ /* babel transpile these */ import "settings/global.js"; import "settings/tabs.js"; import "modules/helpers.js"; import "modules/modal.js"; import "modules/notify.js"; import "modules/tabs.js"; /* end babel transpile */ how can this? need package deal this? any appreciated, thanks. just use e...

Jquery validation in login form asp.net c# with webservice -

hello have created login form in asp.net redirect page have created webservice user validation , jquery ajax data returning undefined page not redirecting please me ... code this webservice [webmethod] public static string loginser(string un,string pwd) { using (sqlconnection con = new sqlconnection(constr)) { using (sqlcommand cmd = new sqlcommand("select username,password emp_login isactive=1 , username='" + un + "' , password='" + pwd + "'", con)) { con.open(); cmd.executenonquery(); con.close(); sqldataadapter da = new sqldataadapter(cmd); datatable dt = new datatable(); da.fill(dt); if (dt.rows.count > 0) { return "1"; } else { return "0"; ...

jsp - <c:param> value attribute not working properly -

in java spring mvc web app, want pass request parameter in link. following portion of .jsp page code ` <c:url var = "updatelink" value="/customer/showformforupdate"> <c:param name="customerid" value="${tempcustomer.id}"></c:param> </c:url> <c:foreach var="tempcustomer" items="${customers}"> <tr> <td> ${tempcustomer.firstname} </td> <td> ${tempcustomer.lastname} </td> <td> ${tempcustomer.email} </td> <td> ${tempcustomer.id} </td> <td> <a href="${updatelink}">update</a> </td> the portion of code below works fine..it displays customer id 'tempcustomer'. <td> ${tempcustomer.id} </td> however, <c:url var = "updatelink" value=...

php - How to make At Least Two Field Required to fill in Laravel 5.2 -

i doing project in want @ least 2 of social media profile must required fill. not achieve this. have form these fields <form role="form" id="submit" class="p-md col-8"> <div class="form-group"> <label>twitter</label> <div class="social-link-input"> <i class="icon fa fa-twitter"></i> <input type="text" name="twitter" class="form-control" placeholder="https://twitter.com/username" value="{{!empty($user->twitter)?$user->twitter:''}}"> </div> </div> <div class="form-group"> <label>facebook</label> <div class="social-link-input"> <i class=...

maven - Zeppelin running but process is dead -

good afternoon. i've been having trouble zeppelin lately. it's first attempt install , have been on past week no success. or suggestions appreciated. as background info, os centos 7 and, on cluster, running spark 2.0.1 on hadoop 2.7.2, hive 2.1.0 , hbase 1.2.4. also, other products installed anaconda2 4.2.0, scala 2.11.8, r 3.3.1 , maven 3.3.9. .bash_profile follows: # added anaconda2 4.2.0 installer export path="/opt/hadoop/anaconda2/bin:$path" ## java env variables export path=$path:$java_home/bin export classpath=.:$java_home/jre/lib:$java_home/lib:$java_home/lib/tools.jar ## hadoop env variables export hadoop_home=/opt/hadoop export hadoop_common_home=$hadoop_home export hadoop_hdfs_home=$hadoop_home export hadoop_mapred_home=$hadoop_home export hadoop_yarn_home=$hadoop_home export hadoop_opts="-djava.library.path=$hadoop_home/lib/native" export hadoop_common_lib_native_dir=$hadoop_home/lib/native export hadoop_conf_lib_native_dir=$hadoop_hom...