Posts

Showing posts from June, 2013

html - Double vertical scroll bar on overflow-x:hidden -

after lot of searching, came question this. due large code, becoming headache identify part of page causing overflow. used: html, body{ overflow-x:hidden; height:100%; } i used alternative way, create wrapper div outiside body tag , applied overflow-x:hidden property none of these seem fix 'double vertical scroll bar issue'. hey think solution, if still looking it, html, body{ overflow-x: hidden; max-width: 100%; height: auto; } instead of writing height:100% have specified. hope helps!

displaying text with html tags as plain text in android -

i trying display text html tags plain text in android app. have tried using of html methods , end shoeing blank space instead of text. final ptamodel current = mdatalist.get(position); spanned content; if (android.os.build.version.sdk_int >= android.os.build.version_codes.n) { content = html.fromhtml(current.getcontent(), from_html_mode_legacy); } else { content = html.fromhtml(current.getcontent()); } holder.date.settext(current.getdate()); holder.minutes.settext(content); holder.title.settext(current.gettitle()); i found answer said use code above, end getting empty textview instead of plain text. this content receiving html tags: "content":"<p>&nbsp;<\/p><p>attendees:<\/p><p> <br><\/p><p>suzy bullett, lisa wagner, jamie flint, camilla logeske, jennifer legault, emily hidalgo<\/p><p> <br><\/p><p>&nbsp;<\/p&

python - pypi pakcage automatically uninstalling and upgrading other things? -

i have pypi package distribute requires django, in setup.py have this... install_requires = ["django"] then in egg have requires.txt file this... django now made new version , uploaded pypi , did pip install -u mypackage , uninstalled current django 1.10 , reinstalled django 1.10.1. how can make leave users django version alone? specify version dependencies like install_requires = ["django>=1.8"] so if user has django less 1.8 upgrade.

c# - Serve file in byte[] as URL -

i working on serverside component of webapp should display images stored in database. i trying find way transform byte array or stream valid url html img tag. the byte[] contains entire file including headers. i have searched solution kept finding reverse problem of saving filestream url. is there way serve file via kind of dynamically generated url or have create physical copy of file link to? you can convert byte array base64 image. public string getbase64image(byte[] myimage) { if (myimage!= null) { return "data:image/jpeg;base64," + convert.tobase64string(myimage); } else { return string.empty; } } your image tag this: <img src="data:image/jpeg;base64,/9j/4aaqskzjrga..."> or larger images (and other file types) it's better use generic handler public void processrequest(httpcontext context) { //check if querystring 'id'

xml - WSO2 ESB ISO 8583 Connector Error -

i have implemented iso 8583 connector on wso2 esb according wso2 documentation: https://docs.wso2.com/display/esbconnectors/configuring+iso8583+connector+operation i sent following xml message rest client: <isomessage> <data> <field id="0">0200</field> <field id="3">568893</field> <field id="4">000000020000</field> <field id="7">0110563280</field> <field id="11">456893</field> <field id="44">dfght</field> <field id="105">abcdefghij 9871236548</field> </data> i got following error in esb system log: couldn't packed iso8583 messages more tid[-1234] [esb] [2016-09-07 05:23:28,028] error {org.wso2.carbon.connector.iso8583.iso8583messageproducer} - couldn't packed iso8583 messages org.jpos.iso.packager.genericpackager.readfile(genericpackager.java:204) org.jpos.iso.

osx - Correct owner/group/permissions for Apache 2 site files/folders under Mac OS X? -

it's hard find mac-specific answers question on web, i'm hoping out there can put 1 rest me? permissions screwed on sites , i'm not sure how fix them without slamming recursive 777 on quite incorrect. thanks! this restrictive , safest way i've found, explained here hypothetical ~/my/web/root/ directory web content: for each parent directory leading web root (e.g. ~/my , ~/my/web , ~/my/web/root ): chmod go-rwx dir (nobody other owner can access content) chmod go+x dir (to allow "users" including _www "enter" dir) sudo chgrp -r _www ~/my/web/root (all web content group _www) chmod -r go-rwx ~/my/web/root (nobody other owner can access web content) chmod -r g+rx ~/my/web/root (all web content readable/executable/enterable _www) all other solutions leave files open other local users (who part of "staff" group being in "o"/others group). these users may freely browse , access db configurations, source

node.js - TFS (on premise) build output shown with wrong character-encoding -

Image
we have tfs2015 , build definition following: when trigger build output wrong character encoding: 2016-09-07t11:40:29.2722404z ΓööΓöÇΓöÇ readable-stream@2.1.5 (buffer-shims@1.0.0, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.2, util-deprecate@1.0.2, process-nextick-args@1.0.7, isarray@1.0.0) 2016-09-07t11:40:29.2722404z run-sequence@1.2.2 node_modules\run-sequence 2016-09-07t11:40:29.2722404z ΓööΓöÇΓöÇ chalk@1.1.3 (supports-color@2.0.0, escape-string-regexp@1.0.5, ansi-styles@2.2.1, strip-ansi@3.0.1, has-ansi@2.0.0) 2016-09-07t11:40:29.2722404z vinyl-source-stream@1.1.0 node_modules\vinyl-source-stream 2016-09-07t11:40:29.2722404z Γö£Î“öÇΓöÇ vinyl@0.4.6 (clone-stats@0.0.1, clone@0.2.0) 2016-09-07t11:40:29.2722404z ΓööΓöÇΓöÇ through2@0.6.5 (xtend@4.0.1, readable-stream@1.0.34) 2016-09-07t11:40:29.2722404z gulp-concat@2.6.0 node_modules\gulp-concat 2016-09-07t11:40:29.2762404z Γö£Î“öÇΓöÇ concat-with-sourcemaps@1.0.4 (source-map@0.5.6

javascript - Align select tags horizontally -

<div style="width:100%;" id="combodiv"> <div style="width: 100px;"> <select style="width: 100%;"/> </div> <div style="width: 200px;"> <select style="width: 100%;" /> </div> <input type="text" style="width: 10%; float:right;" /> </div> i need align these 3 items in line getting 1 select tag , input box. have tried applying float style both divs , various other css styles unable 2 select tags in row along right aligned text box. you haven't closed <select></select> , use float:left align both div horizontally. <div style="width:100%;" id="combodiv"> <div style="width: 100px; float:left;"> <select style="width: 100%;" > <option value="1">1</option> <option value=&q

Can a javascript variable be used from a different file -

this question has answer here: how declare global variable in .js file 5 answers i making game , wanted know how use variable different file. ex: file 1: var js = "js"; file 2: alert(js); i know seems kind of weird have reason doing it. can javascript variable used different file? yes, can... as long it's global variable . this because of javascript files loaded shared global namespace. but warned... in html, need include script declares variable first . otherwise complain variable undefined. example script1.js var globalnumber = 10; script2.js alert(globalnumber); // alert "10" index.html <script src="script1.js"></script> <script src="script2.js"></script>

git - Remove a few commits far back in history -

we working on repository fellow programmer commits separate branch , on master. few days ago decided merge master branch after merging faced environmental dependency issues , decided revert merge. , kept committing on. now need merge branch master i'm having difficulties revert commit since it's deleting of files have not changed since merge. i think can addressed deleting said merge , it's revert history. now question how remove few commits far in history? couple of strategies, try play with git log and git reset --soft/--hard head@{numer} where soft or hard reset type , number want go. can use gui sourcetree , cherrypic specific commit , create new branch. note: make sure play in separate branch or have backup.

php - Using variable inside a function -

this seems simple issue, i'm not having luck solving , not entirely sure search. trying $logo used funciton, image uses variable defined on line 1: $logo = 'http://dev.batman.com/logo.png'; function signup_email_body( $logo ){ $body = '<img src="'.$logo.'" />'; } the funciton triggered on signup , src attribute missing. (n.b. above simplified code save masses of html) the value of $body never returned function goes away once function call finished executing. need return value function in order use it: $logo = 'http://dev.batman.com/logo.png'; function signup_email_body( $logo ){ return '<img src="'.$logo.'" />'; } $body = signup_email_body( $logo ); // <-- $body has string value

soap - Namespace issue with wsdl generated from JAX WS -

i have web service deployed on tomcat server , have generated wsdl file same. later generated new soap project through wsdl, , executed soap request server. the problem here @ server side, unmarshalling of xml failing because of namespace prefix "inputdata" , "ccna" wrong. cfa . according java code, namespaces inputdata xs , ccna bim . so, if modify soap request, unmarshall fine on server side. so, issue ? wsdl generation or anywhere else in jax ws ? should not modifying soap request. soap request : <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cfa="http://cfa.ni.ctl.com/" xmlns:bim="http://www.qwest.com/xmlschema/bim" xmlns:xs="http://www.qwest.com/xmlschema"> <soapenv:header/> <soapenv:body> <cfa:getcfacircuit> <!--optional:--> <cfacircuitrequest> <bim:requestid>123</bim:requestid>

Create c# exception and not throw it -

is there way better i'll have written below exception set when thrown? try { throw new exception("blah"); } catch (exception exe) { assert.notnull(exe.stacktrace); dosomework(exe); // throw; } the short answer : no. the system.exception properties filled in when thrown : by default, stack trace captured before exception object thrown. use environment.stacktrace stack trace information when no exception being thrown. so if need exception object in state after being thrown have no other way throw , catch it. still not drop off main question: need exception object? if you've got method has system.exception input parameter , need stacktrace inside, think of these possible solutions: method overload optional stacktrace input parameter. a successor of system.exception hiding stacktrace property memorizes stacktrace when object created not thrown. as last resort make extension method system.exception class "populates" instance of

jquery - If statement for swapping class -

i using following code try , swap class if class name present on page; $(function() { if ($('.special').length){ $(".tab_item").removeclass("tab_item_color").addclass("tab_item_color"); } }); so in english: if class "special" present, remove .tab_item , add tab_item_color instead. this want do. read correctly? should swapclass used? you can use below code, have check special class exist in element $(function() { $('.tab_item').each(function(){ if($(this).hasclass("special")){ $(this).removeclass("tab_item").addclass("tab_item_color"); } }); }); or $(function() { $('.tab_item.special').removeclass("tab_item").addclass("tab_item_color"); });

python - Error in pip install matplotlib in Mac -

when pip install matplotlib --upgrade --user i dont error program fails saying traceback (most recent call last): file "forest.py", line 22, in <module> matplotlib.style.use('ggplot') attributeerror: 'module' object has no attribute 'style' when try upgrade matplotlib without --user following error $ pip install matplotlib --upgrade collecting matplotlib using cached matplotlib-1.5.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl requirement up-to-date: cycler in /users/vangapellisanthosh/library/python/2.7/lib/python/site-packages (from matplotlib) collecting pyparsing!=2.0.0,!=2.0.4,!=2.1.2,>=1.5.6 (from matplotlib) using cached pyparsing-2.1.8-py2.py3-none-any.whl collecting pytz (from matplotlib) using cached pytz-2016.6.1-py2.py3-none-any.whl collecting numpy>=1.6 (from matplotlib) using cached numpy-1.11.1-cp27-cp27m-macosx_10_6_intel.macosx_10_

How to copy stored procedure from one database to another database on same server dynamically -

i'm trying write script copy stored procedure database on server: select @def = [definition] [@from_db].sys.sql_modules object_id = object_id('myprocedure') exec(@def); however doesn't work, how can copy stored procedure 1 database another? try this declare @sql nvarchar(max) = '' ,@targetdbname nvarchar(255) = 'targetdbname' declare c cursor select definition sourcedbname.[sys].[procedures] p inner join sourcedbname.sys.sql_modules m on p.object_id = m.object_id open c fetch next c @sql while @@fetch_status = 0 begin set @sql = replace(@sql, '''', '''''') set @sql = 'use [' + @targetdbname + ']; exec(''' + @sql + ''')' exec sp_executesql @sql fetch next c @sql end close c deallocate c

windows - Visual c++ can't maximize an application -

i made little exe giving me state of window , maximize when minimized. works regular application calculator. not work application need maximize. application minimized in task bar, full screen application displaying images in dual screen setup. isiconic work on calculator return false on application. iswindowvisible return false, showwindow not working if command reruned iswindowvisible return true. if use nircmd.exe command nircmd win max title "app name" application return fullscreen on 2 screen. tried postmessage sc_restore or sc_maximize no avail here's code hwnd hwnd = findwindow(null, "application name"); if (iswindow(hwnd)) { setforegroundwindow(hwnd); // i'll give focus window. working. std::cout << "visible " << iswindowvisible(hwnd) << std::endl; if(!iswindowvisible(hwnd)) { std::cout << "maximized " << std::endl; showwindow(hwnd, sw_maximize); // workin

github - problems in git pull origin <branch name> -

i want upload modification in bitbucket repository local system. process of upload code on bitbucket repository git branch git branch -a git checkout <branch_name> git add . git commit -m "message" git push origin <branch_name> git status i have done above process uploading code on bitbucket repository, , modified file , code uploaded in particular branch. but when fetched repository particular branch @ server file fetched , file missed (i used below proceess fetching code bitbucket repository) login in server , go project folder git pull origin <branch_name> got following error => error in app/controllers/index_controller.rb app/models/index.rb app/views/index.html.erb db/schema.rb , on then followed these command git stash save --keep-index git stash drop git reset file_path(app/controllers/index_controller.rb) git pull origin +branch_name sudo service apache2 restart i followed above process fetched file bitbucket repository , file mis

What is the difference between Selenium core extensions and Selenium IDE extensions? -

i know using js file must use selenium core extension cannot understand selenium ide extension field for? thanks in advance. selenium extensions provide way add more functionality/feature selenium per requirements. known selenium user-extensions , selenium custom-extensions. the concept pretty simple, extend selenium adding own actions , assertions , locator-strategies . add javascript methods selenium object prototype , pagebot object prototype. on startup, selenium automatically through methods on these prototypes, using name patterns recognize ones actions, assertions , locators. user-extensions can used selenium ide (see this ) , selenium rc (see this ). do not confused different names. same concept getting used @ different places, differently.

payment gateway - How to use Bitpay with Java -

i found post bitpay it's not clear how can use it. https://help.bitpay.com/development/how-do-i-use-the-bitpay-java-client-library i implemented code: public void createinvoice() throws bitpayexception { eckey key = keyutils.createeckey(); bitpay bitpay = new bitpay(key); invoicebuyer buyer = new invoicebuyer(); buyer.setname("satoshi"); buyer.setemail("satoshi@bitpay.com"); invoice invoice = new invoice(100.0, "usd"); invoice.setbuyer(buyer); invoice.setfullnotifications(true); invoice.setnotificationemail("satoshi@bitpay.com"); invoice.setposdata("abcdefghijklmnopqrstuvwxyz1234567890"); invoice createinvoice = bitpay.createinvoice(invoice); } how should implement private key? that answer, believe, found in following file: https://github.com/bitpay/java-bitpay-client/blob/master/src/main/java/controller/bitpay.java

python thrift error ```TSocket read 0 bytes``` -

my python version:2.7.8 thrift version:0.9.2 python-thrift version:0.9.2 os: centos 6.8 test.thrift file: const string hello_in_korean = "an-nyoung-ha-se-yo" const string hello_in_french = "bonjour!" const string hello_in_japanese = "konichiwa!" service helloworld { void ping(), string sayhello(), string saymsg(1:string msg) } client.py # -*-coding:utf-8-*- test import helloworld test.constants import * thrift import thrift thrift.transport import tsocket thrift.transport import ttransport thrift.protocol import tbinaryprotocol # make socket transport = tsocket.tsocket('192.168.189.156', 30303) # buffering critical. raw sockets slow transport = ttransport.tbufferedtransport(transport) # wrap in protocol protocol = tbinaryprotocol.tbinaryprotocol(transport) # create client use protocol encoder client = helloworld.client(protocol) # connect! transport.open() client.ping() print "ping()" msg = client.sayhello()

php - MySQL - order/group records by foreign key referencing the same table (Laravel, ORM) -

i making application in laravel, , have run problem. creating simple crud back-end manage pages. page table structure (simplified) follows: id | title | parent_id ----------------------------- 1 | homepage | 0 2 | | 0 3 | team | 2 4 | mission | 2 5 | directors| 3 6 | contact | 0 in application, want display records nested parents. this: homepage - team - directors - mission contact i able in normal application. however, need query/methods work eloquent models arranges in order. nesting not necessary, can make checks per individual record, however, need query return pages in order per above. this code, while groups correctly pages same parents, need query put them in correct place, order below parent page: page::orderby('parent_id')->get(); thanks help! first of all, define @ model relationship itself, this: public function children() { return $this->hasmany('app\page', 'parent_id'

android - Checking existence of an Activity -

i considering code in this question , , did following: first, create simple, empty project 1 activity called mainactivity , in package com.example.plugins . compile project , install device. app works fine. then, in project have code: intent plugins = new intent(); plugins.setclassname("com.example.plugins", "mainactivity"); list<resolveinfo> list = getpackagemanager().queryintentactivities(plugins, packagemanager.match_default_only); if (list.size() > 0) { tvtext.settext("plugins."); } else { tvtext.settext("no plugins."); } i'd should work, doesn't. gives "no plugins". missing here? update when using packageinfo pi = getpackagemanager().getpackageinfo( "com.example.plugins", packagemanager.get_activities); i activities other app. i think mime-type of intent missing. plugins.settype("text/plain");

generics - What compile-time type must I assign to receieve a return value of java.util.Map<TextAttribute, ?> -

i'd make font derived out of font. here's trying do: val font : font = this.label.getfont(); val attributes : map<textattribute, any> = font.getattributes(); attributes.put(textattribute.underline, textattribute.underline_on); this.label.setfont(font.derivefont(attributes)); however, kotlin compiler complains @ line: val attributes : map<textattribute, any> = font.getattributes(); with message: type mismatch: inferred type (mutable)map<textattribute!, *>! map<textattribute, any> expected per limited understanding of generics in java, understand font.getattributes() returns java.util.map<textattribute, ?> ; latter type parameter means when create bounded / closed generic type out of map, please specify second type parameter, extends java.lang.object . so, when tried following line @ first: val attributes : java.util.map<textattribute, object> = font.getattributes(); the kotlin compiler said: this class shouldn'

sql server - SQL - how to order fields with values like 1.4.2 -

how write sql order text field called "sequentialorder" values 7.5.5 records come out in order of 1.2.4 2.3.8 11.3.4 and not this 11.3.4 1.2.4 2.3.8 you have parse given version strings access components implement order by semantics. there many ways it. try avoid clr code, here comes suggestion: parse version using dot separator, convert each value number, aggregate columns , use proper order by clause: -- script uses function [dbo].[delimitedsplit8k] split delimited -- string value multiple rows; published , avalable @ -- http://www.sqlservercentral.com/articles/tally+table/72993/ -- setup create table version (id varchar(20)) insert version (id) values('1.2.4'); insert version (id) values('2.3.8'); insert version (id) values('11.3.4'); -- cte query ; inrows ( -- split version id many rows select ver.id, dlm.itemnumber, convert(int, dlm.item) item version ver cross apply [dbo].[delimite

call non-static class method with dynamic class name -

right i'm solving problem this: switch($action) { case "get": if("sections" == $table){ echo $get->nested(); } else { echo $get->elements(); } break; case "upd": if("sections" == $table){ echo $upd->nested(); } else { echo $upd->elements(); } break; } but there must more 'elegant' way right?! if("sections" == $table) call_user_func(array(ucfirst($action), 'nested')); else call_user_func(array(ucfirst($action), 'elements')); is not working. how solve that?

php - Slim framework url as file path -

i'm new using slim , trying create simple file hosting site. i'm trying set current directory via url using $app->get() . there way can have url such as: site.com/panel/documents/text/word/etc after panel interpreted current path? have code: $app->get('/panel/{path}', function ($request, $response) { $path = $request->getattribute('path'); return $path; }); the issue i'm able return path when 1 path set, i.e. /panel/documents returns documents . if such /panel/documents/text return not found error. great. thanks! assuming using latest slim v3, can use placeholders achieve goal per documentation: http://www.slimframework.com/docs/objects/router.html#route-placeholders look unlimited optional params $app->get('/news[/{params:.*}]', function ($request, $response, $args) { $params = explode('/', $request->getattribute('params')); // $params array of optional segments }); in case

objective c - Transform an array of value with async function and Reactive-Cocoa -

i have array of string , want modify calling asynchronous function on each value. i tried it's creating racsequence of racsignal , not array of modified string func modifyvalueasynchronously(inputvalue: string, completion: (string -> void)) -> racsignal { return racsignal.createsignal() { subscriber in doaservercall(inputvalue) { outputvalue in subscriber.sendnext(outputvalue) } } } let value: nsarray = ["a", "b"] let result = value.rac_sequence.map({ value in return self.dorequest(value as! string) }) as said, want perform asynchronous function on each of string values in array. because of fact async, final result arrive asynchronous. after getting racsequence of racsignal , want wait until each signal provides value , gather array. let transformation = { (input: string) -> racsignal in return racsignal.createsignal { subscriber in subscriber.sendnext(input + "a&

python - "shade is required for this module" even though shade is installed -

im trying deploy ansible playbook spin new openstack instances , keep getting errorr "shade required module" shade installed dependancies. i've tried adding localhost ansible_python_interpreter="/usr/bin/env python" to ansible hosts file suggested here, did not work. https://groups.google.com/forum/#!topic/ansible-project/rvqccvdllcq any advice on solving appreciated. on hosts file have following: [local] 127.0.0.1 ansible_connection=local ansible_python_interpreter="/usr/bin/python" so far haven't been using venv , playbooks work fine. adding ansible_connection= local, should tell playbook executed on ansible machine (i guess that's trying do). then when launch playbook, start following: - hosts: local connection: local not sure if that's problem. if not work, should give more information (extract of playbook @ least). good luck!

android - my app is not showing in emulator and Crash service did not start -

my app not showing emulator. emulator error; emulator: warning: crash service did not start hax enabled hax ram_size 0x40000000 hax working , emulator runs in fast virt mode. console on port 5554, adb on port 5555 emulator normal starting, app not showing. :( emulator settings; ram:1 gb vm heap: 512 mb Ä°nternal storage: 800 mb im making enable adb integration app not problem im trust. help me please... im using android studio emulator. i don't know answer question i'll recommend use different emulator because android studio emulator slow. use genymotion , simple , fast compare android studio emulator. using long time , never gave me trouble. otherwise you.

android - jQuery draggable() element doesn't start till after the second tap (on double tap only), any explanation? -

i have draggable element responses tap/touch event dragged on slider. works fine on ios devices. on android, works if second tap slider's icon! need work first tap. i'm using jquery touch punch plugin already. here code $(".slider").draggable({ axis: "x", containment: "parent" }, { start: function () { console.log("dragging started"); }, stop: function () { sliderpos = $(".slider").css("left"); sliderpos = number(sliderpos.replace("px", "")); sizer = (math.round((sliderpos / newsliderwidth) * 10) + 10) * 2; $('.reader_text_container, .surah_title_ite

osx - El Capitan pear command not found -

i new mac , trying pear run terminal. scripts added mamp folder , if run: $ sudo /applications/mamp/bin/php/php5.6.10/bin/pear everything fine. however, if run $sudo pear or pear message: "pear command not found" my $path variable looks this: /applications/mamp/bin/php/php5.6.10/bin/pear:/usr/bin:/bin:/usr/sbin:/sbin: when pear $ locate bin/pear same location in path: /applications/mamp/bin/php/php5.6.10/bin/pear any idea can wrong? copied -- in essence -- comment: th $path environment variable should contain list of directories searched command. having executable part of path doesn't resolving location.

python - Modify tf-idf vectorizer for some keywords -

i creating tf-idf matrix finding cosine similarity. want frequent words set have more weightage(i.e, tf-idf value). tfidf_vectorizer = tfidfvectorizer() tfidf_matrix = tfidf_vectorizer.fit_transform(documents) how can modify above tfidf_matrix words in particular set. i converted tfidf-matrix of csr-type 2-d array using, my_matrix = tfidf_matrix.toarray() then, found out index of keyword using, tfidf_vectorizer.vocabulary_.get(keyword) after that, iterated on 2-d matrix , changed tf-idf value according requirements. here, keyword_list contains index of keywords want modify tf-idf value. in range(0, len(my_matrix)): key in keyword_list: if key != none: key = (int)(key) if my_matrix[i][key] > 0.0: my_matrix[i][key] = new_value again, changed my_matrix csr_type using, tfidf_matrix = sparse.csr_matrix(my_matrix) hence, tfidf_matrix modified list of keywords.

javascript - TypeDoc creating empty documentation -

Image
i have gulp task supposed take files , create documentation them. task looks this: var gulp = require('gulp'); var gulptypedoc = require('gulp-typedoc'); gulp.task('typedoc-gamesmart', function () { return gulp.src([ './src/util/config.ts', './src/util/http.ts', './typings/crypto-js/crypto-js.d.ts', './src/gamesmart/gamesmart.ts', './src/gamesmart/apis/client.ts', './src/gamesmart/apis/data.ts', './src/gamesmart/apis/game.ts', './src/gamesmart/apis/score.ts', './src/gamesmart/apis/store.ts', './src/gamesmart/apis/user.ts', './src/gamesmart/main.ts', ]).pipe(gulptypedoc({ // module: 'system', target: 'es5', out: 'docs/gamesmart/', name: 'gamesmart sdk', excludenotexported: true, mode: 'file&#

c# - Out of memory exception with BeginRead -

the idea behind small project developing chat application difference want send objects instead of plain strings. far, have. if deserialize on constructor, works fine (userdto has 2 string fields now), however, plan on having multiple clients sending data server anytime wish. i'm having difficulty understanding how works , how fix error (like this, gives "exception of type 'system.outofmemoryexception' thrown." @ deseralize line) after reading ms's documentation , i'd ideas guys. note whoever tries compile this: binaryformatter has way of doing in: let's userdto has properties string name, string email applying class client , server, must build using class library , add reference of both projects, because somehow binaryformater says tho if create same class in both projects, deserializing claims cannot map object. i'll leaving sample of client using below. server: class program { const int serverport = 60967; static list<userconnectio

jquery - Change Class Dynamically with Javascript after Value has loaded -

i have code here have been working make css class change dynamically. when load page code keeps class 'cart' whenever span'cart count' greater 0. not sure if not loading correctly. http://store.revivesalonsf.com here jsfiddle example have been working same thing. thoughts on how make work? guidance appreciated surly learning js. http://jsfiddle.net/xs9e6mol/65/ $(document).ready(function() { $("span").each(function() { if (parseint($(this).text()) > 0) { $(this).parent().find('a').removeclass("cart"); $(this).parent().find('a').addclass("cart-full"); } }); }); .cart-full { border: 2px solid red } .cartcontainer { padding-top: 5px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <div id="cart-summary"> <div class="cartcontainer"> <span class="cart-su

lua patterns - Lua parsing a table path string to a table -

i need parse string represents path of table, , turn actual table find value nested inside table structure: local function strsplit(str, sep) sep = sep or "%s"; local tbl = {}; local = 1; str in string.gmatch(str, "([^"..sep.."]+)") tbl[i] = str; = + 1; end return tbl; end local function parser(path, tbl) local value; local keys = strsplit(path, "."); _, key in pairs(keys) value = (value , value[key]) or tbl[key]; end return value; end local data = { colors = { r = 1, g = 1, b = 1 } } local red = parser("colors.r", data); print(red); -- prints 1 (correct!) this code runs fine expected output. however, alter "parser" function works number index values , not strings keys (the index part of table, not hash table): local data = { list = { 50, 40, 30, 20, 10 } } local value = parser("colors.list[2]", data); p

vue.js - Handle callback urls in Vue router -

i use stamplay baas, authenticate user, redirect /auth/v1/auth0/connect after, user authenticate.. stamplay call app with /login/callback?jwt=abc.123.xyz how can authenticate user after stamplay call app? tried i router config try.. '/login/callback': { component: vue.extend({ ready() { // ... not called!! never console.log('... ready .. ') console.log(this.$route.query.jwt) } }) } try access this.$route.query.jwt within component.

vb.net - Extracting the "for" attribute from a label element in an html webpage -

i have code analyses various attributes of webpage when parts of webpage clicked. 1 of elements picked out id of clicked element. sometimes there no id , instead element being clicked on label using "for" attribute reference id. in these case want pick "for" attribute value. i have attempted follows: txtid.text = trycast(myhtmldocument, htmldocument).getelementfrompoint(lastmousepos).getattribute("id") if txtid.text = "" txtid.text = trycast(myhtmldocument, htmldocument).getelementfrompoint(lastmousepos).getattribute("for") end if for reason .getattribute("for") returns blank. referencing attribute wrongly - or else going on. html example below: <div class="question legal-owner active"> <a class="help-trigger help-trigger-layout"> <span class="help-text-icon"></span> </a> <div class="quote-help quote-help-layout"> <a cl

Why is there an error in mysql query?Error : Truncated incorrect DOUBLE value: '114.243.134.208' -

it reported error when query in mysql, sql below: update bsk.bskchapterlist set stateid=6 username=11111111111 , lessonid=987; the error was: error : truncated incorrect double value: '114.243.134.208' but value '114.243.134.208' came from? how resolve problems, please me. please check datatype of db table. if of field datatype varchar please wrap quote. let's username field datatype varchar please use following query. assumed stateid , lessonid fields have int datatype , if of having datatype varchar please wrap quotes well. update bsk.bskchapterlist set stateid=6 username='11111111111' , lessonid=987;

python - django testing wrapped function view with mock -

i working through learning mock , cannot figure out why not working... @validate_captcha def sendemail(request): ... email.send() return httpresponse('your email has been sent. thank contacting us') i have wrapper validates google recaptcha , need test view cannot figure out how around wrapper. i tried this.... @patch('main.views.sendemail') def test_sendmail_captcha_pass(self, mock_sendemail): """testing view after captcha passing""" mock_sendemail.return_value = true things = things() data = { 'subject': 'test subject', 'name': 'john appleseed', 'email': 'john@apple.com', 'content': 'content of message'} post_url = reverse("main:contact_email") result = things.client.post(post_url, {}) self.asserttrue(result.status_code == 401) since sendemail function wrapped, using sendemail fun

php - Laravel: How can i change the default Auth Password field name -

Image
i'm working on first laravel project , i'm facing problem. if have experience laravel know calling php artisan make:auth predefined mechanism handles login , registration. this mechanism set understand couple of commonly used words in order automate whole procedure. the problem occurs in case i'm using oracle db , won't let me have table column name of password because system keyword , throws errors when trying insert user. so far, i've tried change password column passwd , worked in registration form expected. user row inserted , page redirected /home. but when try logout , relogin, error telling me credentials not correct. as code, i've changed registercontroller.php takes username instead of email protected function validator(array $data) { return validator::make($data, [ 'username' => 'required|max:50|unique:econ_users', 'passwd' => 'required|min:6|confirmed', ]); } prote

c# - How to get Activity Info from an IDialogContext -

i'm using luisdialog , the callback returns idialogcontext , luisresult. there way can info original activity, channel, name, et al? since v3.2.0 release can access original incoming message intent handlers. check here understand how intent handler should looks like. public async task myhandler(idialogcontext context, iawaitable<imessageactivity> activity, luisresult result) alternatively, can use context.makemessage recommend updating intent handlers.

r - ROracle: dbGetQuery works but dbListTables and other functions do not -

i installed roracle (following directions in package ) , connected our oracle database. i can run queries, using dbgetquery , , results fine, e.g.: > dbgetquery(con, "select count(*) table_name") count(*) 1 6111 however, of other dbi/roracle helper functions give no results: > dblisttables(con) character(0) > dbreadtable(con, "table_name") error in .oci.getquery(con, qry) : ora-00942: table or view not exist any ideas may cause? in both cases, work me if specify schema argument, i.e. dblisttables(con, schema = "my_schema") dbreadtable(con,"table_name",schema = "my_schema") additionally, appears reading ?dblisttables has all , full arguments control whether in schemas, , whether return full schema name or table name.

How do I change python pandas LaTeX output formatting? -

i'm trying better format pandas dataframe output. i have series, convert dataframe , output latex. meal.to_frame().to_latex('meal.tex') this yields: \begin{tabular}{lr} \toprule {} & count \\ \midrule meal & \\ spam & 11723 \\ eggs & 5865 \\ \bottomrule \end{tabular} how can change \toprule , \midrule , \bottomrule \hline . , how can name of index name model appear column header? end result i'm looking is: \begin{tabular}{lr} \hline meal & count \\ \hline spam & 11723 \\ eggs & 5865 \\ \hline \end{tabular} you try working tabulate https://pypi.python.org/pypi/tabulate . use python projects time. have 2 different latex styles. it's output string latex code, use custom function replace parts. if doesn't work, try else to_frame method. data as_matrix() , add labels , go there. for custom styling need write simple script build string yourself.

vb.net - Several rows in SQL Developer but VB says no rows -

dim test123 string dim conn oledb.oledbconnection = new oledbconnection("private") conn.open() dim myselectquery string = "select mti_part_no,sum(mpcs.shop_inv_history.quantity) febqty mpcs.shop_inventory, mpcs.shop_inv_history mpcs.shop_inv_history.date_time '%feb% %2015%' , comments = 'check item out' , mpcs.shop_inventory.si_key=mpcs.shop_inv_history.si_key , shop_inventory.category between 900 , 999 , shop_inventory.scrap_flag <> 1 group mti_part_no order febqty desc" dim cmd oledbcommand = new oledbcommand(myselectquery, conn) dim myreader oledbdatareader myreader = cmd.executereader() myreader.read() test123 = myreader("febqty") there 180 rows when copy/paste query sql developer, whenever try use in vb.net populate listview , getting nothing. tossed above code see getting febqty , error there no rows, same mti_part_no . can't figure out problem is.

User-Agent in request for IOS and Android -

hi i'm developing android , ios app . never set user-agent header api call. (simply use library make request , response) server guys told me " facing issue mobile not authentication when calling esb simply states sytemid=’abc’ now getting malicious hits intruders disguised mobile , cauing lot of traffic" is related user-agent? should now? appreciated. i'm not @ security thing even if don't set custom user-agent, network layer set 1 user agent based on device type , ios version in case of ios app. so check server team logic applied "malicious hit detection". this link contains basic strategy server applies detect request suspicious, https://datadome.co/how-to-detect-malicious-bots/

First common element across multiple arrays in Javascript -

i need find first common element across group of arrays. number of arrays may vary, in sequential order (small->large). arrays properties of myobj. this have far: function compare(myobj,v,j) { if (myobj[j].indexof(v)>-1) return true; else return false; } function leastcommon ([1,5]) { var myobj = { //this filled code, finished result looks 1: [1, 2,...,60,...10k] 2: [2, 4,...,60,...20k] 3: [3, 6,...,60,...30k] 4: [4, 8,...,60,...40k] 5: [5,10,...,60,...50k] }; var key = [1,2,3,4,5]; //also filled code var lcm = myobj[key[key.length-1]].foreach(function(v) { //iterate through last/largest multiple array var j=key[key.length-2]; while (j>=0) { if (compare(myobj,v,j)) { //check see if in next lower array, if yes, check next one. j--; } if (j>0 && (compare(myobj,v,j+1))===true) return v; //before loop exits, return match } }); return lcm; } i'm not sure wrong, returning undefined. note: ye

sql - Apache ignite filtering query by date -

in cache class have factordate joda datetime object @querysqlfield(index = true) private datetime factordate; i need results between 2 dates. achieve have following code: cacheconfiguration<integer, myclass> cfg = new cacheconfiguration<>("mycache"); cfg.setindexedtypes(integer.class, myclass.class); igniteconfiguration ignitionconfig = new igniteconfiguration(); ignitionconfig.setcacheconfiguration(cfg); ignite ignite = ignition.getorstart(ignitionconfig); ignitecache<integer, myclass> cache = ignite.getorcreatecache(cfg); datetime startdateobj = datetimeformat.forpattern("dd-mmm-yyyy").parsedatetime(startdate); datetime enddateobj = datetimeformat.forpattern("dd-mmm-yyyy").parsedatetime(enddate); timestamp starttimestamp = new timestamp(startdateobj.getmillis()); timestamp endtimestamp = new timestamp(enddateobj.getmillis()); stringbuilder builder = new stringbuilder(); bu

string - translate() takes exactly one argument (2 given) in python error -

import os import re def rename_files(): # files dir file_list=os.listdir(r"c:\oop\prank") print(file_list) saved_path=os.getcwd() print("current working directory"+saved_path) os.chdir(r"c:\oop\prank") #rename files file_name in file_list: print("old name-"+file_name) #print("new name-"+file_name.strip("0123456789")) os.rename(file_name,file_name.translate(none,"0123456789")) os.chdir(saved_path) rename_files() here error showing due translate line ...help me next ..i using translate remove digit filename. traceback (most recent call last): file "c:\users\vikash\appdata\local\programs\python\python35- 32\pythonprogram\secretname.py", line 17, in <module> rename_files() file "c:\users\vikash\appdata\local\programs\python\python35- 32\pythonprogram\secretname.py", line 15, in rename_files os.rename(file_

Amazon Web Service PowerShell Credentials setup Errors -

i trying set aws on local machine through windows powershell, gives me following error message; ps c:\> set-awscredentials -accesskey {aaaaaaaaaaaaaaa} -secretkey {aaaaaaaaaaaaa} -stor eas {default} set-awscredentials : cannot evaluate parameter 'accesskey' because argument specified script block , there no input. script block cannot evaluated without input. @ line:1 char:31 + set-awscredentials -accesskey {aaaaaaaaaaaaaaa} -secretkey {aaaaaaaaaaaa ... + ~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : metadataerror: (:) [set-awscredentials], parameterbindingexception + fullyqualifiederrorid : scriptblockargumentnoinput,amazon.powershell.common.setcredentialscmdlet and powershell version following; major minor build revision ----- ----- ----- -------- 3 0 -1 -1 anyone knows problem is? thanks it looks need drop brackets code, documentation amazon comes first in google includes them reason if

java - Why should we declare an interface inside a class? -

why should declare interface inside class in java? for example: public class genericmodellinker implements imodellinker { private static final logger log =loggerfactory.getlogger(genericmodellinker.class); private string joinaspropertyfield; private boolean joinaslistentry; private boolean clearlist; private list<link> joins; //instead of scalar property private string uniqueproperty; public interface link { object getproperty(iadaptable n); void setproperty(iadaptable n, object value); } } when want gather fields in object in order emphasize concept, either create external class, or internal (called either nested (static ones) or inner). if want emphasize fact cooperative class makes strictly no sense (has no use) outside original object use, make nested/inner. thus, when dealing hierarchy, can describe "nested" interface , implemented wrapping class's subclasses. in jdk, significant example map.entry inner in