Posts

Showing posts from June, 2013

android - Variable Stays Null -

i'm trying pass string between activities, ytadapter favorites. ytadapter: mholder.mvideofavorite.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { ////////////////////////////////////////////////////////////// // need send searchresult result here favorites // //////////////////////////////////////////////////////////// apputils.showtoast(result.getsnippet().gettitle() + " added favorites."); intent intent = new intent(mactivity,favorites.class); string vidid,vidtitle,vidthumbnail; vidid = result.getid().getvideoid(); //video id vidtitle = result.getsnippet().gettitle(); //video title vidthumbnail = result.getsnippet().getthumbnails().getmedium().geturl(); //video thumbnail intent.putextra("id",vidid); intent.putextra("title",vidtitle); in

jquery - Append euro-sign to form textfield (zf2) -

i'm trying append € -sign textfield, it's not showing right. �-sign. i've tried following: $(pricetext).val("€ " + price + ",-"); $(pricetext).val("€ " + price + ",-"); as € , € but nothing's worked far. can help? if more info required, please ask, new so. thanks in advance! there character encoding mismatch ( related ), use unicode value \u20ac € (euro) $(pricetext).val("\u20ac " + price + ",-");

javascript - Drop down menu to display content below it once a list item is selected, best way to do it? -

i need create simple dropdown menu combined text box (example 100px below it) should show info related choice when selected. i'm thinking displaying info in simple text, customize css. achieve result should create different classes/variables in javascript or there way html , css? (or there better way this?) have no idea how start this. suppose i'll have study lot of javascript in end, if aware of resources, please, link nice tutorial appreciated! my knowledge of javascript basic if not on zero. thank help. i tried got question correct me if understood else. you can write html like <select id="opt"> <option> no 1</option> <option> no 2</option> <option> no 3</option> </select> <input type="text" id="info" value="no1 info"/> and using jquery can value user selected , according display information. $("#opt").change(function(){ var choice=

iis 7.5 - PHP pages being served very slowly on IIS7.5 -

i've inherited website working (albeit little slowly) php pages loading incredibly slowly. simple "contact us" page takes 10 seconds display. majority of pages html fine. i don't know php or iis! php version 5.6.0. any ideas or suggestions appreciated. edit: the problem due php session files not being deleted out of c:/windows/temp garbage collector. i'm not quite sure why because far can tell gc settings ok... session.gc_divisor = 1000 session.gc_maxlifetime = 1440 session.gc_probability = 1 ...and permissions directory good. directory getting bigger , bigger (hence why running - must have been stacking while). anyway pointed php new directory , working, old sessions being deleted should have been. [i'd tried in directory got dialog box saying "you don't have access, click enable" clicked, windows explorer stopped responding. assumed didn't have access directory (this has happened before), , moved on else. silly me.]

ios - Missing return UITableViewCell -

i sure question have been asked before can't find answer solves problem nested if-else , switch-case logic. have uitableview 2 sections, each sections has 2 custom cells. it. 4 cells. no matter "missing return in function expected return uitableviewcell " question how can change setup else statement @ bottom satisfy swift logic? any appreciated override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { if indexpath.section == 0{ switch (indexpath.row) { case 0: let cell0: settingscell! = tableview.dequeuereusablecellwithidentifier("cell0", forindexpath: indexpath) as! settingscell cell0.backgroundcolor = uicolor.redcolor() break case 1: let cell1: settingscell! = tableview.dequeuereusablecellwithidentifier("cell1", forindexpath: indexpath) as! settingscell cell1.backgroundcolor = uicolor.whitecolor()

xcode - Coredata NSFetchRequest DictionaryResultType null properties Swift -

hello guys using code fetch result coredata func getrequest(entirydesc:nsentitydescription) -> nsfetchrequest{ var request:nsfetchrequest = nsfetchrequest() request.entity = entirydesc request.resulttype = nsfetchrequestresulttype.dictionaryresulttype return request } now problem need attributes contains nil value excutefetchrequest returns properties have values , there work around return null attributes string "" every time fetch ? advanced of course, can dispense .dictionaryresulttype , fetch normal managed objects. there few cases dictionary result type makes sense. if want construct dictionary attributes filled out (for whatever opaque reason), remember 2 things: make sure insert null values objects nsnull() you can use nsentitydescription api generate attribute keys. use entitydescription.propertiesbyname.allkeys generate list of attribute names of entity.

python - Django: How to access test database? -

i working in django 1.8. have django management command create materialized views on database, follows: python manage.py create_db_matviews $db_name $db_user $db_pass now want run management command inside tests, can test command. (my actual database extremely large, , management command extremely slow, test on test data, rather real data.) however calling management command inside test file not work - unsurprisingly since have no idea credentials use: def setupmodule(): management.call_command('loaddata', 'frontend/fixtures/mydata.json', verbosity=0) # load fixtures, then... management.call_command('create_db_matviews', 'default', 'default', 'randomguess', verbosity=0) it fails follows: creating test database alias 'default' ('test_prescribing')... ... running migrations... ======================================

javascript - Table2excel plugin does not work -

Image
i working on dashboard app , implement "download table .xls" feature. on link can see how table looks dashboard i have found library includes tutorial explains set up. can see in code below have done more or less explained. not work , reason table not exported. as can see, have included jquery.table2excel.js in resources other resources used page. have checked if .js file available after page loaded , looks good. i have tried this $(function () { document.getelementbyid('btnexport').addeventlistener("click", function () { document.getelementbyid('mytable').table2excel({ exclude: ".noexl", name: "excel document name", filename: "myfilename" }); }); }); but not , when execute function message in debugg console typeerror: document.getelementbyid(...).table2excel not function

c# - How to reslove the error of service -

i have .net project [scenario] in i: 1. downloaded files winscp.com library in .net 2. parsed them, created tokens, inserted them sql-db using linq sql. problem during converting service: the downloading part goes fine when run service *********************************************************************** when pushing db using linq sql gives exception without entering single row in db i not know, why so. kindly me if 1 knows mistake being made me. note: the exception found using eventlog under: application: errlogsservice_57_92.exe framework version: v4.0.30319 description: process terminated due unhandled exception. exception info: system.data.sqlclient.sqlexception stack: @ system.data.linq.datacontext.submitchanges(system.data.linq.conflictmode) @ errlogsservice_57_92.errlogscreation.read_log_file(system.string, int32, int32) @ errlogsservice_57_92.errlogscreation.parsefileandpush(int32) @ system.threading.executioncontext.runinternal(system.threading.executi

java - Does JVM create an iterator when it iterates over array with for-each loop? -

sorry if asked, did not find answer on stackoveflow , didn't see official tutorials field. the question in title - if have code like int[] array = new int[20]; (int el : array) { ... } will jvm run standard loop for (int = 0; < array.length; i++) or create iterator? upd link may helpful complete answer fastest way iterate array in java: loop variable vs enhanced statement arrays in java don't implement iterable interface cannot iterator array. cannot have iterator on primitive types such int because primitive type can't generic parameter. e.g. if want iterator, have use iterator instead, result in lot of autoboxing , -unboxing if that's backed int[]. the jvm unlikely create iterator for-each loop on arrays inefficient. in fact compiler transform for-each loop indexed loop. can check viewing decompiled byte code method: source code: public void test() { int[] array = new int[20]; (int el : array) { system.out.pri

java - Listing items in Combobox -

i trying create titleareadialog in jface. have text field username entered , combobox selecting group of user. requirement that, when type username in first text field, combobox should show groups corresponding username (there table in database each username assigned set of groups). have written code retrieving groups corresponding username entered. not getting list of groups in combobox. should add listeners textbox or combobox once type username in textfield, list of groups corresponding username in combobox? kindly me new topic , java well. text = new text(composite, swt.border); text.setbounds(205, 10, 109, 19); combo combo = new combo(composite, swt.none); combo.setbounds(205, 49, 109, 21); string reponame=text.gettext(); string[] grpnames=db.getcombovalues(reponame); combo.setitems(grpnames); you can add modifylistener text widget , re-populate combo box on every change so: text.addlistener( swt.modify, new listener() { @override public void handleeven

python - Django email notification -

i want ask guidance on how django email notification https://docs.djangoproject.com/en/1.8/topics/email/#send-mail i have basic task form , option assign someone, when form saved want send email notification assigned user. job/task models.py class job(models.model): completed = models.booleanfield(default=false) task_name = models.charfield(max_length=80, blank=false) description = models.charfield(max_length=80, blank=false) is_important = models.booleanfield(default=false) completion_date = models.datefield(blank=true, null=true) assign_to = models.foreignkey(user, blank=true, null=true) comments = models.textfield(blank=true) def __unicode__(self): return self.task_name job/task view.py @login_required def job(request): if request.method == 'post': form = jobform(request.post) if form.is_valid(): job_record = form.save(commit=false) job_record = form.save(commit=false)

android - Gear 2 - Failed the install -

i trying develop gear 2 application. have tizen project , able deploy .wgt files .crt file requested via .keystore of application. whenever trying install application ( think phone trying push .wgt gear) taking "failed install" error. if install both application android studio everythings works great. can communuate each other. what should missing? i open example git projects guides, tutorials , infos. thanks you

python - Select rows in one DataFrame based on rows in another -

let's assume have large pandas dataframe dfbig columns param1, param2, ..., paramn, score, step , , smaller dataframe dfsmall columns param1, param2, ..., paramn (i.e. missing score , step columns). i want select rows of dfbig values of columns param1, param2, ..., paramn match of row in dfsmall . there clean way of doing in pandas? edit: give example, consider dataframe dfbig : arch | layers | score | time | 1 | 0.3 | 10 | 1 | 0.6 | 20 | 1 | 0.7 | 30 | 2 | 0.4 | 10 | 2 | 0.5 | 20 | 2 | 0.6 | 30 b | 1 | 0.1 | 10 b | 1 | 0.2 | 20 b | 1 | 0.7 | 30 b | 2 | 0.7 | 10 b | 2 | 0.8 | 20 b | 2 | 0.8 | 30 let's imagine model specified pair (arch, layers) . want query dfbig , time series scores on time best performing models arch , arch b. following edchum's answer below, take best solution procedurally: modelcolumns = [col col i

javascript - jQuery filter for each string that's not null -

how apply jquery filter every string that's not null? basically, have following code , want make work number of "selectors" being set beforehand. the list of selectors available in array. if (typeselector === '' && colorselector === '') { $('.product').filter(selector).show(); } else if (typeselector === '') { $('.product').filter(selector).filter(colorselector).show(); } else if (colorselector === '') { $('.product').filter(selector).filter(typeselector).show(); } else { $('.product').filter(selector).filter(typeselector).filter(colorselector).show(); } thanks suggestions/help! to simplify can use chaining: var products = $('.product').filter(selector); if (typeselector !== '') { products = products.filter(typeselector); } if (colorselector !== '') { products = products.filter(colorselector); } products.show();

class - C++ Error: lvalue required as unary '&' operand -

i have created class named node. defined follows: class node { private: int key; node * next; public: void setkey(int key); void setnext(node * next); int getkey(); node * getnext(); }; these functions basic getter , setter functions. now, if try this: movenode(&(btail->getnext()),&start); it shows error :lvalue required unary '&' operand now, if update class node , keep (node * next) public , access via this: movenode(&(btail->next),&start); it shows no error. please how can rid of error. when return node* getnext() , create temporary variable of node* type, has no sense take address using & , temporary variable anyway destroyed soon. when directly access next , refer long-living variable, , can take address. you might want return reference node* getnext() : node*& getnext() {return next;}; so point same variable next , able take address.

javascript - How to automatically install Android app on user click jquery -

i have user click event button on web page. $('.hr_rd_s').click(function() { window.open('gift.php', '_blank'); //automatically install android app code goes here }); <a href="#" class="hr_rd_s"> <span id="text15" class="answer">left</span> </a> for example, if user on android phone, want app automatically installed on user click event. page rendered android phone users. you can't automatically install android app. huge security issue. can link app in google play store user must install it. possible link android installation file

python 2.7 - Strange behaviour when adding columns -

i'm using python 2.7.8 |anaconda 2.1.0. i'm wondering why strange behavior below occurs i create pandas dataframe 2 columns, add third column summing first 2 columns x = pd.dataframe(np.random.randn(5, 2), columns = ['a', 'b']) x['c'] = x[['a', 'b']].sum(axis = 1) #or x['c'] = x['a'] + x['b'] out[7]: b c 0 -1.644246 0.851602 -0.792644 1 -0.129092 0.237140 0.108049 2 0.623160 0.105494 0.728654 3 0.737803 -1.612189 -0.874386 4 0.340671 -0.113334 0.227337 all far. want set values of column c 0 if negative x[x['c']<0] = 0 out[9]: b c 0 0.000000 0.000000 0.000000 1 -0.129092 0.237140 0.108049 2 0.623160 0.105494 0.728654 3 0.000000 0.000000 0.000000 4 0.340671 -0.113334 0.227337 this gives desired result in column 'c' , reason columns 'a' , 'b' have been modified - don't want happen. wonder

c++ - Sorting a list of structs by an element -

i have got struct below: struct man { string surname; string name; char sex; int birth_year; int age; man * next; }; how can sort list alphabetically surname? i know how bubble sort arrays, can't handle list :/ in order make std::list::sort work need overload < operator of class. in case this //n.b. untested code bool operator< (const man& other) { toupper(this->surname) < toupper(other->surname); } you call overload of sort wich takes comp function argument. see here .

Can I download and install apps that previously published for wp8.1 with a Windows 10 phone? -

i have read many articles "forward compatibility" of wp apps stating app targeting 8.0 can run on 8.1 phone. have not verified on wp store. i have published universal app wp 8.1 , users have installed app. investigating various upgrading scenarios happen when windows 10 mobile comes out later year. scenario 1 : can user download , install 8.1 app newly purchased windows 10 phone? show in new, unified windows store? scenario 2 : can user has installed app continue receive updates app after upgrade phone windows 10 mobile? have no plan win 10 release @ stage , update 8.1 release in months come. it helpful if can provide me links policies of new, unified windows store. yes both. existing apps show , can installed store. existing stores, users relevant app device. existing windows phone 8.1 apps run on , available windows 10 mobile devices. can update , expect users receive updates. this discussed in store sessions build: all new in windows store , store

c# - Proper way of hosting an external window inside WPF using HwndHost -

i'd host window of external process inside wpf application. i'm deriving hwndhost this: class hwndhostex : hwndhost { [dllimport("user32.dll")] static extern intptr setparent(intptr hwndchild, intptr hwndnewparent); private intptr childhandle = intptr.zero; public hwndhostex(intptr handle) { this.childhandle = handle; } protected override system.runtime.interopservices.handleref buildwindowcore(system.runtime.interopservices.handleref hwndparent) { handleref href = new handleref(); if (childhandle != intptr.zero) { setparent(this.childhandle, hwndparent.handle); href = new handleref(this, this.childhandle); } return href; } protected override void destroywindowcore(system.runtime.interopservices.handleref hwnd) { } } and using this: hwndhost

distributed - Any key-value storages with emphasis on compression? -

are there key-value storages fit following criteria? are open-source persistent file storage have replication , oplog have configurable compression usable storing 10-100 megabytes of raw text per second work on windows , linux desired interface should contain @ least: store record text or numeric id retrieve record id wiredtiger support different kind of compression: compression considerations wiredtiger compresses data @ several stages preserve memory , disk space. applications can configure these different compression algorithms tailor requirements between memory, disk , cpu consumption. compression algorithms other block compression work modifying how keys , values represented, , hence reduce data size in-memory , on-disk. block compression on other hand compress data in binary representation while saving on disk. configuring compression may change application throughput. example, in applications using solid-state drives

Ansible show output of rails tests -

i've got following ansible play: - name: run rails tests hosts: marflar sudo: yes sudo_user: vagrant tags: - rake tasks: - name: configure nokogiri command: bash -lc "bundle config build.nokogiri --use-system-libraries" - name: install gems command: bash -lc "bundle install" register: bundle_complete - name: check if database exists command: bash -lc "bundle exec rake db:version" ignore_errors: true register: rake_db_version_result - name: create database command: bash -lc "bundle exec rake db:setup" register: db_setup_complete when: rake_db_version_result|failed - name: apply database migrations command: bash -lc "bundle exec rake db:migrate" register: db_setup_complete when: rake_db_version_result|success - name: running test suite command: bash -lc "bundle exec rake test" when: db_setup_co

c++ - String manipulation and ignoring part of string -

i have input following text file using c++ command1 5 #create 5 box length 12 inserttext box how can read in input while ignoring after #sign? for example output should without #create 5 box command1 5 length 12 inserttext box edit: i tried following: while(getline(myfile, line)) { istringstream readline(line); getline(readline, command, ' '); getline(readline, input, '\0'); } ...but doesn't seem work. the outer while(getline( , istringsteam good, after you'd want read space-separated word command, perhaps 1 or more space-separated inputs after that: like std::string command, input; std::vector<std::string> inputs; if (readline >> command && command[0] != '#') { while (readline >> input && input[0] != '#') inputs.push_back(input); // process command , inputs... } it's easier use >> getline parse readline because set stream f

java - PostgreSQL, Hibernate : Moving contents of db to text file/XML file for storage purposes -

i working on spring-mvc application in seeing database growing big. space consumed chat messages history mostly, , other stuff old notifications, not useful. because of thought of moving guys text/xml file give db room breath , increase performance of queries thereby. indexes not useful many insertions. i wanted know if there way, postgresql or hibernate has support such task, data picked out of db , saved in plain files, can accessed , result in atleast performance gains. i have started looking stuff, don't have in hand show. kindly let me know if there questions guys have. thanks lot. i use postgresql json storage , have 2 databases: the current operations db, 1 moving data away slim it the archive database old data aggregated save storage this way can move data current database archive database without compromising acid attributes , can aggregate old data simplify retrieval, grouping various related entities based on common root entity, you'll

ASP.NET application shows previous date than stored in MySQL -

my web application built in asp.net mvc 5 backend mysql. both application , database deployed on same web server. the issue date in grid (jqgrid) shown 1 day before date saved in database, i.e. if mysql database has column has 15-may-2015 jqgrid shows 14-may-2015. this issue when application deployed on server. application works when working in development environment on local machine. i have noticed time stored along date, , if time part 00:00:00 grid output previous day. server location australia the issue has been resolved using function tolocaltime() date column in asp.net mvc resultset.

sbt - How to parallellize tasks given on the command line -

i'd able execute dynamically tasks in sbt. so, i'm using command line: sbt taska taskb taskc it works ok, of them executed sequentially. on other hand, if programmatically write inside build.sbt : val alltasks = taskkey[unit]("all") alltasks := { taska.value taskb.value taskc.value } all of them executed in parallel. how can behavior on command line? you can use all command: build.sbt taskkey[string]("taska") := { println("a start"); thread.sleep(3000); println("a end"); "a" } taskkey[string]("taskb") := { println("b start"); thread.sleep(2000); println("b end"); "b" } taskkey[string]("taskc") := { println("c start"); thread.sleep(1000); println("c end"); "c" } and running it: > taska taskb taskc c start start b start c end b end end

Rhino: Java numbers don't behave like Javascript numbers -

i have instance of java class accessible in javascript program public class contentprovider { public object c(int n) { switch (n) { case 1: return 1.1; case 2: return 2.2; case 3: return 3.3; case 4: return "4"; case 5: return new java.util.date(); } return null; } } this code inside main(): scriptenginemanager mgr = new scriptenginemanager(); scriptengine engine = mgr.getenginebyname("javascript"); engine.put("ctx", new contentprovider()); res = engine.eval("ctx.c(1)"); system.out.printf("rhino:> %s (%s)%n" , res , res != null ? res.getclass().getname() : null ); the simple expression ctx.c(1) prints: rhino:> 1.1 (java.lang.double) now here happens ctx.c(1) + ctx.c(2) : rhino:> 1.12.2 (java.lang.string) and (ctx.c(1) + ctx.c(2)) * ctx.c(3) : rhino:> nan (java.lang.double) rhino performing string concatenation instead of number arithmeti

mysql - Checking if user is admin or not in PHP -

i new php , trying school assignment teacher says "google it" , can't find asnwer works me. here's login.php (please excuse swedish notes in it, teacher) <?php //start session session_start(); require('connect.php'); //3. if form submitted or not. //3.1 if form submitted if (isset($_post['username']) , isset($_post['password'])){ //sätter form värderna variabler $username = $_post['username']; $password = $_post['password']; //kollar om variblerna redan finns databasen $query = "select * `user` username='$username' , password='$password'"; $result = mysql_query($query) or die(mysql_error()); $count = mysql_num_rows($result); //kollar om bägge värdena är likadana databasen och sedan skapar sessionen om de är det. if ($count == 1){ $_session['loggedin'] = 1; $_session['username'] = $username; }else{ //3.1.3 om värdena inte stämmer kommer ett fel medelande att skickas till anv

printing - php LPR Printer class -

how use lpr printer class print txt file usb printer epson lq-1150? <?php include("printsend.php"); include("printsendlpr.php"); $lpr = new printsendlpr(); $lpr->set-host("192.168.1.152"); //put printer ip here $lpr->setdata("c:\\wampp2\\htdocs\\print\\test.txt"); //path file, or string print. $lpr->printjob("somequeue"); //if printer has built-in printserver, might accept queue name. ?> in set host want use share printer name or host? this command using printing ip printers: you need install lpr service windows , linux on server. if ($this->agent->platform() == 'linux') { $command = 'lpr -s ' . $printer->printer_ip . ' -p ' . $printer->printer_name . ' -o -x ' . $file; //$command = 'lp -d ' . $printer->printer_name . ' ' . $file; if (exec($command)) { return true; }

java - Still unsure as to why this integer remains unmodified -

this question has answer here: is java “pass-by-reference” or “pass-by-value”? 72 answers i learning references , datatypes in java , particular code still confusing me. understand of primitive types in java value types (byte, short, int, long, float, double, boolean, char), , when you're using string or object it's reference type. when taught declare , initialize variable, told think of creating box. if create variable "y" , give value of "5" it's i've created box called "y" contained value of 5. teacher said if try call y in method (check out code below more detail) value remain untouched because it's primitive datatype i'm passing in 5, not variable contains 5. i'm confused because if i'm passing in value of 5, why wouldn't following method add 1 onto it. public class referenceandvaluetypes {

tfsbuild - get data from TFS in custom web application -

i need extract data tfs (team foundation server) , create excel sheet data. automate it, writing application . but problem is: how can data tfs? there webservice available or need parse html , data. no. tfs has broad coverage apis , came in 2 flavors: object model , rest. the object model automatically installed when install visual studio / team explorer, otherwise can use stand-alone msi . .net api, can find java version in case need it. om simple use .net developer. the rest api kind of new , should study if satisfy requirement. apis supported on vso , miss tfs on-premise , older versions.

Store credit card details in Paypal payment -

i wanna store card details while using paypal payment, there why in paypal sdks store details of card. paypal's rest api calls "vault" , allows save credit card details on paypal's server don't have save on own server. way can still process saved cards without risk of saving on own server. the classic api (which still prefer) has same thing except it's called reference transactions. can run card verification / $0 authorization, , in future make call doreferencetransaction process amount need using card details paypal has saved on server. either way it's matter of building api requests per documentation. there sdks available this.

How check fast, if database reachable? (Qt, QML, C++)- Linux -

i use qt qml , c++. on application use database. works, if database reachable. my problem is, check, if database reachable (like ping). i tried db.setdatabasename(dsn); if(db.isvalid()) { if(db.open()) { //std::cout <<"offene datenbank"; connected=true; } else { connected=false; } } else { connected=false; } and give connected value result. takes long (maybe 30 seconds), if there no connection. how can check fast, if have database connection? is there maybe way break command .open after 5 seconds not connected? i think 1 easy solution check ping of database sever. can use platform specific ways pinging. this work on linux : int exitcode = qprocess::execute("ping", qstringlist() << "-c 2" << serverip); if (exitcode==0) { // reachable } else { // not reachable }

office365 - Office task pane app: how to get the whole document in an OOXml string? -

i'm developing office task pane app needs access whole document. know there api getfileasync() https://msdn.microsoft.com/en-us/library/office/jj220084.aspx office.context.document.getfileasync(filetype [, options], callback); however,the filetype can 3 values: compressed , pdf , text . compressed returns entire document (.pptx or .docx) in office open xml (ooxml) format byte array. pdf returns entire document in pdf format byte array. text returns text of document string. (word only) when compressed , returned value byte array. how can ooxml string? or there api select content in document can use getselecteddataasync() api? this little late. i've been working task pane apps lately and, turns out, ooxml natively compressed (unless i'm grossly mistaken). my best advice figure out encoding string encoded at, , decode encoding type. i'm willing bet it's utf-8.

rest - "404 Not Found" when viewing swagger api-docs when using swagger-springmvc (now springfox) -

i trying configure swagger in spring project, hitting hitting " http://localhost:8080/api-docs " says "404 not found". maven dependency <dependency> <groupid>com.mangofactory</groupid> <artifactid>swagger-springmvc</artifactid> <version>0.8.2</version> </dependency> swaggerconfig.java file package com.ucap.swagger; import com.mangofactory.swagger.configuration.jacksonscalasupport; import com.mangofactory.swagger.configuration.springswaggerconfig; import com.mangofactory.swagger.configuration.springswaggermodelconfig; import com.mangofactory.swagger.configuration.swaggerglobalsettings; import com.mangofactory.swagger.core.defaultswaggerpathprovider; import com.mangofactory.swagger.core.swaggerapiresourcelisting; import com.mangofactory.swagger.core.swaggerpathprovider; import com.mangofactory.swagger.scanners.apilistingreferencescanner; import com.wordni

email - mail is not sent by device rails 4 -

Image
i using device confirmation , forget password mail not sent. have apply code devise.rb config.mailer = 'devise::mailer' developement.rb config.action_mailer.default_url_options = { :host => "localhost:3000" } config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.smtp_settings = { :address ![enter image description here][2] => 'smtp.gmail.com', :port => 458, :domain => 'gmail.com', :user_name => 'xyz@gmail.com', :password => '123456', :authentication => 'plain', :enable_starttls_auto => true } smtp working find in others project. please suggest me wrong please update port :458 :port => 587

jquery - How do i animate scattered divs to align on pageload -

i browsing ideas new project , animation caught eye here . on pre-pageload boxes scattered, after loading scattered boxes come , align in respective positions. seems complicated jquery application willing learn. any appreciated please, maybe link tutorial or starting point? here fiddle layout. can have 5 blocks in layout animate above website? <!--body--> <div id="bodycontainer"> <div id="indexspotlightcontainer"> slider </div> <div class="indexblockdivider"></div> <div id="indexblockcontainer1"> <div class="indexinfoblock"> block1 </div> </div> <div class="indexblockdivider"></div> <div id="indexblockcontainer2"> block2 </div> <div class="indexblockdivider"></div> <div id="indexblockcontainer3">

java - WPS PIn and Push Android Lollypop 5.0 -

i trying write code wps pin , push method android lollypop. code compiles correctly configuration not initiated station when invoked. not sure doing wrong. piece of code snippet below: wpsinfo getwpsconfig(){ wpsinfo config=new wpsinfo(); config.setup=wpsinfo.pbc; config.setup=wpsinfo.display; config.setup=wpsinfo.invalid; return config; } i tried this: wpsinfo wpsmanager = new wpsinfo(); if(cmdparams[0].equalsignorecase("pbc")){ wpsmanager.setup=wpsinfo.pbc; int wpsstatus = wpsmanager.describecontents(); log.i(tag,"status of device is:"+wpsstatus); system.out.println("status of device is:\"+wpsstatus"); return cmdexecstatus.success; } else if (cmdparams[0].equalsignorecase("pin")){ wpsmanager.setup= wpsinfo.display; string wpspin = wpsmanager.pin; log.i(tag,"pin on device is:"+wpspin);

java - Return a boolean from a JpaRepository method -

i have native query in interface extends jparepository . method should ideally return boolean value, can't figure out how select gets automatically translated boolean . this works, although have call boolean.valueof(haskids(id)) : // yuck. wanted boolean @query(nativequery = true, value = "select 'true' dual exists(" + "select * child_table parent_id = ?)") string haskids(long parentid); how can change more natural return type? boolean haskids(long parentid); // throws classcastexception update: the stacktrace not helpful imho because it's usual nightmare of hibernate proxies , aspectj closures, here's relevant portion anyway. caused by: java.lang.classcastexception: java.lang.string cannot cast java.lang.boolean @ com.sun.proxy.$proxy1025.haskids(unknown source) @ com.bela.foo.bar.service.thingyserviceimpl.recordhaskids_aroundbody4(thingyserviceimpl.java:85) @ com.bela.foo.bar.service.thingyserviceimpl$aj

yii2 - Sum of gridview column -

what way, if it's possible sum column values in gridview , display in summary? have column prices , i'd show sum of them near rows count. yes, it's possible. question broad in current state. can implement on own, recommend use kartik's gridview extension . it's enhanced version of native gridview , has feature. hers paragraph in official docs desribing feature.

java - Hibernate does wrong insertion order for child entities with composite keys -

i have table relies on insertion order (bad legacy design cannot change) , having transient entities being inserted in wrong order. table in question called 'mean' child entity of 'belief'. when session.save(belief); called, action cascaded child mean entities stored list in belief class. mean entities stored in appropriate order in belief.getmeans() list, once persisted database, inserted in order of composite key. example, if there 3 mean entities inserted following order , composite keys: [1, 1], [1, 3], [1, 2] they inserted ordered composite keys so: [1, 1], [1, 2], [1, 3] any idea might causing this? thought hibernate supposed insert based on order appear in list? tried running session.save() on each mean entity individually see if make difference, didn't. i appreciate help! edit: ended doing adding new column mean table called col_index holds column index of mean in resulting matrix. used javax.persistence.orderby annotation new col_index colu

java - Apache Shiro login error: IncorrectCredentialsException -

i keep getting error when attempt login. appreciated. login code realm realm = new testrealm(); securitymanager sm = new defaultsecuritymanager(realm); securityutils.setsecuritymanager(sm); usernamepasswordtoken token = new usernamepasswordtoken(); token.setusername("dave"); token.setpassword("le1990".tochararray()); token.setrememberme(true); subject sub = securityutils.getsubject(); sub.login(token); dogetauthenticationinfo method protected authenticationinfo dogetauthenticationinfo(authenticationtoken token) throws authenticationexception{ usernamepasswordtoken uptoken = (usernamepasswordtoken)token; string username = uptoken.getusername(); if(username == null) this.logger.info("we don't except null usernames. sorry. "); authenticationinfo info = null; try{ user user = new user(); string pass = user.getpassforuser(); if(pass == null) throw new accountexcep

Repeating Capture Groups Regex -

i have large chunk of class data need run regular expression on , data from. problem need repeating capturing group in order acomplish that. womn st 157a queerhistory making ccode typ sec unt instructor time place max enr req rstr status 32680 lec 4 shah, p. tuth 11:00-12:20p iab 131 35 37 60 full womn st 171 sex/race & conquest ccode typ sec unt instructor time place max enr req rstr status 32710 lec 4 o'toole, r. tuth 2:00- 3:20p dbh 1300 52 13/45 24 open ~ same 25610 (glblclt 103b, lec a); 26350 (history 169, lec a); , ~ 60320 (anthro 139, lec b). 32711 dis 1 0 monson, a. w 9:00- 9:50 hh 105 25 5/23 8 open o'toole, r. ~ same 25612 (glblclt 103b, dis 1); 26351 (history 169, dis 1); ,

Offline Installation of python & pip -

i need install python on sever run scripts server has no access internet. the server has access local network has access internet*. use pip manage packages through local network directory specified here . how can install pip, python , dependancies on windows machine, offline can use pip, specified in link above manage packages require? *for clarity: have no ability mirror, hack or otherwise information pass through local network directly internet. the official python installer windows has no other dependencies. runs offline. for other packages may have dependencies (that difficult install on windows); christopher gholke maintains list of windows installers common python packages . these msi installers (or whl files) self-contained. they designed work official python installer windows - use registry entries identify install location. you can download these , move them windows machine. beyond 2 - if have further requirements can use tools basket download pack

html5 - Passing innerHtml value as parameter for play framework routes -

hello trying pass inline edited table value parameter play routes can me same here html code <table class="gradienttable"> <thead> <tr> <th>task</th> <th>timesheetdate</th> <th>hours</th> <th>isbilled</th> <th>work place</th> </tr> </thead> <tbody> @for(element <- currentpage) { <tr> <td contenteditable="true" id="task1">@element.gettask()</td> <td>@element.gettimesheetdate()</td> <td contenteditable="true" id="hours">@element.gethours()</td> <td contenteditable="true" id="isbilled">@element.getisbilled()</td> <