Posts

Showing posts from September, 2013

HTML5 & CSS3 responsive website design margin issue -

please take here , on code. trying make responsive web page, there weird margin top , bottom of first article column. talking margin between top navigation , content column , between footer , content column, , set 10px margin right column below. .content { width: 69%; float: left; margin:0; padding:0 10px 0 0; } i new web designing, , don't know wrong doing here. please me using .topcontent{ display: inline-block; } should solve problem.

java - How to bind a Data Source? -

i'm getting error - org.springframework.beans.factory.beancreationexception: error creating bean name 'netlogsdao': injection of resource dependencies failed; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'abcdatasource' defined in com.kinsale.submclrmgr.config.dataconfig: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [javax.sql.datasource]: factory method 'abcdatasource' threw exception; nested exception org.springframework.jdbc.datasource.lookup.datasourcelookupfailureexception: failed jndi datasource name 'datasource/abc'; nested exception javax.naming.namenotfoundexception: name [datasource/abc] not bound in context. unable find [datasource]. i trying figure out how bind data source, documentation i've found isn't helpful. there jnditemplate can use bind data source, passing para

php - header and footer line in FPDI/TCPDF -

i'm stamping pdf documents fpdi , tcpdf functions, , i'm trying figure out, how can add line below text in header, , upon text in footer. here code: <?php require_once('lib/tcpdf/tcpdf.php'); require_once('fpdi.php'); $fullpathtofile = "testclanek6.pdf"; class pdf extends fpdi { var $_tplidx; function header() { global $fullpathtofile; //global if(is_null($this->_tplidx)) { // number of pages $this->numpages = $this->setsourcefile($fullpathtofile); $this->_tplidx = $this->importpage(1); } if($this->page > 0) { //$this->setprintheader(true); $this->setfont('times', 'i', 11); $this->settextcolor(0); $this->write(15, "vol. 1, no. 15, year: 2015, duff"); $this->image('logo.png', 100, 2, 75,7); } //end of if

java - DatePicker setEditable to false still allows for clicking of Calendar -

i trying seteditable datepicker false value cannot changed. using following disables text field, still allows changing of date clicking on calendar button (the seteditable permissions, can enable/disable depending on login): exampledatepicker.seteditable(user.getgroup().equals(admin)); is there way disable calendar button on datepicker? don't want use setdisable, still want field readable, , can't change css disabled because have other datepickers disabled want greyed out. to disable (i.e make behave it's disabled), call setdisable(...) : exampledatepicker.setdisable(! user.getgroup().equals(admin)); to change appearance default disabled (which agree hard read), can still use css, choose datepicker specifically. easiest way use css pseudoclass: pseudoclass notauthenticated = pseudoclass.getpseudoclass("not-authenticated"); exampledatepicker.setdisable(! user.getgroup().equals(admin)); exampledatepicker.pseudoclassstatechanged(notauthentica

angularjs - Error: [ng:areq] Argument 'ChatAppCtrl' is not a function, got undefined -

hi trying run angular based chat app, it's giving me error. kindly please me fix this. code available on https://github.com/tamaspiros/angularchat the error getting error: [ng:areq] argument 'chatappctrl' not function, got undefined http://errors.angularjs.org/1.3.9/ng/areq?p0=chatappctrl&p1=not%20a%20function%2c%20got%20undefined @ regex_string_regexp (angular.js:63) @ assertarg (angular.js:1577) @ assertargfn (angular.js:1587) @ angular.js:8418 @ angular.js:7592 @ foreach (angular.js:331) @ nodelinkfn (angular.js:7579) @ compositelinkfn (angular.js:7075) @ compositelinkfn (angular.js:7078) @ publiclinkfn (angular.js:6954) the index.html <!doctype html> <html ng-app="chat"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1">

printing - Ghostview - print error -

i'm trying print .ps file produced in idl ghostview. file prints, page reads 'error: typecheck offending command: restore stack: -mark- -savelevel-' any suggestions please? thanks. there's mark on stack when there shouldn't (the restore state above on stack). when try restore, fails because top object on stack isn't saved state. i'd need see file more that.

checkbox - Checkboxes not posting in PHP -

so trying value 3 checkboxes later sent database, reason not posting in php when im testing. <table width="200" border="0"> <tr> <td><img src="images/image1.jpg" ></td> <td><img src="images/image2.jpg" ></td> <td><img src="images/image3.jpg" ></td> </tr> <tr> <td><input type="checkbox" id="checkbox65" class="css-checkbox med" name="avatar" value="image1"/> <label for="checkbox65" class="css-label med elegant" /></label></td> <td><input type="checkbox" id="checkbox66" class="css-checkbox med" name="avatar" value="image2"/> <label for="checkbox66" class="css-label med elegant" /></label></td> <td><input type="checkbox&quo

makefile - gcc-4.1 -> gcc-4.8 linker error. New ".text.unlikely" section overlap ".text" section -

i'm trying build cromwell (original xbox legal firmware replacement) using more recent version of gcc after altering project compilation setup slightly, ld throws following error: ld: section .text.unlikely loaded @ [0000000000000000,0000000000000669] overlaps section .text loaded @ [0000000000000000,0000000000021515] you can clone project here if want have look: https://github.com/not404/cromwell first , foremost, want mention able build , run project(on xbox) using gcc-3.3 on x32 linux vm , gcc-4.1 on cygwin x86 (built gcc target i686-linux-gnu). had remove -werror cflag in main makefile build in gcc-3.3. trying build using gcc-4.8.2 on x32 vm after modifying makefile result in error mentionned above. in order there, modified cflags in makefile in root of project. still had -werror removed clags. had add -fno-stack-protector flags in cflags , eth_cflags past undefined reference '__stack_chk_fail' error. think workaround quite harmless. older gcc vers

ios - Converting Int to Float loses precision for large numbers in Swift -

Image
xcode 6.3.1 swift 1.2 let value: int = 220904525 let intmax = int.max let float = float(value) // here error let intfromfloat = int(float) let double = double(value) println("intmax=\(intmax) value=\(value) float=\(float) intfromfloat=\(intfromfloat) double=\(double)") // intmax=9223372036854775807 value=220904525 float=2.20905e+08 intfromfloat=220904528 double=220904525.0 the initial value 220904525. when convert float becomes 220904528. why? this due way floating-point format works. float 32-bit floating-point number, stored in ieee 754 format , scientific notation, bits allocated value, , exponent (in base 2), diagram single-precision floating-point number wikipedia article shows: so actual number represented as (sign) * (value) * (2 ^ (exponent)) because number of bits allocated storing integer value (24) smaller number of bits allocated in normal integer (all 32), in order make room exponent, less significant digits of large numbers sacrificed,

Custom PSHost, Get-Credential cmdlet in C# -

i trying implement custom pshost class purpose of crafting guis power shell scripts. have taken code here base , started adapting gui projects https://msdn.microsoft.com/en-us/library/ee706557%28v=vs.85%29.aspx all fine until tried run get-credential cmdlet , got error method not implemented(ooouuuu)... initial code these 2 methods: public override pscredential promptforcredential( string caption, string message, string username, string targetname) { throw new notimplementedexception( "the method or operation not implemented."); } public override pscredential promptforcredential( string caption, string message, string username,

java - Android studio doesn't start emulator -

Image
i created project phonegap / node.js tutorial. having problems android studio. emulator doesn't start when try run it. created virtual device these configurations: android 5.1.1 - api 22 512mb ram api 22 3,3 wqvga 240x400 ldpi android armeabi-v7a emulated: uncheked performance: unchecked i using java sdk 1.7. in manifest, have: <uses-sdk android:minsdkversion="7" android:targetsdkversion="22" /> the android studio never displays emulator , cannot run app. my android virtual device configuration: update: these downloaded versions what doing wrong?

.htaccess - htaccess mod_rewrite to example.com/tut/2 -

i need convert link in website way : wwww.example.com/tut/1 from wwww.example.com/tut.php?v=1 i tried alot of way no thing happen my code rewriteengine on rewriterule ^tut/(\d+) tut.php?v=$1 [qsa,l] is there other idea or code ?? you can use code in root .htaccess: options -multiviews rewriteengine on rewritebase / rewritecond %{the_request} /tut\.php\?v=(\d+) [nc] rewriterule ^ /tut/%1? [r=302,l,ne] rewriterule ^tut/(\d+)/?$ tut.php?v=$1 [qsa,l,nc]

php - Inner join in my doctrine2 query increases execution time from 400 milliseconds to 5 secs -

inner join in doctrine2 query increases execution time 400 milliseconds 5 secs, if extract sql , run directly in sqlserver studio takes few milliseconds execute. below query, bottle neck inner join only: $qb = $em->createquerybuilder(); $q = $qb->select( 'wp.id, wp.last_activity_datetime' ) ->from( '\entities\wall_post', 'wp' ) ->leftjoin( 'wp.wall_postslikes', 'likes' ) ->leftjoin( 'wp.wall_postsshare', 'shares' ) ->leftjoin( 'wp.wall_postscomment', 'comments' ) ->leftjoin( 'wp.wall_postsfrom_user','fromuser'); if( $wall_type == self::wall_type_socialise ) { $q->leftjoin( 'wp.wall_postssocialise_album','album'); $q->innerjoin( 'album.socialise_albumssocialise_photo','photo'); } $q->setparameter( 'my_links_r', $my_links_r ) ->setparameter( 1, $userid ) ->setfirstresult( $offset ) ->setmaxresults( $limit )

multithreading - Multithread interactions -

main form: unit unit3; interface uses winapi.windows, winapi.messages, system.sysutils, system.variants, system.classes, vcl.graphics, vcl.controls, vcl.forms, vcl.dialogs, vcl.stdctrls; type tform3 = class(tform) memo1: tmemo; button1: tbutton; button2: tbutton; procedure button1click(sender: tobject); private { private declarations } public { public declarations } class var counter : integer; end; var form3: tform3; implementation {$r *.dfm} uses unit4, unit5; procedure tform3.button1click(sender: tobject); var th1 : thcounter; th2 : thprinter; begin th1:= thcounter.create; th2:= thprinter.create; end; end. thread counter : unit unit4; interface uses system.classes, unit3; type thcounter = class(tthread) private { private declarations } protected procedure execute; override; end; implementation { thcounter } procedure thcounter.execute; var i: integer; printval : integer; begin { place

jquery - Add text to series of labels -

i have list of fields descriptions inside label tags. want add text "your" before each label. so far have <div id="field1"> <label> first label </label> </div> <div id="field2"> <label> second label </label> </div> <div id="field3"> <label> third label </label> </div> <div id="field4"> <label> fourth label </label> </div> var label = $("label"); $("label").html("your"+ label.text); https://jsfiddle.net/smftmdf1/1/ any method achieve without using classes or ids? you need use jquery function each desired result. var label = $("label"); $("label").each(function () { $(this).html("your" + $(this).text()) }); solution: https://jsfiddle.net/7g7ycqnu/

php - Proper shopify api product create -

i trying create product shopify api product not set , getting no errors. print_r($server_output); displays nothing can't see wrong. curl enabled. below code use. when print_r($products); displays array how should. doing wrong? $name='test product 555'; $group=36; $quantity=20; $price='20.95'; $url = 'https://my_key_and_pass/admin/products.json'; $type = 'post'; $product = array('title' => utf8_encode($name), 'body_html' => utf8_encode($name), 'product_type'=> $group, 'variants' => array( array('price' => $price, 'inventory_quantity'=> $quantity, 'inventory_management' => 'shopify' ) ) ); $ch = curl_init($url); $data_string = json_encode(array('product'=>$product)); curl_setopt($ch, curlopt_customrequest, $type); curl_setopt($ch, curlopt_postfields, $data_stri

asp.net web api - WebAPI or WCF with svc file -

this question has answer here: wcf vs asp.net web api 10 answers i want create restfull service. in c# .net in visual studio 2012 framework 4.5 do need create web api this? or can create project .svc file , manage this?(i dont remeber sort of project this) which best way unfortunately, there no answer 1 better other. fortunately, there straightforward way of determining framework use when building new web service. general rule of thumb is: if it's internal/intranet web service, use wcf; if it's external/internet web service, use web api. to prevent creating whole web api best way creating project .svc file , manage it. easier , faster , "safer"!

Maximize android app from service -

i have application runs background service checks notifications gets server. , when notification arrives (ping notification), opens new notification dialog full screen inflated view. on screen have option accept call, calls device sip voice connection. accept call opens new dialog fragment, has ability automatically answer call, , user has option cancel it. when on main activity window, works fine. in service there view inflated layout added window_manager shows notification , when accept call, dialog fragment call status opens. question have now, possible while application minimized? example, user minimized app, service still running in background, when ping notification gets device, shows new notification dialog, when want accept call , show fragment, not possible because. 1. don't have current screen on show dialog fragment calling 2. if create instance of current activity oncreate, , don't destroy ondestroy, can call startactivity on it, nothing shows up. call establish

mysql - Rails 1 to 2 Polymorphic -

i'm having trouble implementing 1-to-2 association, polymorphic. have 3 models involved in this, rule , ip , ipgroup . each rule has 2 of ipish , can either ip or ipgroup . however, when loading entries db, ipish_from , ipish_to remain nil . also, don't confused class_name: "ipish" , there no explicit class in project named "ipish"; in older version of project not polymorphic , said class_name: "ip" . class rule belongs_to :ipish_from, class_name: "ipish", foreign_key: :ipish_id_from, polymorphic: true belongs_to :ipish_to, class_name: "ipish", foreign_key: :ipish_id_to, polymorphic: true end class ip has_and_belongs_to_many :ip_groups has_many :rules_from, as: :ipish has_many :rules_to, as: :ipish end class ipgroup has_and_belongs_to_many :ips has_many :rules_from, as: :ipish has_many :rules_to, as: :ipish end the table in mysql-db looks this ++++++++++++++++++++++++++++ + rules

php - ZF2 - Trigger MvcEvent::EVENT_DISPATCH_ERROR from View Controller -

i using restful controller , on conditions, trigger mvcevent::event_dispatch_error , stop execution of controller after. in module class, have attached event listener can't find way trigger view controller. my module code is: public function onbootstrap(mvcevent $mvcevent) { $eventmanager = $mvcevent->getapplication() ->geteventmanager(); $eventmanager->attach(array(mvcevent::event_dispatch_error, mvcevent::event_render_error), array($this, 'error')); } public function error(mvcevent $mvcevent) { echo $mvcevent->geterror(); die(); } and controller code is: public function indexaction() { $mvcevent = $this->getevent(); $mvcevent->seterror('test-error-code'); $mvcevent->gettarget()->geteventmanager()->trigger(mvcevent::event_dispatch_error, $mvcevent); return; } i think problem you're not attaching application's sharedeventmanager . can use controller's own event

node.js - How to create a link between Git and NPM -

this question has answer here: do need publish npm every time update package available via git? 2 answers is there way link github node package manager? if changes pushed in git published in npm. travis-ci handle you. http://mclear.co.uk/2013/10/06/publishing-to-npm-on-git-commit-using-github-hooks-and-travis/ there's gist, you'll have see whether works yourself. https://gist.github.com/fent/3140668 if not can use basis own solution using got post hooks.

html - Javascript wrap all text nodes in tags -

i know question has been asked of answers use wrap function of jquery. i'm trying figure out plain javascript way of doing this: <div id="content"> "hey" <br> <br> "foo" "bar" </div> <script> function mainfocusout(e) { //here or other focus outs...create function between <br> tags , put divs if (e == 'undefined') e = window.event; var target = e.target || e.srcelement; (var = 0; < target.childnodes.length; i++) { //i'm not sure if need closure function here inside loop works on each individual textnode (function(i) { var curnode = target.childnodes[i]; if (curnode.nodename === "#text") { var element = document.createelement("div"); element.appendchild(curnode); target.insertbefore(element, curnod

ios - UICollectionView design flow layout for attached image -

Image
i attached images have done , have achieve. please guide me achieve this. i have done till now: i want achieve following: here code: - (cgsize)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewlayout *)collectionviewlayout sizeforitematindexpath:(nsindexpath *)indexpath { cgsize size; if (indexpath.row == digit_int_2 || indexpath.row == digit_int_6 || indexpath.row == digit_int_7) size = cgsizemake(150, 68); else if (indexpath.row == digit_int_3 || indexpath.row == 13) size = cgsizemake(150, 150); else size = cgsizemake(68, 68); return size; } i find answer , achieved customise uicollectionviewflowlayout class , inheriting method - (nsarray *) layoutattributesforelementsinrect:(cgrect)rect , play previous item frame , current item frame. but after new problem came 1 item disappear after scrolling. failed find why happening. after 2 days work have move way achieve this. wai ha lee formatt

ios - how can i store parse object directly in NsuserDefault? -

pfquery *location = [pfquery querywithclassname:@"location"]; [location findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { nslog(@"%@", [objects objectatindex:0]); }]; how can store object in nsuserdefaults? for storing custom objects u need add these 2 methods in m file of custom object class -(void)encodewithcoder:(nscoder *)encoder { //encode properties of object [encoder encodeobject:self.contact_fname forkey:@"contact_fname"]; [encoder encodeobject:self.contact_lname forkey:@"contact_lname"]; [encoder encodeobject:self.contact_image forkey:@"contact_image"]; [encoder encodeobject:self.contact_phone_number forkey:@"contact_phone_number"]; } -(id)initwithcoder:(nscoder *)decoder { self = [super init]; if ( self != nil ) { //decode properties self.contact_fname = [decoder decodeobjectforkey:@"contact_fname"];

Generate Grails style scaffolds on plain spring-boot (without Grails) -

one of things love grails ability generate controllers , scaffolded views. i've decided build new project without grails, on java using spring-boot. wondering if there sort of tool equivalent of grails 'generate-all' command generate controllers , views model can head start development. i'd preferably want create views thymeleaf, although know might asking bit much.

javascript - event.clipboardData is undefined -

i trying access paste event in browser , override it. event.clipboarddata undefined. have this: function handlepaste (event) { event.preventdefault(); console.log("handling paste"); console.log(event.clipboarddata); } edit: it part of directive in angular , running in chrome: app.directive('safepaste', [function() { function handlepaste (event) { event.preventdefault(); console.log("handling paste"); console.log(event.clipboarddata); } /* * declaration */ var declaration = {}; declaration.restrict = 'a'; declaration.link = function(scope, element, attr) { // attach paste handler element.on('paste', handlepaste); // register remove paste handler scope.$on('$destroy', function() { element.off('paste', handlepaste); }); }; return declaration; } ]); html: <li ng-repeat="note in notes | reverse"> <a id="note" href=&quo

java - Trying to run both hadoop MapReduce commands and linux commands in shell script -

i have shell script this. #!/bin/sh /home/hduser/downloads/hadoop/bin/stop-all.sh echo "running hadoop program" cd /home/hduser/downloads/hadoop sudo rm -r /tmp/* sudo rm -r /app/* cd sudo mkdir -p /app/hadoop/tmp sudo chown hduser:hadoop /app/hadoop/tmp sudo chmod 750 /app/hadoop/tmp hadoop namenode -format /home/hduser/downloads/hadoop/bin/start-all.sh jps hadoop dfs -mkdir -p ~/downloads/hadoop/input hadoop dfs -copyfromlocal /home/hduser/desktop/iris.arff ~/downloads/hadoop/input hadoop jar ~/desktop/try.jar 2 weka.classifiers.trees.j48 ~/downloads/hadoop/input ~/downloads/hadoop/output /home/hduser/downloads/hadoop/bin/stop-all.sh i invoking script in java program this public class uiinput { public static void main(string[] args) throws ioexception { // runtime.getruntime().exec("/home/hduser/desktop/initial.sh"); new processbuilder("/home/hduser/desktop/initial.sh"); processbuilder pb = ne

powershell - Poweshell script is executing but not working -

i have powershell script running fine in windows power shell ide. when running sql agent job running no error isn't doing operation. below message getting in job history executed user: server\system. string starting: @ line:1 char:1 + <<<< "d:\folder\powerscript.ps1? missing terminator: ". @ line:1 char:23 + "d:\folder\powerscript.ps1? <<<< + categoryinfo : parsererror: (d:\folder\powerscript.ps1?:string) [], parentcontainserrorrecordexception + fullyqualifiederrorid : terminatorexpectedatendofstring. process exit code 0. step succeeded. though, have ran service account "domain\serviceaccount" showing me "servername**system** let me know if more details required. edit- script of job declare @jobid binary(16) exec @returncode = msdb.dbo.sp_add_job @job_name=n'myjob', @enabled=1, @notify_level_eventlog=0, @notify_level_email=0

string - mysql left join empty varchar both side (MyISAM) -

i have join 2 table varchar columns. both of columns contain multiple empty values want ignore them. inner join query works fine : select count(*) tbl1 t1 join tbl2 t2 on t1.col = t2.col , t1.col <> '' but need left join : select count(*) tbl1 t1 left join tbl2 t2 on t1.col = t2.col , t1.col <> '' and 1 taking 20-30 seconde execute... think it's doing join operation before cuts empty values. can't found solution force <> '' condition first. same request without condition take same execution time : select count(*) tbl1 t1 left join tbl2 t2 on t1.col = t2.col but return 50 000 000 vs 150 000 first one. tbl1 : 'ooooa' 'fieldtbl1' 'oooob' 'fieldtbl1' 'ooooc' 'fieldtbl1' 'ooood' 'fieldtbl1' '' 'fieldtbl1' tbl2 : 'ooooa' 'fieldtbl2' 'oooob' 'fieldtbl2' 'ooooc' 'fieldtbl2' ''

osx - How to locate httpdocs folder on Mac? -

Image
how find httpdocs folder on mac? this kinda frustrating, know i have apache installed don't know folder, after need put files in there. how know have apache installed? when type @ address bar " http://localhost " can see page "it works!". as can see on picture don't have under library : my mac os x yosemite 10.10.13 how locate folder? define another folder that. you may find out apache document root command: $ httpd -s | grep documentroot main documentroot: "/library/webserver/documents" in case /library/webserver/documents folder. you may change editing server's config file. on yosemite /private/etc/apache2/httpd.conf file: $ httpd -v | grep server_config -d server_config_file="/private/etc/apache2/httpd.conf" you need root password write file.

android - onloadmore method loads only 5 items on resume -

the app should load 5 items each time user scrolls way down, works fine when user change activity , return brows activity (the main activity) loads 5 items here my code scrolling recyclerview.setonscrolllistener(new endlessrecycleronscrolllistener( layoutmanager) { @override public void onloadmore(int current_page) { int limit = current_page * 5; loadmoreitems(limit); } }); return rootview; } load more items method private void loadmoreitems(int limit) { parsequery<parseobject> query = parsequery.getquery("product"); query.setlimit(limit).orderbydescending("createdat"); dialog = new progressdialog(getactivity()); dialog.settitle("loading"); dialog.setmessage("please wait..."); dialog.show(); query.findinbackground(new findcallback<parseobject>() { publi

c# - WebMethod throws "Incorrect syntax near '='" -

i getting error on line: using (sqldatareader reader =cmd.executereader()) i working on ajax cascading drop down example in asp.net , below code. unable run code due error incorrect syntax near '='. near using (sqldatareader reader =cmd.executereader()) code [webmethod] public ajaxcontroltoolkit.cascadingdropdownnamevalue[] getdropdowncountry1(string knowncategoryvalues) { // select countryid, country country status='active' // string query = "select country, countryid country"; string query = "select [countryname], [countryid] countries"; list<ajaxcontroltoolkit.cascadingdropdownnamevalue> countries = getdata(query); return countries.toarray(); } private list<ajaxcontroltoolkit.cascadingdropdownnamevalue> getdata(string query) { string constring = configurationmanager.connectionstrings["connectionstring"].connectionstring; sqlcommand cmd = new sqlcommand(query); list<ajaxco

haskell - Are there any use cases for this function : foo :: (b -> c) -> (a -> b) -> (a -> c) -

for function : foo :: (b -> c) -> (a -> b) -> (a -> c) taken http://www.seas.upenn.edu/~cis194/spring13/lectures/04-higher-order.html is function no practical use ? (b -> c) cannot constructed unless type c input parameter within function ? and same (a -> b) -> (a -> c) : b & c not input parameters these functions. are there use cases function ? if question using function composition in practice, here small example. let's assume want write function sum of squares of elements of list of numbers. how that? well, write like: squaresum xs = sum (map (^2)) xs . can use function composition instead: squaresum = sum . map (^2) (i use . function composition here instead of foo , doesn't matter). example shows function obtained using function composition(it practical @ least in sense compiles , works correctly). benefits of function composition become more obvious when need compose multiple functions(possibly partially applied).

java - How load first 100 characters with png in TrainingImageLoader -

Image
i draw best png file first 100 characters, if can not out. file there: http://abatis.org.uk/projects/txt2fig.png file fff = new file("c:\\users\\lll\\desktop\\txt2fig.png"); ocrscanner scanner = new ocrscanner(); trainingimageloader loader = new trainingimageloader(); hashmap<character, arraylist<trainingimage>> trainingimagemap = new hashmap<character, arraylist<trainingimage>>(); loader.load(fff.getabsolutepath(), new characterrange('a', 'z'), trainingimagemap); scanner.addtrainingimages(trainingimagemap); image image = imageio.read(fff); pixelimage pixelimage = new pixelimage(image); pixelimage.tograyscale(true); pixelimage.filter(); string text = scanner.scan(image, 0, 0, 0, 0, null); system.out.println(text); exception: java.io.ioexception: expected decode 26 c

machine learning - algorithm to predict user's being online time and channel -

i working on building engine website wherein want increase user engagement based on different activities, music rated or article read, or promotional campaign signed for. for first step, item similarity(for music , articles) has been computed via collaborative filtering, , stored. now, next step, want able analyze these scenarios (a,t) : scenario gives me particular activity , asks me when user activity (t,a) : scenario gives me time slot , asks me activity makes sense recommend user @ time. (c, t) : scenario gives me channel (like sms, email, webpage ad, app ad) , asks channel user available on right now. as above suggests, there number of modules time, channel, interests, location, etc can combined interchangeably, determine in kind of plane can user be, , based on tell whether specific activity suggestion make sense or not. how can go accomplishing scalably? here few things thought of, not sure if can effective building item profile - create item profile stores

Showing Azure WebJob Functions log using API (Kudu) -

i using kudu api display webjob data on website monitoring app created. web app monitors data few other websites created. wondering api endpoints need run in order data page: https://{my_website}.scm.azurewebsites.net/azurejobs/#/functions i interested in displaying of data page (functions, statistics, invocation log - executed functions) at moment parsing text file, find highly inefficient if there's better option available: https://{my_website}.scm.azurewebsites.net/vfs/data/jobs/continuous/{my_webjob}/job_log.txt any suggestions help, in advance. as written in comments webjob client javascript based can see every call makes in console of browser, there find call to: https://<sitename>.scm.azurewebsites.net/azurejobs/api/functions/definitions?lim‌​it=100 this give list of functions in webjob.

Get User posted Content from wordpress to Other website using Ajax request -

i have 1 wordpress , other html website. in wordpress contain user posts. need content wordpress site html website using ajax request. i pass user email id through ajax request ,from request need specified user posted content wordpress. possible.please suggest better option. first of can user details https://codex.wordpress.org/function_reference/get_current_user_id [to need install plugin, run php in wordpress environment] then can use ajax place appropriate data, other web services or web page. http://api.jquery.com/jquery.post/

android - volley status code 200 is considered as error response in 5.0.2 -

i have been using volley in app. have tested app in version 5.0.2 device throws exception like.. 05-15 14:56:02.374: e/volley(23574): [18922] basicnetwork.performrequest: unexpected response code 200 http://sample_url.com (sample url) 05-15 14:56:02.380: e/androidruntime(23574): fatal exception: thread-18922 05-15 14:56:02.380: e/androidruntime(23574): process: com.example.jadoofy_android, pid: 23574 05-15 14:56:02.380: e/androidruntime(23574): java.lang.nullpointerexception: attempt read field 'int com.android.volley.networkresponse.statuscode' on null object reference 05-15 14:56:02.380: e/androidruntime(23574): @ com.android.jadhoofy.backend_tracker_volley.backendhelper_volley$3.parsenetworkerror(backendhelper_volley.java:480) 05-15 14:56:02.380: e/androidruntime(23574): @ com.android.volley.networkdispatcher.parseanddelivernetworkerror(networkdispatcher.java:149) 05-15 14:56:02.380: e/androidruntime(23574): @ com.android.volley.networkdispatcher.run(networkdi

javascript - Deleting an element based on window width -

var $linkfullwidth = $('div.image--link'); if($(window).width() < 768){ // delete element $linkfullwidth } how go targeting element , deleting it? and valid javascript? thanks! remove element jquery since using it. $('#linkfullwidth').remove(); //if elements id linkfullwidth or $('.linkfullwidth').remove(); //if elements class linkfullwidth(will delete elements class though) since caching in variable then $($linkfullwidth).remove(); //would job fine