Posts

Showing posts from June, 2010

java - Having issues with argb method with Android -

i trying figure out how use argb method http://developer.android.com/reference/android/graphics/color.html . i've read through multiple times , still can't app work. i'm trying view widget display color made moving 4 sliders no colors show no matter put sliders. thought argb method return value colorvalue , able use color? suggestions appreciated! my main class looks this: public class colorchooseractivity extends activity implements onseekbarchangelistener { //variables private seekbar redseekbar; private seekbar greenseekbar; private seekbar blueseekbar; private seekbar alphaseekbar; private view colorview; private textview colortextview; //instanced variables private static int colorvalue = 0; private int redvalue = 0; private int greenvalue = 0; private int bluevalue =0; private int alphavalue =0; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_color_chooser);

c# - Constructor not being called while autowiring in service stack -

i writing service in c# using service stack framework. have class inmemoryfilesystem ( https://gist.github.com/elixir24/9457433 ) trying auto wire. here relevant portion of class public class inmemoryfilesystem { public dictionary<string, userfilesystem> clienttofilesystemmap {get;set;} public datetime lastcheckpoint { get; set; } private static readonly log4net.ilog logger = log4net.logmanager.getlogger(typeof(inmemoryfilesystem)); public inmemoryfilesystem () { clienttofilesystemmap = new dictionary<string, userfilesystem>(); userfilesystem filesystem = new userfilesystem(); filesystem.metadata = new usermetadata("piyush", "password", 1); userfile file = new userfile("/x.txt","piyush"); file.filecontent = utils.getbytearrayfromstring("filecontent"); filesystem.filemap.add("/x.txt", file); this.clienttofilesystemmap.add("

merge array of different length php -

let's have 2 arrays this: $arr1 = array( array('position' => 1), array('position' => 2), array('position' => 3), array('position' => 4), array('position' => 5), array('position' => 6), array('position' => 7) ); $arr2 = array( array( 'a' => 'a1', 'b' => 'b1', 'c' => 'c1' ), array( 'a' => 'a2', 'b' => 'b2', 'c' => 'c2' ), array( 'a' => 'a3', 'b' => 'b3', 'c' => 'c3' ) ); the goal have resulting array key position first array copied each array in second array this: $final_arr = array( array( 'a' => 'a1', 'b' => 'b1', 'c' => 'c1', 'position' => 1 ), array( 'a' => 'a2', 'b

Vaadin Grails: Where do I put my images / icons for my Vaadin app in Grails -

i've tried putting them in web-app/vaadin/themes/images folder , tried accessing web-app/images folder , several others. no luck. using new themeresource(null, "vaadin/themes/images/mypic.png") , many many variations no luck. please let me know i'm missing? i'm have resort new externalresource("http:\...mypic.png") images. unable figure out how access locally. it's simple i'm missing. vaadin 7.1.11 , grails 2.3.5 thanks dana your images should located in vaadin/themes.[your_theme]/img access them can use: link l = new link("download introduction source", fr) l.settargetname("_blank") l.setstylename("link-pdf") l.seticon(new themeresource("img/pdf.png")) or, scss 'url(img/notes-bg.png)' instance. don't forget declare theme in vaadinconfig.groovy: themes = ['your_theme']

php - How to pull a directory's files and subdirectories names into an array? -

i'm trying pull names of subdirectories of directory array. i've tried few different things. doing wrong here? i pulled little function off of php scandir() documentation page . $data_dir = 'path/to/data_directory/'; function dirtoarray( $data_dir ) { $result = array(); $cdir = scandir( $data_dir ); // line 19 foreach ($cdir $key => $value) { if (!in_array($value,array(".",".."))) { if (is_dir($data_dir . directory_separator . $value)) { $result[$value] = dirtoarray($data_dir . directory_separator . $value); } else { $result[] = $value; } } } return $result; } $data_dir_array = dirtoarray( $data_dir ); print_r( $data_dir_array ); ouput warning: scandir(/users/alexcory/library/application\ support/alfred\ 2/workflow\ data): failed open dir: no such file or directory in /users/alexcory/li

excel - use a created function within a function vba -

im making vba function calculate integral using trapezoidal rule how can apply function created in vba use in function...heres code ( worksheet.function did not work) option explicit function funcion(x double) double funcion = 3 * (x ^ 3) + 5 * (x ^ 2) - 10 * x + 20 end function function sumatoria(a double, n double, h double) double dim integer dim sum double = 0 sum = 0 while (i <= n - 1) sum = sum + worksheetfunction.funcion(a + * h) = + 1 loop sumatoria = sum end function this works : function sumatoria(a double, n double, h double) double dim integer dim sum double dim temp double = 0 sum = 0 while (i <= n - 1) temp = + * h sum = sum + funcion(temp) = + 1 loop sumatoria = sum end function

how do i make jquery mobile password check UI -

i trying make page checking password jqm 1.4. and can see design on url below. http://www.tiikoni.com/tis/view/?id=c19ea08 how make each key numeric button ? is there examples or references ? you should use simple numeric input (not 4 of them). when input has focus, native os-specific numeric keyboard appears.

vb.net - Entity framework - Return to list error? -

i got problem - return list entity framework . need return object. here code: public function gethardwaredetail() list(of hardwaredetailapp) dim idlist new list(of string) dim data = (from p in db.tt_hardware select new hardwaredetailapp {.internalnum = p.internal_num, .description = p.description, .terminalmodel = p.hardware_model, .hardwareinternalnum = p.hardware_id, .status = p.isactive, .firmware = nothing, .serialnum = nothing}) if data.count > 0 each row in data idlist.add(row.internalnum) next end if dim data2 = (from p in db.tt_terminal_hardware idlist.contains(p.hardware_internal_num) select new hardwaredetailapp {.firmware = p.hardware_firmware, .serialnum = p.hardware_serial_num, .internalnum = data.firstordefault.internalnum, .description = data.firstordefault.description, .terminalmodel = data.firstordefault.terminalmodel, .hardwareinternalnum = data.firsto

textbox - In Dart-polymer I have been unable to find a way to keep a text-box scrolled to the bottom -

i have found multiple ways in various browsers , languages nothing can find has worked dart-polymer in chrome. otherwise simple , standard: <template> <style> textarea { width: 825px; } </style> <div> <textarea id="ta" rows="10" on-mouseover="{{on_mouse_over}}"> {{message}} </textarea> </div> </template> thanks! i guess want: @customtag('my-text') class mytext extends polymerelement { @observable string message = ""; mytext.created() : super.created(); void messagechanged(old) { var ta = $['ta']; ta.scrolltop = ta.scrollheight; } void attached() { super.attached(); new timer.periodic(new duration(seconds: 1), (_) => message += 'some text ${new datetime.now()}\n'); } } i added id="ta" <textarea> make $['ta

eclipse - Openni, Android, and PrimeSense Setup -

i trying develop simple android application (running on nexus 10) connect primesense camera. research seems openni way go; however, i'm having hard time figuring out need. when download openni software , install whole bunch of different files i'm unable find simple explanation of how simple 'hello world' type application: what openni jars need , can find them? how configure eclipse/android studio project include these jars. there other files need besides jars: drivers..? i started android dev , i've never used primesense nor other 3d scanning cameras maybe i'm missing obvious? could point me in right direction? haven't been able find on openni website help. thanks in advance. the following simple tutorial on how proceed. it's straightforward http://www.hirotakaster.com/weblog/openframeworks-8-1-and-openni-2-2-on-android-tutorial/

How to do multiple pagination without page not found error in Cakephp -

i have paginate 2 models (income,expanse) in student model view page . have page not found problem cakephp's pagination. it have no problem when paginate result has 1 page or same, error if 1 has more paginate result other. for example. -income has paginate result 1 page , expanse has 1 page. no problem @ all. -income has 10 pages , expanse has 10 pages no problem @ all. -income has 2 pages , expanse has 1 page. income page 2 page not found error. -income has 5 pages , expanse has 2 pages. income page 3,4,5 page not found error. -income has 10 pages , expanse has 13 pages. expanse page 11,12,13 page not found error. for example(not real one) , student's view have income , expense items ,both display pagination. //this how config paginator in student controller. public $paginate = array( 'income' => array ( 'order'=>array('income_id'=>'asc'), 'limit'=>10, 'recursive'=

SQL Server REPLACE Characters in Different Tables -

i trying figure out how replace characters in 1 table using characters columns in table in sql server. think best way using cursor , run replace statement unsure how syntax like. have many rows in each table able run once , have loop through table1 , replace values should replaced using data in table2. i've posted example below of want code do. table1 (contains mystring column): mystring favorite color blue favorite color red favorite color green table2 (contains origchar , replacechar columns): origchar replacechar blue red green red our table1 result after replace: mystring favorite color red favorite color red our favorite color red here samples of work far. thoughts of how of these methods work intended. sample one: declare @crowid int; declare @corigchar varchar(50); declare @creplacechar var

elisp - Emacs CEDET Hook -

i want hook cedet modes c++ mode. using following script in .emacs file: (add-hook 'c++-mode-hook (lambda () ... (my_cedet_load) ) ) where (defun my_cedet_load () (interactive) (semantic-mode) (global-semantic-stickyfunc-mode t) (global-semantic-idle-scheduler-mode t) (global-semantic-idle-completions-mode t) (global-semantic-highlight-edits-mode t) ) now, problem once open .cpp file, semantic-mode enabled in buffers. how enable such mode in .cpp files? semantic global minor mode. semantic.el to enable semantic, turn on `semantic-mode', global minor mode (m-x semantic-mode ret, or "source code parsers" tools menu). enable @ startup, put (semantic-mode 1) in init file. as such when semantic-mode enabled in buffers. can use semantic-inhibit-functions restrict buffers in semantic activated. documentation list of functions call no arguments before semantic setup. if of these funct

compilation - Intellij exclude file from being compiled -

Image
i trying exclude particular file in project being compiled. according intellij idea documentation "marking file plain text". however, context menu in project view functionality supposedly located has no such action. using version 13.02 of intellij. here context menu looks like: under settings > compiler > excludes, add entry. any attempts run path specified here result in classnotfoundexception , , important class indicator well.

jQuery.ajax() to grab a stringified version of a CSS File throws CORS error? -

on page, load css file cdn using line like: <link rel="stylesheet" type="text/css" href="//cdnjs.cloudfare.com/whatever.css?abcdefg"> and css loads great. after page load, have javascript script loops through linked stylesheets , tries grab contents as string . so, using jquery ajax, code looks like: //"links" array of linked stylesheets; each value link's href $.each(links, function(i, v) { //assume first value in loops "//cdnjs.cloudfare.com/whatever.css?abcdefg" $.ajax(v, { mimetype: 'text/plain', datatype: 'text', complete: function(data) { console.log(data.responsetext); } }) } i following cors error in console: "xmlhttprequest cannot load //cdnjs.cloudfare.com/whatever.css?abcdefg. no 'access-control-allow-origin' header present on requested resource. origin 'http://stackoverflow.com' therefore not allowed access&q

javascript - Calling .mouseenter( ) is working even though .click( ) won't trigger animation -

in html, have button id of "submit1" <div id="first"> <form> <input type="radio" name="school" value="pitt">pitt<br> <input type="radio" name="school" value="memphis">memphis<br> <button id="submit1">submit</button> </form> </div> now in jquery, try use .click() trigger div "first" fadeout, so: $(document).ready(function() { $('#submit1').click(function(){ $('#first').fadeout('slow'); }); }); weirdly enough, nothing happens when click submit. thought maybe wasn't calling .js file, alas, when change .mouseenter( ), works trigger fadeout of div. $(document).ready(function() { $('#submit1').mouseenter(function(){ $('#first').fadeout('slow'); }); }); i saw old stack overflow post used alert instead of animat

google chrome - Which web browsers support the MPEG-DASH streaming protocol? -

i have found bellow: according to: this link dash supported browser browser supports w3c media source extensions (mse), today chrome , ie11 and here firefox 21 includes implementation of dash html5 webm video turned off default. can enabled via " about:config " , "media.dash.enabled" preference. firefox 23 removed support dash html5 webm video but can made run in chrome(23+). tell me browsers support dash mpeg streaming video? browsers not support mpeg-dash natively websites need javascript libraries play dash streaming. these open source mpeg-dash player libraries require mse support in browser: dash.js : official reference implementation shaka player : google's player library other clients: dashas : open source client written in flash (so no mse support needed) commercial clients mse support in browsers chrome 23 ie 11 (only on windows 8+) edge safari 8.0 (only on os x, not on ios) firefox 42

ios - How to access instance from another class -

thanks in advance! i'm new oop, problem may basic, i've searched hours , still cannot find solution. i'm using cocos2d , box2d in project. in gamelayer.mm file, have label show current score. , there's custom sprite derived ccsprite. now, wanna increment current score custom sprite class when property of sprite "isdead" changed true. follows: - (void) setisdead { isdead = 1; // increment score } my question how can increment score subclass? cannot access instance or instance method of gamelayer.mm subclass. tried change function of incrementing score instance method class method, , make score global instance, got duplicate error later. thanks advice! you use observer design pattern here in observer listens event , performs action accordingly. so in gamelayer.mm add observer in init function: [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(receiveisdeadnotification:) name:@"spr

How to use regex to parse a S3 bucket list of files - Python -

i have following method: def scan_s3dir(dirname): try: cmd = "s3cmd ls {s3bucket} --recursive".format(s3bucket=dirname) output = subprocess.check_output([cmd], stdin=none, shell=true) #s3://dgsecure/test_data/ regex = "dgsecure/test_data/[^/]*/(\s+)*" installers = re.findall(regex, output) print installers except exception, e: print e sys.exit(2) when execute s3cmd ls /path/to/bucket --recursive get: 2014-02-14 02:21 0 s3://path/to/bucket/ 2014-02-14 17:32 236 s3://path/to/bucket/foo.txt 2014-02-26 23:31 6035 s3://path/to/bucket/bar.txt 2014-02-14 22:17 2960 s3://path/to/bucket/baz.txt from regular expression, want produce list files, including subdir present in //path/to/bucket/ example like: s3://path/to/bucket/hello/world.txt the output have returned is: ['

java - Write message from IRC channel into a file with PircBotX -

hello pretty new java have fiddled bit. this time trying make bot twitch channel can configure on own, making raffle , other independent stuff. i using library connect twitch irc called pircbotx: https://code.google.com/p/pircbotx/ , have understanding on how answer listeneradapter so: public class commands extends listeneradapter { public void onmessage(messageevent event) { if (event.getmessage().equals("!commands")) { event.respond("available user commands: !topic, !faq, !youtube, !twitter, !schedule, !time"); } } } but in particular listener trying return message when person does: !topic newtopic in instance need "newtopic" string. i don't know if there way save topic in twitch api write in own file. i thinking might this: newtext = event.getmessage.????? if (event.getmessage().equals("!topic " + newtext)) { if (event.getchannel().isop(event.getuser())) { try (buffe

c# - how to implement variable initialization when loading dll in net? -

made dynamic loading dll using reflection how implement variable initialization @ boot? private bool loadplugins( string path ) { try { string[] pluginfiles = directory.getfiles(path, "*.dll"); plugins = new list<iplugin>(); ( int = 0; < pluginfiles.length; i++ ) { string args = pluginfiles[i].substring(pluginfiles[ ].lastindexof( "\\" ) + 1, pluginfiles[ ].indexof( ".dll" ) - pluginfiles[ ].lastindexof( "\\" ) - 1 ); type objtype = null; try { assembly ass = null; assemblyname myassemblyname = assemblyname.getassemblyname(pluginfiles[i].tostring()); ass = assembly.load(myassemblyname/*args*/); var s = ass.fullname; if ( ass != null ) { objtype = ass.gettype(args + ".plugin&q

jquery - Creating custom touch gestures using javascript -

i need create custom gestures different shapes square, circle etc. in other words need detect when user draws square or circle on touch device using javascript. currently i'm trying achieve using hammer.js custom gestures far can detect whenever user draws , code looks like var obj= { name: 'draw', index: 7, defaults: { max_draw_dur:200, min_delta_x:100, min_delta_y:200 }, centerx:undefined, centery:undefined, changingdir:false, changeindir:0, startangle:0, currdir:undefined, currdx:0, currdy:0, handler: function(ev, inst) { if(hammer.detection.previous!=undefined) { var prev = hammer.detection.previous; var curr = hammer.detection.current; switch (ev.eventtype) { case hammer.event_start: this.changeindir=0; this.startangle=0; this.centerx=curr.startevent.center.pagex; this.centery=curr.startevent.center.pagey; hammer.detection.current.name = 'draw' inst.trigg

java - How to add Project to use everywhere without changing anything in another project -

i apologize, if question has been answered earlier, haven't found appropriate answer asking one. i have developed android application. want develop same application different splash screen , logo. want use earlier project development if changes happen in logic can track them easily. what trying add project , use project library every where . ( project 1 -> parent project want use library) ( project 2 -> child project want use parent project) went project 2 (where want add/use parent project library) project properties -> java build path -> project -> add added project1 (parent project) now in mainactivity of project2 (child project) using project1 mainactivity: package child.project.appstar; public class mainactivity extends parent.project.appstar.mainactivity { } now there else need add or can run project in devices? any kind of appreciated. you can make main project library project. if using eclipse open main project projec

objective c - iOS xcode re-using tableview -

Image
can please explain how re-use tableview controller different information each button selected, see picture. basically user tap select button presents appropriate table view populated data, choose item return symbol browser , have "select" button change users selection table view. each "select" button need have different information in tableview. can provide me links on this? sorry still grasping objective-c. you can declare property in tableviewcontroller.h @property(nonatomic,assign) int viewloadfor initialise property when navigate tableviewcontroller and check value of viewloadfor in tableviewcontroller , load tableview according that eg. if(viewloadfor == 1){ tableviewarray = @[@"hello",@"hello1"]; } else if(viewloadfor == 2){ tableviewarray = @[@"bye",@"bye1"]; }

java - Websphere Multiple slf4j logback bindings work around -

i running application on websphere v8.5.5.0 , attempting use logback logging framework. when try start application, greeted error similar this one : [10/03/14 13:19:00:900 est] 00000097 systemerr r slf4j: class path contains multiple slf4j bindings. [10/03/14 13:19:00:900 est] 00000097 systemerr r slf4j: found binding in [bundleresource://266.fwk1755217229:1/org/slf4j/impl/staticloggerbinder.class] [10/03/14 13:19:00:900 est] 00000097 systemerr r slf4j: found binding in [wsjar:file:/c:/program%20files%20(x86)/ibm/websphere/appserver_1/profiles/appsrv01/installedapps/aussydcvtlj007node02cell/myapp.ear/lib/logback-classic-1.1.1.jar!/org/slf4j/impl/staticloggerbinder.class] [10/03/14 13:19:00:900 est] 00000097 systemerr r slf4j: see http://www.slf4j.org/codes.html#multiple_bindings explanation. [10/03/14 13:19:01:313 est] 00000097 systemerr r slf4j: actual binding of type [ch.qos.logback.classic.util.contextselectorstaticbinder] as answer explai

Multi tenant rails app with devise -

i'm trying build multi tenanted app in which different banks separated subdomain. part working fine. there 1 more level of multitenancy bank products. each bank has multiple products a devise user can belong on product this means have register twice 2 products of same bank though under same subdomain(client requirement can't change) because of can have same email address 2 products. uniqueness scoped product_id so have select product while signing in , signing up this how i'm trying implement above solution around_filter :scope_current_bank, :scope_current_product before_filter :authenticate_user! helper_method :current_bank, :current_product def current_bank @current_bank = bank.find_by_subdomain!(request.subdomains.first) end def current_product if user_signed_in? @current_product = current_bank.products.find_by_id(params[:product_id]) else @current_product = current_user.product end end def scope_current_bank bank.current_id = curren

c++ - Mixing fixed function pipeline and programmable pipeline in opengl -

okay, here problem. have framework used school visualizations, , i've been trying set 3d graphics. problem is, framework uses fixed function pipeline draw. without messing up, i've been trying work around old code still needs use fixed function pipeline, , have been setting facilities allow creation of shaders , shader programs. i've got simple color shader compile , i've made test vertex array (a green triangle). now when tried render it, screen went black. before hand, there lot of 2d sprites , not moving screen, stepping through code added render function, found screen goes black moment call gluseprogram. if comment out gluseprogram, , parts set uniforms , draw, works normally. gluseprogram disable fixed function pipeline? if so, there anyway reactivate it, per se? the moment use gluseprogram fixed function pipeline replaced programmable pipeline. can't have fixed function + programmable pipeline @ same time. example suppose scene contains fog. if

vb6 - recordset.close got wrong help plssss -

help code got wrong says: either bof or eof true, or current record has been deleted,requested operation requires current record. i think rs.close has problem or can set rs.close? because set , used recordset twice. can help? please fix code. public function borrowersname(byval iname, byval imod, byval icat, byref bfname, byref blname) boolean dim datereturned string 'select firt primary key of item qry1 = "select tblitem_id tblitem inner join tblcategory on tblitem.tblcategory_id=tblcategory.tblcategory_id tblitem.item_name='" + iname + "' , tblitem.item_model='" + imod + "' , tblcategory.category_name='" + icat + "'" rs.open qry1, conn qry1result = rs.fields(0).value rs.close qry2 = "select date_returned,firstname,lastname tblborrowers tblitem_id='" & qry1result & "' order tblborrowers_id desc limit 1" rs.open qry2, conn datereturned = rs.fields(0).value if dat

javascript - Bootstrap: scrollspy doesn't work after I've added smooth scrolling -

i'm building site using twitter bootstrap, , got scrollspy work, using below javascript: $('body').scrollspy({ target: '.navbar' }) but stopped working me, after add script enable smooth scrolling: <script type="text/javascript"> $(document).ready(function() { // navigation click actions $('.scroll-link').on('click', function(event){ event.preventdefault(); var sectionid = $(this).attr("data-id"); scrolltoid('#' + sectionid, 750); }); // scroll top action $('.scroll-top').on('click', function(event) { event.preventdefault(); $('html, body').animate({scrolltop:0}, 'slow'); }); // mobile nav toggle $('.nav-toggle').on('click', function (event) { event.preventdefault(); $('#bs-example-navbar-collapse-1').toggleclass("open"); }); }); // scroll function function scrolltoid(id, speed){ var offse

assembly - Not understanding instruction execution order in recursive factorial function (MIPS) -

i confused how code multiplies n each n-1 given order of sequences. let me explain how see happening , can point out i'm wrong. if n less 0, comparison false , program returns 1(if first time has been called). if not, l1 called , gets decremented. here confused. looks fact being called again after decrement , multiplication function never takes place. in case, if n = 5, decrement until n = 0 , multiply 1 x 5 @ end. my best guess i'm missing in terms of pushing/popping values on , off stack, haven't clue. fact: addi $sp, $sp, -8 # adjust stack 2 items sw $ra, 4($sp) # save return address sw $a0, 0($sp) # save argument n slti $t0, $a0, 1 # test n < 1 beq $t0, $zero, l1 # if n >= 1, go l1 addi $v0, $zero, 1 # return 1 addi $sp, $sp, 8 # pop 2 items off stack jr $ra # return instruction after jal l1: addi $a0, $a0, -1 # n >= 1; argument gets (n – 1) jal fact # call fact (n – 1) lw $a0, 0($sp) # return jal: restore argument n lw $ra, 4

requirejs - callback when required file's requirements have completely finished evaluating -

sorry, i'm having tough time wording question. essentially have file includeme.js: require('anotherjs.js', function() { console.log('yo, should print before "hello"'); } which required following require function: require('includeme.js', function() { console.log('hello, should printed second after "yo"'); }); i want of includeme.js evaluated before callback 'require'ing includeme.js. want yo logged before hello. is, includeme.js loaded, anotherjs.js loaded sync, meanwhile callback hello log called, before anotherjs finished being fetched , yo called. is there way have callback waits js file evaluated requires returning? the answer use requirejs recommend. define things requiring. in case of example: require('anotherjs.js', function() { console.log('yo, should print before "hello"'); } should be: define('anotherjs.js', function() { [...]

java - How to get 'complete' download size of a url with jsoup -

hey guys hoping me out. i using jsoup scrape websites need total bytes downloaded , cant seem figure out. i.e need total bytes downloaded 'get' request including headers, body, etc. in advance. maybe 1 @ api have helped: connection.response response = ... int size = response.bodyasbytes().length; ( http://jsoup.org/apidocs/org/jsoup/connection.response.html#bodyasbytes() )

javascript - increase number automatically in the text field after clicking save button -

i had text field named bill no ,my problem increase value in text field automatically , bill no 1 , after clicking save button should save 1 after saving bill no should automatically increase 2 , any advice ? <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>sales</title> <link href="css/module.css" rel="stylesheet" type="text/css"> <link href="css/jquery-ui.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="js/jquery.min.js"></script> <script src="js/jquery-ui.min.js"></script> <script src="js/date.js"></script> <script> $(docu

nsstring - Comparing 2 strings in Objective-C -

i have nstask of output stored in nsdata object. string via nsstring *outputstring = [[nsstring alloc] initwithdata:outputdata encoding:nsutf8stringencoding]; now can nslog string , compare via [outputstring isequaltostring:@"nslogged string"] . result 2 strings not identical. why that? played encoding not seem problem. the output tool contains trailing newline character. either compare against "yourexpectedstring\n" or use like outputstring = [outputstring stringbytrimmingcharactersinset:[nscharacterset newlinecharacterset]; to remove newline characters.

javascript - V8: Fatal error: CHECK(V8::ArrayBufferAllocator() != NULL) failed -

i error when try run js code ( this + this ) v8 (tried master 2 weaks ago, 3.23.17, 3.24.40, 3.25.5; 3.23.0 doesn't work anymore because of api changes): # # fatal error in ..\..\src\runtime.cc, line 785 # check(v8::arraybufferallocator() != null) failed # a lot of other js code has worked already, wonder problem is. it's on win8 x64 build. v8 has been build described in official docs (using gyp + msvc 2012). don't think there problem because worked fine other js code. i think there might issue v8 itself, not sure... i asked on mailing-list here . some c++ code, don't think there problem because worked fine other js code: #include <string> #include <assert.h> #include <iostream> #include <sstream> #include <iomanip> #include <boost/noncopyable.hpp> #include <v8.h> // create new isolate (completely isolated js vm). struct v8isolate : boost::noncopyable { v8::isolate* isolate; v8isolate() : isolate(v

c# - Load text to datagridview -

Image
i have point files like: i have created code allows users select files dialog box , populate data gridview. private void cmdload_click(object sender, eventargs e) { datatable table = new datatable(); table.columns.add("point"); table.columns.add("x"); table.columns.add("y"); table.columns.add("z"); table.columns.add("r"); table.columns.add("a"); table.columns.add("b"); table.columns.add("c"); stream mystream = null; openfiledialog openfiledialog1 = new openfiledialog(); openfiledialog1.initialdirectory = "c:\\"; openfiledialog1.filter = "data files (*.pnt)|*.pnt"; openfiledialog1.filterindex = 2; openfiledialog1.restoredirectory = true; if (openfiledialog1.showdialog() == dialogresult.ok) { try { if ((mystream = openfiledialog1.openfile()) != null) { u

android - Exception handling on AsyncQueryHandler -

when using android's asyncqueryhandler , there easy way handle exceptions thrown asynchronous insert or need write own version of class? poking around asyncqueryhandler source became clear extend suit needs without pain. since "asyncqueryhandler exception handling" doesn't give on google or i've attached source below in case else ever finds in same situation. basically is, extends asyncqueryhandler 's internal worker thread , wraps call through thread's super.handlemessage in try-catch block, sends caught exceptions main thread in message, gets passed onerror callback. default onerror re-throws exception. /** * thin wrapper around @link {@link asyncqueryhandler} provides callback invoked * if asynchronous operation caused exception. */ public class sturdyasyncqueryhandler extends asyncqueryhandler { public sturdyasyncqueryhandler(contentresolver cr) { super(cr); } /** * thin wrapper around {@link asyncquer

Skip multiple iterations in loop python -

i have list in loop , want skip 3 elements after look has been reached. in this answer couple of suggestions made fail make use of them: song = ['always', 'look', 'on', 'the', 'bright', 'side', 'of', 'life'] sing in song: if sing == 'look': print sing continue continue continue continue print 'a' + sing print sing four times continue nonsense of course , using 4 times next() doesn't work. the output should like: always aside of life for uses iter(song) loop; can in own code , advance iterator inside loop; calling iter() on iterable again return same iterable object can advance iterable inside loop for following right along in next iteration. advance iterator next() function ; works correctly in both python 2 , 3 without having adjust syntax: song = ['always', 'look', 'on', 'the', 

combine into a single SQL query both the first date and the total number of dates that are returned -

i want combine single sql query both first date , total number of dates returned where clause. i can 2 separately: select dateadded table id = x order dateadded asc limit 1 and select count(*) table id = x but how merge these 2 queries? how about, select min(dateadded), count(*) table id = x since don't specifiy engine using, avoids far standardized limit keyword .

Android image downloading -

i want download image android phone , follow downloading prossess . downloading working ,but didn't found way how tho follow in log tag==> final target determine speed of download : `at t=0,1s 40byte downloaded` @ t=10s 2000byt downloaded ... here code ,i hope me ,and thank public class downloadactivity extends activity { private menuitem item; private string url = "http://10.0.2.2:8080/testandroid/downloadservlet"; //http://localhost:8080/testandroid/downloadservlet/logo.png private string name = "/logo.png"; imageview imgview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_download); imgview = (imageview) findviewbyid(r.id.imgview1); string[] params = new string[] {url, name}; sendhttprequesttask task = new sendhttprequesttask(); task.execute(params); } @override

actionscript 3 - Action Script 3 Health Bar Issues -

i new as3 , trying add dynamic health code. here code have based on dynamic health. var currenthealth:int = 5000; var totalhealth:int = 10000; //dynamic health var healthpack:medipack = new medipack(); healthpack.width = 30; healthpack.height = 30; healthpack.x = math.random() * stage.stagewidth; healthpack.y = math.random() * stage.stageheight; stage.addchild(healthpack); and: //display current health health.bar.width = 300 * (currenthealth / totalhealth); currenthealth -= 1; //detecting collision health if (stage.contains(healthpack)) { if (player_mc.hittestobject(healthpack)) { currenthealth += 5000; healthpack.parent.removechild(healthpack); } } my current symbols have in library associated health are: healthbarbg (has instance name of bar) , instance of healthbar healthbar , medipack whenever run code error of: scene 1, layer 'actions', frame 2, line 91, column 2 1120: access of undefined property healthb

objective c - creating a sortable grid in Cocoa (horizontally) -

i'm struggling create view sortable elements in it. what i'm looking have elements, 1-5 in 1 row, can drag them left , right , rearrange them, while adding , deleting. like this, first row (1 2 3 4): jquery sortable inside these elements want have view, more controls, , changeable items. tableviews seem sort vertically, , collectionview doesn't either, far know. are there implementations have look? approach here? thanks in advance! chris i've had same problem once , haven't found nothing cocoa purpose. in principle thsi should help: use nsmutabledictionary keys each field, e.g. field_1 , value, contains positionnr in collectionview. when reordering adjust values change. the data collectionview nsmutablearray, created/updated using number display dictionary = value. array can contain data, other array, , used collectionview.

javascript - Mouse pointer decoration in JAVA project -

i working in school project , make attract child in project want implement special mouse pointer. example pointer like, pointer moves small bird follow pointer. doing project in java platform . links guys know please let me know. i can give .this regarding flying bird follow button ,when hovering .you can refer following link.hope out :) http://codepen.io/minimalmonkey/pen/ouwcn and helpful also, it's widget http://www.way2blogging.org/2011/01/how-to-add-animated-flying-twitter-bird.html

php - curl is not working on my production server -

$url="http://nis.com/smsapi.asp?mobnum=".$umobile."&uid=*****&pswd=*****&msg=hi%20".$firstname."%2c%20thanks%20for%20registering"; $curl_handle = curl_init(); curl_setopt( $curl_handle, curlopt_connecttimeout, 10 ); curl_setopt( $curl_handle, curlopt_returntransfer, 1 ); curl_setopt( $curl_handle, curlopt_header, 1 ); curl_setopt($curl_handle, curlopt_post, true); curl_setopt( $curl_handle, curlopt_verbose, 1 ); curl_setopt( $curl_handle, curlopt_url,$url ); $buffer = curl_exec( $curl_handle ); //print_r( curl_getinfo ( $curl_handle ) ); echo("sfsf = ".$buffer ); } there form , when user enter values name . phone , mail . after using post request took mobile no , name post use in $url when on localhost server send me message when put on production server shows no error , not send me message note :the

jquery - insert inside a div within a table row -

hello have table having div in alternate rows. want add table inside divs. please check link , update me. advance <table> <tr> <td>hi</td> </tr> <tr> <td>foo 1</td> <td> <input type="button" value="remove" id="remove1" /> </td> </tr> <tr> <td> <div></div> </td> </tr> <tr> <td>foo 2 </td> <td> <input type="button" value="remove" id="remove2" /> </td> </tr> <tr> <td> <div></div> </td> </tr> </table> $("table tr input").on('click', function(e){ alert($(this).closest('td').parent()[0].sectionrowindex); alert($(this).closest(&q

sublimetext2 - How to Autocomplete link in sublime text 2 -

hey have link file in html this: and i'm trying real hard autocomplete file link, eg: if type this: stylesheets/s or should suggest me style.css or similar. how achieve that, in webstorm phpstorm i've encountered autocomplete feature allows me browse files , assures me link i'm typing correct, please let me know if there way or should revert other ide. i suggest checkout following package sublime: https://sublime.wbond.net/packages/autofilename

css - Align a bootstrap navbar to the right -

Image
i'm trying move navbar right, tried both navbar-right, , pull-right, - <div class="container" > <h1 align="center"><a href="#">my site</a></h1> <div class="container" > <ul class="nav nav-tabs navbar-right" > <li class="active"><a href="#">tab1</a></li> <li><a href="#">tab2</a></li> <li><a href="#">tab3</a></li> <li><a href="#">tab4</a></li> </ul> </div> <br> hello </div> so there 2 problems here - grey line underneath tabs shorter, , tabs aren't aligned - want "tab1" rightmost one, , correspondingly "tab4" leftmost one. i same results navbar-right , pull-right. how can fixed? thanks! you can have behavior extending bootstrap. demo on jsbin: http://jsbin.com/zan

java - How to know, which child are called static parent method? -

i have next classes: abstract public class parent{ static public void logrequestor(){ //string requestor = // how requestor? //log.e("requestor is: " + requestor); } } class childa extends parent{ } class childb extends parent{ } somewhere have next lines: childa.logrequestor(); childb.logrequestor(); childa.logrequestor(); how know, child called static parent method no params in function logrequestor ? want have next logs: requestor childa requestor childb requestor childa that not possible, statics defined in class not in instance therefore statics cannot e.g. inherited und therefore cannot used polymorphism. see answer more details: why doesn't java allow overriding of static methods?

php - Iterating through two POST arrays of different length to find customers who bought x,y,z but didn't buy x,y,x,z -

all answers out there deal iterating 2 or more arrays of same length, or same keys, not here. tried of ideas out there no avail. i have 2 multiple selects submitted in same post form - products bought , products not bought. contain same products, multi selects have produce same items in array (think of how many combinations there are.) first foreach works fine , pulls mysql customers had of selected "bought" items. second nested foreach doesn't iterate - takes first value "hasn't brought" array. html part: find customers have bought: <form method="post" action=""> <select name="bought[]" size="5" multiple="multiple"> <option value="rd"> brown t shirt </option> <option value="rdx"> red t shirt </option> <option value="hd"> white t shirt </option> <option value="cb"> black t shirt</option> <option