Posts

Showing posts from January, 2015

How to find visible class based on partial id and then return full id in jquery -

how find visible class based on partial id , return full id in jquery, here of code better understanding. <div class="visible" id="fares-and-payments-1-10kms"> </div> <div class="hidden" id="fares-and-payments-11-20kms"> </div> <div class="hidden" id="fares-and-payments-21-30kms"> </div> so if take snippet above want return "fares-and-payments-1-10kms" id div has class visible. the elegant , efficient way awesome. you use attribute starts-with selector, in combination class var elem = $('[id^="fares-and-payments"].visible'); that gets element, if need id, you'd elem.prop('id')

Using VB to read SQL Server database into JSON format -

i trying call http://localhost:26006/api/home/getemplist in html array of key value pairs of data table employee . have class model of employee contains properties each column (name, address, phone number). know i'm not close, advice appreciated. new @ programming , trying understand. dim conn string = "server=timepc; database=timeclock;trusted_connection=true" <httpget> public function getemplist() list(of employee) dim querystring string = "select * employee" dim result new datatable using connection new sqlconnection(conn) dim command new sqlcommand(querystring, connection) connection.open() using adapter new sqldataadapter(command) adapter.fill(result) end using end using return result end function

javascript - Using AngularJS Trying to insert a <tr> in the middle -

here, i'm trying insert tr tag under selected tr tag.i managed insert tr in table in bottom. sample code: "use strict"; (function(angular) { var app = angular.module('app', []); app.controller('maincontroller', maincontroller); maincontroller.$inject = ['$compile', '$scope', '$templatecache']; function maincontroller($compile, $scope, $templatecache) { var publishshown = false; var lastitemappned; var vm = this; vm.targets = ['single passenger', 'single driver', 'all passengers', 'all drivers']; vm.items = ["cheese", "pepperoni", "black olives"]; vm.cancel = cancel; vm.fruits = [{ name: 'orange', color: 'orange', tree: 'orange tree!', origin: 'china' }, { name: '...

pandas time series pivot -

i have time series of financial data in pandas dataframe in tidy format currently. have 1 datapoint per row, , data includes: 1 date 2 country (us, uk, or japan) 3 sector (tech, industrials, consumer, health_care) 4 metric (count_of_stocks, total_market_cap, volatility, etc) 5 value the data in "long format" -- 5 columns wide. i'd pivot have each date represented 1 row multi-index. each of 3 regions has same 4 sectors , 5 metrics, expect resulting dataframe 60 columns wide. i've been struggling figure out how set multi-index , pivot/unstack it. don't mind if resulting dataframe has either multi-index (with top 3 rows tree)or has 1 index row names us_indus_autos_count, etc. any appreciated. in advance

How to detect version of MIT Scheme? -

is there method can used detect version of mit scheme used within piece of scheme code? for example, may need piece of code determine whether being interpreted mit scheme 9.1, or mit scheme 9.2, , act accordingly. maybe there exists procedure (e.g. (interpreter-version) ) returns release number of mit scheme? to obtain version of mit scheme: (get-subsystem-version-string "release") sample return value: "9.2" caution: method undocumented. procedure used defined in src/runtime/system.scm . note: method used slib (reference: mitscheme.init ).

angular - Paypal Integration Angular4 -

i have done research on web , find solutions javascript, not in angular i'm searching 1 have coded checkout, paypal angular 4 , spring backend wish can explain me concept , if have coded ready wish can show it. i need path follow make run...

javascript - Losing tab to next step after typing in description -

why code lose focus after type in description of work? after type description , hit tab cursor goes nowhere. thanks <div class='span8 bgcolor'> <label>description of work, including dates</label> <textarea rows="3" name="comments" id="comments" class="span12" style="text-align:left" onchange="javascript:addcomments(this.value)"> </textarea> </div> </div> <div class="row-fluid" id="distributioninfo"> <div class="span3 lightblue"> <label>select pay distribution</label> <select id='pay_dist_code' name='pay_dist_code' class='span12' onfocus='javascript:populatedistribcodes(this.value)' onchange='javascript:getdistributioninfo(this.value)'> <option selected>select pay distribution</option> </select> </div> ...

java - How do I stop a functional interface from being a target for lambda expressions? -

i have api interface 2 (overloaded) methods of same name take different argument types. these different types both technically functional interfaces, user should not allowed create instances of 1 of them. here simplified example: public class example { @functionalinterface public interface computation { int compute(); } public interface wrappedcomputation { computation unwrap(); } public static class solver { public static int solve(computation a) { return a.compute(); } public static int solve(wrappedcomputation b) { return solve(b.unwrap()); } } public static void main(string... args) { // 'computation' interface should lambda target // coder can make own 'a' computation solver.solve( () -> { return 5 + 5; } ); // 'wrappedcomputation' interface should not lambda target // o...

javascript - Deferring CSS load, why is including preload <link> faster? -

i'm testing out preloading , i'd know why including preload link before preload script faster tenth of second. rel="preload" tells browser start downloading stylesheet not block loading. script creates stylesheet url , applies page. why stand-alone-script not performant? <link rel="preload" href="https://unpkg.com/tachyons@4.8.0/css/tachyons.min.css" as="style" onload="this.rel='tachyons.min.css'"> <script type="text/javascript"> //<![cdata[ if(document.createstylesheet) { document.createstylesheet("https://unpkg.com/tachyons@4.8.0/css/tachyons.min.css"); } else { var styles = "@import url('https://unpkg.com/tachyons@4.8.0/css/tachyons.min.css');"; var newss=document.createelement('link'); newss.rel='stylesheet'; newss.href='data:text/css,'+escape(styles); document.getelementsbytagname("head"...

ios - Has wit.ai stopped development on android-sdk -

i'm looking nlp , chatbot frameworks personal project of mine when ran across wit.ai. while seems intuitive , developer friendly while being free feel doubtful android-sdk repo here: https://github.com/wit-ai/wit-android-sdk . project have based on android app stale sdk repo kind of red flag why i'm bit concerned. have stopped developing because ios 1 seems pretty date , maintained? are ios changes new features or sdk updates? i've not noticed many changes in api. also, have considered using api.ai

How can i use internal iteration within function in python? -

i need code run : pp = ["first", "second", "third"] sum(d d in pp) i error : typeerror: unsupported operand type(s) +: 'int' , 'str' i guess there lazy evaluation. please me this? thank you! sum() buildin function default start 0 . takes numbers , return total. not allowed string . so, above error . rather, can join list using ''.join() function. like : pp = ["first", "second", "third"] sum = ''.join(pp) print(sum) output : firstsecondthird

html - Show placeholder text as label in Desktop -

this question has answer here: hide placeholder css 6 answers i want show placeholder in mobile view , hide placeholder in desktop view. how this? end inand mobile view should this: <label>enter name:</label> <input type="text"/> and mobile view should this: <input type="text" placeholder="name"> with jquery : $(document).ready(function(){ $(window).resize(function(){ var wid = $(this).width(); if((wid > 300) && (wid < 400)) { $('input[type="text"]').attr('placeholder','name'); $('label').hide(); } else { $('input[type="text"]').attr('placeholder',''); $('label').show(); } ...

scala - Spark takes 0.5 second to average 100 numbers -

i've dataset of 70 millions rows in csv of users locations , date times, , wrote following code average number of points of top 100 users: val spark = org.apache.spark.sql.sparksession.builder .appname("test") .getorcreate import spark.implicits._ val watch = new stopwatch() watch.start() val schema = new structtype().add("user_id", stringtype).add("datetime", longtype) val df = spark.read.format("csv").option("header", "true").schema(schema).csv(inputfile) df.createorreplacetempview("paths") val pathds = spark.sql("select user_id, min(datetime) started, max(datetime) finished, " + "count(*) total, max(datetime) - min(datetime) timedelta " + "from paths group user_id order total desc limit 100") pathds.cache() pathds.collect.foreach(println) println(watch.elapsedtime(timeunit.milliseconds)) val avgpoints = pathds.select(avg("total")).as[double].he...

How to get data from json file in angularjs 2 -

i new angularjs2. have retrieve data json file array. can use json data in components.thanks helping me. first of need keep json file in src/assets folder , read there http getfromfile(){ debugger; return this.http.get("./assets/data.json") .map((response: response) =>response.json()) .catch(this._errorhandler); } _errorhandler(error:response){ console.log(error); return observable.throw(error || "internal server error"); } you need import these: import { http, response } '@angular/http'; import { observable } 'rxjs/observable'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; import 'rxjs/add/observable/throw';

c# - Relation between master page and non master page -

there page login.aspx having label control "lbl_loginexpired". there masterpage. want change text of "lbl_loginexpired" within master page. how can achieve this? note: 1) login.aspx not content page. 2) label label1=new (label)login.fndcontrol("lbl_loginexpired") not working in masterpage. if there no master page- content relationship between these 2 pages. think options limited. assuming lbl_loginexpired not part of user control can register in both pages. recommend using session object pass information between these 2 pages. hence in master page session["expiredtext"] = "your login has been expired"; and in login pag check session value whether null or not , show content of it. lbl_loginexpired.text=session["expiredtext"]?.tostring(); also not forget reset (or abonden session when user logs out)

user interface - How to add a button at the top right corner of an alertview in swift 3? -

Image
i have used the following code create alertview: let alert = uialertcontroller(title: "title", message: "message", preferredstyle: uialertcontrollerstyle.alert) alert.addaction(uialertaction(title: "cancel", style: uialertactionstyle.default, handler: nil)) alert.addaction(uialertaction(title: "okay", style: uialertactionstyle.default, handler: nil)) self.present(alert, animated: true, completion: nil) but want add button @ top right corner of alertview following image? how can implement it?

Webpack. Theming fallback -

is possible resolve theming path fallback webpack? so let's have next structure: app/ ├── componenta/ │ └─ index.js │ └── themes/ └── woot/ └── componenta/ └── index.js and import import componenta 'app/componenta/index.js'; then depending on build want receive next: for webpack → app/componenta/index.js for theme="woot" webpack → app/themes/woot/componenta/index.js thank you it should that... didn't test, think represent starting point. look @ normalmodulereplacementplugin // webpack.config.js module.exports = env => { const theme = env.theme || null; const configs = object.create(null); configs.plugins = []; if(theme) { const theming = new webpack.normalmodulereplacementplugin( /(.*)components\/index/, (resource) => { resource.request = resource .request .replace(/components\/index/, `components\/${theme}\/in...

python - Why numpy returns true index while comparing integer and float value from two different list -

how avoid returning true index while comparing 10.5 , 10 ? a = np.array([1,2,3,4,5,6,7,8,9,10.5]) b = np.array([1,7,10]) = np.searchsorted(a,b) print # [0 6 9] i want places of exact matches: [0 6] you use np.searchsorted left , right , keep don't return same index both: >>> import numpy np >>> = np.array([1,2,3,4,5,6,7,8,9,10.5]) >>> b = np.array([1,7,10]) >>> = np.searchsorted(a, b, 'left') >>> j = np.searchsorted(a, b, 'right') >>> i[i!=j] array([0, 6], dtype=int64) that works because searchsorted returns index element needs inserted if want keep other array sorted. when value present in other array returns index before match ( left ) , index after matches( right ). if index differs there's exact match , if index same there's no exact match

javascript - Why does badge count go from 1 to 12? -

when receiving message in chat program, count should increment 1. jumps 1 12. why that? $("#btn").click(function(){ var count = number($('.badge').text()); $('.badge').text(count + 1); }); <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-kj3o2dktikvyik3uenzmm7kckrr/re9/qpg6aazgjwfdmvna/gpgff93hxpg5kkn" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/u6ypibehpof/4+1nzfpr53nxss+glckfwbdfntxtclqqenisfwazpkamnfnmj4" crossorigin="anonymous"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0abixch4zdo7tp9hkz4tshbi047nrkglo3sejag45jxxngifyzk4si90rdiqnm1" crossorigin="anonymous"></script> <script src="https://ajax.googleapis...

c# - cannot implicitly convert type 'int?' to system.collection.generic.IEnumerable -

i making small demo in asp.net have created 1 abstract class , implemented in dal, have created poko classes when calling of few properties getting error. here code : public class personpoko { public int id { get; set; } public string name { get; set; } public int? age { get; set; } public gender gender { get; set; } //assigning gender of type enum public string address { get; set; } public ienumerable<country> countryid { get; set; }//this dropdownlist } public class country //created class fetch dropdownlist records database { public int id { get; set; } public int? countryid { get; set; } public string countryname { get; set; } } public enum gender { m, f } personabstract.cs public abstract class personabstract { public abstract ienumerable<personpoko> getallperson(); public abstract bool addperson(personpoko pk); public abstract bool updateperson(personpoko pk, int id); public abstract bool de...

Excel vba to extract outlook email --run error 438 -

please refer code below. code in excel vba , run in order extract large amount of email in outlook. i have 3 questions , need help let's "inbox" has around 400+ emails , while running following code, error 438 came out when code searching 23 email. how can solve out? please refer code below: dim olmail variant should use "object" or "variant"? better , why? in near future, outlook have more 1 email account. let's first email account abc@def.com , second email account abcd1@abc.com . in future, need run code first email account , second email account. how can switch them? this current code: sub getfrominbox() dim olapp outlook.application dim olns namespace dim fldr mapifolder dim olmail variant dim i, ij integer dim tt date set olapp = new outlook.application set olns = olapp.getnamespace("mapi") '<questions 2---how can change in here add more 1 emai...

Unable to show the main intent in android emulator using react native -

Image
setup react-native app react-native init command , running react-native run-android command execute helloworld message it's throwing below error react native android emulator: delete node_modules , reinstall npm install. start again using react-native run-android

javascript - Getting image from webapi causes memory leak -

i have aurelia client gets image asp.net server via api. image served server holds emgu cv umat var. following method in controller image , displayed correctly. this method results in memory leakage , can't seem orgin (not calling method, means no leak): update, tried mawg's suggestion when close stream not show image. leak gone there no image. [system.web.http.httpget] [system.web.http.route("dummymethod3")] public httpresponsemessage get2() { httpresponsemessage response = new httpresponsemessage(); try { console.writeline("get image 3"); ddengine.sem.waitone(); var memorystream = new memorystream(); resultimage.bitmap.save(memorystream, imageformat.png); memorystream.position = 0; var result = new httpresponsemessage(httpstatuscode.ok); result.content = new streamcontent(memorystream); result.content.headers.contenttype = new mediatypeheadervalue("image/png")...

node.js - gulp Task is not in your gulpfile -

new node.js, trying use gulp. got error: task 'styles' not in gulpfile i see common error, can cause it? code. both auto-prefixer , gulp in package.json file the file name autoprefixer.js var gulp = require('gulp'); var autoprefixer = require('gulp-autoprefixer'); gulp.task('styles',function(){ return gulp.src('css/style.css') .pipe(autoprefixer()) .pipe(gulp.dest('build')) }); what can problem? i found out problem... file name autoprefixer.js , not gulpfile.js should be. once changed file name worked great.

php - Securing application access to pre authorized individuals only -

i building php application , lock backend (even login page) accessible preauthorized people - further able link activities authorized individuals. i aware such locking may done using ssl or certificate of sort not sure or how achieve it. have seen different companies implement in ways mentioned below at 1 company, user fills in form details , company issues certificate user installs on browser in order access backend another company, user given exe run each time want access backend. my php application running on windows server 2016 , know how achieve both or either of above. resource or specific appreciated. i not sure if question right here or stack exchange network, kindly forgive ignorance. first of all: do not cross post on different networks. secondly, way supply client certificates web app accepted app you're developing. key words research are: tls, client certificates, certificate based authentication.

find out who watched my telegram Avatar -

recently, there new robots claim able tell has seen profile photo of them fake. i want know possible write bot? directly using bot api or indirectly creating channel bot ... this not possible in telegram, bots provide fake data. you can't know views channel post via either client api, bot api, or unofficial apis.

Django multiple admin modifying the same databases -

i'm total noob in django , wondering if it's possible admin doing same thing @ same time ? thing after looking @ django documentation is possible have 2 admins, possible admins task in same databases @ same time ? thanks help you didn't made clear want but: if admin mean superuser yes can have many admins want. admins can change in database @ same time, if mean changing specific row of specific table @ same time, not possible because of these reasons: its kinda impossible save @ same time. when both admins tries save anything, last request saved (the first 1 saved changes last request) and if there important data in database, should block other accesses row till first user has done job , saved changes. (imagine ticket reservation website has block other users allowed order same ticket number till user finishes order or cancel it.) also if mean 2 different django projects using single database, yes. 2 different admins , above conditions works them t...

Regex with phrase, space and any digit -

i'm not experienced regular expressions, need 1 allows specific phrase, space, digit , dot in order. like this: theme 1. question 15. and on. thanks you can use regex : ^[a-za-z]+\s\d+\.$ meaning ^ -> start of phrase [a-za-z]+ -> specific phrase allow 1 or more upper or lower alphabets \s -> followed space \d+ -> followed 1 or more degits \. -> end dot $ -> end of phrase regex demo

amazon web services - Do I get charged every time I create a new AWS WorkSpace? -

they there monthly fee. charged month progresses or right away? amazon workspaces charged on pro-rata basis. so, if run 1 one week , turn off, you'll charged approximately 1 quarter of monthly fee. the first month's fee , last month's fee pro-rated, based upon how long workspace running. there no charge creating workspace.

Stata Coefplot Spacing -

Image
i working coefplot package in stata ssc. have large number of estimated coefficients plot on same graph. accordingly, reduce spacing between coefficients. so instance: quietly sysuse auto, clear quietly regress price mpg trunk length turn coefplot, drop(_cons) xline(0) how can spacing between "mileage (mpg)" , "trunk space (cu. ft.)" decreased? graph:

Xamarin.forms Navigation page not showing in add item visual studio -

Image
i creating visual studio cross-platform xamarin.forms application (c#) , add navigation page solution. when press add, content page, tabbed page, , master detail page show up, not navigation page. this extremely strange , frustrating...anybody know solution? i have xamarin installed , updated latest version.

Firebase how to index this data to be fetched? -

i have db users , items . every user has languages , array of languages, example ['en', 'ar'] every item has language , string, example 'en' . how can index items, such can list of last x items in array of languages? (i.e - latest 5 items either 'en' or 'ar') for single language solution simple - have index has language key, , array of item keys ordered whatever. please note firebase official documentation recommends against using arrays . imho, main problem in project trying use array, anti-pattern when comes firebase . beside that, 1 of many reasons firebase recommends against using arrays makes security rules impossible write. because firebase database structured pairs of key , values, best option use map . to achieve want, recomand using database structure looks this: firebase-root | --- users | | | --- uid1 | | | | | --- languages | | | | | ...

r - Cannot add caption to landscape format figure in knitr -

\documentclass{article} \usepackage{pdflscape} \begin{document} \begin{landscape} graph (fig. \ref{fig:mygraph1}in landscape format works fine. <<mygraph1,out.width='1\\linewidth', fig.width=11.5, fig.height=6, echo=false >>= graph <- c(1, 7, 9, 11, 9) plot(graph) @ when adding caption figure breaks <<mygraph2,out.width='1\\linewidth', fig.width=11.5, fig.height=6, echo=false, fig.cap="caption">>= graph <- c(1, 7, 9, 11, 9) plot(graph) @ , breaks if made latex figure \begin{figure} <<mygraph3,out.width='1\\linewidth', fig.width=11.5, fig.height=6, echo=false >>= graph <- c(1, 7, 9, 11, 9) plot(graph) @ \end{figure} \end{landscape} \end{document} this seemingly answered here: knitr rnw latex: how obtain figure , caption in landscape mode that's full page width however putting chunk within \begin{figure} doesn't seem solution. @ least me figure still breaks landscape orientation. ideas? ...

How to lunch an appliations on linux using python script? -

this question has answer here: python: how execute external program 4 answers i have lunch multiple similar application regularly on linux machine want write script open them without fail. could please me here write script open multiple applications @ time. example: firefox , libre office cal can please suggest script can able open these above applications(firefox , libre office cal) can build customized script open multiple applications. thanks in advance...!!! script: import os import browser threading import thread def app1(my_app_name): os.system(my_app_name) def main(): t1 = thread(target=app1, args=(('firefox',)) ) #t2 = thread(target=app1 , args=(('libreoffice',)) ) t1.start() #t2.start() if __name__ == '__main__': main() maybe useful : import os threading import thread def app1(my_app_name): os.s...

Passing Jquery Variable to PHP for database submission -

i attempting pass jquery variable php in order submit variable value database. php code, html code, , jquery code in same code file called entrysurvey.php. have radio button image when being clicked attribute being used define jquery variable. successful, alert portion of code displays correct variable number corresponding image. however, not successful in utilizing ajax in order pass off php yet. have tried many different onsubmit functions nothing has worked far. appreciated. my jquery code: <script type="text/javascript" src="javascript/jquery-3.2.1.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ var value $('img').click(function(){ $('.selected').removeclass('selected'); $(this).addclass('selected'); // var value = $(this).val(); // alert(value); if($(this).attr("alt") == "first image"){ ...

excel - Solution to log benchmarking results and update them easily, including adding new attributes for comparison -

i'm benchmarking set of programs running on gpu , cpu, logging time spent on different parts of program , other data google sheet. there 30 tests, each of has rows dedicated sub test cases of running test on cpu , gpu , columns log time taken etc. looks like, --------------------------------- test1|time(s)|gpu compute(%)|speedup cpu | 1 | 0 |=a2/a2 gpu | .3 | 75 |=a3/a2 test2|time(s)|gpu compute(%)|speedup cpu | 2 | 0 |=a5/a5 gpu | .6 | 75 |=a6/a5 test3|... ... i'm finding difficult add new rows or columns across tests. the best solution have been have 3 dimensional sheet , 2 dimensions dedicated rows , columns describing 1 of benchmarks , 3rd dimension store each benchmark. i'm looking forward suggestions can ease adding more sub test cases (e.g. hybrid cpu gpu or fpga) , attributes describe test runs, facility assign formulas attributes. it'd helpful if upload data , view on platforms google driv...

c# - Create a custom DataGrid's ItemsSource -

i working datagrids struggling binding data since number of columns varies depending of info has showed. so, have tried create , object contains columns , rows need @ point , binding object itemssource property. since have worked datagridviews in windowsforms have in mind this: datatable mytable = new datatable(); datacolumn col01 = new datacolumn("col 01"); mytable.columns.add(col01); datacolumn col02 = new datacolumn("col 02"); mytable.columns.add(col02); datarow row = mytable.newrow(); row[0] = "data01"; row[1] = "data02"; mytable.rows.add(row); row = mytable.newrow(); row[0] = "data01"; row[1] = "data02"; mytable.rows.add(row); but haven't been able find way same thing in wpf since need columns datagridcomboboxcolumns example. actually have read many post in site, none of them helped me. lost. could me? need able create table may contain datagridtextcolumns or `datagridcomboboxcolumns, etc, in order b...

node.js - Connection Error (Couldnt get any Response) unable to post on Mongodb -

Image
i have tried post in mongodb using postman while posting text got error of (couldnt response) not showing error command nodemon please me did mistake ..! need ? my index.js file is:- const express = require('express'); const path = require('path'); const bodyparser = require('body-parser'); const cors = require('cors'); const mongoose = require('mongoose'); const config = require('./configdb/database'); // connection database mongoose.connect(config.database); // connection success db mongoose.connection.on('connected',() => { console.log('connected database ' +config.database); }); //on error while connecting mongoose.connection.on('error',(err) => { console.log('connection error try again database failed connect ' +err); }); const app = express(); const articles = require('./routers/articles'); // port start const port = 2200; // cors middleware app.use(cors()); //...

how to parse this web service using retrofit in android? -

http://www.superbinstruments.com/directory/index.php?r=webservice/profile/id/4096 here want pass id in url (like above) , jsonobject (can null) in body. here concept when pass null json object retrieve profile data or if pass json object profile information update profile data. i have tried below methods can retrieve data can not update data. update data we can pass same json response body. @post("index.php") call<userprofile> profileuser(@query("r") string value, @body string user); @post("index.php?") call<userprofile> saveuser(@query("r") string value, @body jsonobject user); i passing like: value= webservice/profile/id/4096 if pass json string profile updated info getting "invalid request password not needed." or if pass jsonobject profile updated info getting java.lang.outofmemoryerror: outofmemoryerror thrown while trying throw outofmemoryerror; no stack trace available the link have post...

nlp - Crawl ~50 websites looking for key words (climate) using TF-IDF -

"fighting climate change - words?" i come linguistics + stats side , not computer science/programming side of things, please patient me , thank you! i'm working on research project involves expending lot of time , energy looking @ ~ 50 different websites 2-3 times week find out new developments in energy sector/climate change, don't miss news (before changed or deleted) , want save , not miss files of interest. for there laughable set-up of bookmarks. i'd make work easier, if possible, crawling these websites (every day best) looking changes , in particular looking keywords either on (the relevant sections of) website or within posted documents themselves. in regards documents going employ algorithms (or simple variations) tf-idf (term frequency - inverse document frequency) , df-icf (document frequency - inverse corpus frequency) , compare language used (comparative analysis of corpora) on time , "seasons" (e.g. political changes). tldr: ...

javascript - Declaration of directive or component in defferent modules, angular 4 -

is possable declare 1 directive/component many modules? can export one: import { directive, elementref } '@angular/core'; @directive({ selector: '[appbigtext]' }) export class bigtextdirective { constructor(el: elementref) { el.nativeelement.style.fontsize = '100px' } } module one: import { bigtextdirective } '../common/directives/dir225'; @ngmodule({ imports: [httpmodule........... providers :[homeservice], declarations: [ homecomponent, detailcomponent, bigtextdirective ] component: import { bigtextdirective } '../common/directives/dir225'; @component({ selector: 'my-app', template: ` <router-outlet></router-outlet> <div appbigtext>this text huge.</div>. ` }) module 2 same inculding, have error error: type bigtextdirective part of declarations of 2 modules: homemodule , notesmodule! please consider moving bigt...

mysqli using row count to create percentage <divs> from query -

i trying create visual representation of small survey has 3 possible answers in mysqli. have created 3 separate recordsets, , tried record count each, turning results graphical display. not working, , hoping can point out error(s) mysqli... <?php $recordset2 = new wa_mysqli_rs("recordset1",$sig4,0); $recordset2->setquery("select * survey_smoking smoking_allowed 'in%'"); $designated->num_rows; $recordset2->execute(); ?> <?php $recordset1 = new wa_mysqli_rs("recordset2",$sig4,0); $recordset1->setquery("select * survey_smoking smoking_allowed 'everywhere%'"); $allowed->num_rows; $recordset1->execute(); ?> <?php $recordset3 = new wa_mysqli_rs("recordset3",$sig4,0); $recordset3->setquery("select * survey_smoking smoking_allowed 'no%'"); $forbidden->num_rows; $recordset3->execute();?> and trying use thre simple divs show results... <div style=...

python - how to download pics to a specific folder location on windows? -

i have script download images given web url address: from selenium import webdriver import urllib class chromefoxtest: def __init__(self,url): self.url=url self.uri = [] def chrometest(self): # file_name = "c:\users\administrator\downloads\images" self.driver=webdriver.chrome() self.driver.get(self.url) self.r=self.driver.find_elements_by_tag_name('img') # output=open(file_name,'w') i, v in enumerate(self.r): src = v.get_attribute("src") self.uri.append(src) pos = len(src) - src[::-1].index('/') print src[pos:] self.g=urllib.urlretrieve(src, src[pos:]) # output.write(src) # output.close() if __name__=='__main__': ft=chromefoxtest("http://imgur.com/") ft.chrometest() my question is: how make script save pics specific folder location on windows machine? ...

if statement - Why am I getting this output in C++? Explain the logic -

#include <stdio.h> #include <iostream> int main() { if(null) std::cout<<"hello"; else std::cout<<"world"; return 0; } the output above question is: world kindly explain me why getting output. not able satisfactory answer after referring several different sources. null results in false condition. imagine null 0, this: if(null) would equivalent this: if(0) thus code become: #include <stdio.h> #include <iostream> int main() { if(0) std::cout<<"hello"; else std::cout<<"world"; return 0; } where obvious because 0 results false, if condition not satisfied, body of if-statement not executed. result, body of else-statement executed, explains output see. ps: correct way of defining null , null_pointer?

java - Aerospike EOFException repeatedly -

using aerospike java client 4.0.6 aerospike server 3.14.1.2 repeatedly getting following exception : com.aerospike.client.aerospikeexception: java.io.eofexception @ com.aerospike.client.async.nioeventloop.processkey(nioeventloop.java:276) @ com.aerospike.client.async.nioeventloop.runcommands(nioeventloop.java:206) @ com.aerospike.client.async.nioeventloop.run(nioeventloop.java:165) caused by: java.io.eofexception @ com.aerospike.client.async.nioconnection.read(nioconnection.java:112) @ com.aerospike.client.async.niocommand.read(niocommand.java:240) @ com.aerospike.client.async.nioeventloop.processkey(nioeventloop.java:254) ... 2 more even if following steps mentioned in aerospike website async client http://www.aerospike.com/docs/client/java/usage/async on debugging deep found class :com.aerospike.client.async.nioconnection method : public boolean read(bytebuffer bytebuffer) throws ioexception { while (bytebuffer.hasremainin...

dataset - editing vb.net data connections and data sources -

i've inherited vb.net application developed against production sql-server database. have development sql-server , want make sure development work done against development copy of data. deploy application production , have run against production sql-server. i've added logic application startup of first form checks see whether should run against development or production server, can set connection string , that's working. but there several "data sources" defined, , using 2 different "data connections". think i'd have 1 data connection , have point development copy of data. if database has 50 tables , 5 forms, make sense have 1 "data connection", multiple data sources of data sources have 1 data set , of them have multiple data sets (they nested)? or thinking these objects properly? you can either way, whatever fancy. depends how want work, system has 3 connections different sources. nice put in 1 place, have hassle of movi...

TypoScript: Include Right Content Column into Template Typo3 [7.6.10] -

Image
i want use "right content" column in template. created in backend example content this: i wrote source code of template on own. looks this: page = page page.stylesheet = fileadmin/template_ffw/style/style.css page.typenum = 0 page.10 = template page.10.template = file page.10.template.file = fileadmin/template_ffw/index.html page.10.workonsubpart = document_body page.10.subparts { content < styles.content.get asside < styles.content.getright menu = hmenu menu.1 = tmenu menu.1 { no = 1 no.allwrap = <div class="level1"> | </div> } } page.10.marks{ logo = image logo.alttext = logo logo.file = fileadmin/template_ffw/style/ffw_logo.png rootline = hmenu rootline.special=rootline rootline.special.range= 0 | -1 rootline.1=tmenu rootline.1.no.allwrap= | / |*| | / |*| | } at index.html file have source code: <html> <head> <title>t...

Why is in-app notification shown as junk by Clean master? -

junk notification shown clean master while trying show notification app, clean master resisting action showing 'junk notification' in device. however, if clean master uninstalled, notification shown it's expected. question is, if there way show notifications in devices having clean master installed.

I'm fail in accessing my localhost in xampp -

sir, have problem in accessing index.php file. located @ "c:/xampp/htdocs/index.php". please tell me how can access this... , when tried access though " http://localhost/index.php " show error such "object not found , error 404" [enter image description here][1] and show message(error) while first time start apache service such as: "you not running administrator rights! work 6:55:24 [main] application stuff whenever services 6:55:24 [main] there security dialogue or things break! think 6:55:24 [main] running application administrator rights!" stated in post change port number not working still.. i'm waiting reply... please me..

python - django admin/options.py TypeError: 2 options needed, 3 given -

edit: have posted full traceback below, requested. i needed custom logic happen before deleting pages model, overloaded delete() method. (i know bad form. fixed later, it's important express how got mess) with this: def delete(self, *args, **kwargs): # stuff... super(pages, self).delete() unfortunately, caused following typeerror when tried delete page via admin interface: delete_model() takes 2 positional arguments 3 given i decided needed things properly, , deleted delete method overload, , implemented pre_delete logic via following signal handler: @receiver(pre_delete, sender=pages) def handle_page_delete(sender, **kwargs): obj = kwargs['instance'] if(obj != none): tmp1 = obj.prev_id tmp2 = obj.next_id if(tmp1 != none): tmp1.next_id = tmp2 obj.prev_id = none if(tmp2 != none): tmp2.prev_id = tmp1 obj.next_id = none i followed best practices putting handler in signals sub-module ,...

web crawler - Web Crawling with seed URLs from search engine -

i need know if worth build crawler on top of results given search engine. by means, given query, grab n urls search engine , input them crawler find more relevant pages search. there scientific paper/experiment claiming doing helps gathering more relevant pages instead of getting urls search engine? if understood right, rebuild search engine, because job bring related/relevant results first on search. and, although did not mention directly search engine, guess google, suggest use advanced search options before trying else. google provides api performing searches, can use in system. if approach not fit you, possible craw on google results, , perform custom searches (for example filtering results site, term or etc) google not happy , block calls. suggest give try on open api...

python 3.x - Changing string to int from a list of lists only for isdigit -

i have list called rawsafirlistoflists , work python 3, looking this: [['423523525', 'horos', 'wafad', ' 23523523523 - horod wafad', 'august', '2014', '540', '0', 'ianuarie', '2015', '0', '0', 'restanta_mandat', 'mandat neachitat nam', '', 'ajutor refugiati', 'inclus_in_plata', ''], ['5235232', 'stoicovicidf', 'pauladd andreead', ' 52352352352 - stoicovicide paulf cristian', 'august', '2014', '42', '0', 'februarie', '2015', '0', '0', 'restanta_mandat', '', '', 'alocatia de stat pentru copii', 'inclus_in_plata', '']] there want iterate , transform numbers string int. code: for level1 in rawsafirlistoflists: level2 in level1: if level2.isdigit(): int(level2) print(level2) pri...

java - How to add bottom padding to span content of textView within RelativeLayout programmatically -

Image
how can padding added bottom of textview programmatically? noticed there padding above text not below. can done in order add black padding @ bottom @ top? make text view lot more legible (especially letters extend below baseline i.e. g , y ). textview tv1 = v.findviewbyid(r.id.textview1); string mystring = " " + getstring(r.string.magnify) + " "; spannable spanna = new spannablestring(mystring); spanna.setspan(new backgroundcolorspan(color.black), 0, mystring.length(), spannable.span_exclusive_exclusive); spanna.setspan(new foregroundcolorspan(contextcompat.getcolor(getcontext(), r.color.yellow)), 0, mystring.length(), spannable.span_exclusive_exclusive); tv2.settext(spanna); you can use: yourtextview.setpadding(0, 10, 0, 0); android - how set padding textview in listview or expandablelistview or increase textviewheight , centre text.