Posts

Showing posts from July, 2011

Android update recyclerView items -

i have simple problem on update recyclerview items new data, i'm wondering code work fine without using data binding, in code adding new items trigger click on button clickonsendcommandtorobot method, method must add new item list , adapter can know add new data , refresh recyclerview , dont error, list size 1 public class activityregister extends baseactivities { private robotmessagesadapter adapter; private list<robotviewmodel> model; private static final string tag = "register"; @override public void oncreate(@nullable bundle savedinstancestate) { super.oncreate(savedinstancestate); binding = databindingutil.setcontentview(this, r.layout.activity_register); activityregisterpresenter presenter = new activityregisterpresenter(this); activityregisterviewmodel viewmodel = new activityregisterviewmodel(); binding.setviewmodel(viewmodel); binding.setpresenter(presenter); if (savedi

android - How can I find and run the keytool -

i reading development guide of facebook developers @ here it says must use keytool export signature app such as: keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64 i not know how find keytool in order run it. tried open windows command prompt , paste above command, did not work. i found solution myself below quote. works fine. "c:\program files\java\jdk1.6.0_26\bin\keytool.exe" -exportcert -alias sociallisting -keystore "d:\keystore\sociallisting" | "c:\cygwin\bin\openssl.exe" sha1 -binary | "c:\cygwin\bin\openssl.exe" base64

vba - How to manage a local git repository using Rubberduck -

i'm using rubberduck (version 2.0.13) in combination local git repository version control of vba project. currently, need re-open repository every time start rubberduck using manage -> open existing repository in source control window. is there better way handle local repository, e.g. can rubberduck save setting? don't want use online repository, think "unsynced commits" tab irrelevant me. this started comment, got long... figured i'd make disappointing answer instead. i don't vba (lately anyway) can't actively use rubberduck's source control feature, , haven't contributed that part, know users seem manage use - both local , remote repositories: these users can give better answer can far using it goes. there are quite number of open issues involving source control feature , a project dedicated stabilizing it . it's provided "as-is", in "better nothing". the idea it's supposed pick projecti

Check if email exist php -

i have question, have php script check if email address exist. but appear yahoo, hotmail, aol , others providers accepting emails , not rejecting invalid emails. only gmail, , many domains stackoverflow.com rejecting no vaild emails. check script , let me know if can check yahoo , others. html post form <html> <body> <form action="checkemail.php" method="post"> <b>e-mail</b> <input type="text" name="email"> <input type="submit"> </form> </body> </html> php <?php /* validate email address. */ function jvalidateemailusingsmtp($stoemail, $sfromdomain = "gmail.com", $sfromemail = "email@gmail.com", $bisdebug = false) { $bisvalid = true; // assume address valid default.. $aemailparts = explode("@", $stoemail); // extract user/domain.. getmxrr($aemailparts[1], $amatches); // mx records.. if (sizeof($amatches) == 0)

meta - Spanning Tree Graph -

i have question spanning tree , not entirely sure how tackle properly. a connected graph g= (v, e) withn=|v|vertices can have many different spanningtrees, each exactlyn−1 edges. relationships among these spanning trees can berepresented meta-graph sg. each vertex ofsgcorresponds 1 of spanning treesofg . there edge between 2 vertices of sg if corresponding spanning trees ti andtj have n−2 common edges ing(so ti has 1 edge ofg not intj , tj has 1 edge of g not in ti). (a) prove meta-graph sg of connected graphg connected. (b) suppose edges of g have positive integer weights. weights not necessar-ily distinct, there can more 1 minimum spanning tree (mst). vertices of sg correspond msts of g , other vertices correspond spanning trees of g not have minimum weight. prove subgraph of sg inducedby vertices of sg corresponding msts of g connected. answer: not entirely sure how solve problem , correct argument proove a) , b) this have far part a) suppose metagraph of g not conne

ios - How to not display data in first component of UIPickerView until the start of specific row in second component? -

Image
i apologize if duplicate of following questions, if please mark so: how set data in second component based on first component selection in uipickerview not able reload second compoenent based on value in first component in uipickerview first, illustration of have in uipickerview : i have 2 components in uipickerview . first component not show until row 3 of second component selected, i.e. day(s) . i have following simple code set up: func pickerview(_ pickerview: uipickerview, titleforrow row: int, forcomponent component: int) -> string? { if component == 0 { return times_array[row] } else { return cycle_array[row] } } func pickerview(_ pickerview: uipickerview, numberofrowsincomponent component: int) -> int { if component == 0 { return times_array.count } else { return cycle_array.count } } i'm sure it's obvious, i'm not sure how apply simple logic. can point me in ri

algorithm - Need a geometric edge/crease detection method -

Image
i experimenting primitive rendering style (solid colors highlighted edges/creases) open-source game contribute to. world geometry simplistic, , comprised of blocks, pyramids, , there may other simple volumes cylinders, cones, other kinds of prisms, etc. rendering done opengl es 2. i have been experimenting edge detection methods edges/creases. seemed doing shader-based edge detection (i tried sobel filter , several other algorithms) on depth value , face normals easiest, unable result, due precision limits of depth buffer , complexity of far-away geometry, inability antialiasing on edges. i decided needed render lines geometrically make them thick , smooth out edges, etc. generate lines programmatically geometry definition prior rendering improve runtime performance. can of effect want drawing main geometry, set depth offset, draw lines on geometry. however, technique has shortcomings, seen below: overlapping geometry there may several pieces of geometry overlapping or adjo

javascript - How to show ajax response in a para or div in text form? -

i have created 1 page ajax function insert data database on click of submit data getting insert in database want show message data inserted or not created div , showing result in cant see text. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>post</title> </head> <body> <form class="postform" id="postform" method="post" action="addpost.php"> <fieldset> <legend>please add details below </legend> <p> <label for="title">title (required, @ least 2 characters)</label> <input id="title" name="title" minlength="2" type="text" required> </p> <p> <label for="url">url (required)</label> <input id="url" type="url"

ios - How may I trigger banner notifications using FCM? -

how show banners in app using firebase's fcm feature? able receive , show banner notifications via apple provided delegate method: func usernotificationcenter(_ center: unusernotificationcenter, willpresent notification: unnotification, withcompletionhandler completionhandler: @escaping (unnotificationpresentationoptions) -> void) { completionhandler([.alert, .badge, .sound]) } however, once try use fcm, method no longer called. instead, it's method receives notification information: extension firebasenotificationmanager: firmessagingdelegate { func applicationreceivedremotemessage(_ remotemessage: firmessagingremotemessage) { let appdata = remotemessage.appdata appdata.foreach { print($0) } } } i can printout of appdata , i'm not sure how display banner alert. any appreciated! i using ios 10 , working me. - (void)usernotificationcenter:(unusernotificationcenter *)center willpresentnotification:(unnotification *)notification

javascript - Promises Syntax -

i've looked through several promise syntax, i'm not understanding (including ones had examples). of them resolved variable, mine bit more complex, , can't seem running right. i'm using firebase current user, , want run next lines after user. here's code: componentdidmount() { var promise = new promise ((resolve, reject) => { var user = fire.auth().currentuser}; resolve( if(user) { console.log('favorites: requesting favorites'); fire.database().ref('/favourites/' + user.uid).once('value').then(function (snapshot) { var recipes_obj = snapshot.val(); let recipes = []; (let id in recipes_obj) { let recipe = recipes_obj[id]; recipe.id = id; recipes.push(recipe); console.log("recipes: ", recipes) } console.lo

plsqldeveloper - Template Using query variable with a variable -

how use query variable variable in template? in example given below possible directly result of query without showing createstmt in dialog. desired input user [mytable] here template code : [$query my_query = select dbms_metadata.get_ddl( 'table', '[mytable]', 'auser' ) dual] create table statement [mytable] [createstmt=$my_query]

java - How can I invoke this method with an array? Is it possible to do? -

i've been given array use within class assignment. /** * compacthand - method supplied you! * re-order array cards occupy indices, i.e. 0,1,2,... * , nulls in higher indices. * count number of cards in array , set ncard accordingly. * example: if array [kclub][null][2diamond][null][7spade] * routine sets array [kclub][2diamond][7spade][null][null] , sets ncard 3. * note relative order of cards not changed. */ private void compacthand(){ int nc=0, ix=0, nullix=-1; // find first null do{ if (cards[ix]==null){ nullix = ix; break; } } while (++ix<cards.length); if (nullix==-1){ // there no nulls. set ncards , return. ncard = cards.length; return; } nc = nullix; // loop end of array , swap cards nulls for(ix=nullix; ix<cards.length; ix++) if (!(cards[ix]==null)){ cards[nullix++] = cards[ix]; cards[ix] = null; nc++;

r - php exec() doesn't store the output in $output argument -

my index.php : <?php $n = 3; exec("rscript my_script.r $n", $out); var_dump($out); <? my_script.r : #!/usr/bin/env rscript <- as.numeric(commandargs(true)) rootkea <- mongodbconnect('rootkea') print(i:10) output: array(0) { } shell output: $ rscript my_script.r 3 loading required package: rjava loading required package: methods [1] 3 4 5 6 7 8 9 10 interestingly php works expected if remove mongodbconnect line my_script.r modified my_script.r : #!/usr/bin/env rscript <- as.numeric(commandargs(true)) #rootkea <- mongodbconnect('rootkea') print(i:10) output: array(1) { [0]=> string(27) "[1] 3 4 5 6 7 8 9 10" } shell output: $ rscript my_script.r 3 loading required package: rjava loading required package: methods [1] 3 4 5 6 7 8 9 10 i need have database connection , other processing in my_script.r before print result. how make exec store output in $out argument?

Starting Ruby on Rails server on Windows automatically -

im totally newbie in rails , have problem. every single time im rebooting pc have run server based on ruby on rails console command in right directory. there problem - have make run server automatically booting windows. @btw: there possibility hide console? you can create batch file instruction give in command prompt like cd projects\myapp ruby script\server and drop copy of file windows start -> programs -> start folder.

php - yii2+nginx, subdomain to module -

i have project working on yii2 (backend nginx). project has several modules, can conditionally called: category 1 (cat1) category 2 (cat2) it required implement functionality when requesting cat1.coolsite.example , opens module available coolsite.example/cat1 . accordingly, second category try adding 2 server configs modules 1 , @ nginx error.log if doesn't trick. server { listen 80; server_name cat1.coolsite.example,; location / { proxy_pass coolsite.example/cat1/$uri; } }

django - Override the DEFAULT_FILE_STORAGE with MEDIA_URL to integrate Azure CDN -

i'm using azure storage account storing media files setting simple in settings.py this: default_file_storage = 'storages.backends.azure_storage.azurestorage' azure_account_name = 'my_account_name' azure_account_key = 'my_account_key' azure_container = 'my-container' however, considered later want use azure cdn instead serving media files. how point cdn url instead? tried setting in media_url like media_root = os.path.join(base_dir, 'upload') media_url = '//my-media.azureedge.net/my-container/' however storage-account blob 1 being shown default url 'xxxxx.blob.core.windows.net' instead of media url.. how show media_url instead of 'xxxxx.blob.core.windows.net'? thankfully have answer one. need override storage backend class of azure on 'storages' library replacing blob hostname cdn hostname. settings.py media_url = '//my-media.azureedge.net/my-container/' storages.py impor

DATE_FORMAT error in ruby in rails 4 with sql server 2014 as a database on windows 7 -

i getting date_format error in ruby on rails sql server database <% date = date.today %> <% @employees = employee.where("status = ? , date_format(date_of_birth,'%d/%m') = ?", "active" , date.strftime('%d/%m')) %> try this, <% date = date.today %> <% @employees = employee.where("status = ? , format(date_of_birth,'dd/mm','en-us') = ?", "active" , date.strftime('%d/%m')) %> learn more format function

Access VMware Host from docker container java app -

i have vmware server , direcotry logs /opt/app1/logs.java app running inside 1 of docker containers of vmware. java app has write logs vmware location(/opt/app1/logs).existing app writing conatainer path /usr/app/logs. how point java app write logs in vmware logs location /opt/app1/logs.thanks in advance replies , answers.

java 8 - Can't update JAVA_HOME in Ionic -

so have updated jdk version 8.0 or greater , confirmed on terminal java -version . when run command ionic build android, still has java_home set previous jdk, 7.0. did change in /etc/environment , yes, afterwards used source /etc/environment/ . anyone know how update java_home ionic? it mistake in path set java_home. i changed following java_home=/usr/lib/jvm/java-8-oracle

Do webpack loaders use concept similar to gulp in-memory streaming? -

after reading articles similar this appears question - webpack loaders use node streams avoiding fs io operations? here quote: all gulp plugins through streams read in data , output data. can processed in memory, output of 1 stream piped input another. unix pipes.

asp.net mvc - Jenkins trigger a build based on the commit in multiple projects -

recently have started working on ci project, has build project on scm commit (git/svn). tried using build trigger remotely , triggering job when commit code , building application successfully. now have multiple projects in single repository, based on commit has find respective project in repository , start executing specific job. is there way in jenkins? code post-commit-hook-jenkins.vbs file set args = wscript.arguments jobname = args.item(0) token = args.item(1) ' url open surl = "http://builduser:a844e9e505bfc5e6e9ce6e953ba5443a@localhost:8080/buildbytoken/build?job=" + jobname + "&token=" + token ' post request send. wscript.echo "surl: " + surl srequest = "" httppost surl, srequest function httppost(surl, srequest) set ohttp = createobject("microsoft.xmlhttp") ohttp.open "post", surl,false ohttp.setrequestheader "content-type", "application/x-www-form-urlencoded&quo

"Unable to write to the configuration file." Error with Magento Connect Manager 1.9.3.2 -

after migrating apache server ubuntu 14.04 centos 7, started experiencing these permission errors. on magento connect manager login page, i'm hit error message , unable login: unable write configuration file. the error remained after set permission every file , folder 0777. i, then, deleted .cfg files in "downloader" folder. error message has become: settings has not been loaded. used default settings config file not exists please save settings unable write configuration file. after login/logout, restarting apache server , entire host, error remained. error logs did not record @ all. solved! selinux preventing apache writing directory. used following command enable it: chcon -t httpd_sys_rw_content_t /var/www/html -r

mysql - Joins symfony 2 -

Image
i have 3 tables , use yaml, connect each other this: trainings: onetomany: exercisetrainings: targetentity: exercisetraining mappedby: training cascade: ["persist", "merge"] joincolumn: name: id referencedcolumnname: training_id exercises: onetomany: exercisetrainings: targetentity: exercisetraining mappedby: exercise cascade: ["persist", "merge"] joincolumn: name: id referencedcolumnname: exercise_id trainingexercises: manytoone: exercise: targetentity: exercise inversedby: exercisetrainings joincolumn: name: exercise_id referencedcolumnname: id training: targetentity: training inversedby: exercisetrainings joincolumn: name: training_id referencedcolumnname: id i need "exer

Jquery Modal to Load External URL -

i'm using plugin page overlay when set link external page, not working. won't open. error: xmlhttprequest cannot load "external url here". no 'access-control-allow-origin' header present on requested resource. origin 'my web url' therefore not allowed access. this code, i've loaded necessary library: //not working <a href="http://google.com" rel="modal:open">visit google</a> //working code <a href="terms.html" rel="modal:open">view terms , conditions</a>

ios - How can I get current month as number ie. "1" in objective c? -

this question has answer here: nsdate year/month/day 17 answers how can current month not "jan" want in format "1" , in short want current month as number because want append number string complete url link json parsing. thank in advance. try month number nsdate *date = [nsdate date]; nsdateformatter *datefor = [[nsdateformatter alloc]init]; [datefor setdateformat:@"mm"]; //[datefor setdateformat:@"m"]; // use single m avoid 0 before month number nsstring *monthnumber = [datefor stringfromdate:date]; hope help..

upgrade - After TYPO3 Update from 6.2 to 7.6 still errors in TCA? -

Image
i've made update typo3 cms 6.2 typo3 cms 7.6.16 . after few problems other extensions ( tx_news and third party ext. ) , changes in tca . works fine after import live-dump ... upgrade wizard / database compare update reference index flush cache , empty typo3temp deactivate , reactivate extensions problems everything? unfortunately, no. extension im_appointments doesn't work. don't written extension myself. if try add new data record in backend ext., i'll error: an item in field form of table tx_imappointments_domain_model_job not array expected but database comprare finished. tables correct?! where's problem? know it's hard analyze without source code. there's database field wrong, why? it's same database before? where's fault .. ext_tables.php or still sth. in tca wrong? need tip .. frustrating .. edit: sys_log entry core: exception handler (web): uncaught typo3 exception: #1439288036: item in field form of table tx

xml - Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': -

Image
creating web application using spring , hibernate framework... while running project, getting error. please help. if change in dispatcher-servlet.xml , im getting other errors. **here dispatcher-servlet.xml:** `<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.

Python : word frequency in a file -

i've created simple word count program in python reads text file, counts word frequency , writes result file. problem if want search "windows" , text file contain word "xwindows" count also. import sys import glob import errno files = glob.glob('w.asm') the_count =['windows'] name in files: open(name) f: print "occurences in file -- %s " % name contents = f.read() print contents number in the_count: print "windows occured-", contents.count(number) w.asm file contains windows iwindows qwindows hwindows kwindows windows windows windowsh wwindows windows iwindows qwindows hwindows kwindows output occurences in file -- w.asm windows iwindows qwindows hwindows kwindows windows windows windowsh wwindows windows iwindows qwindows hwindows kwindows windows occured- 14 so actual output want 4 because windows occurred 4 times code giving 14.... so please help

Spring Hello World Web App on Intellij -

Image
this first spring application ever. trying display hello,world in browser. followed steps below, wrong dependencies. using intellij 1.2017 installed zip https://spring.io/guides/gs/maven/#initial copied initial directory file system on intellij: import project choose ../initial/pom.xml next -> selected org.springframework:gs-maven:0.1.0 -> jdk 1.8 -> finish run: works fine here. now want dispaly hello, world! in browser, follwoing steps here: http://projects.spring.io/spring-boot/ added class samplecontroller modified pom.xml follows: <modelversion>4.0.0</modelversion> <groupid>org.springframework</groupid> <artifactid>gs-maven</artifactid> <packaging>jar</packaging> <version>0.1.0</version> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.5.2

Dynamic loop variable in JavaScript with PHP elements -

i'm using jquery plugin called imagemapster create map mysql / php content , values. there 120+ defined areas on map , i'd use loop write code each pop tooltip. although can create loop in javascript , replace plain text i'm not having luck including javascript variables (i) inside php elements. the code i'm trying replace below. i'd every instance of number (1,2 , 3) generated loop. possible mix javascript , php this? <script> $(document).ready(function () { $('#shape1').mapster({ showtooltip: true, tooltipcontainer: '<div class="map_popup"></div>', fill : true, areas: [ { key: "1", tooltip: "controller 1<p> production <?php echo $sumofsup_ac_today_1; ?> kwh<br> energy <?php echo $sumofac_p_1; ?> kw<br>", }, {

android - How can I get Intent in a service? -

i have intent: intent serviceintent = new intent(getapplicationcontext(), servicio.class); serviceintent.putextra(mainactivity.extra_bt_device, btdevice); getapplicationcontext().startservice(serviceintent); but reason, in service code: btdevice = (bluetoothdevice) params.getextras().get(mainactivity.extra_bt_device); // btdevice = getparcelableextra(extra_bt_device) it says intent null, isn't null on activity. you need bind service activity access service methods. using service object can call service method , pass value activity service. write code in activity- servicio mservice; @override protected void onresume() { super.onresume(); intent bindintent = new intent(this, servicio.class); bindservice(bindintent, mserviceconnection, context.bind_auto_create); } @override protected void onpause() { super.onpause(); unbindservice(mserviceconnection); mservice = null; } private serviceconnection mserviceconnection = new serviceconn

javascript - Jquery : Changing the last div's content id without reflecting changes to previous one -

i have 1 div who's id xyz1 , inside has 3 div who's id abc1 , def1 , ghi1 respectfully. when user click on add new button current div xyz1 should cloned , hidden , cloned div appended below xyz1 div . , new cloned div having parent id xyz2 , children div's should have id abc2 , def2 , ghi2 . following code should make more sense . <div id="xyz1" style="display:block"> <div id="abc1" class="abc"></div> <div id="def1" class="def"></div> <div id="ghi1" class="ghi"></div> </div> when user click on add new button div should hide , next div should below . <div id="xyz2" style="display:block"> <div id="abc2" class="abc"></div> <div id="def2" class="def"></div> <div id="ghi2" class="ghi"></di

PHP - Export query to CSV wrong character on date field -

i'm trying create csv file mysql query, have problem dates. need force enclose each fields double quotes, , i'm using function: $fp = fopen($filename, 'w'); $result = mysqli_query($db_conn, $query) or die( mysqli_error( $db_conn ) ); while($row = mysqli_fetch_assoc($result)) { //fputcsv($fp, $row); fputcsv($fp, array_map(function($value) { if ($value == null || $value == "" || !isset($value) || $value === "0000-00-00 00:00:00") { return '""'; } ///remove escaped double quotes within string. $value = str_replace('\\"','"',$value); //then force escape these same double quotes , unescaped ones. $value = str_replace('"','\"',$value); // remove \n $value = str_replace("\n", '', $value); $value = str_replace("\r&qu

optimization - Writing constraint in CPLEX OPL -

i have problem in writing constraint. have 1 mobile phone number, 4 tariff package , 9 months. now, solution giving different tariff each month. write constraint solution gives same tariff each model //data {string} numbers = ...;//mobile phone number, id, 1 number {string} usagecategories = ...;//{"fixed""mobile""international""data"} tuple packageinfo { string name; float price; float fixedminutes; float mobileminutes; float internationalminutes; float data; }; {packageinfo} packages = ...;//tariff package info float usagefixed[numbers] = ...;//fixed min used float usagemobile[numbers] = ...;//mobile other min used float usageinternational[numbers] = ...;//international numbers used float usagedata[numbers] = ...; //data traffic (kb) float taxfree[numbers] = ...; //tax free items float internationalservices[numbers] = ...; //international services float priceperminute[usagecategories] = ...;//

json - Redis Lua Differetiating empty array and object -

i encountered bug in cjson lua when using script in redis 3.2 set particular value in json object. currently, lua in redis not differentiate between empty json array or empty json object. causes serious problems when serialising json objects have arrays within them. eval "local json_str = '{\"items\":[],\"properties\":{}}' return cjson.encode(cjson.decode(json_str))" 0 result: "{\"items\":{},\"properties\":{}}" i found solution https://github.com/mpx/lua-cjson/issues/11 wasn't able implement in redis script. this unsuccessful attempt : eval "function cjson.mark_as_array(t) local mt = getmetatable(t) or {} mt.__is_cjson_array = true return setmetatable(t, mt) end function cjson.is_marked_as_array(t) local mt = getmetatable(t) return mt , mt.__is_cjson_array end local json_str = '{\"items\":[],\"properties\":{}}' return cjson.encode(cjson.decode(json_str)

lets encrypt - GitLab CE (omnibus) - Apache Letsencrypt -

i running gitlab under apache per documentation , instructions. secure letsencrypt, have no idea hot let certbot/letsencrypt access /.well-known needed have issue certificate method. i know can dns, cumbersome can't automated. thx you'll need add couple of additional configuration lines apache. you'll need exclude requests .well-known being intercepted , processed gitlab-workhorse: https://serverfault.com/questions/850175/apache-2-4-gitlab-letsencrypt-not-working

python - "is" operator behaves unexpectedly with integers -

why following behave unexpectedly in python? >>> = 256 >>> b = 256 >>> b true # expected result >>> = 257 >>> b = 257 >>> b false # happened here? why false? >>> 257 257 true # yet literal numbers compare i using python 2.5.2. trying different versions of python, appears python 2.3.3 shows above behaviour between 99 , 100. based on above, can hypothesize python internally implemented such "small" integers stored in different way larger integers , is operator can tell difference. why leaky abstraction? better way of comparing 2 arbitrary objects see whether same when don't know in advance whether numbers or not? take @ this: >>> = 256 >>> b = 256 >>> id(a) 9987148 >>> id(b) 9987148 >>> = 257 >>> b = 257 >>> id(a) 11662816 >>> id(b) 11662828 edit: here's found in python 2 documentation

angularjs - Specifying default extensions in angular2 and ng2-table -

Image
i trying use ng2-table in angular2 project. installed angular2 , ng2-table using npm, when run app 404 errors. but files exist in project! the server looking files no extension, there way specify default extension? app.module.ts import { ngmodule } '@angular/core'; import { browsermodule } '@angular/platform-browser'; import { formsmodule } '@angular/forms'; // <-- ngmodel lives here import {ng2tablemodule} "ng2-table"; import { jobscomponent } './components/jobs/jobs.component'; import { jobstable } './components/jobs/jobs.component'; @ngmodule({ imports: [ browsermodule, formsmodule, // <-- import formsmodule before binding [(ngmodel)] ng2tablemodule ], declarations: [ jobscomponent, jobstable ], bootstrap: [ jobscomponent,jobstable ] }) export class appmodule { } jobs.components.ts import {component, oninit} '@angular/core'; @component({ selector: 'jobs&

.htaccess - 404 not found with assets on https -

Image
i want implement https website. since did redirection, assets stylesheets or images return 404 not found. headers can see in development tools show requests done in http url in https. how can fix please ? here .htaccess (i'm using slim php framework) rewriteengine on rewritecond %{request_filename} !-f rewritecond %{https} off rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] rewritecond %{http_host} ^www.domain.com rewriterule ^ index.php [qsa,l]

multiple domain sharing same ip with my website creates backlinks of my website -

my search console data shows links site have backlink different domains shares same host ip mine. weird thing have link of site on domain similar subdirectory website. example, mywebsitedotcom/bike-type/mountainbike has link otherwebsitedotcom/all-bike/ , otherwebsitedotcom/all-bike/road-bike where /all-bike/ , /all-bike/road-bike same subdirectory of mywebsite.com it looks domain share ip generating page url same subdirectory url. difference domain. worst of page similar page directory url end in page not found , cant find url said found on page.

javascript - HTML Datepicker - Opened by default -

i'm using input of type date. know if there way make datepicker selection panel opened default when user enters in page. the element this: <input class="form-control user-success" id="starting-date" name="date" required="" type="date" value="2017-04-07" data-initialized="true"> you can display embedded in webpage calling on div instead of input, per official documentation .

sql server - Azure data factory copy activity fails. Login failed for user -

we trying copy data on prem sql server azure blob storage through data factory copy activity. installed data management gateway , connect. build copy pipeline copy table azure blob, ran fine week we seeing error since 2 days now copy activity encountered user error @ source side: errorcode=usererrorfailedtoconnecttosqlserver,'type=microsoft.datatransfer.common.shared.hybriddeliveryexception,message=cannot connect sql server: '', database: '', user: ''.,source=microsoft.datatransfer.clientlibrary,''type=system.data.sqlclient.sqlexception,message=login failed user 'chinese char displayed here'.,source=.net sqlclient data provider,sqlerrornumber=18456,class=14,errorcode=-2146232060,state=1,errors=[{class=14,number=18456,state=1,message=login failed user 'chinese char displayed here'.,},],'. client able login sql server same credentials given in data management gateway. checked status of management gateway , fine ,

spring - How to dynamically set @Bean at @Configuration in @Service? -

i use spring cloud & feign client app.and want set param 'accept-language' headers when call feign clients. found similar questions @ [using @headers dynamic values in feign client + spring cloud (brixton rc2) ask] 1 ,but don't know how set header param.here code: set mydefaultfeignconfig @ app.java @enablefeignclients(basepackages = {defaultconfiguration = mydefaultfeignconfig.class) and mydefaultfeignconfig.java : @configuration public class mydefaultfeignconfig { private string requestlanguage = "zh"; @bean requestinterceptor feignrequestinterceptor() { return new requestinterceptor() { @override public void apply(requesttemplate template) { template.header("accept-language", requestlanguage); } }; } //doesn't work public static void updatebean(string requestlanguage) { annotationconfigapplicationcontext applicationcontext = new annotationconfigapplicationcontext(mydefaultfeignco