Posts

Showing posts from August, 2014

reactjs - use react to change css when selectors are typed out -

i'm trying create page similar this: samuel reed , css changing when selectors typed out. i've created onclick functions works want them i'm not sure how make them work without links. if point me in right direction, appreciated! this code, i'm using reactjs var colorchanger = react.createclass({ getinitialstate: function() { return { color: '#f00', backgroundcolor: '#fff' }; }, changecolor: function() { this.setstate({ color: '#00f' }); }, changebgcolor: function() { this.setstate({ backgroundcolor: '#000' }); }, changepadding: function() { this.setstate({ padding: '10px' }); }, changewidth: function() { this.setstate({ width: '400px' }); }, changemargin: function() { this.setstate({ margin: '0 auto' }); }, render: function(){ var style = { color: this.state.color, backgroundc...

java - How do I implement RMI using the computers connected in the same network? -

i tried implementing rmi concept using 2 computers connected in company network. binded remote object using ip address , specific port number. worked fine when tried in local machine. now in order access other computer shared adder (extends remote ) interface .class file other computer , client code. when tried access it throwed classnotfoundexception: stub not found . so shared stub.class file generated after running command >> rmic addimpl . after worked fine on remote computer also. now question is, how rmi implemented ? need share both adder interface , stub class file generated in order client access our remote method ? below classes , interfaces: interface adder extends remote class addimpl extends unicastremoteobject implements adder class server class client you need share 3 files adder.class, adder.java, adderremote_stub.class (not java code) let assume have compiled already create 2 different directories launch 3 command prompt set first...

SharePoint workflow task not created -

i have custom workflow starts approval workflow whenever list item created. on our test server, work fine. however, when deployed on server, task of approval workflow not being created. ideas why? whether have activated feature view workflow or not? if yes check workflow setting whether referring same task list or not.

Drupal Webform : set SCORE on each SELECT Options? -

i have webforms on drupal multiple select options (radio). , in select, want option 1 : gives 2 points, option 2 : give 1 point, etc... after display on webpage : score 12/20 points . example : bear can ... ? 0|white <- response give 2 points 1|yellow <- response give 0 point 2|brown <- response give 2 points 3|dark <- response give 1 points the question : how store point of select options because there key|value in admin interface? in fact : how add infos each select option row? the way associate key points. 0 corresponds 2 points, 1 0 point, 2 2 points , 3 1 point. on submission @ user responses , calculate based on responses particular question. thus under form settings set redirection location page process logic , redirect there or show output on same page.

c - Better to pass struct, or pointer to struct? -

i have data struct, read in function. i want smallest memory, code size, , speed footprint possible. i'm working on avr. typedef struct { uint16_t clu; uint16_t num; uint32_t cur_rel; } fsavepos; now, function stores file position struct: // approach 1 fsavepos save_pos(const ffile* file); // return value // approach 2 void save_pos(const ffile* file, fsavepos* pos); // modify reference and function reverses (ffile object modified): // approach 1 void restore_pos(ffile* file, const fsavepos pos); // pass value // approach 2 void restore_pos(ffile* file, const fsavepos* pos); // pass reference what advise best idea? if trying minimise memory footprint, struct type larger pointer better passed using pointer. data smaller better passed value. if pointer , data same size, doesn't matter much. assuming on avr32, pointer 32-bit , struct 64-bit (plus padding). that suggest better passing pointer/reference. however, struct not partic...

html - CSS border-bottom getting space between elements -

i working on sidebar, have 'a' elements inside 'li's, applying css code on them, , giving them border. when apply border-bottom on 'a' elements, space between elements effected. how can remove space between them? thanks. sidebar image link: http://imgur.com/gntsanx code [html] : <div id="container"> <div class="sidebar"> <ul id="nav"> <li><a href="#" class="selected">dashboard</li> <li><a href="#">booter hub</li> <li><a href="#">stresser</li> <li><a href="#">friends</li> <li><a href="#">search</li> <li><a href="#">purchase</li> </ul> </div> <div class="content">...

c# - Get type programmatically and use it as a typeparam -

what want read in lex.db database. preferably paged pages of pre-defined size. have done following: dbinstance database = getdatabase(); var tables = database.alltables(); foreach (var table in tables) { string str = table.tostring(); str = str.replace("lex.db.dbtable`1[", string.empty); str = str.replace("]", string.empty); type t = type.gettype(str); if (t != null) { var columns = database.readall<t>(); //handle columns } } the problem function readall has typeparam. assumed use type typeparam, since represents class want results of. however error: "the type or namespace name 't' not found (are missing using directive or assembly reference?)". so how can make actual type used typeparam instead of letter 't'? i'm creating windows universal app windows 8.1 , windows phone 8.1 edit: based on suggestions romkyns , stefan steinegger gave tried using reflection. have fol...

Typescript npm install not working -

when run sudo npm install -g typescript thing gets installed test3 . get: $ sudo npm install -g typescript password: test3@1.0.0 /usr/local/lib/node_modules/test3 $ tsc -bash: tsc: command not found the typescript compiler never installed. reinstalled node/npm see if install issue, didn't seem fix it. ideas?

python - Django admin removes selected choice in ModelChoiceField on edit? -

i'm using admin.tabularinline in admin code i've made custom form. class ratecardform(forms.modelform): category = forms.modelchoicefield(queryset=models.category.objects.all(), label='category') class meta: model = models.ratecard fields = ('category') class ratecardinline(admin.tabularinline): model = models.ratecard form = ratecardform = 3 the problem after i've saved model instance, whenever edit model instance, remove pre-selected choice , i'll have select choice again. ideas how stop it? also modelchoicefield if don't specify label, come none on admin page, don't need specify admin.stackedinline . to preselect selected category instance can set primary key field's initial value overriding __init__() on modelform : class ratecardform(forms.modelform): category = forms.modelchoicefield(queryset=models.category.objects.all(), label='category') class meta: ...

javascript - Pass a function that returns the value of the ko.computed Error when using ko.toJSON -

i trying serialize viewmodel json send server , receiving following error. uncaught error: pass function returns value of ko.computed the error happens on var data = ko.tojson(self, mapping); line , mapping failed attempt not try , convert 'save' function json. doing wrong? updated include jsfiddle var model = { "licenseid": "0e73d791-3ce4-e411-88ba-534e57038000", "username": "#my user", "userid": "muuserid", "macaddress": "4c-0b-bh-23-4v-bc", "computername": "my user description", "companyid": "314083b3-223c-415f-910f-dh7c13j45206", "timelog": false, "reject": false, "companies": [{ "companyid": "7d5b63b3-b0f6-47de-b620-b611ede2c277", "name": "company 1", "abbreviation": "com1" }, { "companyid":...

javascript - How can I use PhantomJS to convert a DIV to a PDF? -

i have been reading other answers here suggest phantomjs best library use convert html pdf while preserving css etc. in pdf, many other libraries have issues doing. i looked @ website couldn't see method convert specific div pdf. for example between <div id="pdfcontent"> , </div> needs converted pdf. can provide simple example?

grouping - How can segregate data groups using apache PIG -

i have data in csv format columns "movie name", price output should under 5 : 5200 5-10 : 500 10-15 : 5140 and on i tried below code a = load '/root/pig-0.13.0/scripts/dvd_data/dvd_csv.txt' using pigstorage(','); b = foeach generate replace($0, '\\"', ''),$2,$6 i unable identify logic desired output.i looking it. if use case count of movies under fixed set of price buckets (lt5, gt5 lt10, gt10 lt15) etc.. can make use of bincond operator. pig script : a = load 'a.csv' using pigstorage(',') (movie_name:chararray,price:long); b = foreach generate ((price < 5) ? '5' : ((price < 10) ? '5-10' : ((price < 15) ? '10-15' : '>15'))) key, price; c = group b key; d = foreach c generate group, count(b); dump d; sample input : a.csv : movie1,1 movie2,2 movie3,3 movie4,4 movie5,5 movie7,7 movie9,9 movie10,10 movie11,11 movie12,12 output : d...

ios - CTTelephony to detect connection type? -

i trying find out connection type of device. have implemented reachability detects if user on wifi, offline, mobile data.. trying find out how detect in more detail e.g. 3g, 4g. the below answer says cttelephony doesn't show how implement it. project doesn't #import framework linked up. detect carrier connection type (3g / edge / gprs) anyone had problem?

android - Is it possible to create an app that when installed the user can easily turn Bluetooth/NFC ON and OFF by double clicking the Home button? -

i'm looking create shortcut bluetooth or nfc on android+ios, preferably "double clicking home button." possible? if not possible there other shortcuts? maybe double tapping mobile screen? thanks reading. on ios, of 10 june 2015, not possible on non-jailbroken devices, there no public api expose button actions developer.

php - Bootstrap DropDown Autoselect -

i'm using bootstrap dropdown enhancement, there way can pre-select 1 of dropdown options based on value pulled database? i've tried following works normal radio buttons isn't working this. i'm guessing because it's bootstrap it'll need sort of .active or .selected adding in somewhere. <!-- email --> <div class="form-group"> <label for="pri_email" class="col-sm-3 control-label">primary email</label> <div class="col-sm-9"> <div class="input-group"> <input type="email" class="form-control" id="pri_email" placeholder="email" name="pri_email" value="<?php echo $row_showcontact[0]['pri_email'];?>"> <div class="btn-group input-group-btn"> <button data-toggle="dropdown...

Easiest way to get Class UML from java(android) files or project w/o eclipse. Reverse engineer -

this question has answer here: generate uml class diagram java project [closed] 4 answers how class uml diagram android project (android studio) or java files, w/o using eclipse? maybe there guides or tuttorials how it? i guess have find tool able to: reverse code in order obtain uml models (without diagram) create diagrams i not know tool doing in unique step of them can automatically generate class diagram models. stackoverflow not best place tool discussion let me know if not find any.

r - RODBC on an Oracle Database and special characters -

sorry if ask question has been ask, found similar questions (like special characters , rodbc example) in forum no answer me... so, problem when make query on oracle database, via rodboc in r, can't see correctly special characters in return. r automatically convert (when can) special characters normal characters here simple test made : > cnx <- odbcconnect(dsn="mydsn", uid="mylogin",pwd="mypassword") > sqlquery(cnx, paste("select 'eéèêëÄÊÍÕØ' col dual")) col 1 eeeeeaei?? i'm under win7 x64, "mydsn" odbc connection uses "oracle in oraclient12home1" (64 bits). use "r x64 3.2.0" rodbc package version 1.3-11. database on linux server, nls_characterset "we8mswin1252" i've made other tests understand better : same test odbc connection uses "oracle in oraclient12home1_32bit" "r i386 3.2.0" => same problem same test odbc connection on l...

javascript - Google Map API: Why we need to set title for Marker object? -

it make sense me setting title markers in google map api. not show or anything. for? from https://developers.google.com/maps/documentation/javascript/markers : the marker's title appear tooltip. if not wish pass marker options in marker's constructor, instead pass empty object {} in last argument of constructor.

html - How can I overlay a banner/status line on every web page in a test environment -

Image
i have "testing" environment setup , cloned our production servers. i'm trying figure out simple way visually indicate proxied test environment , not production (and vice versa). started modifying our company logos in "test" overlaying them with, well, word "test" there lot of logos.. besides, anytime clone production testing refresh things, logos need moved back. it's greasy way of doing things. anyone know of way configure apache inject or overlay 1 line status @ top or bottom of browser? ideally, unaffected ajax, javascript or css code running in application. my company including stylesheet puts image banner accross top says "development mode" here's css use ( development.css ) @charset "utf-8"; body{ background-image:url('/images/intra/development.png'); background-position:top center; background-repeat:repeat-x; margin-top:26px !important; } screenshot:

google apps script - Copy emails with a specific Gmail label to Spreadsheet, without duplicates -

i trying make script takes email within label , puts google sheets. i'm using function @ moment: function getmessageswithlabel() { var destarray = new array(); var threads = gmailapp.getuserlabelbyname('facebook').getthreads(0,10); for(var n in threads){ var msg = threads[n].getmessages(); var destarrayrow = new array(); destarrayrow.push('thread has '+threads[n].getmessagecount()+' messages'); for(var m in msg){ destarrayrow.push(msg[m].getsubject()); } destarray.push(destarrayrow); } logger.log(destarray); var ss = spreadsheetapp.getactivespreadsheet(); var sh = ss.getactivesheet(); if(ss.getlastrow()==0){sh.getrange(1,1).setvalue('getmessageswithlabel() results')}; sh.getrange(ss.getlastrow()+1,1,destarray.length,destarray[0].length).setvalues(destarray) } this works @ grabbing emails in 'facebook' label grabs emails every time, creating du...

database - MySQL error: The maximum column size is 767 bytes -

when run program mysql, got error message: 2015-06-10 15:41:12,250 error app.wsutils 419 incron: error: ('hy000', '[hy000] [mysql][odbc 5.2(w) driver][mysqld-5.7.7-rc-log]index column size large. maximum column size 767 bytes. (1709) (sqlexecdirectw)') i googled little bit, , found error might relating innodb_large_prefix option. however, using mysql 5.7.7 rc, has set innodb_large_prefix "on" (checked in mysql workbench), allowing 3072 bytes. not sure if problem innodb_large_prefix or not. anyway, have idea how fix problem? your column trying index large , settings must not correct innodb_large_prefix . there couple prerequisites parameters have set in order innodb_large_prefix work correctly. you can check make sure innodb_large_prefix set running: show global variables 'innodb_lar%'; here couple prerequisites using innodb_large_prefix: you need set global variable innodb_file_format= barracuda to check set...

json - Trouble outputting Float value using Jackson library for Java -

when using jackson convert pojo string finding float values being truncated 5852402.63111111 becoming 5852402.6 when print out string. of values come e7 or number after them when cannot put value 8 digits. there must done printer or mapper set not truncate values. have been looking through documentation , have had no luck figuring 1 out. thanks! currently method converting string is: objectmapper mapper = new objectmapper(); mapper.enable(serializationfeature.indent_output); defaultprettyprinter printer = new defaultprettyprinter(); mapper.writer(printer).writevalueasstring(myobject);

AngularJS : Service for data between controllers -

i have page main controller , nested controller showing details product. want use a service in angular call server, retrieve data object , hold data object. main controller call service fetch data , details controller needs know updated , access data. service looks this: .service("productservice", function ($http, $q) { var product = {}; //interface returned return ({ fetchproduct: fetchproduct, clearproduct: clearproduct, product: product }); function fetchproduct(id) { var request = $http({ method: "get", url: "/online/productdata.ashx?itemid=" + id, params: { action: "get" } }); return (request.then(handlesuccess, handleerror)); }; function clearproduct() { product = {}; }; // transform error response, unwrapping application dta // api response payload. function handleerro...

how to install Emacs Prelude system-wide on windows/MinGW? -

i trying install emacs prelude emacs. thing found after googling this page , tells me clone prelude c:\users\your_user_name\appdata\roaming\.emacs.d but need have prelude in emacs system folder because need make emacs folder zip file , usable on other machines. what tried far (unsuccessfully) are: 1. download emacs 24.5.1 gnu ftp site, , decompress c:\emacs 2. git clone git://github.com/bbatsov/prelude.git 3. mv prelude/ /c/emacs/site-lisp i thought step 3 should populate emacs system-wide startup folder site-lisp , , allow prelude load on emacs startup. didn't happen. loaded haskell .hs file emacs, , haskell mode isn't automatically activated prelude documentation suggests. can 1 please explain how correctly install prelude emacs system-wide? thanks you've "populated" emacs site-lisp folder in sense you've moved prelude directory in full site-lisp . while -- in conjunction require -ing accordingly in configurations -- sufficien...

Cmake apparently ignoring CMAKE_BUILD_TYPE? -

so i'm using cmake project. consists of set of shared libraries linked 1 executable. generated in project (there no external targets). each sub project lives in own directory, own cmakelists file. so make out-of-source build, taking care set cmake_build_type debug, , run cmake, , make. use gnu make 3.81, gcc 4.8.1, binutils 2.23.2 , cmake 3.2.3 on windows box using msys/mingw. the problem that, when load executable in gdb (version 7.6), place breakpoint on function 1 of shared libraries, , try single step, gdb skips whole function saying has no line number information. according understanding, line number information part of debugging information, expected generated during compiling process (as per cmake_build_type) didn't, know how can cmake generate line number information (that is, without manually adding compiler-specific options in cmake files, although take if it's solution). i've tried setting cmake_build_type command line (when invoking cmake utili...

How to show symfony roles -

i'm working symfony 2.3. how can show user roles without (role_). want change view, in database intact. when display roles in view have role_admin role_consultor and want admin consultor role entities need implement roleinterface. can add own custom fields such names want. http://api.symfony.com/2.3/symfony/component/security/core/role/roleinterface.html

expressionengine - ExpressioneEngine contains operator doesn't work -

i'm trying have expressionengine check channel field word , if word found, display contents of field. in case, want search {links-title} word "volunteer" , if word "volunteer" found, display contents of {links-branch}. here code i'm trying use: {exp:channel:entries channel="locations-links"} {if links-title *= "volunteer"} {links-branch} {/if} {/exp:channel:entries} this page: https://ellislab.com/expressionengine/user-guide/templates/conditionals.html#contains-operator says contains operator *= when use it, page displays blank. literally seems though operator not work. if use == works, in case, {links-title} has "volunteer" , nothing else. anyone know how going on here? your question should asked on @ expressionengine.stackexchange.com actually. anyway, version of ee using? handling of conditionals changed lot in more recent versions, , using docs latest version of ee. if site not running ee 2.10 bette...

ios - UIImagePicker - Do not allow panorama to be picked -

looking image picker. picker functioning - - allows user pick panorama photos normal photos on device. i want have picker allow user choose non panorama pictures. i looked through dev document , couldn't find this. appreciated! here's code: @ibaction func selectimage(sender: anyobject) { let imagepicker = uiimagepickercontroller() imagepicker.delegate = self imagepicker.sourcetype = uiimagepickercontrollersourcetype.photolibrary imagepicker.mediatypes = [kuttypeimage nsstring] imagepicker.allowsediting = false self.clearbtn.hidden = false self.presentviewcontroller(imagepicker, animated: true, completion: nil) } func imagepickercontroller(picker: uiimagepickercontroller, didfinishpickingmediawithinfo info: [nsobject : anyobject]) { self.dismissviewcontrolleranimated(true, completion: nil) let image = info[uiimagepickercontrolleroriginalimage] as! uiimage self.postimage.contentmode = .scaleaspe...

c# - Google Contacts API with Service Account issue -

so, i've got working, except 1 issue. i've got google service account set can access our domain contacts. , can batch query them perfectly! but if call cr.retrieve("some-contact-url-here"), throws error griping not having refresh token. i'm using service account though, don't refresh token when authenticate. and can't seem find answer how i'm supposed refresh token service account. there's 1 or 2 stackoverflow posts actively mention getting refresh token service account....but linked has since been redirected. else i've found refresh tokens has been authenticating manually , storing token. because need use service account, not possibility. a service account's credentials, obtain google developers console, include generated email address unique, client id, , @ least 1 public/private key pair. use client id , 1 private key create signed jwt , construct access-token request in appropriate format. application sends token reques...

jquery - Bootstrap 3 Carousel: Displaying set of Images as per button choice -

this trying achieve: have 3 category of images different no. of images in each category: category 1 (5 images), category 2 (3 images) , category 3 (4 images). the images displayed in carousel should follow order: if button 1 pressed gets active , displays images of category 1, if button 2 slider displays 3 images of category 2 , 4 images of category 3 on pressing button 3. possible through bootstrap carousel not want slider purpose. so, here implementation solve problem: http://jsbin.com/qemiki/7/edit how works? the plugin exposes 2 classes: slidebycategory , dynamiccarousel dynamiccarousel, in short terms, creates slideshow this: { 'id': '#category_b', 'slides': [{ img: 'http://themes.themolitor.com/wpbm/files/2011/05/tumblr_mrraevblsp1st5lhmo1_12801-280x170.jpg', title: 'foo category b', desc: 'my lorem foo' }, { img: 'http://themes.themolitor.com/wpbm/files/2011/05/16gz2hu-280x170....

Large Sqlite Statements for Android -

Image
i filling cursorloader app has been in play store on year now. there no trouble crashing or complaints it. trouble is, without use of stored procedures, has massive sql statement fill loader. make little more manageable, used string variables build up. without string variables, unfold several pages of unmanageable sql statement. app cardiologger in play store. sql format 4 columns of data on log page. can't feeling missing important concept or api. best practice composing sqlite statements in dire need of stored procedures? veteran developers using develop clean code? here 4 column sql result sql statement give above result. /******************************************************************************* * * sql string workoutlogcolumns * * *****************************************************************************/ calendar c = calendar.getinstance(); int utcoffset = c.get(calendar.zone_offset) + c.get(calendar.dst_offset); long utcmilliseco...

qtp - How to get the Test Configuration name in UFT? -

recently upgraded our test management tool hp qc hp alm supports new feature called "test configuration". earlier used have multiple tests developed in uft using 1 test multiple configuration. in script level have used environment("testname") @ many places. since using single test multiple configuration, environment("testname") gives name of single test contains logic of multiple configurations. is there way "test configuration" names in uft?

vba - Access: Setting a source object to another source object path -

i'm trying crazy again. use line of code: reports![prntrep].sourceobject = forms![search form]!subform1.sourceobject the source object of subform1 dynamically depending on query need search. want source of report set same query, don't need make bunch of different reports. throws error 2465, application defined or object defined error. a report not have sourceobject property. reason access throws error #2465, "application-defined or object-defined error" when attempt reference it. here immediate window example system: ' first demonstrate report accessible ... debug.print reports!rptfoo.name rptfoo ' when referencing sourceobject ... debug.print reports!rptfoo.sourceobject ' <-- error 2465 perhaps want alter report's recordsource instead: ' current recordsource ... debug.print reports!rptfoo.recordsource select rmy.id, rmy.reportdate, rmy.gainorloss record_matyields rmy; ' change recordsource saved query ... re...

c# - GraphicsPath.AddPolygon not rendering properly -

Image
basically have form , trying "dim" areas of draw focus part of form. i'm using form no border , 50% opacity, aligned actual form. area trying mask dark gray area, roughly, pictured: to "u"-shaped form, i'm using graphicspath addpolygon , calculating points of each vertex: var p = new graphicspath(); var origin = new point(top, left); var maxextentpt = new point(origin.x + width, origin.y + height); point[] points = { origin, new point(origin.x + leftpanel.width, origin.y), new point(origin.x + leftpanel.width, maxextentpt.y - bottompanel.height), new point(maxextentpt.x - rightpanel.width, maxextentpt.y- bottompanel.height), new point(maxextentpt.x - rightpanel.width, origin.y), new point(maxextentpt.x, origin.y), maxextentpt, new point(origin.x, maxextentpt.y), origin }; p.addpolygon(points); overlayform.region = new region(p); overlayform.location = pointtoscreen(point.empty); the 3 panels in code masking, ...

javascript - How do I steal the click event from an element? -

long-story-short: i'm trying make bootstrap's modal window visible when page loads. i copied bit of html w3schools . <!-- trigger modal button --> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#mymodal">open modal</button> <!-- modal --> <div id="mymodal" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">modal header</h4> </div> <div class="modal-body"> <p>some text in modal.</p> </div> <div class="modal-footer"> ...

c++ - The destructor for the class member `B`, why is it invoked in the snippet below? -

from §5.3.5[expr.delete]/1, can understand destructor object *a not invoked in snippet below. didn't understand why destructor class member b invoked in case, can seen in live example . #include <iostream> class { public: class b{ public: ~b(){ std::cout << "b dtor" << '\n'; } }; a() { p = new b(); } operator b*() { return p; } private: b* p; }; int main() { a* = new a(); delete *a; std::cout << "end" << '\n'; } would appreciate quote standard explaining this. your delete *a applies operator delete non-pointer expression *a of type a . way can legal when type a implicitly convertible pointer type. 5.3.5 delete [expr.delete] 1 ... operand shall have pointer object type, or class type having single non-explicit conversion function (12.3.2) pointer object type. 2 if operand has class type, operand converted pointer type calling above-mentioned conv...

ios - GameCenter iTunesConnect - Leaderboard is not a member of a leaderboard set attached to version -

Image
does know mean? i've tried searching everywhere can't find word on it. essentially created group app (and deluxe counterpart), created leaderboards , added them leaderboard sets. tried adding leaderboard sets , checking constituent leaderboards. unchecking leaderboards doesn't fix , toggling off game center doesn't either. i can no longer save changes app , apple hasn't gotten me (2 weeks). have default leaderboard selected. i had similar issue , it's been resolved itunes engineers. i'd recommend checking if works on end too.

nginx multiple domains (www and non-www for each domain) -

i'm trying host 2 domains on nginx server, www non-www redirection. here site configs: site 1: server { root /var/www/afspraken/; index index.html index.htm; server_name site1.nl; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; } } server { server_name www.site1.nl; return 301 $scheme://site1.nl$request_uri; } site 2: server { root /var/www/mijn/; index index.html index.htm; server_name site2.nl; } server { server_name www.site2.nl; return 301 $scheme://site2.nl$request_uri; } three of 4 servers work correctly: www.site2.nl , site2.nl , site1.nl . www.site1.nl server gives me site2 though. doing wrong? found problem. servers return 301 need defined first (before servers handle redirected requests). working example: server { server_...

HTML Link with external CSS no working -

this question has answer here: div background color not showing body color 1 answer when try link following code css file, doesn't work. <!doctype html> <html> <head> <link href="style.css" type="text/css" rel="stylesheet"/> </head> <body> <div class="body" </div> <body> </html> style.css contents: .body { background-color: blue; } in html file, following put in bold underlined red line in notepad++: <-link href="style. css " type="text/ css " rel=" stylesheet "/> *note '-' in link href= demonstrational purposes. doesn't seem work. background color stays white. help? put content in div. and close div this <!doctype html> <html> <head> ...

Populating select menu using database elements - Python/Django/javascript/html -

as title suggests, trying populate html select menu using elements database. right now, have set of file systems (issp's) associated set of compatible operating systems (many-to-many relationship). when user selects issp version drop-down, want compatible operating systems displayed without hardcoding bunch of javascript arrays. i have no problem populating issp select menu database template passed full list of issp's part of context. however, because django not allow use of python methods take arguments, i'm having trouble populating operating system menu. i want like (though realize it's impossible way, i'm looking suggestions alternate route): function populateselect(select, osid) { $(osid).html(""); var issp_version = $(select).val(); (i = 0; < { issp_list.filter(issp=issp_version).os_length }; i++) { $(osid).append('<option value="{ issp_list.filter(issp=version).os.all()[i] }" display = ......

matlab - How to get a number of probability distributions "averaged"? -

let have 'n' vectors of data of unequal lengths. of these vectors similar (range, etc., see example below), , can fitted specific probability distribution. how can average out these distributions? make sense? if yes, how go programming ? for example:- n=2, data1 of 400 samples, normal distribution range 1 5, , mean 3 , standard deviation 0.75. for data2 of 500 samples, normal distribution range 0.95 5.2, , mean 3.05 , standard deviation 0.78.

css - KendoUI Grid input styling in column -

i have kendoui grid being generated this: <div id="clientsdb"> @(html.kendo().grid<example.openaccess.obclientsetup>() .name("grid") .columns(columns => { columns.bound(obcs => obcs.profilename).width(140); columns.bound(obcs => obcs.default).width(190); columns.bound(obcs => obcs.eefinalize).width(100); columns.bound(obcs => obcs.completed).width(110); columns.command(command => { command.edit(); command.destroy(); }); }) .groupable() .pageable() .sortable() .editable(editable => editable.mode(grideditmode.inline)) .datasource(datasource => datasource .ajax() .read(read => read.action("ob2_clientprofiles", "ob")) .update(update => update.action("editinginline_update", "ob")) .destroy(update => update.action("editinginline_destroy", ...

amazon web services - How do you set up UAT for DynamoDB? -

i have found 1 answer suggested tagging tables. since picking existing system , not building scratch labor intensive. i have scoured aws week , found no tangible steps creating/maintaining uat dynamodb. the java, local dynamo not persist data. i grateful information regarding establishing sustainable uat environment dynamodb. at current employer create separate aws environment uat. separate environment done having aws account. account can used uat. in our code, if keys uat account access uat dynamodb databases. if keys production, or development, access production or development dynamodb databases. this has pros , cons. 1 con have manage multiple aws accounts. that's pro on can assess aws costs per account. one pro can keep table names intact across environments. not need "mytablenameuat" , "mytablenamedev"... "mytablename", , keys passed application @ deployment determine environment used.

jsp - how to set selected option in jquery multiselect -

i use jquery multiselect. want set option selected when write selected="selected" attribute option multiselect doesn't run correctly. example when 2 option selected deselect option after number of selected doesnt decrease. use control 6: callback in this demo . my javascript: $(document).ready( function() { $("#identificationmethods").multiselect( null, function(el) { ... }); }); my html <select id="identificationmethods" name="identificationmethods[]" multiple="multiple" style="width: 100px;"> <c:foreach items="${identificationmethodics}" var="im"> <option <c:if test="${im.selected == true}">selected="selected"</c:if> value="${im.subtype}"> ${im.subtype} </option> </c:foreach> </select>

url - How do can I code a rewrite rule in IIS 8 so that all traffic points to https://www.*.com from http://*.com? -

i have following root level urls people possibly go: 1. http://example.com 2. http://www.example.com 3. https://example.com 4. https://www.example.com how can ensure 1, 2, , 3 redirect 4 rewrite rule in iis 8? of course, should keep whatever secondary information attached (e.g. /images/myfile.jpg?query=string&another=string ) you can try rule <rewrite> <rules> <rule name="example.com www.example.com" enabled="true" stopprocessing="true"> <match url="(.*)" /> <conditions logicalgrouping="matchany"> <add input="{http_host}" pattern="www.example.com" negate="true" /> <add input="{https}" pattern="off" /> </conditions> <action type="redirect" url="https://www.example.com/{r:1}" redirecttype="permanent" /> </rule...

python - Fill between y = 0 and positive values of y -

Image
i'm practicing fill_between matplotlib function. what want fill area between y = 0 , positive values of y , let area between y = 0 , negative values of y unfilled. something like: import matplotlib.pyplot plt x = [1,2,3,4,5] y = [0,2,-3,4,-5] ypos = [i in y if i>0] plt.plot(x,y) plt.fill_between(x,0,ypos) plt.show() the error gives valueerror: argument dimensions incompatible. i've checked possible solutions couldn't working. you use where=np.array(y)>0 to restrict filled region drawn , use interpolate=true to have fill_between find points of intersection: import numpy np import matplotlib.pyplot plt x = np.array([1,2,3,4,5]) y = np.array([0,2,-3,4,-5]) plt.plot(x,y) plt.fill_between(x, 0, y, where=y>0, interpolate=true) plt.show() yields

php - Regex scripture match -

i have following regex code i'm trying perfect scripture searches. ... rest of 66 bible books. /(?=\s)\b(genesis|exodus|leviticus|...)(\.)?(\s)?((\d{1,3})([:,-;]?(?=\d))?((\d{1,3})?([:,-;]?(?=\d))?){0,50})/iu where i'm running issue is multiple passage references genesis 3:2 1 chronicles 2:2 if use regex space in search function assumes 1 in chronicles genesis 1 , not recognize , send preg_replace_callback . suggestions? the input string whole paragraph mat 3:12; luke 3:17; revelation 16:14 • gathered, 7 mat 2:4; mat 22:34; mat 27:27; mar 4:1; mar 5:21; joh 11:47; act 4:26 • into, 1 revelation 13:10 • resorted, 1 joh 18:2 • themselves, 1 act 11:26 • together, 24 mat 13:2; mat 22:41; mat 26:3; mat 27:17; mat 27:62; mar 2:2; mar 6:30; mar 7:1; luke 22:66; joh 11:52; act 4:6; act 4:27; act 4:31; act 13:44; act 14:27; act 15:6; act 15:30; act 20:7; act 20:8; 1 corinthians 5:4; revelation 16:16; revelation 19:17; revelation 19:19; revelation 20:8 what i'm trying ...

datetimepicker - datepicker yii2 kartik wrong format -

Image
i have problem kartik datetime picker. the value has entered gets scrambled in input, following screenshot tells all: i followed demo code: <?php use kartik\datetime\datetimepicker; echo '<label>start date/time</label>'; echo datetimepicker::widget([ 'name' => 'startdatetime', 'options' => ['placeholder' => 'select operating time ...'], 'convertformat' => true, 'pluginoptions' => [ 'format' => 'd-m-y g:i a', 'startdate' => '01-mar-2014 12:00 am', 'todayhighlight' => true ] ]); ?> you using php's data formatting characters. see plugin documentaion correct date formatting. in case instead of d-m-y g:i a should dd-m-yyyy h:ii p

javascript - submitting form with PJAX -

im using pjax in web project, , when submit form, pjax handling it, related stuff coming in , replacing in pjax container, after default action happening- form getting submitted in traditional way , entire page loading again form html here <form class="form_class"><input type="text" name="search" id="search_query" class="basic_input" value="" /><button onclick="this.form.submit();" >find</button></form> here pjax code form invoking $(document).on('submit', '.form_class', function(event) { $.pjax.submit(event, '#container_id'); }); it works- the default form submission happens, want pjax way, dont want complete page reload(the traditional submission) just use event object cancel default submission behavior: $(document).on('submit', '.form_class', function(event) { event.preventdefault(); // stop defaul...

python - IOError when trying to convert CSV into dataframe -

i want try , understand why error in following code. error ioerror: [errno 2] no such file or directory: 'f17-yields.csv' import urllib2 import pandas pd import os url = 'http://www.rba.gov.au/statistics/tables/csv/f17-yields.csv' response = urllib2.urlopen(url) html = response.read() dataframeofxls_file = pd.excelfile(os.path.basename(url)) print dataframeofxls_file cheers you have few problems. first downloading csv file, not saving locally, , trying open non-existent local file. second, csv file not excel file, , don't need pd.excelfile open it. try csv reader instead. example: import pandas pd url = 'http://www.rba.gov.au/statistics/tables/csv/f17-yields.csv' pd.read_csv(url)

Python - Logging from multiple modules to rotating files without printing to console -

i trying add logging medium size python project minimal disruption. log multiple modules rotating files silently (without printing messages terminal). have tried modify this example , have functionality need except 1 issue. here how attempting configure things in main script: import logging import logging.handlers import my_module log_file = 'logs\\logging_example_new.out' #logging.basicconfig(level=logging.debug) # define handler writes messages rotating log files. handler = logging.handlers.rotatingfilehandler(log_file, maxbytes=100000, backupcount=1) handler.setlevel(logging.debug) # set logging level. # create message formatter. formatter = logging.formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s') # tell handler use format handler.setformatter(formatter) # add handler root logger logging.getlogger('').addhandler(handler) # now, can log root logger, or other logger. first root... logging.debug('root debug message.') ...

ios - Cocos2D 2.x: Running CCWave action makes sprite disappear -

i can run ccwave actions on sprites no problem, except particular instance. initialize class of mine has ccsprite add ccrendertexture. sprite made adding tile sprite textures ccrendertexture, , removing tiles. can add sprite ccrendertexture child no problem, if add ccwave function , run it, sprite disappears. // 1: create new ccrendertexture ccrendertexture *rt = [ccrendertexture rendertexturewithwidth:width height:height]; // 2: call ccrendertexture:begin [rt beginwithclear:0 g:0 b:0 a:0]; /* loop tiles within bounding object's rectangle */ cgpoint tilecoord; for(int w = 0; w < (width / tilepxwidth); ++w){ for(int h = (height / tilepxwidth); h > 0; --h){ tilecoord = [tilecoord tilecoordforposition:ccp(x + (w * tilepxwidth), y + (h * tilepxwidth)) withmap:...

python - Specifying greater than inequality in scipy -

i've solved simple lp problem constraints "less or equal to". i used scipy.optimize.linprog those. the problem when 1 or more of constraints equation "greater or equal to". how specify that? need use two-phase approach provided scipy.optimize.linprog an example of such is: 7x1 + 4x2 + 9x3 ≥ 750 4x1 + 6x2 + 7x3 ≤ 40 17x1 + 9x2 + 2.5x3 ≥ 3540 56x1 + 3x2 + 27x3 ≤ 6450 here wrapper incorporates lower bound rows in lingprog formulation. note more error trapping necessary (for example, number of columns of each a matrix need equal), not meant robust implementation. proper error trapping, suggest skim through linprog source code . from scipy.optimize import linprog import numpy np def linprog_lb_wrapper(c, a_ub=none, b_ub=none, a_lb=none, b_lb=none, a_eq=none, b_eq=none, ...

sql server - SSIS package execution succeeds but doesn't do its job -

i use sql server agent fill tables in datawarehouse. have 50 steps in job , every step run proxy account. , every step works correctly besides one: ssis package contains 20 execute sql tasks execute procedure. have in execute sql task: declare @rc int declare @fordate datetime = null declare @tablename sysname = 'd_entity' declare @datafolder varchar(1024) = 'c:\mountpoints1\src_etl\' declare @logfolder varchar(1024) = 'c:\mountpoints1\src_etl\' declare @debug bit = 0 execute @rc = [dbo].[etl1a_hr] @fordate ,@tablename ,@datafolder ,@logfolder ,@debug go the thing is, if execute package ssis catalog, works ok. if run job, succeeds, deletes tables, doesn't fill it. seems procedure stops somewhere in middle. any ideas? please advise, took me days trying solve this... i think maybe related permissions. executing ssis package use security context running agent impersonates credentials defined in proxy, , runs job step using security ...

Copying a complete XML Element using XSLT -

i translating 1 xml file another. want copy single, complete element original xml new xml. have tried using identity transformation can work if copy entire document. if try limit single element (which contains lot of data), values of in document - not xml tags , not in desired element. i'm relatively new xslt i'm not understanding identity transformation process correctly. here sample input: <?xml version="1.0" encoding="utf-8"?> <dataextract version="1.0"> <importexport>export</importexport> <entities> <entity> <data>unwanteddataa</data> <data>unwanteddatab</data> </entity> <entity> <data>unwanteddatac</data> <data>unwanteddatad</data> </entity> <entity> <entitydata> <data>abc</data> ...