Posts

Showing posts from January, 2013

c++ - Malloc failed on ps4 development -

i malloc(180k) error in program, commented them , write code below in same file. still return bad ptr. (i breakpoint @ return) int main (int argc, char *argv[]) { char *b = (char *)malloc(sizeof(char)*1000000); return exit_success; } i suppose issue on computer, open other program on same condition (46% memory used), (i did not close pre project), write same code in main() first, , malloc returns normally. should issue? ps: windows7 x64 (4g) think remain @ least 1g memory,because memory used showed in explorer 46%. i asked question sce, , response had add limit in play station 4 project. must declare global virable size_t scelibcheapsize = 1*1024*1024*50; set heap, otherwise it's default value 64k or 256k?(i forget it..)

c - My 64 bit machine can only store 4 bytes each memory location -

my computer 64bit mac. how many bytes of information stored in 1 of these locations in memory? when tried in gdb x /2x first 0x7ffff661c020: 0xf661b020 0x00007fff my code #define put(p, val) (*((size_t *)(p)) = (val)) put(first, (size_t)some pointers); i use gcc -g compile it seems 4 bytes store in 0x7ffff661c020 . 0x00007fff stores in 0x7ffff661c024. why cant store 0x00007ffff661b020 in 0x7ffff661c020. thanks each memory location can store 8 bits, because memory byte addressable. 64-bit machine doesn't give 64 bits in every memory location, means can naturally handle 64 bits @ time. for example, registers 64 bits wide (unless intentionally manipulate sub-registers ax or eax instead of 64-bit rax ), , can load many bits memory single instruction. you can see it's byte addressable fact 2 addresses have difference of 4 between them: 0x7ffff661c020: 0xf661b020 0x7ffff661c024: 0x00007fff \____________/ four-byte ...

reactjs - TypeError: 'undefined' is not an object (evaluating 'this.props.people.map') -

i getting 'undefined' not object error when running test cases. here actual code. class people extends react.component{ displayalert (email){ alert(email); } render (){ return ( <div>{ <ul key = {this.props.id}> <li> <button onclick= {this.displayalert.bind(this, this.props.email)}>{this.props.lastname + ', ' + this.props.firstname}</button> </li> </ul>} </div> ); } } class personlist extends react.component{ render () { /* people array of people*/ var items = this.props.people.map( function ( item ){ return <people id = {item.id} email = {item.email} firstname = {item.firstname} lastname = {item.lastname}> </people> }); return ( <div> {items} </div> ) } } react.render( <personlist people={ people } />, el ); also, have test case check "person-list has instance every person". fail...

jquery - Background Image of a div that is responsive in bootstrap 3 -

i need make background image of header div background image of mr. bill gates in http://www.gatesnotes.com/about-bill-gates/summer-books-2015 the header background image of mr. bill gates didn't change height screen small. i tried background-size:cover still height changed when screen small. i place background-size:cover custom.css in bootstrap folders. check demo : https://jsfiddle.net/w8f0mkbg/1/ html <div id="image"> <img src="http://stylonica.com/wp-content/uploads/2014/02/nature-wallpaper-362.jpeg"> </div> css #image img { min-width: 100%; width: 100%; height: auto; } background image centered responsive demo: https://jsfiddle.net/yeyene/905pc2p0/ *there still lots of ways too, can try out , see of them; css tricks: https://css-tricks.com/perfect-full-page-background-image/ smashing: http://www.smashingmagazine.com/2013/07/22/simple-responsive-images-with-css-background-images/

objective c - save UIImage to disk with simulator ios 8 doesn't work -

the following code works great on ios < 8 doesn't work xcode 6.1.1 , ios 8 device simulator nsdata *imagedata = uiimagepngrepresentation(sharesnapshot); [imagedata writetofile:@"/users/myuser/desktop/123.png" atomically:yes]; does know if simulator issue don't have real device ios8 check on. so you're running permission issue here. i'm not sure why worked before 8.0, i'm seeing (something changed): the operation couldn't completed. (cocoa error 513) https://developer.apple.com/library/ios/documentation/cocoa/conceptual/errorhandlingcocoa/errorobjectsdomains/errorobjectsdomains.html#//apple_ref/doc/uid/tp40001806-ch202-cjbgaibj as stands, you'll run problems when running on actual device. better way handle save data application's document directory. fetch directory path via nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes) append filename using stringbyappendingpathcomponent yo...

jquery - Reference other static file in django javascript file -

i need load file function use telephone autoformatter library ( intl tel input ) when tried in standalone html page, worked fine, when i'm trying in django project, file isn't loading , think it's because it's not finding in path. main.js , utils.js both in static directory of project i'm not sure why can't find utils.js file. main.js: $(document).ready(function() { $("#phonenumber").intltelinput({ utilsscript: "utils.js" }); }); what in cases need reference server-side paths in javascript set "app" object in uppermost template, can reference in javascript files loaded after, typically require.js. example: # base.html (upper-most template) <!doctype html>{% load static staticfiles %} <html> <head>. . .</head> <body> . . . <script> var myapp = { staticurl: '{{ static_url }}...

android - Reopen PendingIntent after AppDestroy -

i have problem pendingintent in app. i send gcm messages server application. when user clicks on notification, new pendingintent created moves user "alertactivity", countdown starts all of works fine @ moment. the problem now, when user closes app , reopen it. while countdown running want redirect user alertactivity again. how possible? i start intent with: private void sendnotification(string msg) { intent resultintent = new intent(this, alertactivity.class); resultintent.putextra("msg", msg); pendingintent resultpendingintent = pendingintent.getactivity(this, 0, resultintent, 0); notificationcompat.builder mnotifybuilder; notificationmanager mnotificationmanager; mnotificationmanager = (notificationmanager) getsystemservice(context.notification_service); mnotifybuilder = new notificationcompat.builder(this) .setcontenttitle("alert") ...

android - How to show changed SwitchPreference value after AlertDialog click -

i have switchpreference displays alertdialog onchange , accept/reject change depending on button clicked in alertdialog (positive/negative). if user attempts change value "true" change should accepted, otherwise alertdialog should shown , switchpreference change should rejected. if user confirms alertdialog (positive button) switchpreference should changed. below relevant part of activity class extends preferenceactivity. values in sharedpreferences updated expected switchpreference not change visibly (switch remains checked) - have re-open settingsactivity see change (switch unchecked). final switchpreference passwordenabled = (switchpreference) findpreference(password_enabled); passwordenabled.setonpreferencechangelistener(new preference.onpreferencechangelistener() { @override public boolean onpreferencechange(final preference preference, object newvalue) { final context c = getactivity(); if ((boolean) newvalue) { return true;...

c# - How can I retrieve AppSettings configuration back in Asp.Net MVC 6? -

assuming using new depencyinjection framework configure classes , dependencies in new asp.net/vnext. how can use, how can pre-defined configuration settings? public void configureservices(iservicecollection services) { // add application settings services container. services.configure<appsettings>(configuration.getsubkey("appsettings")); // add ef services services container. services.addentityframework() .addsqlserver() .adddbcontext<applicationdbcontext>(options => options.usesqlserver(configuration["data:defaultconnection:connectionstring"])); // add identity services services container. services.addidentity<applicationuser, identityrole>() .addentityframeworkstores<applicationdbcontext>() .adddefaulttokenproviders(); // configure options authentication middleware. // can add options google, t...

php - .widget, article not found on Wordpress style.css -

i trying find element ".widget, article " in style.css theme. happened shows on developer tools, can't find in style page. the layout background, , white default the web developer tools says layout <article> <header class="entry-header">...</header> <div class="entry-content clearfix">...</div> ... the styles page says in index:156 of theme .widget, article { background: #8c3737; } i can't find article element or change index.php file appropriately make background transparent. any ideas of how echo id article when loads, or other?

ios8 - NSJSONSerialization json data from Swift dictionary containing struct as values -

i trying convert swift dictionary (that has string keys , struct values) json data using nsjsonserialization. getting error: cannot invoke 'datawithjsonobject' argument list of type'([string : vik.version], options: nsjsonwritingoptions, error: nil) is there missing. appreciated. thanks following code. final class vik: nsobject { private struct version { private var name: string private var filestoadd = [string]() private var filestoremove = [string]() init(name: string, filestoadd: [string]?, filestoremove: [string]?) { self.name = name if let filestoadd = filestoadd { self.filestoadd = filestoadd } if let filestoremove = filestoremove { self.filestoremove = filestoremove } } } ...... ...... ...... private var changelogdict = [string : version]() private func addtodirectory() { ....... ....... let ...

firebug lite - How to debug JavaScript in DukeScript -

is possible debug javascript when using dukescript? i've tried adding firebuglite <script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script> it loads , that's awesome has no visibility of $root model. don't know if it's possible add breakpoints. partly, 1 can include firebuglite. see example here . 1 problem i've found firebug loads has no visibility of model, $root returns undefined. i've tried work around problem creating javascript resource myresource.js under main/resouces myresource = { loadfirebug: function(){ if (!document.getelementbyid('firebuglite')){ e = document['createelement' + 'ns'] && document.documentelement.namespaceuri; e = e ? document['createelement' + 'ns'](e, 'script') : document['createelement']('script'); e['setattribute...

java - How to retrieve cell value with same result as displayed in Excel? -

Image
i have following code: workbook workbook = workbookfactory.create( file ); sheet sheet = workbook.getsheet( "sheet1" ); formulaevaluator evaluator = workbook.getcreationhelper().createformulaevaluator(); dataformatter formatter = new dataformatter( true ); int rownum = 0; int colnum = 0; row row = sheet.getrow( rownum ); cell cell = row.getcell( colnum ); double rawcellvalue = cell.getnumericcellvalue(); system.out.println( "raw value: " + rawcellvalue ); string cellvalue = formatter.formatcellvalue( cell, evaluator ); system.out.println( "formatted: " + cellvalue ); this produces output: raw value: 1713.6 formatted: $1,713 when open file in excel professional 2010, value displays $1,714 any ideas why poi produces different value excel? there way configure poi returns same value (i.e. obeys same rounding algorithm excel)? i'm using poi 3.12 xls (excel 97-2013) file. edit: java format cell $#,##0 (internal poi). here's excel...

removeTracksFromPlaylist not removing tracks with ios spotify sdk -

i testing method remove tracks playlist. modified demo project "simple track playback" provided sdk. wanted remove track form playlist when hit fastforward. changed fastforward method way it's not doing anything, , error nil. -(ibaction)fastforward:(id)sender { if([self.player isplaying] && self.currentplaylistsnapshot){ sptauth *auth = [sptauth defaultinstance]; [self.currentplaylistsnapshot removetracksfromplaylist:@[self.player.currenttrackuri] withaccesstoken:auth.session.accesstoken callback:^(nserror *error) { if (error != nil) { nslog(@"*** failed remove track : %@", self.titlelabel.text); return; } }]; } [self.player skipnext:nil]; } self....

emr - No Impalad available -

i'm setting hue 3.8.1 point emr i've received following message check_config: impala editor no available impalad send queries to. i've confirmed impala running on host (the emr master node), , tat connection can made using impyla. what missing here? the host , port correctly set # host of impala server (one of impalad) server_host=192.168.16.231 # port of impala server server_port=21050

VirtualBox open few windows for 1 virtual machine -

when start virtual machine, 3 windows of virtual machine appear. begins after changes normal, scale , full window mode. as found out - windows represent 1 virtual machine - can move terminal window1 window 2. have 2 monitors , maybe reason. don't know how start 1 window. change in machine settings display -> display count 1 save.

Django dynamically change index in template -

i have following code in template: {% test in page.object_list %} <tr> <td colspan="2" class="testsuite">{{ test.name.0 }}</td> <td class="testsuite">failed: {{ percentages.0 }}%</td> </tr> {% endfor %} where test.name.0 name of test suite , percentages list of failed test cases inside test suite. wondering how might able change percentages.0 percentages.i i incremented on each iteration of for loop. update after trying @gocht's answer have following code: in template tags/get_percentage.py file from django import template register = template.library() @register.filter def get_percentage(percentage_list, i): return percentage_list[int(i)] and in template {% load get_percentage %} {% test in page.object_list %} <tr> <td colspan="2" class="testsuite">{{ test.name.0 }}</td> <td class="testsuite"...

javascript - loop jQuery simple animated lines 3 times -

update: due vagueness of question - resulted in broad answer doesn't apply (as can see below). full question , problem migrated -- > add loop function around 3 small animations within larger animation functions how define below loop / play 3 times in row before stopping (simple line animation jquery): my animation works.. it's 3 lines come out 1 @ time draw triangle... it's looping 3 times need. var padding = $('.conn-1').css('padding'); var line_anim = 700; $('.replay').hide(); $('.conn-1').width('100%').animate({'height':'100%'},line_anim, function () { $('.conn-2').height('100%').animate({'width':'100%'}, line_anim, function () { $('.conn-3').css({width:'100%'}).animate({'height':'100%'}, line_anim, function(){replay();}) } ); } )...

Why does log4net stop logging after a while on .NET WCF but not a usual website? -

i've search many sites , tried several different opinions. still not solve it. here things did right now: in global.asax @ application_startup give file path , startup log4net. right after start log4net, write log says "application has stared'" currently, there 1 worker in iis wcf application iis user has access write , modify , read privileges the problem: when invoke method of service directly (without doing 2. step below), no logs written on browser, write te wcf url , hit enter, log4net creates folder , files (files empty @ point). if make requests , invoke methods (doing 1st step), log4net writes logs. the actual problem: after 3rd step, (lets waited without invokes of wcf methods around 10 minutes or more), invoking does not create log4net text logs anymore . sometimes, if repeat 2nd step, begins writing logs again. there no coherent results. here config.xml: <?xml version="1.0" encoding="utf-8"?> ...

android - Localizing dates samsung galaxy -

Image
i’m facing strange problem localizing dates. when running app on emulator swedish locale (sv) works fine. dates formatted according to: yyyy-mm-dd however, when run same app on samsung galaxy s4 dates end as: dd-mm-yyyy locale.getdefault().getlanguage() evaluates “sv” in both cases. i use following snippet date string public static string getdatestring(date date) { return android.text.format.dateformat.getdateformat(app.getcontext()).format(date); } localization works fine when comes rest of ui. any ideas? it possible have different date format on 2 devices same locale set. in android 4.x settings preferences on device allow users set date format not default date format locale selected on device. the option available via; settings > date & time > choose date format not option on samsung devices can found on stock android 4.x. on android 5.1 option seems have been removed.

Android Tilt issue with Accelerometer and Magnetometer -

i trying detect yaw, pitch & roll using following code: @override public void onsensorchanged(sensorevent event) { if (event.sensor == maccelerometer) { system.arraycopy(event.values.clone(), 0, mlastaccelerometer, 0, event.values.length); mlastaccelerometerset = true; } else if (event.sensor == mmagnetometer) { system.arraycopy(event.values.clone(), 0, mlastmagnetometer, 0, event.values.length); mlastmagnetometerset = true; } if (mlastaccelerometerset && mlastmagnetometerset) { sensormanager.getrotationmatrix(mr, null, mlastaccelerometer, mlastmagnetometer); sensormanager.getorientation(mr, morientation); morientation[0] = (float) math.todegrees(morientation[0]); morientation[1] = (float) math.todegrees(morientation[1]); morientation[2] = (float) math.todegrees(morientation[2]); mlastaccelerometerset = fals...

Sqlite Database Doesn't "Reset" -

i have rspec file runs following method before , after each "describe" test block: def self.reset commands = [ "del #{cats_db_file}", #the "del" changed "rm" windows "cat #{cats_sql_file} > sqlite3 #{cats_db_file}" # | used before (pipe in linux) ] commands.each { |command| `#{command}` } dbconnection.open(cats_db_file) end i'm running of in windows command line. reason, database overpopulates repeatedly; seems database doesn't "clear" itself, when test block run, same attributes added again. syntax in commands array above okay? kind of new this, appreciate suggestions!

java - HQL query not working -

i doing query in hql , retrieving no results, when execute in mysql works. me resolve problem? i copied sql query printed in console when executed in code, , worked in mysql, same query. help detachedcriteria subquery = detachedcriteria.forclass(itineraryday.class, "itineraryday"); subquery.add(restrictions.eqproperty("itineraryday.master", "this.master")).setprojection(projections.rowcount()); detachedcriteria tourresults = detachedcriteria.forclass(tour.class, "tour"); tourresults.createalias("tour.master", "master"); tourresults.createalias("master.itinerariesday", "itinerariesday"); tourresults.createalias("itinerariesday.itinerarydaydestinations", "itinerarydaydestinations"); tourresults.createalias("itinerarydaydestinations.destination", "destination"); tourresults.createalias("destination.country", "country...

javascript - JS Regular Expression - global number of char -

i regular expression determinate string allows: -at least 2 digit; -at least 1 capital letter -at least 1 of char: !,$,? my principal problem chars can situated in position! ex: 1dfa2! it's ok 11aw! practically, occurrence has global. edit: tried, step step, first number, problem position! /(0-9){2}/g i'm @ start regex you can use following lookahead assertion: ^(?=.*\d.*\d)(?=.*[a-z])(?=.*[!$?]).*$ see demo

php - Wordpress -multi urls for the same site -

i have wordpress site (v4.2.2) domain name www.example.com , need point second local domain variant www.example.co.za same site. have tried many suggestions modifying wp-config.php, index.php , .htaccess, failed work. for index.php <? // check domain , change proper spelling if necessary $our_server = "example.com"; $our_http = "http://www.example.com"; if ( isset($http_host) && !eregi($our_server, $http_host)) { header("location: $our_http$request_uri"); exit; } ?> for .htaccess rewriteengine on rewritecond %{http_host} ^(www\.)example\.co.za$ [nc] rewriterule ^ http://www.example.com%{request_uri} [r,l,ne] i appreaciate guidance on topic on how redirect www.example.co.za www.example.com if trying have multiple domains single wordpress install, need couple of things. you need add dns a record , point 2nd domain ip address of main domain. you need add domain alias in apache serv...

sql server - Build a SELECT statement based on values returned in sys.columns -

so, trying figure out how (if possible) return result set of 2 columns who's rows directly proportional number of columns in given table name, without using dynamic sql function: exec . ex. have table 'tbla': create table [dbo].[tbla]( [columna] [varchar](20) not null, [columnb] [varchar](20) not null, [columnc] [varchar](20) not null ) and hav tblb create table [dbo].[tblb]( [column1] [varchar](20) not null, [column2] [varchar](20) not null ) i can locate columns running: select c.name sys.columns c inner join sys.tables t on c.object_id = t.object_id t.name = 'tablename' i want return table of 2 columns # of rows equal number of columns table name querying. example, select columna, columnb, columnc tbla columna = ??? would inserted table: table [dbo].[resulttable]( [columnname] [varchar](max) not null, [columnvalue] [varchar](max) not null ) so sp returns looks kinda like: ---------------------------- | columnname | columnvalue | --...

Ansible variable register task being skipped -

i trying come playbook determine corresponding ossec release agent package install on remote servers. playbook first runs shell command determine matching release rpm install, variable register task being skipped when run playbook in check mode. tasks: - name: determine lateast ossec release rpm centos version shell: curl -s https://www.atomicorp.com/channels/ossec/centos/$(cat /etc/redhat-release | awk '{print $3}' | cut -c1)/x86_64/rpms/ | grep ossec-release | sed "s/'/ /g" | awk '{print $6}' | tail -1 ignore_errors: yes register: ossec_release_rpm - name: install latest centos 6 ossec release rpm yum: name=https://www.atomicorp.com/channels/ossec/centos/6/x86_64/rpms/{{ item }} state=present with_items: ossec_release_rpm.stdout - name: install ossec-hids-client yum: pkg=ossec-hids-client state=present the output getting following. specifically, register task being skipped , can't seem figure out why. check completed i...

c++ - How to use std::copy output with std::distance for a C-style array type -

how can store outputiterator returned std::copy used parameter later std::distance call? i cannot use auto c++11 , need use c-style arrays. that's kind of i'm trying do: unsigned char data[max_data_len]; unsigned char x[max_x_len], y[max_y_len]; // cannot use auto here auto out = std::copy ( x, x + runtime_x_len , std::copy ( y, y + runtime_y_len , data ) ); size_t data_size = std::distance ( data , out ); for c-style arrays 'iterator' returned pointer element type. so in case return value of std::copy() unsigned char* .

C++ Need to send std::string over a LAN network -

i need able send std::string on lan network. in case have mac, , pc able make communicate. have taken around web, haven't had lucky in terms of solution case. ideas how set network through c++ these computers can share text? the boost asio library provides robust framework doing network communication through sockets. examples using c++11 can found here: http://www.boost.org/doc/libs/1_58_0/doc/html/boost_asio/examples/cpp11_examples.html the chat client/ server examples may of particular interest you.

html - List in an auto height div -

i'm building website , i'm not experieced. have boxes different content (text, table , list). every box has padding of 40px , automatic height. on text 1 , table 1 it's working perfectly. list has problems: http://abload.de/img/status64u3x.jpg what doing wrong? want bottom edge of information box in same vertical position edge of edge of features box. since website have lot of different content different heights same layout kind of responsible solution ould awesome. therea css way it? this how want be: http://abload.de/img/howiwantithpuz9.jpg also here code: <div id="maincontainer"> <div class="boxseperator text"> <p> <span class="gross">  blender</span> </div> <div class="boxmenu"> <div class="boxcontainer"><a href="inspirations.html">inspirations</a> </div> <div class="boxcontainer"><a...

How to iterate through a list of modules and call their methods in Python 3 -

goal: ability drop files "modules" folder & call common set of methods/vars each file. should modules initialized static classes if of modules have common methods/vars? my project folder tree: /client __init__.py /modules __init__.py foo.py bar.py spam.py client __init__.py file: from client.modules import __all__ modulestrings (get list of "modules" "modulestrings") # how write function? # initialize modules dynamically module in modules: if (hasattr(module, 'init')): print(module.__name__) print("has initialize method!") module.init() # call do_stuff method in each module module in modules: if (hasattr(module, 'do_stuff')): print("has do_stuff method!") module.do_stuff() modules __init__.py file: # stores list of module string names in __all__ import os import glob files = glob.glob(os.path.dirname(__file_...

dplyr - R Conditional evaluation when using the pipe operator %>% -

when using pipe operator %>% packages such dplyr , ggvis , dycharts , etc, how do step conditionally? example; step_1 %>% step_2 %>% if(condition) step_3 these approaches don't seem work: step_1 %>% step_2 if(condition) %>% step_3 step_1 %>% step_2 %>% if(condition) step_3 there long way: if(condition) { step_1 %>% step_2 }else{ step_1 %>% step_2 %>% step_3 } is there better way without redundancy? working dygraphs if matters. here quick example take advantage of . , ifelse; x<-1 y<-t x %>% add(1) %>% { ifelse(y ,add(1), . ) } in ifelse if y true if add 1, otherwise return last value of x . . stand-in tells function output previous step of chain goes, can use on both branches. edit @benbolker pointed out, might not want ifelse , here if version. x %>% add(1) %>% {if(y) add(1) else .} thanks @frank pointing out should use { braces around if , ifelse statements continue chain. ...

javascript - Authenticate Firebase/Firechat with Wordpress user or database -

i'm trying use wordpress users authenticate automatically firebase/firechat. you can see here on documentation firebase can use custom authentication, using secure json web tokens: https://firechat.firebaseapp.com/docs/ they refer firebase page describes generating , using these tokens in depth: https://www.firebase.com/docs/web/guide/login/custom.html?utm_source=docs&utm_medium=site&utm_campaign=firechat so i'm trying accomplish these things: if user logged-in, have firechat recognize user-login , set chat alias that. if not logged-in, can still see chat when go talk should prompt them register or login (if take @ main example in firechat documentation using twitter login, can see using this. firechat example on home page well). set user moderator if author of page. not important i'd rather focus on getting chat work first , worry later. from understand functionality in firechat, , firebase apparently able authenticate server/system provided can g...

Android Wearable -- Get package name of installed apps from smart phone -

is there way package names of installed apps on wearable device (watch) smart phone? restriction have cannot install on wearable device itself. checked nodeapi ( https://developers.google.com/android/reference/com/google/android/gms/wearable/nodeapi ) gives me some information wearable device nothing regards apps installed. appreciated. thanks!

android - Spannable Grid Layout manager with fixed size of first items -

Image
i using twowayview library. have found spannablegridlayoutmanager useful me. trying achieve next result. let me explain this. need same layout. first grid cell rowspan = 2. can see on screenshot. may ask me, why ask question if post desired result. here 1 problem, current orientation of layout manager vertical, may notice gray space under layout. there 3 items in recycler view. if add more 3 that, depending on specified height. what need need have same result on first screenshot,but horizontal scroll. if change layout manager orientation horizontal following result. of course can play row , colspans desired result, different on each screen dimension. i need first 3 items of list same on first screenshot, ability scroll horizontally if there more 3 items. must scaled independently screen orientation, dimension, works vertical layout manager orientation. there shouldn't appear fourth, fifth item if there enough space 3 , in such layout. i have tried p...

ruby - Dashing dashboard won't display on Windows -

i ran following: dashing new project cd project bundle install && dashing start it listed "using" output , began server. output here . visiting localhost:3030 resulted in plain grey web page nothing on text try this: curl -d '{ "auth_token": "your_auth_token", "text": "hey, can do!" }' \http://localhost:3030/widgets/welcome @ top of page. page's generated source code here . running curl command, modified work on windows, seemed if worked, changed nothing on grey webpage. curl -x post -h "content-type: application/json" -d "{ \"auth_token\": \"your_auth_token\", \"text\": \"hey, can do!\" }" http://localhost:3030/widgets/welcome the console running server showed following: 127.0.0.1 - - [02/jun/2015 11:55:58] "post /widgets/welcome http/1.1" 204 - 0.0000 i figured out. must have node.js or kind of javascript engine inst...

xpages - How to store a list of dates in a multi-value field using SSJS? -

Image
in past, i've added multi-value text data field putting values simple javascript array. example: doc.replaceitemvalue('alwaysaccess', ["john doe","bob smith"]); any recommendations on how store series of dates in multi-value, time/date field in notes document? tl;dr: concept should identical multi-value field of string s, date(/time) values need valid notesdatetime values stored. a notes field can have multiple date/time values; can see in form, selecting field of type date/time , checking "allow multiple values". you can see multi-value of replaceitemvalue page of domino designer knowledge center . to accomplish same notesdominoapi (in ssjs), we'll need to: get handle on notesitem (the field, i'll create) create our values put in field (i'll create couple using session.createdatetime ) add these values java.util.vector , interpreted multi-value (you should able use ssjs array , if prefer) set...

Match status bar colour with most predominant colour of art Material Design Android -

i wondering if there kind of library/api or way match status bar colour imagery in whatsapp material design update. example here , here . thanks in advance! i'm not sure got it, can extract dominant colors in image palette support library . it lets extract, given bitmap, 6 colors might need: vibrant vibrant dark vibrant light muted muted dark muted light see here reference.

model view controller - How to start with the design of an OOP MVC app -

i started learn mvc, i'm trying make applicaction manage fuel, question how go defining appropiate models, , logicly breaking down parts involved, in design following: "the app must, include tank or deposit include stock of fuel, tank should able keep track of fuel has left." "the system must keep record of restocking , outs of tank, include entity equipment, truck or machinery loaded fuel." "at last equipment must keep record of hour meter of , able compare usage of fuel in order obtain performance." on technical side using zend framework 2, should contain on 1 module or make various modules , relate them. a module should considered standalone application. keeping in mind, that's should start from. consider typical blog module. blog must have categories , posts. since categories , posts part of 1 module , since interaction tightly coupled, wrong make categories , posts standalone modules. so in case, equipments , fuels ...

Forgot Neo4j Server Password -

because this question never answered, hoping me reset password connect neo4j password (at localhost:7474). zachary wrote post on solving restarting service using: sudo service neo4j-service restart but did not find helpful. in terminal, ran bin/neo4j restart (which think equivalent command), , not able reset password. depending on environment , installation type need file named auth under directory dbms , remove it. in macos, dmg installations (adjust custom locations): /users/xyz/documents/neo4j/default.graphdb/dbms/auth or (homebrew install) /usr/local/cellar/neo4j/x.x.x/libexec/data/dbms/auth windows users should same file in default.graphdb/dbms directory. in ubuntu /var/lib/neo4j/data/dbms/auth alternatively, might choose disable auth in configuration file, found in macos: /users/xyz/documents/neo4j/.neo4j.conf or /usr/local/cellar/neo4j/x.x.x/libexec/conf and set property false dbms.security.auth_enabled=false after doing this, nee...

Understanding Perl's `eval` -

i trying understand perl's eval function. here test script wrote: [red@tools-dev1 ~]$ cat evaltest.pl #!/usr/local/bin/perl -w use strict; while(<data>) { chomp; ($arg1, $arg2, $op ) = split /,/; $cmd = "$arg1 $op $arg2"; print "$cmd\n"; $rc = eval { $cmd }; print "rc [$rc]\n"; } __data__ 1,2,!= 1,1,!= 1,2,= 1,1,= 1,2,== 2,3,> 3,2,> 3,3,> 2,3,>= 3,2,>= 3,3,>= 2,3,< 3,2,< 3,3,< 2,3,<= 3,2,<= 3,3,<= when execute output ... [red@tools-dev1 ~]$ ./evaltest.pl 1 != 2 rc [1 != 2] 1 != 1 rc [1 != 1] 1 = 2 rc [1 = 2] 1 = 1 rc [1 = 1] 1 == 2 rc [1 == 2] 2 > 3 rc [2 > 3] 3 > 2 rc [3 > 2] 3 > 3 rc [3 > 3] 2 >= 3 rc [2 >= 3] 3 >= 2 rc [3 >= 2] 3 >= 3 rc [3 >= 3] 2 < 3 rc [2 < 3] 3 < 2 rc [3 < 2] 3 < 3 rc [3 < 3] 2 <= 3 rc [2 <= 3] 3 <= 2 rc [3 <= 2] 3 <= 3 rc [3 <= 3] ... trying output looks more this: 1 ...

cannot get email attachment in Pentaho kettle -

i'm trying extract email attachement in kettle (pentaho pdi) using 'email messages input', looked @ other examples , follow example ,here input step different 'get mails (pop3 / imap)' , 1 can specify attachment. i'm using pdi 5.2 , tried in 5.3, , second type of input 'pop3/imap' not there. is there other way how hold of attachment? thank help just create job. , find step there.

javascript - Bluebird PromisifyAll without any Async suffix, i.e. replace the original functions possible? -

bluebird has promisifyall function "promisifies entire object going through object's properties , creating async equivalent of each function on object , prototype chain." it creates functions suffix async . is possible replace old functions entirely? replaced functions work original functions addition return promise, thought should safe replace old functions entirely. var object = {}; object.fn = function(arg, cb) { cb(null,1) }; bluebird.promisifyall(object); object.fn // not want object.fnasync // => should replace `object.fn` there's option specify custom suffix option unfortunately doesn't work empty string bluebird.promisifyall(object, {suffix: ''}); rangeerror: suffix must valid identifier the problem if walks prototype , places *async functions - need brand new copies of every object in prototype chain fail since libraries return own objects. that - if you're using mongoose , you're getting collection o...

r - Subset of a table that contains at least one element of another table -

i have 2 tables made intervals of bp, table1 has large intervals , second has short intervals (just 2bp). want make new table contains table 1 ranges have @ least 1 element of table 2 contained in "large" ranges. if doesn´t have element in table 2 corresponds table 1 range, range of table 1 should not included. in example row 2 ( 1, 600, 1500 ) of table1 ( df ) should not included: df <- "chromosome start end 1 1 450 1 600 1500 2 3500 3585 2 7850 10000" df <- read.table(text=df, header=t) table2 ( df2 ) df2 <- "chromosome start end 1 5 6 1 598 599 2 3580 3581 2 7851 7852 2 7859 7860" df2 <- read.table(text=df2, header=t) newtable ( dfout ): dfout <- "chromosome start end 1 1 450 2 3500 3585 2 7850 10000" dfout <- read.table(text=df2, header=t) try foverlaps data.table library(data.table) setkey(setdt(df1), chromosome, start, end) setkey(setdt(df2), chromosom...

javascript - Can i add class to a different element of hover with jquery/js -

i have mutable elements different id , want match id name class on tag toggle class tag` <a id="ab" href="" class="divone marker"><span>this ab</span></a> <a id="aba" href="" class="divtwo marker"><span>this aba</span></a> <a id="abab" href="" class="divthree marker"><span>this abab</span></a> <div id="divone"></div> <div id="divtwo"></div> <div id="divthree"></div> when hover on div gets id matches class on tag , adds class active , when remover hover removes class i hope makes sense , appreciated thanks in advance dan you can use jquery.hover() http://jsfiddle.net/4snhdpx1/6/ $('div').hover(function(event) { if (event.type == 'mouseenter') { $('.' + this.id).addclass('active'); ...

android - Is there a way to use PyCharm to code over MonkeyRunner -

i wondering if ever tried use pycharm code scripts monkeyrunner android, , how ?

jsf - The value of input range is not updated on submit -

i have rangesliders like: <h:form> <input name="range1" id="range1" min="0" max="5" value="#{prefprofilebean.pref1}" type="range"/> <input name="range2" id="range2" min="0" max="5" value="#{prefprofilebean.pref2}" type="range" /> ... <p:commandbutton value="profil speichern" onclick="pf('updprofile').show();" action="#{prefprofilebean.submit}" /> in view value of sliders updated, press submit button values not written, instead values stay same initially. way cant change , save values in database. can use onchange action somehow override initial values shown changed ones... can tell me how actual chosen value out of components?

c++ - Logger for handling both wide and non-wide strings -

i want single logging function/macro similar cout/wcout, can take both std::string , std::wstring (and wchar_t, etc) input. wide inputs converted utf8 before being sent stream. ideally use it: logger << utf8str << widestr << std::hex << 84 << " blah " << 1.2 << std::endl; a global overload of operator<< not work me, since collides other parts of project. i'm trying extend std::ostringstream this: #include <iostream> #include <sstream> #include <string> #include <locale> #include <codecvt> using namespace std; string wtoutf8(const wstring &wswide) { typedef std::codecvt_utf8<wchar_t> convert_typex; std::wstring_convert<convert_typex, wchar_t> converterx; return converterx.to_bytes(wswide); } struct clogstream : public virtual std::ostringstream { // allow wstrings clogstream& operator<< (const wstring& ws) { *this << wtoutf8(w...

ios - Rounded corners with NSMutableAttributedString -

my question think simple couldn't find google. using nsmutableattributedstring modify styles in string , example use code change background color: [string addattribute:nsbackgroundcolorattributename value:[uicolor colorwithred:0.4 green:0.8 blue:1 alpha:1] range:nsmakerange(0,18)]; and question is, how can round corners of background? in advance.

.net - Integrate SSRS with AngularJS? -

i have project, frontend using pure html5/angularjs, webservice using .net, , report ssrs. i have major problem of displaying ssrs reports on frontend. tried embed report in iframe pops credentials always, not practical. i want know if possible backend can retrieve ssrs report, wrap html or other consumable format, exposes webservice. frontend call webservice , display on screen. is there sample code doing this? take @ answer display pdf reporting services except in case download format .html , embed in iframe so like: uri uridownload = new uri("http://myreportserver?myreport&rs%3acommand=render&rs:format=html"); string strsavepath = @"c:\temp\report.html"; system.net.webclient wcli = new system.net.webclient(); wcli.downloadfile(uridownload, strsavepath); then set iframe's src downloaded file.

asp.net - Connection property has not been initialized when filling a DataSet -

Image
so here issue: currently trying make report show 1st , 2nd shifts, multiple days... so if select range 6/02 - 6/04, running query 3 times... once 6/02, 6/03, , 6/04... can select shift, dates, 4:30am-4:30pm 1st shift.... currently have error, when trying put queries/calls inside loop... calculate difference of 2 dates , set them fine, connection string gives me error: if image not easy see here text description of error: server error in '/mfgx_test' application. fill: selectcommand.connection property has not been initialized. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.invalidoperationexception: fill: selectcommand.connection property has not been initialized. source error: line 623: dim dstop1 new dataset line 624: dim datop1 new sqldataadapter(strsql, mycn1) line 625: ...

javascript - Is there some way I can pass a reference to an Angular model to a scope function? -

i have several canvas areas in web app capture peoples' signatures, on official documentation. busy trying develop popup, provide larger area user sign on, on smaller devices. signature areas this: <canvas width="400" height="200" ng-signature ng-model="party1.signaturebase64"></canvas> <a href="" ng-click="getsignaturemodal(party1.signaturebase64)">show signature pad</a> then have following function on view scope pops modal gather signature data, javascript's "by value" passing, stuck how return value function model. $scope.getsignaturemodal = function (signaturebase64) { var modalinstance = $modal.open({ templateurl: 'signaturewindow.html', controller: 'signaturemodalcontroller', size: 'lg', resolve: { base64: function () { return signaturebase64; } } }); modalinstan...

api - How to use authorization header PHP -

i trying use authorization header in order use vimeo api. it tells me 'authorization: basic ' + base64(client_id + ':' + client_secret) , can do. but on internet tell me code? not php, go in php file? if function use on after storing it? go in htaccess file? it sad how terrible , online documentation on this. to summarize, im saying show me code thanks help $api_url = 'http://myapiurl'; $client_id = 'myclientid'; $client_secret = 'myclientsecret'; $context = stream_context_create(array( 'http' => array( 'header' => "authorization: basic " . base64_encode("$client_id:$client_secret"), ), )); $result = file_get_contents($api_url, false, $context); documentation links: file_get_contents stream_context_create http context options for more complex requests, can use curl , library's php implementation mess , prefer avoid when can. guzzle library abstracts...