Posts

Showing posts from May, 2013

javascript - angularjs factory promises and couchDB -

please bare me still learning angularjs. i have written following service data local json file: healthsystemservice.factory('healthsystemdata', ['$resource', function($resource) { return $resource('scripts/data/health-system/data.json', {}, { get: { method: 'get', isarray: true } }); } ]); then use service in controllers: $scope.healthsystems = healthsystemdata.get(); now, know how fetch same data pouchdb database: var db = new pouchdb('healthsystems'); db.get('healthsystems_list').then(function(doc) { return doc.list; }); as can see promise resolve .then my problem when try replace hard coded data in factory 'scripts/data/health-system/data.json' with data couchdb. trying like: healthsystemservice.factory('healthsystemdata', ['$resource', function($resource) { return $resource(***data couchdb(a promise)***, {}, { get: { method: 'get',

android - Passing "this" as root to LayoutInflater.inflate() in a custom component -

i writing code custom component extends linearlayout. include spinner @ top, , number of settings below, depending on spinner set to. i.e., when user selects "apple" on spinner, "color" option appears, , when select "banana" "length" option appears. since spinner option might have many settings associated it, define each group of settings in layout xml "merge" root tag. call initviews() in each constructor inflate views can add/remove them later. here code class: public class schedulepickerview extends linearlayout { protected context context; protected spinner typespinner; protected viewgroup defaultsetters; // viewgroup show when no schedule selected in spinner protected viewgroup simplesetters; // viewgroup show when simpleschedule selected in spinner public schedulepickerview(context context) { super(context); this.context = context; in

dns - Custom domains for Azure Web App -

i'm trying set multiple custom domains our web app. basically it's dynamic website checks url , displays specific content based on customer determined url. let's have contoso.com our customer. in order website work need , record poiting our server ip provided azure , txt record poiting mywebsite.azurewebsites.net. but not enough, have go azure portal, , add hostname there, 'contoso.com', otherwise our customer 404 error. my question is, can tell azure, our web app, accept hostname, not ones defined in azure portal? i know can add hostnames via powershell or rest api, have thousands of customers , maintain. no that's not possible. think, can have multiple sites running on same vm , they'll have same ip address. service requires each site register it's hostname ahead of time when request comes in, service knows site request should routed to.

Connect android device to computer with usb and send data(string,int) -

system that, android device pluged macintosh usb cable. and in android application, want send data (a line of string,int, not matter) computer. how can ? possible ? do need application on computer ? or terminal enough? i create irc bitlbee server on computer, send string, or whatever through irc channel in it. or maybe find app it.

javascript - Is It possible to show tooltip on dropdown in asp.net -

in web application, have dropdowncheckboxes control trying show tooltip on selectbox items. is possible do. i tried code: .aspx: <%@ register namespace="saplin.controls" assembly="dropdowncheckboxes" tagprefix="asp" %> <link rel="stylesheet" href="css/bootstrap-3.1.1.min.css" type="text/css" /> <link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet" /> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> script tag <script> $(function () { $("#tooltip1").tooltip(); }); </script> <div class="tooltip1"> <asp:dropdowncheckboxes id="dropdown1" runat="server" usese

How to get all the yyyymm dates between two dates which are in yyyymm format in SAS? -

i have 2 different dates 201509 , 201608. want dates between them in format yyyymm (201509,201510,201511,201512,201601,201602,201603,201604,201605,201606,201607,201608). issue tackling months between years. also, teh months keep changing , might 201601 201612. it's daily run code , i'm trying automate in sas. appreciated! sas has functions allow must first convert/read dates "sas dates". can use intck count months between start , end , intnx create new month date values. data months; input (start end)(:yymmn.); format start end yymm.; = 0 intck('month',start,end); month = intnx('month',start,i); output; end; format month yymm.; cards; 201509 201608 ;;;; run; proc print; run;

Is there a way to tell less-css/gulp-less to leave an @import rule as-is -

i'd css file produced less compiler contain @import directive @ beginning of file. i.e. given less file: @import "external.css" /* import directive should left */ @import "globals.less" { color: @linkcolor; } /* defined in globals.less */ the resulting css file should this: @import "external.css" { color: #00a; } it seems none of various options of less import directive helps producing this. there other way? update: i'm using gulp-less compile less files. might problem package , not less ( @import (css) "external.css"; doesn't give desired result). update: seem gulp-less problem (or other library in chain) because code in question should output @import statement as-is without using (css) option. the less compiler seems capable of reading file extension , if css leaves @import directive as-is . so, should not less compiler issue. yes, try using css keyword @import (css) "external.css";

javascript - Multiple steps to process data, what's good pattern for JS/Angular? -

imagine have few steps process data. first download it, smth else , on many times. code in c# several lines - 1 each step. as understand now, in js/angular this: function prepateandgo() { loaddata() .$promise.then((loadeddata) => { preparedata(loadeddata).$promise().then((prepareddata) => { preprocessdata(prepareddata).$promise().then((preprocesseddata) => { anddosmthelse(preprocesseddata).$promise().then((anddosmthelsedata) => { makeupdata(anddosmthelsedata).$promise().then((makeupeddata) => { console.log('finally, loaded , processed, lets go'); }); }); }); }); }); } isn't there more beautiful pattern? what's common solution against spaghetti? what need create utility functions return promise. exampl

how to save the view pager fragment instance in android -

when move tab, every time creating new. getting tabname , catid server, private void settabtitle() { final tablayout tablayout = (tablayout) findviewbyid(r.id.tabs); tablayout.settabmode(tablayout.mode_scrollable); mviewpager.setadapter(new viewpageradapter(getsupportfragmentmanager())); viewpager.setoffscreenpagelimit(jsontab.size()); tablayout.post(new runnable() { @override public void run() { tablayout.setupwithviewpager(mviewpager); tablayout.setontabselectedlistener(new tablayout.ontabselectedlistener() { @override public void ontabselected(tablayout.tab tab) { mviewpager.setcurrentitem(tab.getposition()); // current clicked tab position } @override public void ontabunselected(tablayout.tab tab) { } @override public void ontabreselected(tablayout.tab tab) {

bash - pattern matching in sudoers file using tab space in pattern -

i need write shell script check entry there or not in /etc/sudoers file this pattern need check nimbus all=(all) nopasswd:all in pattern word word tab space there how find pattern exist in file /etc/sudoers or not using linux shell script root user somestring='nimbus all=(all) nopasswd:all' file=sudoers echo $file echo -e $somestring if grep -q $somestring "$file"; echo "line found" else echo "line not found" fi error got grep: all=(all): no such file or directory grep: nopasswd:all: no such file or directory please me in regard thanks sagar the problem script is, not escaping( \ ) meta-characters( ( , ) in case) grep identify them have special meaning. also quoting variables prevents word splitting , glob expansion, , prevents script breaking when input contains spaces, line feeds, glob characters , such. the modified version of script should like #!/bin/bash somestring='ni

uiscrollview - Pinch to zoom for entire UICollectionView -

i want entire uicollectionview zoomable including items in it. i tried delegate method func viewforzooming(in scrollview: uiscrollview) -> uiview? uicollectionview falls under uiscrollview hierarchy. unfortunately, method doesn't triggered collectionview. then tried putting collection view inside uiscrollview ---> contentview(uiview). func viewforzooming(in scrollview: uiscrollview) -> uiview? { return self.contentview //the content view holds collection } note: uicollectionview subview of uiscrollview's contentview. uiscrollview's maximumzoomscale set 3.0. zooming isn't working excepted. after zooming content, collection view contents not scrollable in zoomed state. any appreciated.

opensearchdescription - Add Open Search Description with multiple URLs based on language -

the website want add opensearchdescription has language parameter in url path define vistors language. means search url different every language, e.g. http://www.example.org/en/search , http://www.example.org/fr/search the below snippet allow add search url, specific language (e.g. english). <opensearchdescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <script/> <shortname>example site</shortname> <description>search example site</description> <inputencoding>utf-8</inputencoding> <image width="16" height="16" type="image/x-icon">http://www.example.org/favicon.ico</image> <url type="application/x-suggestions+json" method="get" template="http://suggestqueries.google.com/complete/search?output=firefox&amp;q={searchterms}" /> <url type="text/html" method="get" template="http://www.example.org/en

php - Lost old value file when edit form submit symfony2 -

i got edit form (project) field file upload picture. in database got column 'img' save upload picture. but want user, if don't upload new picture, got old img. i old img repository: public function editaction(request $request, projet $projet) { $editform = $this->createform('bbw\projetsbundle\form\projettype', $projet); $editform->handlerequest($request); $em = $this->getdoctrine()->getmanager(); $repository = $em->getrepository('bbwprojetsbundle:projet'); $old = $repository->findonebyid($projet->getid()); // données bdd actuel $old_img = $old->getimg(); var_dump( $old_img ); // got old name img in database - ex: img.png if ($editform->issubmitted() && $editform->isvalid()) { var_dump( $old_img ); // got null img .. $file = $projet->getimg(); // new file upload - here got null img ( when upload no file ) if( $file != null ){ // if send image - fi

python - Adding two asynchronous lists, into a dictionary -

i've found dictionaries odd thing in python. know me i'm sure cant work out how take 2 lists , add them dict. if both lists mapable wouldn't problem dictionary = dict(zip(list1, list2)) suffice. however, during each run list1 have 1 item , list2 have multiple items or single item i'd values. how approach adding key , potentially multiple values it? after deliberation, kasramvd's second option seems work scenario: dictionary.setdefault(list1[0], []).append(list2) based on comment need assigning second list value item of first list. d = {} d[list1[0]] = list2 and if want preserve values duplicate keys can use dict.setdefault() in order create value of list of list duplicate keys. d = {} d.setdefault(list1[0], []).append(list2)

pgAdmin query tool stays frozen even after query is over -

i running postgresql 9.6 in windows 7 laptop. nobody else connects database. ran insert sql in query tool of pgadmin4. query got on after 20 minutes or so. records got inserted & state in pg_stat_activity went active idle checked opening other query tool window. original window in query run continued frozen message "waiting query execution complete" how can fix problem. did research. have tcp/ip connection getting broken mentioned in below links link 1 and link 2 (under connection database dropped) not solution got work around. problem after query execution running autovacuum , after got over, pgadmin staying frozen. disabled autovacuum in config file , started working fine. not sure if have impact on performance or else. see.

PHP Array Calculation -

array ( [pid] => 877 [encounter] => 15342 [fee] => 300.00 ) array ( [pid] => 877 [encounter] => 15342 [fee] => 300.00 ) array ( [pid] => 1422 [encounter] => 15332 [fee] => 600.00 ) array ( [pid] => 690 [encounter] => 15335 [fee] => 0.00 ) array ( [pid] => 690 [encounter] => 15335 [fee] => 276.30 ) array ( [pid] => 690 [encounter] => 15335 [fee] => 0.00 ) array ( [pid] => 690 [encounter] => 15335 [fee] => 0.00 ) array ( [pid] => 690 [encounter] => 15338 [fee] => 400.00 ) code $test_cnt = 0; test_encounter_pid = array(); foreach($provinnrarr $datadisparr){ $test_encounter_pid['pid'] = $datadisparr['pid']; $test_encounter_pid['encounter'] = $datadisparr['encounter']; $test_encounter_pid['fee'] = $datadisparr['fee']; if (in_array($datadisparr["

openscenegraph - Ellipsoid to Sphere in OSG -

i have been practicing openscenegraph examples provided osg. 1 of example, came across text on ellipsoid. osgtext::text* createtext(osg::ellipsoidmodel* ellipsoid, double latitude, double longitude, double height, const std::string& str) { double x, y, z; ellipsoid->convertlatlongheighttoxyz(osg::degreestoradians(latitude), osg::degreestoradians(longitude), height, x, y, z); this works in case.then thought same sphere. in example, ellipsoid drawn basing on lat, long , height. want draw sphere radius depends on window size / screen size. unfortunately failed see converts screen coordinates sphere size in osg::sphere class. some 1 can me, solve this. there might thing converts this, may did not come across because of less experience. cheers, inna. osg::sphere not geospatial model osg::ellipsoidmodel. just create osg::ellipsoidmodel both radii (equator , polar) same sphere radius wish, , use osg::ellipsoidmodel.

Copying data from one Excel Worksheet to another using VLOOKUP -

i have vlookup table on 1 sheet , require 1 column copied onto sheet. currently, can data copied across rows copied on over condition. =vlookup(all_data!a2,all_data!a2:e20001,5,false) this formula have currently. works when drag down, copies of data. want drag down , copies of data based on condition. example, copy of email addresses in column b column contains value = ctp03. possible? sheet 1 test data ctp03 emailaddress ctp03 emailaddress ctp03 emailaddress ctp04 emailaddress sheet 2 expected output ctp03 emailaddress ctp03 emailaddress ctp03 emailaddress the reason looking formula because data changes weekly copy , paste of data sheet 1 automatically populate sheet 2 of email addresses ctp03

grails - Could not determine Hibernate dialect for database name [NuoDB]! -

i trying build groovy project based on gorm, nuodb. getting error - could not determine hibernate dialect database name [nuodb]! the weird thing works mysql. initial suspect database configuration nuodb, checked , re-checked configuration parameters, per provided here nuodb docs i upgraded grails-datastore-gorm-hibernate4 version 3.1.1.release 1.1.0, discussed here same issue sof question the application i'm building based on example presented using gorm standalone (without grails) - github link i not able understand if problem due specific grails version, or due nuodb. possible grails/gorm not support nuodb yet ? my application.properties - spring.datasource.driverclassname=com.nuodb.hibernate.nuohibernatedriver spring.datasource.url=jdbc:com.nuodb.hib://localhost/test spring.datasource.username=username spring.datasource.password=password #spring.datasource.hibernate.dialect=com.nuodb.hibernate.nuodbdialect #spring.datasource.dialect=com.nuodb.hibernate.nuodbdia

cron - Azure WebJob never ran. Why? -

Image
navigating app services in azure, navigating webjobs, able add new webjob. name it, upload zip file necessary files, , under type, select triggered instead of continuous . triggers, scheduled selected. for cron expression, put 0 */5 * * * * . sure enough, webjob runs every 5 minutes. can check webjob logs see status , they're returned "successful". however, when attempting same process different cron expression, webjob never ran. yesterday, uploaded same exact zip file above, 0 0 5 * * * cron expression (set run @ 5am every morning). i checked morning in microsoft azure webjobs logs , under "last run time", webjob says never ran . why this? will webjob not run if i'm not logged azure make sure runs? how can guarantee webjob run? anyone else having problem? all times utc mentioned here else. if have against utc, can alter timezone setting website_time_zone application setting detailed here . also make sure have always on enab

data warehouse - Is dimensional modeling feasible with Amazon Redshift -

as know, referential constraints not enforced redshift. should still opt dimensional modeling ? if so, how around limitations , maintain data integrity of our datawarehouse. yes, dimensional modelling feasible , encouraged on redshift. redshift optimized star schema queries optimizing star schemas , interleaved sorting on amazon redshift refer is dimensional modeling feasible in amazon redshift?

virtualhost - MAMP 500 Internal Server Error -

i got little problem. i made 2 virtual hosts "web-backend.local" , "oplossingen.web-backend.local". but have "500 internal server error" what doing wrong? hosts file: ## # host database # # localhost used configure loopback interface # when system booting. not change entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost # mamp virtualhost mappings 127.0.0.1 web-backend.local 127.0.0.1 oplossingen.web-backend.local httpd-vhosts.conf: # # virtual hosts # # if want maintain multiple domains/hostnames on # machine can setup virtualhost containers them. configurations # use name-based virtual hosts server doesn't need worry # ip addresses. indicated asterisks in directives below. # # please see documentation @ # <url:http://httpd.apache.org/docs/2.2/vhosts/> # further details before try setup virtual hosts. # # may use command line option '-s' verify virtual host #

javascript - React Native - Share local image with showShareActionSheetWithOptions -

i have question sharing local image showshareactionsheetwithoptions . here code: actionsheetios.showshareactionsheetwithoptions({ title: "react native", message: "hola mundo", url: '@theme/img/share/share.png', subject: "share link" // email }); from documentation : "if url points local file, or base64-encoded uri, file points loaded , shared directly". but doesn't work. not sure how access or how path image. in app root folder (where index.io.js located) have "src/theme/img"-folder images are. in example react-native have image .js file is, doesn't work either. in current react native version (0.49), valid urls can be: chosen imagepicker of expo api screenshot taken via reactnative.takesnapshot('window') the path looks like: /private/var/mobile/containers/data/application/7a8ea990-d8c0-43b9-a527-365111fcbba0/tmp/reactabi21_0_0native/9bd50e06-3d6f-4e44-9465-a17d6be399d4.p

php - .htaccess rewrite in subdirectory not working under root directory with .htaccess -

my domain points root folder. in folder need have .htaccess redirect subfolder. in root folder have .htaccess: rewriteengine on rewritebase / rewritecond %{request_uri} !^/sub/folder/ rewritecond %{http_host} ^(www\.)?domain\. rewriterule ^(.*) /sub/folder/$1 [l] in sub/folder/.htaccess have lines: rewriteengine on rewritebase / errordocument 404 /index.php?action=404 rewritecond %{request_uri} ^/image/([^/]+)/(\d+)x(\d+)/([^/]+).(jpg|png)$ rewriterule (.*) file.php?action=%1&code=%4&w=%2&h=%3 [b,l,qsa] rewritecond %{request_uri} ^/cscard_valid$ rewriterule (.*) index.php?action=cscardvalid&ajax=true [l,qsa] .. i don't known why redirects doesn't works. can me please? thanks get rid of .htaccess in subfolder add rules root 1 so: rewriterule ^image/([^/]+)/(\d+)x(\d+)/([^/]+).(jpg|png)$ sub/folder/file.php?action=$1&code=$4&w=$2&h=$3 [b,l,qsa]

java - Camel - Error with JAXPSAXProcessorInvoker when function is added to xsl -

i have following stylesheet , xml: students.xml <?xml version="1.0" encoding="utf-8"?> <class> <student rollno="393"> <firstname>dinkar</firstname> <lastname>kad</lastname> <nickname>dinkar</nickname> <marks>85</marks> </student> <student rollno="493"> <firstname>vaneet</firstname> <lastname>gupta</lastname> <nickname>vinni</nickname> <marks>95</marks> </student> <student rollno="593"> <firstname>jasvir</firstname> <lastname>singh</lastname> <nickname>jazz</nickname> <marks>90</marks> </student> </class> students.xsl <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/

sqlite - No such table while writing to sqlite3 database from Pyspark via JDBC -

i trying write spark dataframe sqlite3 database in python using sqlite-jdbc xerial , this example . i getting error java.sql.sqlexception: [sqlite_error] sql error or missing database (no such table: test) the database file hello.db created table test has schema sqlite> .schema test create table test (age bigint , name text ); i running spark-submit --jars ../extras/sqlite-jdbc-3.8.11.2.jar example.py in order find driver. i running spark 1.6.0. (hopefully) reproducible example import os os.environ["spark_home"] = "/usr/lib/spark" import findspark findspark.init() pyspark import sparkconf, sparkcontext pyspark.sql import sqlcontext config = { "spark.cores.max": "5", "spark.master" : "spark://master2:7077", "spark.python.profile": "false", "spark.ui.enabled": "false", "spark.executor.extraclasspat

jquery - How do I remove opacity (hover opacity) when clicked so video will not be transparent -

i want able hover on youtube video , affect transparency/opacity (as now) but, when click play video, turns solid , no longer uses hover opacity. i'm not sure how use jquery , click function on iframe . doesn't seem work. * { margin: 0px 0 0 0; } body { background: url("https://photos-4.dropbox.com/t/2/aaazaqaql59efvsi-nmxk-jzk3dedldcqahbtj9zhmbz2g/12/20139880/jpeg/32x32/1/_/1/2/back.jpg/ej6giw8y9dugbygh/bwjw1osyltn5scruols8x1brd_phrj_y11ss9ctvrzq?size_mode=5") fixed; background-size: cover; } #content { width: 853px; height: 480px; background: #000000; opacity: 0.8; margin-top: 40px; margin-left: auto; margin-right: auto; } iframe { opacity: 0.7; filter: alpha(opacity=70); -moz-transition: 0.4s ease-out; /* ff4+ */ -o-transition: 0.4s ease-out; /* opera 10.5+ */ -webkit-transition: 0.4s ease-out; /* saf3.2+, chrome */ -ms-transition: 0.4s ease-out; /* ie10? */ transition: 0.4s ease-out;

c# - Xamarin PCL - How can I upload/download a File to/from a FTP Server? -

i'm developing mobile app using xamarin. in current version android supported, expand windows , ios. so question is: how can make pcl allows me download - cross plattform - file ftp server or upload - cross plattform - file ftp server? since ftpwebreuquest class not avaiable in pcl - neither webrequest class. you need inject code platform specific libraries. why not using mvvm framework mvvmcross helps lot this? https://github.com/mvvmcross/mvvmcross

performance - Counter Intuitive javascript sqrt performace? -

i'm taking webdev class , 1 of tasks had calculate if age perfect square. seeing of different solutions students came with, curious actual performance wrote little test see how stack each other, , turns out 1 calls math. functions far , away fastest consistently. here functions: var func1 = function(age){ var agesq = math.floor(math.sqrt(age)) * math.floor(math.sqrt(age)); return agesq === age; } var func2 = function(age){ return math.sqrt(age) % 1 === 0; } var func3 = function(age){ return number.isinteger(math.sqrt(age)); } var func4 = function(age){ return (parseint(math.sqrt(age)) * parseint(math.sqrt(age)) == age) } running each of these on 100,000 array of integers 0-99 total time each follows 3 runs: [4.405000000000015, 8.625000000000014, 10.54000000000002, 7.895000000000039] [3.989999999999807, 6.310000000000002, 6.780000000000001, 6.444999999999993] [3.584999999999795, 13.98500000000014, 11.47999999999999, 9.965000000000003] as can see first 1 dram

java - How to Limit ServletListener to a Single Context? -

i have jsr-356 websocket application. use listeners initialize it, don't need rely on jar scanning annotations slows down startup. for example, use servletcontextlistener implementation register websocket's endpoint : @override public void contextinitialized(servletcontextevent sce) { servercontainer servercontainer = (servercontainer) sce .getservletcontext() .getattribute("javax.websocket.server.servercontainer"); servercontainer.addendpoint(myendpoint.class); } and register listener in web.xml deployment descriptor: <listener> <listener-class>my.servletcontextlistenerimpl</listener-class> </listener> the problem endpoint registered of web contexts, not want. how can limit listener specific contexts? or set "init params" on listener via configuration can inspect in servletcontextlistener , register endpoint if matches init param? each webapp own servletcontext , wouldn't po

python - Argparse: parse multiple subcommands -

did research, couldn't find working solution. i'm trying parse following command line, 'test' , 'train' 2 independent subcommands each having distinct arguments: ./foo.py train -a 1 -b 2 ./foo.py test -a 3 -c 4 ./foo.py train -a 1 -b 2 test -a 3 -c 4 i've been trying using 2 subparsers ('test','train') seems 1 can parsed @ time. great have subparsers parents of main parser such that, e.g. command '-a' doesn't have added both subparsers 'train' , 'test' any solution? this has been asked before, though i'm not sure best way of finding questions. the whole subparser mechanism designed 1 such command. there several things note: add_subparsers creates positional argument; unlike optionals `positional acts once. 'add_subparsers' raises error if invoke several times the parsing built around 1 such call one work around we've proposed in past 'nested' or 'recursi

java - Complex when on a Camel route -

i new camel have lot of questions. before ask try research issue carefully. on issue can't find solution. may key words generic. i need have , condition on routing. (soap messages) there 2 fields in header have specific values before route used. how specify if(x == 1 , y == 2) using routebuilder? i think can use simple ( http://camel.apache.org/simple ). predicates ( http://camel.apache.org/predicate.html ). in xml-dsl like: <choice> <when><simple>${header.x} == '1' && ${header.y} == '2'</simple> <log message="do message"/> </when> <otherwise> <log message="do else"/> </otherwise> </choice>

linkedin - Inconsistent public-profile-url formats -

when using linkedin api's people-search endpoint, getting inconsistent url formats profiles returned. performed search yesterday, specifying first , last name , requesting public-profile-url, , of results had public profile urls in format: https://www.linkedin.com/in/ *** i performed same search today , received same profiles, public profile urls in format: https://www.linkedin.com/pub/ *** i know they're same profiles because when attempt navigate pub url in browser redirects me /in/ url. understanding /pub/ format had been discontinued, , profiles created /in/ public profile url format. why public-profile-urls being returned in /pub/ format @ seemingly random times? causing issues application resulting in duplicate accounts in db.

ruby - how to return true or false when a string contains any letters A-Z or a-z? -

i familiar how check if string contains substring, , familiar how check if single letter number or letter, how go checking string letters? def letters?(string) # do here? end # string '111' '1a2' 'ab2589a5' etc... string = '1a2c35' if letters?(string) == true # if string has letters else # else if doesnt end i think, can try it: def letters?(string) string.chars.any? { |char| ('a'..'z').include? char.downcase } end if don't wanna use regexp. method return true if there letters in string: > letters? 'asd' => true > letters? 'asd123' => true > letters? '123' => false

html - Nested ordered lists of different types -

i trying nest several ordered list html tags, , have each of them separate types. however, of list elements staying type 1, , cannot tell why. this code: <ol type="1"> <li>sales associate 2003- present</li> <ol type="2"> <li>target west, wichita, ks</li> <ol type="3"> <li>help customers purchases</li> <li>handle customer questions , complaints, working ensure complete customer satisfaction</li> <li>run cash register</li> <li>monitor security system</li> </ol> </ol> <li>grounds keeper 1998-2003</li> <ol type="2"> <li>riverside golf course, wichita, ks</li> <ol type="3"> <li>helped general outdoor maintenance of apartment complex</li>

javascript - Angularjs add validation to dynamic fields using $compile -

am trying add required input element in form. however, form dynamic.if put element manually in page works,but if use $compile doesn't work. my html: <div style="padding-left:20px; padding-right:20px"> <ng-form name="myform"> <div id="appendhere"></div> <button type="submit" ng-disabled="myform.$invalid" class="btn btn-primary">save</button> </div> </div> </ng-form></div> my controlles js: 'use strict'; myapp.controller("compilecontroller", ["$scope", "$compile", function ($scope, $compile) { var $result = $("<ng-form name='form'><div class='form-group'><h5><label class='col-xs-2 col-form-label'>absence status</label></h5><div class='col-xs-10'><input class='form-contro

javascript - For loop doesn't work for image selector -

i'm trying make picture selector loop doesn't work. it should make selected div orange , , turn other divs white . function clickpic(id) { document.getelementbyid("pic"+id).style.backgroundcolor='orange'; for(var = 0; < 310; i++) { if(!i == id) { document.getelementbyid("pic"+i).style.backgroundcolor='white'; } } } the divs turning orange when clicked, others stay orange too. looking function , need, looks want this.. you can run working example: function clickpic(id) { // div , set div orange var selected_div = document.getelementbyid("pic"+id); selected_div.style.backgroundcolor = 'orange'; // looping through 16 divs i've created for(var = 0; < 16; i++) { if(i != id) // changed operation { document.getelementbyid("pic"+i).style.backgroundcolor='white

ajax - How to set and get values from cookie in EmberJS using ember-simple-auth -

excuse naivety, new sessions, cookie based authentication , python tornado. trying access api written in python tornado, , using ember cli client. can't seem set cookie values in request sent server. how 1 set cookie correctly in ajax/ember.js? techs i'm using: ember cli ember simple auth python tornado situation have: log in page users can try log in. need: way set parts of successful response server local storage location, or cookie. have: api endpoint accessing using ajax need: way pass parts of log-in response data 'cookie' server throwing error saying cookie invalid or missing. ok whomever running same problem, had set following ajax setting in "findall" function model, , on authenticate method. ... xhrfields: { withcredentials: true }, success: succsfunction, error: errorfunction...

How to add delays for launch configurations in Eclipse? -

Image
i have launch group several launch configurations. when ran, configurations launched 1 after other quickly. i'm not sure if 1 launch needs "return" in fashion in order next start. i add delay between of launches. either manual time duration: launch1, wait 2 seconds, launch2; or way tell next launch can happen now. is there way in eclipse (i'm on 4.5.2)? maybe plugin or option in launch configuration? i'm open script option if can guide me. in eclipse oxygen options became available launch group launch configuration. go run > run configurations... , under launch group add new configuration , add configurations want launch. it's possible set delay in post launch action :

java - Class object vs instance garbage collection when unreachable? -

when create new object employee emp = new employee , per mine understanding system class loader(in case of stand alone program) or web class loader(in case of webserver tomcat) loads employee class object(including class level fields/methods) , actual employee instance created. my question why class object garbage collected if reference dead object garbage collected if unreachable. is because employee class object still referred internally class loader(system/web class loader) employee instance not referred class loader ? update :- question has been marked duplicate of when , how classes garbage collected in java? not answer mine question. question comparison why class not gc'ed object not should reopened . link answered when/when not class object can garbage collected question why not object also. not reference class loader ?

node.js - Are configuration files in Node&Express supposed to be read asynchronously? -

it naive question. have config file storing need making connection db. if reading asynchronously, connection done in callback? fs.readfile(pathtoconfigfile, function (err, data){ createconnection(data);}); does ugly, suspicious , bit dangerous, doesn't it? (this example, i'd hear opinions it, if , why worng doing , on) in case using mongoose, query db on schema object (i.e. user.find()...) null results because connection doesn't happen synchronously guess. thank much (here app-structure) app.js db.js (read config file , make connection) config.json (info of db , others) user.js (model users) home.js (query users , list them on .get '/') it's ok sync operations during app start up. however, not sync stuff once app has started, while handling requests. your app should configured start if database connectivity successful. // set app var express = require('express') var app = express() .... // set database connectiveity var d

ios - 'SpringBoard' may not respond to presentViewController -

i'm trying make simple baseline tweak ios 9.3.3 display message when springboard starts. keeps giving me error , can't figure out how correct it. appreciated. reason i'm not using uialertview because deprecated. error: > making tweak uialertcontrollertest ==> preprocessing tweak.xm ==> compiling tweak.xm (armv7) tweak.xm:9:8: error: 'springboard' may not respond 'dismissviewcontrolleranimated:completion:' [-werror] [self dismissviewcontrolleranimated:yes completion:nil]; ~~~~ ^ tweak.xm:12:8: error: 'springboard' may not respond 'presentviewcontroller:animated:completion:' [-werror] [self presentviewcontroller:alertcontroller animated:yes complet... ~~~~ ^ 2 errors generated. make[3]: *** [/home/theodd/desktop/uialertcontrollertest/.theos/obj/debug/armv7/tweak.xm.ae1dfb2c.o] error 1 make[2]: *** [/home/theodd/desktop/uialertcontrollertest/.theos/obj/debug/armv7/uialertcontrollertest.dylib] error

data structures - Find second minimum - algorithm -

i want find second minimum 3 numbers. i have blackbox gets 2 input numbers, blackbox returns max between numbers. additionally, have blackbox returns min. now have box gets 3 numbers input , needs return second min. can me solve this? how can solve using 2 blackboxes? thanks! i can see of way to 3 uses of blackbox. let's pretend each element a,b,c. find min of b , b c. find max of 2 answers , have second min. if b returned, find min of , c.

php - ACF Wordpress get posts by category and custom fields -

Image
i have problem acf in wordpress. created own field , created own plugin display it, don't know how can display fields. have this: wp_reset_postdata(); $myargs = array ( 'showposts' => 6 ); $myquery = new wp_query($myargs); if($myquery->have_posts() ) : while($myquery->have_posts() ) : $myquery->the_post(); ?> <p> <?php the_title(); ?> </p> <?php endwhile; endif; wp_reset_postdata(); and display me posts. want display posts category "raporty" , want display of custom fields. sorry english ;) siema kubol, to show posts post_type 'raporty' add $myargs : $myargs = array ( 'showposts' => 6, 'post_type' => 'raporty' ); in wp loop use e.g. get_field( 'typ_raportu' ) . outside loop get_field( 'typ_raportu', post_id_here ) .

javascript - CSS positioning/resizing html5 video background -

Image
hey wizards of interwebs, i've been pulling hair out past couple of days trying figure 1 out. i'm trying include fullscreen video background , seems have hit snag. below image of trying accomplish. i tried video element iframe. can't div below nest under, when browser window resized. any or pointers appreciated. closest i've gotten min-width/height still leaves gap... what end shws in 2nd img. video resizes browser , there's gap below it to prevent problem need this: css: .div1{ background-color: red; height: 100%; position: relative; overflow: hidden;} .div2{ background-color: black; height: 100%;} video{ position: absolute; height: 100%; width: 100%; margin: 0; padding: 0; top: 0; bottom:0; right: 0; left: 0;} and put video inside div1: <div class="div1"> <video autoplay>...</video> </div> <div class="div2"> </div> it don't allow video element show @ overflow. , d