Posts

Showing posts from April, 2013

Compile C++ error -

#include "std_lib_facilities.h" int main() { constexpr double euro_to_dollar = 1.11; constexpr double yen_to_dollar = 0.0081; double dollar = 1.00; char unit= 'a'; cout <"please enter value followed e or y: \n"; cin >>dollar>> unit; if (unit= 'e') cout << dollar << "euro == " << euro_to_dollar*dollar << "dollar\n"; else if (unit='y') cout << dollar << "yen== " << yen_to_dollar * dollar << "dollar\n"; } 5 error: 'constexpr' not declared in scope 5 error: expected ';' before 'double' 7 error: expected ';' before 'double' 15 error: 'euro_to_dollar' not declared in scope 17 error: 'yen_to_dollar' not declared in scope i'm doing problem programming: principles , practice using c++ (2nd edition)by bjarne stroustrup. , can see i'm doing wrong here. try...

angularjs - What's wrong with ngAnimate and ui.bootstrap modal? -

in example http://plnkr.co/edit/etwexjk0hru3b8wovojq angular.module('animateapp', [ 'nganimate', // adding causes issue modal backdrop 'ui.bootstrap' ]) when close modal, backdrop won't go away. if comment out 'nganimate' dependency (script.js line 4), works fine. am doing wrong or bug in ui.bootstrap when used nganimate? it appears breaking change somewhere between angular 1.3.15 , 1.4.0. apparently in nganimate changed interferes backdrop hiding. if turn off animation, backdrop hides fine: $scope.openmodal = function() { $modal.open({ templateurl: 'modal.html', controller: 'modalctrl', backdrop: true, animation: false }); } if drop down 1.3.15, there no issue: plunker if check dependencies page ui-bootstrap, doesn't have quite caught 1.4.0 yet: https://david-dm.org/angular-ui/bootstrap#info=devdependencies it may worth posting issue or seeing if has already. ...

javafx - Static contextMenu in TreeCell -

in tutorial https://docs.oracle.com/javafx/2/ui_controls/tree-view.htm contextmenu added treecell allow item specific context. instead of creating new contextmenu() every cell feasible in case make contextmenu static , create items inside static initializer e.g. private final class textfieldtreecellimpl extends treecell<string> { private static final contextmenu addmenu = new contextmenu(); static { menuitem addmenuitem = new menuitem("add employee"); addmenu.getitems().add(addmenuitem); addmenuitem.setonaction(new eventhandler() { public void handle(event t) { treeitem newemployee = new treeitem<string>("new employee"); gettreeitem().getchildren().add(newemployee); } }); } is there benefit in creating new contextmenu instance every cell?

c++ - How to store text file on embedded systems flash memory and read from it -

i'm trying following: storing text file (7kb) in flash memory of steval-mki109v2 (running freertos) board , read text file , doing computation on device itself. have 2 problems regarding that: 1) storing text file enough add text file keil project? can access after compiling? 2) accessing data that's failed until now. @ first tried using fopen() stdio.h got errors on compilation. found out project compiles using microlib seems doesn't include file i/o. after compiling standard c - library successful reach fopen part in code system crashes. now don't know if reason text file not found or if cannot use fopen() on embedded system. didn't find further information inside stm documents or forums except flash_unlock(); function seems it's used writing. do need store text file in way , access memory address instead of filename? i'm confused , cannot find information online. thanks in advance help! if want contents of file char-string, can conv...

Grails jQuery icons not showing up -

application.css *= require main *= require mobile *= require_self *= require bootstrap *= require themes/ui-lightness/jquery-ui-1.10.4.custom *= require_tree . application.js //= require jquery //= require js/jquery-ui-1.10.4.custom //= require_tree . //= require_self //= require bootstrap if (typeof jquery !== 'undefined') { (function($) { $('#spinner').ajaxstart(function() { $(this).fadein(); }).ajaxstop(function() { $(this).fadeout(); }); })(jquery); } buildconfig.groovy // plugins compile step compile ":scaffolding:2.1.2" compile ':cache:1.1.8' compile ":asset-pipeline:1.9.9" compile ":spring-security-core:2.0-rc4" compile ":spring-security-ui:1.0-rc2" compile ":mail:1.0.7" compile ":jquery-ui:1.10.4" compile ":famfamfam:1.0.1" // plugins needed @ runtime not compilation runtime ":hibernate4:4.3.6.1" // or ...

Dynamic orderBy Breaks ng-repeat in view in AngularJS -

i having problem dynamically ordering data getting through service in controller. data loads fine when initial search, try update orderby, of data in views disappear instead of being reordered. data displaying in view data stored $scope.filtered_events. also, controller attached via router template. search controller (function () { .controller("search", function ($scope, zipcodesvc, $filter, $http) { $scope.$on("search", search); $scope.sortby = "date"; function search(evt, data) { $scope.zip_codes = []; $scope.locations = null; $scope.response = null; $scope.events = null; zipcodesvc.find(data.str, data.dist) .then( function (response) { $scope.locations = response; for(i=0; i<$scope.locations.zip_codes.length; i++){ $scope.zip_codes.push($scope...

java - When reassigning color to pixels, all color is black -

simplified code: public static void main(string[]args) throws exception { bufferedimage img = new bufferedimage(512, 512, bufferedimage.type_int_argb); (int = 0; < 512; i++) { (int j = 0; j < 512; j++) { if (complex.getinfinite()) { color newcol = new color(100, 0, 0); img.setrgb(i, j, newcol.getrgb()); } if (complex.getinfinite() == false) { color newcol = new color(0, 0, 100); img.setrgb(i, j, newcol.getrgb()); } } } saveimage(img, new file("julia.jpg")); } my problem when run program, julia.jpg black image. have played around amount of pixels color , pixels coloring turn black. i wondering if issue when generated image gave wrong type. change bufferedimage img = new bufferedimage(512, 512, bufferedimage.type_int_argb); to bufferedimage img = new bufferedimage(512, 512, bufferedimage.type_int_bgr); ...

java - How to make a class extending a jLabel so that it appears as a JLabel in my main class? -

so, i'm making memory. have tile class, @ point have number, , boolean (to show if flipped or not). made duplicates of numbers tile objects , randomized them, , in turn added them layout. basically, need them show on screen jlabels, , i'm not sure how this? should extending else, or special in tile class? or problem logic elsewhere? here's tile class @ point (very little) ps. need use timer flippy flop class tile extends jlabel implements actionlistener{ boolean flipped; int imagenum; imageicon image; jlabel card; tile(int num, boolean f) { imagenum=num; flipped=f; card=new jlabel(""+imagenum); } public void flipcard() { } public void actionperformed(actionevent a) { } any appreciated! edit: here's main class try add tiles jpanel gridpanel = new jpanel(new gridlayout(gridsize, gridsize)); tile[][]tiles=new tile[(gridsize*gridsize)/2][2]; boolean[][]tileplaced=new boolean[(gridsize*gridsize)/2][2]; jlabel[][] card...

gruntjs - Compiling Bootstrap less files -

i read in 'getting started' page on bootstrap's website need have autoprefixer , grunt. what these , how use them when i'm compiling bootstrap's less files? i able compile less file (bootstrap.less) css file using prepos program still not sure if using autoprefixer or grunt. my system , program: os: lubuntu 15.04 64 bit text editor: sublime text program installed: node.js, less, grunt-cli autoprefixer , grunt node packages available via npm. i'd recommend starting grunt's getting started guide: http://gruntjs.com/getting-started

html - presentation of .htaccess dialog -

i using .htaccess provide access password protected section of web site. possible incorporate process in html page more presentable standard dialog box? it's kinda possible there javascript trickery believe can done if using apache 2.4 can use module called mod_auth_form give html friendly alternative. this module allows use of html login form restrict access looking users in given providers. html forms require more configuration alternatives, html login form can provide friendlier experience end users. http://httpd.apache.org/docs/2.4/mod/mod_auth_form.html so if haven't upgraded, time. :)

javascript - AngularJS losing two way binding after JS form plugin rendering -

i'm hoping better understanding of angularjs might able shed light on whats going on here. i have webpage long form. after js form plugin initialized, in form no longer has 2 way data binding. js plugin reference can found here if remove id link js plugin, not applying or rendering steps plugin, 2 way data binding works expected. i post lot of code here i'm not sure help. have no problem posting code @ request. any ideas on why 2 way data binding losing effect after rerendering form tag , contents? i able angularjs work correctly plugin including plugin @ bottom of page instead of top. think key here let angularjs load first, page, jquery steps plugin (at boom of page uses it). thanks comments!

c++builder - Unwanted W8080 warnings from TeeChart component in CBuilder XE8 -

when compiling project under cbuilder xe8 uses teechart components distributed ide, long reams of errors this: [bcc32 warning] gdiplusstringformat.h(306): w8058 cannot create pre-compiled header: initialized data in header [bcc32 warning] mi3proc.cpp(719): w8080 'gdiplus::flatnessdefault' declared never used [bcc32 warning] mi3proc.cpp(719): w8080 'gdiplus::genericsansseriffontfamily' declared never used [bcc32 warning] mi3proc.cpp(719): w8080 'gdiplus::genericseriffontfamily' declared never used [bcc32 warning] mi3proc.cpp(719): w8080 'gdiplus::genericmonospacefontfamily' declared never used [bcc32 warning] mi3proc.cpp(719): w8080 'gdiplus::genericsansseriffontfamilybuffer' declared never used [bcc32 warning] mi3proc.cpp(719): w8080 'gdiplus::genericseriffontfamilybuffer' declared never used [bcc32 warning] mi3proc.cpp(719): w8080 'gdiplus::genericmonospacefontfamilybuffer' declared never used [bcc32 warning] mi3proc.cpp(71...

postgresql - Parallel Aggregation with postgres insert/copy locking and blocking -

i need big amount of calculation, insert result postgres database. used parallel aggregation calculation , shard processor count. i noticed each cycle, first 5 mins, cpu utilization 100% cores doing calculation. next 30 mins, data copied postgres different threads, blocks each other... wondering should optimize it. sharding not option here, partition table date, don't want make complicated sharding again personid... is there way resolve issue? possible put data single queue , let postgres process queue? more details: in each thread, 2 things: 1) calls data service calculation, , result set 2) copy result set database table(kpis_weekly) we start n (n = processor count) threads above process, data sharded personid spread evenly on threads. bottle neck database table. these threads have insert same table, therefore block each other , slow down whole thing. the issue (as op rightly pointed out) funneling writes thread generate 1 single table bottleneck. what h...

python - Pandas issue iterating over DataFrame -

i'm using pandas scrape web page , iterate through dataframe object. here's function i'm calling: def getteamroster(teamurl): teamplayers = [] table = pd.read_html(requests.get(teamurl).content)[4] nametitle = '\n\t\t\t\tplayers\n\t\t\t' ratingtitle = 'singlesrating' finaltable = table[[nametitle, ratingtitle]][:-1] print(finaltable) index, row in finaltable: print(index, row) i'm using syntax advocated here: http://www.swegler.com/becky/blog/2014/08/06/useful-pandas-snippets/ however, i'm getting error: file "squashscraper.py", line 46, in getteamroster index, row in finaltable: valueerror: many values unpack (expected 2) for it's worth, finaltable prints this: \n\t\t\t\tplayers\n\t\t\t singlesrating 0 browne,noah 5.56 1 ellis,thornton 4.27 2 line,james 4.25 3 desantis,scott j. 5.08...

c# - DevForce doesn't always fire Queued Events if they are queued during a call to FireQueuedEvents -

we running cases change property on our entity propertychanged event doesn't fire. doing logic part of save , problem seems way devforce queues events during save. looking @ code loadingblock.dispose(), see this: public void dispose() { this._entitymanager.firequeuedevents(); this._entitymanager.isloadingentity = this._wasloadingentity; } there race condition there fire queued events before changing isloadingentity property. means new events generated during firequeuedevents queued (since isloadingentity still true) events queued never fired since fired queued events (that knew about). seems devforce should reset isloadingentity flag before firing events. think solve our problems. here code might explain our case. i'll use merge call instead of savechanges since it's easier use in unit test: //create main entity manager , test entity var em = new entitymanager(); var entity = new myentity {sid = 123}; em.attachentity(entity); //create second c...

sass - Message appears when running scsslint -

i following step step on https://www.npmjs.com/package/grunt-scss-lint have installed everything, , seems working fine when type in terminal 'scss-lint'. however want running in grunt gruntfile: scsslint: { allfiles: [ 'src/scss/**/*.scss', ], options: { bundleexec: true, config: '.scss-lint.yml', reporteroutput: 'scss-lint-report.xml', colorizeoutput: true } }, grunt.registertask('default', ['js', 'html', 'scsslint',]); so type in grunt in terminal run tasks , in terminal - pops up: running "scsslint:allfiles" (scsslint) task running scss-lint on allfiles please make sure have ruby installed: ruby -v install scss-lint gem running: gem update --system && gem install scss-lint running through grunt not work typing scss-lint in terminal...

Python script to turn input csv columns into output csv row values -

i have input csv like email,trait1,trait2,trait3 foo@gmail,biz,baz,buzz bar@gmail,bizzy,bazzy,buzzy foobars@gmail,bizziest,bazziest,buzziest and need output format indv,attrname,attrvalue,start,end foo@gmail,"trait1",biz,,, foo@gmail,"trait2",baz,baz,, foo@gmail,"trait3",buzz,,, for each row in input file need write row n-1 columns in input csv. start , end fields in output file can empty in cases. i'm trying read in data using dictreader . i've been able read in data import unicodecsv import os import codecs open('test.csv') csvfile: reader = unicodecsv.csv.dictreader(csvfile) outfile = codecs.open("test-write", "w", "utf-8") outfile.write("indv", "attr", "value", "start","end\n") row in reader: outfile.write([row['email'],"trait1",row['trait1'],'','']) outfile.write([row...

osx - Prevent Terminal Scrollback In Curses (Python)? -

setup: iterm2 in mac os x python 2.7 application using curses. leaving alone works fine; uses timer update information , rewrite screen , 2 pads. if accidentally "scroll up" mousewheel or mousepad, see individual "frames" written iterations in program's while-loop. also, causes kind of memory or cpu lag such takes long time bottom , view actual application again. if @ possible, i'd avoid this. thoughts?

excel vba - how to add item to a combobox on button click? -

Image
i want add item combobox found in excel worksheet text box located in user form when button clicked.i see value added combobox become empty when close , reopens workbook.can 1 me handling this? thank u you're fast response first thank both feedback , correction.let me make more clear concern create workbook , save xlsm. on first worksheet define user name follows: name: dn_cmb_items range: ="" using developer ribbon add excel (not activex) combobox onto worksheet1 , set list-by-range dn_cmb_items open vba editor , add user form workbook, name frm_add_cmb_item , set showmodal false . drop text box form , name tb_item_text . drop button form, name cmb_add , context menu choose view code . creates click event handler. implement handler follows: private sub cmb_add_click() dim v_r range, v_n name set v_n = names("dn_cmb_items") if v_n.value = "=""""" v_n.value = "=...

ios - UITableView with Multiple Data Arrays -

i have app, in have 7 different uitableviewcontroller s. 7 linked through tabbarcontroller . looking way have single custom class used throughout 7 uitableviewcontroller s. have 7 different arrays hold specific number of objects. need know how to: change number of rows in tableview , depending on array i'm using data source. change array being used data source based on viewcontroller user looking @ (can done?) change contents of cell, based on array being used data source. i'm familiar using uitableview single data source, don't know how approach multiple data sources. thanks! • change number of rows in tableview, depending on array i'm using data source. you can accomplish conditions in tableview delegates - (nsinteger)tableview:tableview numberofrowsinsection:section inside delegate need identify datasource particular tableview. check table if 1 being refreshed so: - (nsinteger)tableview:tableview numberofrowsinsection:section ...

logging - Algorithm to find record in a log structured file system -

i have log of records. each record has id , timestamp. new records appended log monotonically increasing id, though there can deletion of records in between. the problem - if given timestamp t1, provide efficient algorithm determine log record has timestamp = ceil(t1). points note. log can big millions of records. there can missing records because of record deletion. example: if log record = (id, timestamp), log can shown this: (1, 10), (2, 11), (5, 15), (8,18), (9, 19), (10, 20) find id of record min timestamp greater or equal 17. answer 8. find id of record min timestamp greater or equal 11. answer 2. find id of record min timestamp greater or equal 22. answer nil find id of record min timestamp greater or equal 5. answer 1 i have come simple data-structures solve problem. /* index: 0 1 2 3 4 5 6 7 8 9 10 11 12 */ int ids[]= {1, 2, 6, 7, 10, 11, 12}; int map[]= {0, 1, 1, 0, 0, 0, 1, 1, 0, 0...

javascript - Multiple forms & Navigating away from unsaved changes -

i using this: alert unsaved changes in form alert unsaved changes. my issue have multiple forms on page: - searchform - recordform i want alert trigger recordform , not searchform. i can't seem figure out. you have set id recordform container, , change selector trigger event: // in case 'record-form' id $("#record-form :input").change(function(){ unsaved = true; });

database migration - How to disable updating of structure.sql in rails? -

this question has answer here: how disable db:schema:dump migrations 6 answers is there config option let disable updating of structure.sql? it updates everytime run migration , don't need update. we need legacy tables. you can disable in config/application.rb : config.active_record.dump_schema_after_migration = false see configuration guide here .

javascript - Is there XML, XSLT, and XPATH support in the new Microsoft Edge browser? -

does have information xml, xslt, or xpath support in new microsoft edge browser? in specific: when use javascript function transformtodocument() , ends following error message: “error in transformnode: invalid argument” . the same code working ie 10, ie 11, chrome, safari, etc., unfortunately not working new browser. looks xpath included: https://msdn.microsoft.com/en-us/library/dn974343(v=vs.85).aspx

javascript - How can I rename a folder name using grunt? -

there folder say... vendor/jquery-1.10.0 how can write grunt task such can strip off version off of dependency name? i.e want vendor/jquery this can last task the grunt list of tasks. do not want while copy happening. the first results on searching grunt rename folder show grunt-contrib-rename npm. may want check out. i don't know flow, maybe should consider making symlink instead of renaming folder every time, @meder suggested. either create 1 manually , don't care renaming folder more, or use grunt-contrib-symlink create in task.

Cannot build Grails app in Eclipse with Java 1.8 -

i've inherited grails project , trying build in eclipse java 1.8. can build war file java 1.7 when switch 1.8 , rebuild following error: openjdk 64-bit server vm warning: ignoring option maxpermsize=256m; support removed in 8.0 | error java.lang.reflect.invocationtargetexception | error @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) | error @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) | error @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) | error @ java.lang.reflect.method.invoke(method.java:483) | error @ org.codehaus.groovy.grails.cli.support.grailsstarter.rootloader(grailsstarter.java:234) | error @ org.codehaus.groovy.grails.cli.support.grailsstarter.main(grailsstarter.java:262) | error caused by: java.lang.noclassdeffounderror: [ljava/util/hashmap$entry; | error @ java.lang.class.getdeclaredmethods0(native method) | error @ java.lang.class.privateget...

python - Pandas not recognizing NaN as null -

Image
i have dataframe, portion of looks this: i read in file using line of code: df = pd.read_table(oname,skiprows=1,sep='\t',usecols=(3,4,5),names=['year','month','snow_depth']) when call df.isnull(), false each cell when nan should come true default, believe. have idea why isn't getting picked on? edit: results of df.info() <class 'pandas.core.frame.dataframe'> int64index: 360 entries, 516 875 data columns (total 3 columns): year 360 non-null int64 month 360 non-null int64 snow_depth 360 non-null object dtypes: int64(2), object(1) memory usage: 11.2+ kb it looks data had 'nan' values ' nan' can add param read_table , na_values=[' nan'] , add default list of values treat nan . alternatively can replace them using: df.replace(' nan', np.nan)

angularjs - How to send all value of checkboxes on server? -

i have html code generated angular js via ng-repeat : <li ng-repeat="(key, item) in data.conditions_list" ng-class="{active: item.active}"> <span class="sbrand-checkbox"> <input ng-checked="item.active" type="checkbox" ng-model="formdata.conditions[item.id]"> </span> <label>{{item.name}}</label> </li> this code sets checkboxes on active state if ng-checked="item.active" . works. when checked unchecked element , submit checked default form see: ["conditions"]=> array(1) { [5]=> string(4) "true" } so, means sent thta checkbox have cheked. others not sent on server. i can as: html: <input ng-checked="ischecked(item.active, item.id)" type="checkbox" ng-model="formdata.conditions[item.id]"> angular js: $scope.ischecked = function ...

python - Sending multiple bytes through Serial Communication -

i using arduino , python 3.4 pyserial , trying send multiple bytes through serial communication, having issues since code running, print statements have in places debugging purposes outputting strings not expecting. have tried writing simplified version of code , works correctly, not sure doing wrong! also, in attempt fix this, put in if statement in has slowed down code lot. suggestions on how streamline code faster and/or how send , receive right data appreciated! python: #sources: #http://stackoverflow.com/questions/676172/full-examples-of-using-pyserial-package more info #http://pyserial.sourceforge.net/pyserial_api.html import serial import time #sets connection parameters, relook @ when know more ser = serial.serial( port ='com4', baudrate = 9600, parity = serial.parity_odd, stopbits = serial.stopbits_two, bytesize = serial.eightbits, timeout = 5 ) def dectopercent (decimal): #maps value 0-1 0-255 , makes interger, hex ...

scripting - modify the thread pool in websphere 8.5 using wsadmin script -

i want modify thread pool size default, work manager, , on.. using wsadmin (jython) scripting. how change maximum , minimum sizes?? i can't seems find correct document change of thread pool settings, "adminconfi.modify" not responding attributes this makes sense me. assuming id coming in result of getid on jvm. list of thread pools, grab id's of thread pools want modify (in case 'default' , 'webcontainer' thread pool) modify. adminutil crux of one, else threadpool "list" 1 big nasty useless string. def setthreadpools(id): threadpools=adminconfig.list('threadpool',id) threadpoollist=adminutilities.converttolist(threadpools) tps in threadpoollist: if adminconfig.showattribute(tps,'name') == 'default': defaultthreadpoolid=tps if adminconfig.showattribute(tps,'name') == 'webcontainer': webcontainerthreadpoolid=tps adminconfig.modify(defaultthreadpoo...

java - Using PrepareCall method to pass a parm to a function and to return a count Value -

i wrote function in oracle, takes parm , return count. stored procedure's return type number. call function using preparecall method in java as, public static int checkpreviousload(int id) { int countprev = 0; //here run function existing count of loaded id. try { callablestatement proc_stmt = connection.preparecall(" {? = call f_chk_previousload(?)}"); proc_stmt.setlong(1, id); // register type of return value proc_stmt.registeroutparameter(1, oracletypes.number); // execute , retrieve returned value. proc_stmt.execute(); resultset rs = (resultset) proc_stmt.getobject(1); rs.next(); countprev = rs.getint(1); system.out.println("the count is: "+countprev); rs.close(); proc_stmt.close(); } catch(sqlexception e) { string temp = e.getmessage(); system.out .println("error: sql exception...

java - Bitmap OutOfMemoryError -

i have question error. i make favicon parser urls. like: public class grabiconsfromwebpage { public static string replaceurl(string url) { stringbuffer sb = new stringbuffer(); pattern p = pattern.compile("https?://.+\\..+?\\/"); matcher m = p.matcher(url); while (m.find()) { sb.append(m.group()); } return sb.tostring(); } public static string getfavicon(string url) throws ioexception { try { document doc = jsoup.connect(url).get(); element element = doc.head().select("link[href~=.*\\.(ico|png)]").first(); if (element != null) { if (element.attr("href").substring(0, 2).contains("//")) { return "http:" + element.attr("href"); } else if (element.attr("href").substring(0, 4).contains("http")) { return element.attr("href"); } else { return replaceurl(...

How to use Samsung OAuth login on Android Device? -

i interested in adding oauth 2.0 login samsung accounts on android device, can't seem find documentation on this. please share apis, documentation on how achieve samsung accounts? seems complicated: should explaining stuff there: samsung doc seems more or less in beta , not know if still possible key. drop them mail know status of api :d if refer response of link , mentionned chaton has been closed last year project has been taken down , there never stable , working account api :( use google auth instead, used, give try, never know maybe it's working!

javascript - How to Slide Left to Right an Element by jquery -

trying slide h3 title right direction jquery slider . slider has fade effect default, i'm trying give slideright effect h3 title of slider. html: <div id="headslide"> <ul> <li class="post-content"> <div class="slidshow-thumbnail"> <a href="#"> <img src="http://3.bp.blogspot.com/-h4-nqvz5-ve/vq3hltss3zi/aaaaaaaabic/iaoda5zoumw/s350-h260-c/girl_with_winter_hat-wallpaper-1024x768.jpg" height="260" width="350"/> </a> </div> <span class="content-margin"> <p>cicero famously orated against p...</p> /* title */ <h3><a href="#">download premium blogger templates</a></h3> <span class="info">info</span> </spa...

R: scatterplot from list -

Image
i have data similar following: a <- list("1999"=c(1:50), "2000"=rep(35, 20), "2001"=c(100, 101, 103)) i want make scatterplot x axis years (1999, 2000, 2001 given list names) , y axis value within each list. there easy way this? can achieve close want simple boxplot(a) , i'd scatterplot rather boxplot. you create data frame year in 1 column , value in other, , plot appropriate columns: b <- data.frame(year=as.numeric(rep(names(a), sapply(a, length))), val=unlist(a)) plot(b)

python - Is it possible to create __attribute__((__constructor__)) functions in Cython source? -

when writing cython implementation file (.pyx), possible define functions __attribute__((__constructor__)) or __attribute__((__destructor__)) of shared library cython create extension module? it wouldn't make sense place these prototype declarations in header file unless defined them in c file , compiled such function implementations cimport ed... __constructor__ -ness of function apply that compiled library, not 1 compiled cython. note not referring __cinit__ or __dealloc__ extension types instead c-specific functions designed run upon library load or unload. it not clear me if requirements of module built cpython api (e.g. py_initmodule ) prevent module having other function built entry hook automatically invoked when library loaded (or unloaded destructor).

naming conventions - Best Powershell verb to indicate Validation? -

i have method validates particular value. in powershell, convention use verb within 'get-verb' list, puzzled on 1 best usage. alternatively, if design architecture should change avoid validation through method in other manner welcome suggestions along line too. verbs related are: ensure, compare, edit, convert, initialize, update, assert, confirm, measure, resolve, test, write, grant , use . the appropriate verb validating value test . quoting approved verbs list (section diagnostic verbs ): verb (alias) action comments ... ... ... test (t) verifies operation or action, not use verbs consistency of resource. such diagnose, analyze, salvage, or verify.

java - Implementing Factory Pattern with reflection -

i implementing factory pattern here factory class: class productfactory { private hashmap m_registeredproducts = new hashmap(); public void registerproduct (string productid, class productclass) { m_registeredproducts.put(productid, productclass); } public product createproduct(string productid) { class productclass = (class)m_registeredproducts.get(productid); constructor productconstructor = cclass.getdeclaredconstructor(new class[] { string.class }); return (product)productconstructor.newinstance(new object[] { }); } } and here concrete class: class oneproduct extends product { static { factory.instance().registerproduct("id1",oneproduct.class); } ... } my question: how enforce concrete implementations register id along class object? - because if class doesn't register in factory cant used. can't use abstract class requires somehow child send name , id parent, enforcin...

Javascript rating - result to same line -

how can result 1-5 in same line, while hovering on circles? please see http://jsfiddle.net/3xlnxahq/ <div id="wrapper"> <div id="content"> <ul id="rating"> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> </ul> </div> </div> you defined clear:left in ratinginfo div. means no other floating elements can left of it, , it's appearing sort of new line. replace float left declaration. also p tag adding paragraph space disrupts float left declaration. change p tag div tag. working fiddle http://jsfiddle.net/3l9rhqt0/ new css: #ratinginfo {float:left; width:5...

sql - Chartkick gem, limit group in pie chart and multiple series -

Image
i have small problem grouped records. chart code: <%= pie_chart countchatline.group(:channel).count %> the problem is, have more few :channels in database, , chart looks this: can somehow take n top :channels , sum rest of others or something? or add others every :channel has less n%? the chartkick gem (which started using), chart whatever data provide it. it's data provide looks like. yes, can absolutely reduce number of slices in pie aggregating them, however, need yourself. you can write method in model summarize , call such: <%= pie_chart countchatline.summarized_channel_info %> method in countchatline model: def self.summarized_channel_info {code info , convert format want} end hope helps. that's did.

dns - WordPress.org and Vanilla Forums on 1 VPS -

i looking @ setting blog , forum. using wordpress.org blog , vanilla forums forum. buy 2 vpss if can work on 1 vps better. i set mydomain.com/www.mydomain.com goes wordpress website , forum.mydomain.com goes vanilla forums. hosting vps ovh using vps classic. using centos on vps if helps. i have looked around not find answer using 2 different web servers (wordpress , vanilla). sorry if has been asked. thanks, wordpress , vanilla not "two different web servers". both applications run on web server. long server meets minimum requirements both, should have no problem running them both on same vps: https://github.com/vanilla/vanilla/blob/master/readme.md#self-hosting-requirements https://wordpress.org/about/requirements/ regarding running both, each under it's own domain, need setup virtual host each. if vps has cpanel (or similar) need setup addon domain. if vps unmanaged (no control panel) can setup virtual host manually. quick google search should ...

msbuild - How to change app settings of Web.Config using targets.wpp -

i have created wpp.targets file deployment in azure. want change appsetting property of webconfig during deployment azure. found sample in http://sedodream.com/permalink,guid,25ddd39e-59de-4e35-becc-de19dcc5e4ea.aspx , uses pubxml , parameters.xml. want use wpp.targets instead of pubxml. <appsettings> <!-- todo: set in azure config --> <add key="customer" value="xyz" /> </appsettings> need update customer value "client" during deployment , web.config file should reflect changes in deployed folder below <appsettings> <add key="customer" value="client" /> </appsettings> answer i have achieved using projectparametersxmlfile in msdeploy msbuild api.csproj /p:projectparametersxmlfile="c:\parameter.xml"/p:publishsettingsfile=%publishfilelocation% you can use parameter xml file for example <parameters > <parameter name="cu...

How to read corpus of parsed sentences using NLTK in python? -

i working bllip 1987-89 wsj corpus release 1 ( https://catalog.ldc.upenn.edu/ldc2000t43 ). i trying use nltk's syntaxcorpusreader class read in parsed sentences. i'm trying work simple example of 1 file. here code... from nltk.corpus.reader import syntaxcorpusreader path = '/corpus/wsj' filename = 'wsj1' reader = syntaxcorpusreader('/corpus/wsj','wsj1') i able see raw text file. returns string of parsed sentences. reader.raw() u"(s1 (s (pp-loc (in in)\n\t(np (np (dt a) (nn move))\n\t (sbar (whnp#0 (wdt that))\n\t (s (np-sbj (-none- *t*-0))\n\t (vp (md would)\n\t (vp (vb represent)\n\t (np (np (dt a) (jj major) (nn break))\n\t (pp (in with) (np (nn tradition))))\n\t (pp-loc (in in)\n\t (np#1004 (dt the) (jj legal) (nn profession)))))))))\n (, ,)\n (np-sbj#1005 (np (nn law) (nns firms))\n (pp-loc (in in) (np#1006 (dt this) (nn city))))\n (vp (md may)\n (vp (vb become)\n (np (np ...

android - onSearchRequested() not activating the search dialog -

my main activity needs invoke search , display search results. search dialog not appear when onsearchrequested() called. i have found similar questions , followed every detail (i think) apparently have else wrong. here snips of implementation. parts of androidmanifest.xml <application android:label="@string/appname" android:launchmode="singletop" ... > <meta-data android:name="android.app.default_searchable" android:value=".main.mainactivity" /> <activity android:name=".main.mainactivity" android:launchmode="singletop" ... > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.search...

Unit test apex trigger not populating picklist values -

i have simple 'after insert' trigger on custom object update picklist values. based on if conditions updating picklist values working fine webservice or manual insert ui when write unit test case return null picklist values. picklist values dependent on trigger execution after record inserted. not controlling picklist values. creating test data , returning values fields excepting picklist values. need set values explicitly? i can't tell sure without seeing code, might guess need re-query records after insert.

php - Get categories and then posts for custom post type -

thanks reading post.. i using wplms theme , custom post type registered 'course' i getting post's code: $args = array( 'orderby' => 'date', 'order' => 'desc', 'post_type' => 'course', 'post_status' => 'publish', 'suppress_filters' => true i want categories , posts each category. example: category name : education , posts education, want categories name , respective post, or category names , posts posts must have category name well. i hope work's. thanks in advance this code list posts according categories: $categories = get_terms( 'category' ); foreach ($categories $key => $value) { $args = array( 'posts_per_page' => -1, 'offset' => 0, 'category' => $value->term_id, // tells category id 'post_type...

c++ - Getting the requirements for a function within the function call -

when calling function has requirements obtained in other functions, better or worse have function call 1 of requirements within overall function call? i've made simple example demonstrate: int amounttomultiplyby(int multiplyamount) { int temp; std::cout << "how want multiply by: "; std::cin >> temp; multiplyamount = temp; return multiplyamount; } void sumofnumbers(int numone, int numtwo, int multiplyamount) { std::cout << "1: " << numone * multiplyamount << std::endl; std::cout << "2: " << numtwo * multiplyamount << std::endl; } main version 1: int main() { int multiplyamount; sumofnumbers(5, 10, amounttomultiplyby(multiplyamount)); return 0; } main version 2: int main() { int multiplyamount; multiplyamount = amounttomultiplyby(multiplyamount); sumofnumbers(5, 10, multiplyamount); return 0; } in version 1, call amountto...

c++ - What is the meaning of : "int i, (!!i)"? -

we have following c++ code: int i; (!!i); what operation on variable i? i've seen done prevent warnings "warning, variable unused" . after odd !!i statement, variable (technically) used in expression, warning suppressed, didn't change anything. example: void myfunc() { int i; (!!i); // suppress warning caused block below. #if debug // in retail / non-debug code, not used, , warning created!! = getcountofsomething(); printf("the count of %d\n", i); #endif // debug }

html - Jquery UI Dialog with AngularJS -

i'm learning angularjs, searched in google can not find solution problem. i using jqueryui dialog, bootstrap css , want angularjs events , queries database. i have following files: index.html <!doctype html> <html lang="es-mx"> <head> <meta charset="utf-8"> <meta content="ie=edge" http-equiv="x-ua-compatible"> <title></title> </head> <body> <link rel="stylesheet" href="js/jquery-ui-1.11.4/jquery-ui.min.css"></link> <link rel="stylesheet" href="bootstrap-3.3.4/css/bootstrap.min.css"> <script src="js/jquery-1.11.3.min.js"></script> <script src="js/jquery-ui-1.11.4/jquery-ui.min.js"></script> <script src="bootstrap-3.3.4/js/bootstrap.min.js"></script> <script src="js/demo.js"></script> <...