Posts

Showing posts from February, 2015

.htaccess - Rewrite url with part of it already existing -

i trying rewrite url, should pretty simple can't wrap head around it. my htaccess file @ moment: directoryindex rewriteengine on #indexes uitzetten options -indexes #cross site access toestaan header set access-control-allow-origin "*" header add access-control-allow-headers "origin, x-requested-with, content-type" #website directoryindex index.php rewriterule ^actueel/(.*).html portfolio.php?alias=$1 [l] rewriterule ^info/(.*).html catlisting.php?alias=$1 [l] rewriterule ^nieuws/(.*).html nieuws.php?alias=$1 [l] rewriterule ^(.*).html content.php?alias=$1 [l] i using joomla cms, since updating latest version need type out url end @ correct page (i used able type websiteurl/cms have type websiteurl/cms/administrator) how can rewrite when url ends /cms/ (or /cms) adds /adminitrator @ end? when try following end in infinite loop: rewriterule ^cms cms/administrator [l] the problem ^cms is, mat

Python search mutiple hard drives -

i'm trying write simple script searches local drive c: , 2 external drives e: , f: .docx files , write them log. have search part down right can search 1 hard drive @ time , can not figure out how write results .log or .txt file. here starting code: work no error import fnmatch import os rootpath = 'f:' pattern = "*.docx" root, dirs, files in os.walk(rootpath): filename in fnmatch.filter(files, pattern): print( os.path.join(root, filename)) import fnmatch import os drives = ['c:\\','e:\\','f:\\'] pattern = "*.docx" rootpath in drives: print "now searching in: ",rootpath root, dirs, files in os.walk(rootpath) : filename in fnmatch.filter(files, pattern) : print os.path.join(root, filename) write result in file this: with open("log.txt","wb") fs: result = "whatever result getting" fs.write(result) update: import fnmatch impo

excel - Creating colors with loop -

i create maximum of twelve different colors looping incrementing color values. problem getting shades of same color or bright or dark. using interior.color = xxxxxxx . any idea how achieve nice colors? this'll make nice rainbow :) sub colors() application.screenupdating = false r = 1 c = 1 rv = 50 until rv >= 255 gv = 50 r = 1 until gv >= 255 bv = 50 c = 1 until bv >= 255 cells(r, cc + c).interior.color = rgb(rv, gv, bv) 'print nnumbers color 'cells(r, cc + c).value = rv & ", " & gv & ", " & bv bv = bv + 20 c = c + 1 loop gv = gv + 20 r = r + 1 loop rv = rv + 20 cc = cc + 1 loop until rv <= 0 gv = 50 r = 1 until gv >= 255 bv = 50 c =

javascript - Celery+Django+jQuery -- Report success/failure of celery task in jQuery -

i asked similar question on how detect , report when celery task completed (or has failed). question focused on how using django messages framework, turned out unnecessary purposes. current approach send json httpresponse instead, , render success or failure message based on json received. below code poll state of task: views.py: def poll_state(request): if request.is_ajax(): if 'task_id' in request.post.keys() , request.post['task_id']: task_id = request.post['task_id'] task = asyncresult(task_id) if task.successful(): logger.debug("successful upload") return httpresponse(json.dumps({"message":"upload successful!", "state":"success"}), content_type='application/json') elif task.failed(): logger.debug("error in upload") return httpresponse(json.dumps({"message&

Reproduce Python 2 PyQt4 QImage constructor behavior in Python 3 -

i have written small gui using pyqt4 displays image , gets point coordinates user clicks on. need display 2d numpy array grayscale, creating qimage array, creating qpixmap. in python 2 works fine. when moved python 3, however, can't decide on constructor qimage - gives me following error: typeerror: arguments did not match overloaded call: qimage(): many arguments qimage(qsize, qimage.format): argument 1 has unexpected type 'numpy.ndarray' qimage(int, int, qimage.format): argument 1 has unexpected type 'numpy.ndarray' qimage(str, int, int, qimage.format): argument 1 has unexpected type 'numpy.ndarray' qimage(sip.voidptr, int, int, qimage.format): argument 1 has unexpected type 'numpy.ndarray' qimage(str, int, int, int, qimage.format): argument 1 has unexpected type 'numpy.ndarray' qimage(sip.voidptr, int, int, int, qimage.format): argument 1 has unexpected type 'numpy.ndarray' qimage(list-of-str): argument 1

typescript - How to implement OnInit and OnChanges on same component with type safety -

one of things typescript type safety , use consistently. typescript not support multiple inheritance, how can extend angular 2 component class oninit , onchanges @ same time? i know works without declaring inheritance code without squiggly lines. oninit , onchanges not classes interfaces, components don't inherit implement interfaces. as class can implements many interfaces needs, there no problem implementing both oninit , onchanges interfaces on same component. for example: class foocomponent implements oninit, onchanges { } for more information, have @ angular lifecycle hooks guide .

sockets - C++ SSL connect: message too long -

i'm developing application many clients should connect server application , transmit every minute string 300 bytes. client's gateway between rs232 , socket server. connection between clients , server ssl encrypted openssl. both developed in c++. the transmission running 24/7 it's not critical if data lost. first tried tcp connection, got trouble it, because connection break times. decided connect , disconnect every minute, when send informations (maybe later cache data , send not every minute). because of thought better use udp connection dtls. but have 2 problems udp connection. ca every 10th string has 1 missing character. it's not critical, isn't maybe fault in code ? if use "ssl_ctx_load_verify_locations" verify client, got error: "ssl connect: message long". think should typically messages on 64k? on connect don't send data? how can happen while connecting ? you think udp right protocol me? or should rather use tcp? he

angularjs - Insecure Reponse on https access with ExpressJS/NodeJS -

i keep having recurring issue on custom site built on wamp. i followed instructions on how generate self-signed certificate , private key ssl. use, nodejs/expressjs create https server use web api data on site. employing angularjs display data. now confusing part sometimes, works on google chrome. however, fails on firefox, opera , microsoft edge. on angularjs file have this: testcontrollers.controller('summoner-by-name', ['$scope', '$http', '$resource', function($scope, $http, $resource) { $scope.summonername = {text: 'abc'}; $scope.items = regions; $scope.submit = function () { settimeout(function() { data = {"summonername": $scope.summonername.text, "region": $scope.items.selectedoption.name, "pid": "000"}; $http({ method: 'post', url: 'https://localhost:3030/custom_project', datat

multidimensional array - how to create a new column from php foreach -

Image
i have group of classes on monday , take place in 5 different rooms. i'd present them in columns based on location using divs , sort location, start. data no problem (find classes run on monday) lists in 1 column foreach arrays incorrect. here's $data $calendar = array(); foreach ($data $row) { $calendar[$row[0]][] = $row; } foreach($calendar $key => $row) { foreach($row $field => $value) { $recnew[$field][] = $value; } } here's array exerpt array(1) { [""]=> array(20) { [0]=> array(1) { ["calendars"]=> array(9) { ["id"]=> string(3) "742" ["title"]=> string(4) "yoga" ["start_date"]=> string(10) "2015-09-14" ["end_date"]=> string(10) "0000-00-00" ["start_time"]=> string(8) "20:00:00" ["end_time"]=> string(8) "21

javascript - Affecting only one element with jQuery toggle -

so have got code $('.item').click(function () { if ($(".secondary", this).is(":hidden")) { $(".primary", this).toggle('slide', { direction: 'right' }, 500, function () { $('.secondary', this).toggle('slide', { direction: 'left' }, 500); }); } }); current behavior when click .item, .primary slides right, .secondary doesn't slide in @ all. fiddle: http://jsfiddle.net/zm3zp6ax/ $('.item').click(function () { var $this = $(this); if ($(".secondary", this).is(":hidden")) { $(".primary", $this).toggle('slide', { direction: 'right' }, 500, function () { $('.secondary', $this).toggle('slide', { direction: 'left' }, 500); }); } }); demo

go - Golang Rabbit MQ Fanout Exchange Multiple Consumers -

i publishing messages in fanout exchange java application. able receive message in multiple consumer in java. have 2 consumers in golang app 1 of consumer (alternatively ) receiving message (not both of them published message). func handlemessagefanout1(){ conn := system.eltropyappcontext.rabbitmqconn channel, err := conn.channel() if(err!=nil){ log.println(err) } //forever := make(chan bool) deliveries,err := channel.consume( "example.queue", //queue "qw", true, false, false, false, nil) if(err!=nil){ log.println(err) } go func() { d := range deliveries { log.printf("message recived in fanout 1") log.printf("received message: %s", d.body) } }() //<-forever } //2nd consumer package consumer import ( "github.com/eltropy/shehnai/backend/golang/common-packages/sy

asp.net mvc - Deploying the same site N times -

with our company, sell service our customers, website let customers enter parameters , informations, , then, can query web service previous informations computed. these web sites hosted on our servers. we have on our servers 1 database per client (dbo.client1, dbo.client2...) same schema. and provide different url each client : expl : www.client1.service.com www.client1.ws.com/compute www.client2.service.com www.client2.ws.com/compute but i'm wondering how deploy web services , web site? do have deploy 1 web service , 1 website per client (with different web config)? , maybe create multiple deployment scripts ? or possible imagine 1 instance of each (web service , web site), listening on several addresses, , creating different connection string according entry point of request (is possible mvc or wcf ?) any other idea ? i don't know best practice here. thank you. if read question 1 day, solve problem using multi-tenant solution, allow me dep

babeljs - Is there a way to use loose modules when using es2015 preset in babel 6? -

tried use following babelrcs: { "presets": [ ["es2015", { "transform-es2015-modules-commonjs": { "loose": true } }] ] } fails "invalid options type foreign" { "presets": ["es2015"], "plugins": [ ["transform-es2015-modules-commonjs", { "loose": true }] ] } ignores "loose" option { "plugins": [ ["transform-es2015-modules-commonjs", { "loose": true }] ] } does not use preset i ended creating preset es2015-mod same purpose - exact copy of babel's es2015 loose modules enabled.

android - Get All views higher in z index than given View? -

i have find out views higher in z-index ( overlapping ) given view public list<view> getviewshigherinzindex(view givenview) { //return views higher in z index givenview } one of approach thought involves finding parent view of given view , recursively finding elements. though have view elements, how can determine z-index of child views. how can compare them find out if overlapping. can rectangle bounds , see if intersecting doesn't give z-order. you use recursive dfs walk view hierarchy viewgroup.getchildat() , use view.getz() compare z values.

c# - Calculating time difference on datetime object in Entity Framework giving error -

this question has answer here: linq entities not recognize method 'system.timespan subtract(system.datetime)' method 4 answers i trying calculate time difference between 2 date , want day name of date. for ex.: 4/7/2016 day: monday here class: public class attendance { public int id { get; set; } public nullable<system.datetime> startdatetime { get; set; } public nullable<system.datetime> enddatetime { get; set; } } when trying this: var query = (from t in context.attendance select new { timediff=t.enddatetime.value.subtract(t.startdatetime.value).totalhours, day=system.startdatetime.tostring("dddd"); }).tolist(); error linq entities not recognize method 'system.timespan subtract(system.datetime)' method, , metho

angularjs - Angulary and Django REST -

how can filtred queryset? simply example: .controller('tviewcontroller', ["$scope", "$stateparams", "ad", "banner", function($scope, $stateparams, ad, banner) { $scope.ad = ad.get({ ad_id: $stateparams.ad_id }); $scope.banners = banner.query(); }]) and class cbanner(models.model): image = models.imagefield(upload_to="img") ad = models.foreignkey(cads, null=true, blank=true) class cads(models.model): name = models.charfield(max_length=80, null=true, blank=true) they both have viewset, serializer , routing register class adsviewer(viewsets.modelviewset): queryset = cads.objects.all() serializer_class = adsserializer etc... how can filtered this: $scope.banners = banner.query(); banners ad(foreignkey) = ad_id ? you need add query parameter url, such as: http://example.com/api/ads/?ad_fk=5 in adsviewer : def get_queryset(self): """ view should retu

android - onEnterAnimationComplete() is not called after an Activity Transaction -

i have 2 activities single shared object, imageview . both activities subclasses of appcompatactivity , share same theme: <style name="apptheme" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="coloraccent">@color/coloraccent</item> <item name="android:windowactionbar">false</item> <item name="android:windowcontenttransitions">true</item> <item name="android:windowtranslucentstatus">false</item> <item name="android:windowexittransition">@transition/transition_slide</item> <item name="android:windowentertransition">@transition/transition_slide</item> <!-- specify shared element transi

scanf error in C++ - program doesn't respond -

okay weird. when remove int count = 1 , count++; code, program gives no error. if remove scanf , not remove count++; program gives no error count++; . have nothing each other why happening? #include <stdio.h> #include <string> #include <stdlib.h> #include <math.h> int is_prime(int num) { int isprime = 0; (int = 2; <= sqrt(num); += 2) { if (i % 2 == 0) i++; if ((int(num) % i) == 0) { return isprime = 1; break; } } return isprime; } int main(int argc, char **argv) { int = 0; char *buffer; printf("enter sentence:\n"); scanf("%[^\n]", buffer); char array[1000] = " "; char temp[2] = " "; int count = 1; (int = 0; < 100; i++) { array[i] = buffer[i]; = array[i]; int primefind = is_prime(a); if (a % 2 == 0) { printf("%c", a); // nothing

php - Add space between each word in multi-colored text image -

i trying produce multi-colored text image imagemagick , php. following code works, cannot insert space after each word. have tried various settings, nothing working. should use annotate or draw text command instead of label? label seems simple use here. $file = 'font.ttf'; $command = "convert -background white -fill black -font $file -pointsize 80 -density 90 label:new -fill black -font $file -pointsize 80 -density 90 label:here -fill red -font $file -pointsize 80 -density 90 label:? +append $multi-color-text.png"; exec($command); update: solution remarks: spaces not work in command line. so, need escape double quotes forward slash. this has worked: $command = "convert -background white -fill black -font $file -pointsize 80 -density 90 label:\"new \" -fill black -font $file -pointsize 80 -density 90 label:\"here \" -fill red -font $file -pointsize 80 -density 90 label:? +append $multi-color-text.png"; thank all, fred

php - Running PHPUnit on composer projects -

i working on lib composer/packagist. while working on php classes,i parallely writing tests method, check if works well. file tree: ├── composer.json ├── composer.lock ├── readme.md ├── src │   └── resizer.php ├── tests │   └── resizertests.php └── vendor └── phpunit etc... composer.json: { "name": "eschmid1972/image-resizer", "description": "library resizing images custom options", "keywords": [ "php", "image", "imagemagick", "resize" ], "license": "bsd-3" ], "require": {}, "require-dev": { "phpunit/phpunit": "~4.0" } } what need do, can run tests command phpunit in project root? i've found solution: need create phpunit.xml file in project root or directory want execute phpunit . the documentation configuration hosted at: ht

java - Check SD Card after Saving Image (Android) -

i have intent when complete, saves image /sdcard/aperture. while image save, not show image saved. problem? tried using scan broadcast in on activity result causes crash, , not scan image. @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if (requestcode == settings_request && resultcode == activity.result_ok) { mediafragment content = (mediafragment) getfragmentmanager().findfragmentbyid(com.marlonjones.aperture.r.id.content_frame); if (content != null) content.reload(); reloadnavdraweralbums(); } if (requestcode == new_picture) { // return file upload if (resultcode == activity.result_ok) { uri uri = null; if (data != null) { uri = data.getdata(); } if (uri == null && mcamerafilename != null) { uri = uri.fromfile(new file(mcamerafilena

matlab - Find pixel coordinates from real world using a Kinect -

i trying basic level robotics computer vision, , have run problem going real world coordinates pixels in order read kinect's depth map. doing because able draw on hand of non constant depth, located @ given x , y location in millimeters. the problem i'm having distance of object camera needs known in order convert between real world , pixels. how either find depth @ location, or convert depth map metric coordinates instead of pixels?

ruby - How to send notifications according to time zone in rails? -

i trying send push notifications rails applications scheduled every 7th day @ 10am cronjob using whenever gem. problem have users different time zones. us,eu,aus,ind etc. if trigger utc time 10 users might notifications @ midnight, that's awful thing disturb someone's sleep. what can schedule every timezoneuser receive notification @ 10am of timezone. i saving timezone every user. user_id time_zone 153 +10:00 155 +05:30 i schedule job run every hour desired day of week, check users have time 10am , send them. way run job 24 times in 1 day of week covering whole world timezones. every '0 * * * 1' # send notification users @ 10am end in above example, 0 * * * 1 corresponding. (at minute 0) (every hour) (every day) (every month) (first day of week -monday-) if want send notification on sunday example number should 7 , tuesday 2 , on.

how do I import json generated by javascript into Mongodb -

i need rid of newline character separates objects in json file can import mongodb without having objects in array. use in javascript this? need data in format can import: { name: "widget 1", desc: "this widget 1" } { name: "widget 2", desc: "this widget 2" } the answer is, dont have convert file array, mongoimport expects "json-line" format have. this format performance, because don't have load @ once, instead mongo take line line. imagine billion lines, if convert array, cost memory... this way linear time operation, lines gets streamed db. look here: http://zaiste.net/2012/08/importing_json_into_mongodb/ however, if think need conversion, this: fs.readfile('my.json', function(e, text) { var arraylikestring = "[" + text.split('\n').join(',') + "]"; var array = json.parse(arraylikestring); }) to import array of objects use command: mongoimport -

c++ object link order visual studios -

im having problem visual studios 2013. building large c++ project many classes. problem several of classes static or have static objects of predefined values. problem of these classes rely on static versions of other objects. yet upon debugging can see 1 of these static objects being initialized static object has yet initialized. there way define order objects initialized? can see searching cant specify linking order , if doesnt determine static object initialization order. would separating objects out static libraries help? or there easy way tell order static objects should initialized? or need find way initialize them in correct order?

Index into arbitrary nested Dictionary/List structure in C# -

i have structure dictionary<string,object> , values either strings, nested dictionary<string,object> or lists of these nested dictionaries. structure temp area build converted json. if want make assertions on contents of structure, though, can't like foo["bar"][0]["baz"][1][2]["quux"] without ridiculous type casting, , because structure not recursive, solution ( recursive generic types ) doesn't work. what best option here? should @ dynamic ? should replace dictionary instances anonymous objects? should looked @ expandoobject ? etc. since converting json anyway use json.net lets foo["bar"][0]["baz"][1][2]["quux"] out of box , has other nice features turning object in formatted json string once ready turn in that.

ruby on rails - Adding minitests/reporters to test_helper.rb - error message -

so bit beyond knowledge. added minitests/reporters test_helper.rb doing following : i installed minitest reporters gem : gem install minitest-reporters , added require in test_helper.rb : require "minitest/reporters" minitest::reporters. when run tests, here : should reinstall gems? running via spring preloader in process 15917 /home/ubuntu/workspace/sample_app/db/schema.rb doesn't exist yet. run `rails db:migrate` create it, try again. if not intend use database, should instead alter /home/ubuntu/workspace/sample_app/config/application.rb limit frameworks loaded. /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.rc2/lib/active_support/dependencies.rb:293:in `require': cannot load such file -- minitest/reporters (loaderror) /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.rc2/lib/active_support/dependencies.rb:293:in `block in require' /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-5.0.0.rc2/lib/active_support/dependen

documentation - How to publish Sphinx generated HTML on Google Sites -

i'm looking use sphinx document few python modules. i'm wondering if there convenient way host resulting site multiple html files on google sites? if not, best way host python module documentation on google sites? i need use google sites host documentation available solution company.

linux - DKIM : Signature header exists but is not valid -

i have configured postfix spf , dkim emails marked spam. here domain.db (i use bind9) : ... mail._domainkey in txt ( "v=dkim1; k=rsa; p=abcd" ) i verify : host -t txt mail._domainkey.domain.com i receive (ok) : mail._domainkey.domain.com descriptive text "v=dkim1\; k=rsa\; " "p=abcd" i've checked problem on email-tester.com , , 10/10, dkim seems correctly installed. but when check content of email, see : ... dkim:pass dkim:pass spf:pass ... x-spam-report: * -0.0 no_relays informational: message not relayed via smtp * -0.0 no_received informational: message has no received headers * 0.0 t_dkim_invalid dkim-signature header exists not valid x-spam-status: no, score=0.0 required=5.0 tests=no_received,no_relays, t_dkim_invalid autolearn=ham autolearn_force=no version=3.4.0 any idea ? ----- update ------- after adding in master.cf : -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_mil

innerhtml - javascript-var value displaying NaN randomly? -

i running strange issue. building online store, , have displayed products so: var products = { 'box1':{ 'price' : 10, 'quantity' : 10 }, 'box2':{ 'price': 15, 'quantity' : 10 }, 'clothes1':{ 'price': 20, 'quantity' : 10 }, 'clothes2':{ 'price': 30, 'quantity' : 10 }, 'jeans':{ 'price': 50, 'quantity' : 10 }, 'keyboard':{ 'price': 20, 'quantity' : 10 }, 'keyboardcombo':{ 'price': 40, 'quantity' : 10 }, 'box2':{ 'mice': 20, 'quantity' : 10 }, 'pc1':{ 'price': 350, 'quantity' : 10 }, 'pc2':{ 'price': 400, 'quantity' : 10 }, 'pc3':{ 'price': 300, 'quantity' : 10 }, 'tent':{ 'price': 100, 'quantity' : 10 },

How can I run Tensorflow on one single core? -

i'm using tensorflow on cluster , want tell tensorflow run on 1 single core (even though there more available). does know if possible? to run tensorflow on 1 single cpu thread, use: session_conf = tf.configproto( intra_op_parallelism_threads=1, inter_op_parallelism_threads=1) sess = tf.session(config=session_conf) device_count limits number of cpus being used, not number of cores or threads. tensorflow/tensorflow/core/protobuf/config.proto says: message configproto { // map device type name (e.g., "cpu" or "gpu" ) maximum // number of devices of type use. if particular device // type not found in map, system picks appropriate // number. map<string, int32> device_count = 1; on linux can run sudo dmidecode -t 4 | egrep -i "designation|intel|core|thread" see how many cpus/cores/threads have, e.g. following has 2 cpus, each of them has 8 cores, each of them has 2 threads, gives total of 2*8*2=32 th

Understanding HHH90000016 error in Hibernate -

i better understand, , possibly fix, following warning: 2016-07-04 17:04:33,151 warn [ajp-nio-8009-exec-3] org.hibernate.orm.deprecation - tocolumns - hhh90000016: found use of deprecated 'collection property' syntax in hql/jpql query [null.elements]; use collection function syntax instead [elements(null)]. it seems query contains expression ? in associatedusers.elements associatedusers set<string> . have used such expression in past changed them new syntax using filter helper facility. however debugging showed me real expression is ((enabled = ?) , (organizationid = ?) , ? in elements(associatedusers)) why error logged if use suggested syntax? hibernate version 5.1.0

ASP.NET 5 Website (Razor) -

i'm building angular app powered web api in vs2015 , asp.net 5. in previous version of asp.net possible serve cshtml pages in lieu of html pages, without having construct mvc controllers , routes. example if created asp.net web pages (razor) project. basically go localhost/index.cshtml , assuming had had @datetime.now.tostring() on page return white page date on it. i want serve client markup via cshtml opposed html static filed because i'd leverage of convenient server-side stuff taghelpers. is possible of beta8 asp.net 5? it possible translate every page string. used email templates. can setup own route generic controller or create own middleware . with code van generate view string renderviewtostring(@"/views/email/activateemail", new activateemail() { emailaddress = user.email, callback = callbackurl }) public async task<string> renderviewtostring<tmodel>(string view, tmodel model) { var viewengineresult = _com

Weblogic upgrade to 12c: deployment fails because url mapped to multiple servlet -

i've setup new weblogic 12c environment. on deploying application know works in weblogic 11g error "the url-pattern /resources/* in web application mapped multiple servlets." the mapping it's referring in web.xml inside application.ear that's being deployed, it's mapped once: <servlet-mapping> <servlet-name>velocity</servlet-name> <url-pattern>/resources/*</url-pattern> </servlet-mapping> the project doesn't contain other references url pattern /resources/*, can explain duplicated mapping coming , how can work around it? the closest issue find this: https://bugster.forgerock.org/jira/si/jira.issueviews:issue-html/openam-7947/openam-7947.html , has been marked unreproducible. full stack trace deployment: <error> <deployer> <bea-149205> <failed initialize application "<application_name>" due error weblogic.application.moduleexception: weblogic.management.dep

public - Is it possible to get a unique id of nearby Bluetooth devices? -

i looked around , read mac addresses on bluetooth devices. accessible device owner? can accessed nearby devices? is possible list of nearby bluetooth devices (specifically smart phones) unique id without pairing? thanks! getting list of nearby bluetooth devices called discovery process (for bt "smart ready" devices). if talking bt "smart" devices - can listen on fixed advertising channels. none of methods above guarantee devices around - since these nearby devices can in state not respond discovery request or don't advertise.

javascript - Multiple variables using $watchGroup -

my watchgroup isnt working, gives me undefined, doing wrong in code? $scope.$watchgroup([vm.footer.nrrows, vm.issaved], function(current, original) { console.log("nr rows "+current[0]); console.log("is saved? "+current[1]); }); change code this: $scope.$watchgroup(["vm.footer.nrrows", "vm.issaved"], function() { ... }, true); if variable $scope.something should put in $watch "something"

excel - How to use same cell formula value as input for the same formula? -

i need solve this: on excel cell a3 use custom vba formula =smoothticker(a1,a2) function must use it's a3 cell output input value function smoothticker(ticker integer, increment integer) if (ticker > smoothticker , ticker - smoothticker > increment) smoothticker = ticker else smoothticker = smoothticker end if end function in case can't use smoothticker variable input value please help! thank you does want? private smoothtickervalue integer function smoothticker(ticker integer, increment integer) if (ticker > smoothtickervalue , ticker - smoothtickervalue > increment) smoothtickervalue = ticker end if smoothticker = smoothtickervalue end function the problem doing kind of thing excel doesn't calculate contiguous cells in order , doesn't recalculate cells unless inputs change - kind of calculation may not work expected.

How do make it detect input? in python -

i tried set shop system this: def command(): command = input("press \"c\" continue , earn $1 or \"s\" go shop! -->") def display_shop(): print ("buy stuff @ shop like:") print ("") print ("double money - gives $2 instead of $1") item = input("which item want?") if item == ("double money"): doublemoney = true print("added (double money)") work1() def work1(): chop = input('type \"c\" earn $1 -->') global win if chop == ('c') , win == false: global gold global command time.sleep(1) print ('$1 earned') if doublemoney == true: gold = gold+2 if doublemoney == false: gold = gold+1 displaymoney() chop = 0 command() if gold == 100: win = true work1() my problem is, each time run it, , see question: "press \"c\" continue , earn $1 or \"s\&

android - How to drop third party jars from obfuscated jar using proguard, gradle -

i'm using -libraryjar dependency obfuscate android library jar this: -injars build/libs/mylib.jar -outjars build/libs/mylib-proguarded.jar -libraryjars build/intermediates/classes/release/libs/gson-2.3.1.jar this bundles gson library final obfuscated library jar. issue: android app that's supposed using obfuscated library jar, has own inclusion of gson, , conflict having 2 copies of gson jars. how can exclude gson jar library obfuscated jar. my rest of proguard config this: -dontpreverify -dontwarn android.annotation.suppresslint -keepparameternames -renamesourcefileattribute sourcefile -keepattributes *annotation*,exceptions,innerclasses,signature,deprecated,sourcefile,linenumbertable,*annotation*,enclosingmethod -keep class sun.misc.unsafe { *; } -keep public class * { public protected *; } -keepclassmembernames class * { java.lang.class class$(java.lang.string); java.lang.class class$(java.lang.string, boolean); } -keepclasseswithmembe

javascript - angularjs and spring app not running from war file -

i have been developing app uses angularjs , spring mvc. app runs in eclipse when run as...run on server , view in web browser @ localhost : 8080 / appname . but have used eclipse maven pugin build war file , deploy war remote server. when type in domain name on remote server, text main index page, without of javascript, or css. since links javascript, , index page relies on client-side includes, can access in browser remote server small amount of unformatted text no links. is there step creating executable war angularjs not aware of? methods used create war , install on server have worked many times spring-only apps running on same server, , developed in same eclipse installation on same devbox. how can start diagnose problem? new angularjs. how render angular files? use jsp + angular? if using static files serve angular html static file serving working.this means wrong going javascript , css files mapping (wrong urls) otherwise if render jsp + angular may

security - Where are JWT tokens stored on the server and other related questions -

as title suggests, jwt tokens stored on server side? in database or in memeory? understand implementation can vary due different requirements, in general store it? if want provide basic token authentication server, meaning upon receiving username , password via post request, return token. in case, how token generated basic algorithm work differently jwt token? with token generated simple algorithm: it not contain payload its value not computed based on username , password, cannot rehashed meaningful in case, there still value use jwt? thanks!

php - Unwanted lines in TCPDF class with custom header and footer -

Image
i'm using tcpdf generate pdf reports. need custom headers , footers, extended original class overwrite header , footer methods suggested in official documentation ( https://tcpdf.org/examples/example_002.phps ). here code: class apppdf extends \tcpdf { const logo_path = '/../../../public_html/public/images/logo-big.png'; private $xlogo; private $ylogo; private $wlogo; public function __construct($orientation='p', $unit='mm', $format='a4', $unicode=true, $encoding='utf-8', $diskcache=false, $pdfa=false, $xlogo = 8, $ylogo = 0, $wlogo = 50) { parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa); $this->xlogo = $xlogo; $this->ylogo = $ylogo; $this->wlogo = $wlogo; } public function header() { $this->image(__dir__ . self::logo_path, $this->xlogo, $this->ylogo, $this->wlogo); } public function foote

Swift: Present UIAlertController in closure -

Image
we trying present uialertcontroller within closure error "implicit use of self in closure, use self. make capture semantics specific". correct syntax here? you need refer "self" explicitly when talking object's instance variables inside block. self.showviewcontroller(...)

cloudera - Kafka parcel not installed well -

i using cloudera cluster (5.5.1-1.cdh5.5.1) , installed kafka parcel (2.0.1-1.2.0.1.p0.5) . when tried add kafka service on cluster, had following error on every host tried add role on : error found before invoking supervisord: user [kafka] not exist. created user manually on every node needed, restarted service, , seemed work until tried modify kafka config cloudera manager. cloudera's kafka configuration isn't "binded" real kafka configuration. the error when try modify broker.id : fatal error during kafkaserverstartable startup. prepare shutdown kafka.common.inconsistentbrokeridexception: configured broker.id 101 doesn't match stored broker.id 145 in meta.properties. if moved data, make sure configured broker.id matches. if intend create new broker, should remove data in data directories (log.dirs).`