Posts

Showing posts from May, 2015

canvas - Threejs: Differences between geometry.faceVertexUvs in r47 and geometry.faceVertexUvs in r58 -

Image
working on part of code porting threejs r47 threejs r58. have problems canvas 2d texture loaded image stretched. the respective code snippet follows: var geometry = new three.spheregeometry( 200, 80, 60 ); ( var = 0, l = geometry.facevertexuvs[ 0 ].length; < l; ++ ) { ( var j = 0, jl = geometry.facevertexuvs[ 0 ][ ].length; j < jl; j ++ ) { var uv = geometry.facevertexuvs[ 0 ][ ][ j ]; var = uv.v * math.pi - math.pi / 2; = math.sin(a); uv.v = 0.5 - math.log( ( 1 + ) / ( 1 - ) ) / ( 4 * math.pi ); uv.v = 1 - uv.v; } } i think, there changes in way geometry.facevertexuvs used threejs r47 r58. help, warmly welcomed!. in advance... https://github.com/mrdoob/three.js/wiki/migration "uv replaced vector2. means .u , .v .x , .y." r53 r54. maybe helps? :)

php - How to generate xml in codeigniter -

i trying generate xml database query. here generated xml link: http://mydeal.ge/api/xml but when try parse xml, error: http://wallsparade.com/test.php . my code is: public function xml() { $res = $this->db->query('custom query'); if($res->num_rows() > 0) {$output = '<?xml version="1.0"?>'. "\n"; $output .= "<deals>"; foreach($res->result() $item) { $output .= "<sale id = '".$item->id."'>"; $output .= "<link>".$item->link."</link>"; $output .= "<title>".urlencode($item->title)."</title>"; $output .= "<image>".$item->image."</image>"; $output .= "<text>".urlencode($item->text)."</text>"; $output .= &

ffmpeg - avformat_open_input return value, error code on NaCl Module -

i'm trying port ffmpeg nacl module. so far, module linked ffmpeg , sdl libraries. it can play yuv format video directed load memory , copy yuvoverlay buffer (it's easy). now, want use ffmpeg decode video, when call function avformat_open_input returns -5 when input url string , such rtmp:// or mmsh:// ; returns -1052488119 when input file name , such /saved/tmp (i mount file system - html5fs). there questions: what means of -5 , -1052488119? if file can't open avformat_open_input, possible input type buffer not file name or url string ? if i'm not question or description, can tell me. if doing same thing or having same problem, can discuss together. thanks, jar there ffmpeg port in naclports . maybe useful you?

highcharts - Is it possible to have more than two panes in HighStock chart? -

i able plot chart data has usual open high low , close plus volumes , open interest. these represented in 3 panes: pane 1: open high low close pane 2: volumes pane 3: open interest. the 'two panes, candlesticks , volumes' example highcharts (highstock) deals pane 1 , 2. question if possible plot third pane under volumes pane can have open interest bars? thanks yes, possible - add more axis in example mentioned.

solver - Resolving problems with Algebraic Loops in SIMULINK models -

Image
my problem i have simulink model has got feeback loop aka algebraic loops causing error in simulation. original solver configuration fixed-step dormand-prince (order 5). tried fixed-step order 3 (runga-kutta). still has not resolved issue. my question is there way resolve algebraic loop without altering original performance or design of circuit much? clarification question i sure there way solve this. however, don't want compromise original performance of circuit. moreover, customer-supplied data , seems have managed work out fine. require point me right direction regarding how solve this. my approach far i tried break loop using: i) switch (if ip = 0, op = 0; if ip = 1, op = 1) know stupid different block breaks loop. ii) logic gate (xoring feedback signal 0). unfortunately, don't know how zero-order hold unit delay loop seems commonly prescribed solution kind of problem. believe may cause issues model's intended performance. i have posted query o

iphone - Files Deleting from Table View but not from Document Directory by using Swipe Gesture -

if (editingstyle == uitableviewcelleditingstyledelete){ nsfilemanager *filemanager = [[nsfilemanager alloc]init]; nsstring *filepath = [documentsdirectory stringbyappendingpathcomponent:[nsstring stringwithformat:@"%@ ",[self->localsongs objectatindex:indexpath.row]]]; [filemanager removeitematpath:filepath error:nil]; [self->localsongs removeobjectatindex:indexpath.row]; [tableview deleterowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; [self.tableview reloaddata]; } any suggestion? following code how delete file document directory : nsstring *imagename = @"name of file" nsfilemanager *filemanager = [nsfilemanager defaultmanager]; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; [filemanager remo

ios - Issue with Aviary SDK device orientation -

i trying lunch aviary sdk photo editor in landscape mode , works on ipad !! , app crashes on iphone due problem : 'uiapplicationinvalidinterfaceorientation', reason: 'supported orientations has no common orientation application, , shouldautorotate returning yes' i tried different ways no success : - (ibaction)photoeditor:(id)sender { [self displayeditorforimage:imagebg.image]; } - (void)displayeditorforimage:(uiimage *)imagetoedit { //set device orientation [afphotoeditorcustomization setsupportedipadorientations:@[@(uiinterfaceorientationlandscaperight), @(uiinterfaceorientationlandscapeleft) ]]; afphotoeditorcontroller *editorcontroller = [[afphotoeditorcontroller alloc] initwithimage:imagetoedit]; [editorcontroller setdelegate:self]; [self presentviewcontroller:editorcontroller animated:yes completion:nil]; } none of these codes worked : 1- - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientatio

c# - Can not update Stock Availability / Is In Stock value via Magento API -

background i have live , test magento store. generate magentoapi c# class wsdl of magento store. problem i able update product quantities no issues via api class. trying set stock availability field api not change it's value. code [test] public void updateisinstockfield() { magentostoreconfig storeconfig = gettestmagentostore(); var magentoapirepo = new magentoapirepository(storeconfig); cataloginventorystockitementity magentoproduct = magentoapirepo.getproductfromsku(new[] { "sku-123456" }); var productupdated = new cataloginventorystockitemupdateentity { is_in_stock = 0, manage_stock = 0, use_config_manage_stock = 0, qty = new random().next(50, 100).tostring(cultureinfo.invariantculture) }; magentoapirepo.updatestockquantity(magentoproduct.product_id, productupdated); } result from ma

python - Work out correct money denominations for change -

working on django project. on payment model have simple def save def save(self, *args, **kwargs): self.amount_change = self.amount_due - self.amount_paid return super(payment, self).save(*args, **kwargs) if amount_change comes -455.50 i'd return change as 2x200 1x50 1x5 1x0.5 what i'd breakdown amount_change money denominations have , return change client correct notes , or coins. denominations [200, 100, 50, 20, 10, 5, 1, 0.5] how go doing this? appreciated. building upon this answer , believe returning desired results: from collections import counter def change(amount): money = () coin in [200, 100, 50, 20, 10, 5, 1, 0.5]: num = int(amount/coin) money += (coin,) * num amount -= coin * num return counter(money) input , output: >>> c = change(455.50) >>> print c counter({200: 2, 0.5: 1, 50: 1, 5: 1}) edit : if need pass in negative number, create new variable inside funct

c# - WPF Task on Touch device not back properly to UI Thread -

i have wpf application background tasks done works on laptop not working fine in tablet windows 7. you click screen, loading image shown while background job done, , @ end of job dialog info shown. press button on dialog , go main screen. in tablet @ end when dialog shown have press screen once have gui "active" , again application detect click. ui thread gets "disabled" after background task , needs screen touch active again. quite annoying because user has press multiple times button action performed. behaviour happens in tablet, not on laptop... here code: public void processtouch(point p) { task getpendingdocstask = task.factory.startnew(getpendingdocs, cancellationtoken.none, taskcreationoptions.none, taskscheduler.default); task aftergetpentingdocstask = getpendingdocstask.continuewith(w => aftergetpendingdocs(), taskscheduler.fromcurrentsynchronizationcontext()); } private void getpendingdocs() { thread.sleep(500); }

php - Paypal 3rd party Shopping Cart integration doesnot return form values -

i facing problem in paypal 3rd party shopping cart integration. after sucessfull payment, doesnot values paypal. using following code: <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="upload" value="1"> <input type="hidden" name="business" value="example@mail.com"> <input type="hidden" name="item_name_1" value="item name 1"> <input type="hidden" name="amount_1" value="1.00"> <input type="hidden" name="item_name_2" value="item name 2"> <input type="hidden" name="amount_2" value="2.00"> <input type="hidden" name="item_name_3" value="item name 3"> <input type="hidden&

ios - Why gesture recognizer outlets are strong by default -

when create outlet control ctrl-dragging in interface builder suggests make outlet weak. but if create outlet gesture recognizer suggestion make strong. curious reason behind of this, wrong making gesture recognizer outlets weak too? ref: http://www.raywenderlich.com/forums/viewtopic.php?f=2&t=5126 from ios 5.0 not retain gesture recognizers when added view controller. by making strong properties , connecting them gesture recognizers, can ensure stay alive otherwise app crash. credit ray wenderlich team member hollance .

sql - Too Many Client Task Exception in Java JDBC -

i creating jdbc odbc connection through java programs. have make connection many times . after times program throws many client task exception . how can resolve problem . pasting sample example of requirement class connectiondemo { public void connect() { try { class.forname("sun.jdbc.odbc.jdbcodbcdriver"); connection con=drivermanager.getconnection("jdbc:odbc:dsn"); statement st= con.createstatement(); } catch(exception ex) { ex.printstacktrace(); } } } calling programs class { public static void main(string args[]) { //supose have call connect methods thousands of times solution connectdemo demo= new connectdemo(); dem0.connect(); } } the key saving connections.why not use static method call connections in: public class connector { private static final string url = "jdbc:mysql://localhost/"; private static final string login = "root"; private static final string passwor

c# - Mobile JQuery Advancements -

i trying apply date picker , time picker controls in mobile views . have tried lot went in vein. atlast hope stack overflow. please me if has applied datepickers or time pickers in mobile views please tell me procedure apply that. thank have tried 1 way given on here http://jquerymobile.com/demos/1.0a4.1/experiments/ui-datepicker/ i using jquery.mobile.1.3 , latest. have written in script , css section <link rel="stylesheet" href="jquery.ui.datepicker.mobile.css" /> <script src="jquery.ui.datepicker.js"></script> <script src="jquery.ui.datepicker.mobile.js"></script> and used control in similar way mentioned never worked me <input type="date" name="date" id="date" value="" /> did read http://jquerymobile.com/demos/1.0a4.1/experiments/ui-datepicker ? you need 4 things: 1) label in html <label for="date">date input:<

python - Google App Engine Remote API + OAuth -

i'm using gae remote api access data store of app. authentication gae made using remote_api_stub.configureremoteapi authentication function returns user name , password. is there way authenticating using access_token, example oauth or oauth 2.0? there solution google accounts configured use 2-step verification. at moment, seeing “badauthentication invalidsecondfactor" error thrown, not able login shell. in order solve this, need app password authorizes app access account resources. follow tutorial , use generated password , username of admin of target app engine app credentials remote api. update: additionally, can take @ remote_api_stub.py file appengine sdk. you'll find family of methods called _configureremoteapiwith* (note leading underscore), such as: _configureremoteapiwithkeyfile _configureremoteapiwithcomputeenginecredential _configureremoteapiwithoauthcredentials methods documented, please take @ docstrings. they'll let authen

"Facebook Store" Extension for magento is not connecting to localserver? -

i have installed magento extension connect magento store facebook store. want test functionality in localhost before set in live server. extension have installed in local. http://connect20.magentocommerce.com/community/fbshops this error facing facebook extension. error! using local host, or ip not accessible outside, please contact hosting provider. is there way available test facebook module in localserver ? using magento 1.7. you need make ip accessible outside world, can if have static ip. need forward request ip port forwarding web server. and have use external ip address instead of localhost in magento check this. can external ip address here .

android - make: *** No targets specified and no makefile found. Stop -

Image
this question duplicate make *** no targets specified , no makefile found. stop problem different , tried solution not work me. i'm working on opencv library , start sample project gives following error me. please me solve error. 17:31:25 **** auto build of configuration default project myfirstopencvjni **** make make: *** no targets specified , no makefile found. stop. 17:31:25 build finished (took 122ms) following android.mk file //android.mk local_path := $(call my-dir) include $(clear_vars) opencv_lib_type:=static opencv_install_modules:=on include ../includeopencv.mk include $(opencv_mk_path) local_module := first-opencvjni local_src_files := first-opencvjni.cpp local_ldlibs += -llog -ldl include $(build_shared_library) after many searches solved error, right click on project->properties->c/c++ build(left side)->builder settings->uncheck "use default build command" checkbox->enter "${ndkroot}/ndk-build.cmd"

html - Div will not display properly on mobile browser -

i have menu div , maincontent div. displays on ie , chrome, when view on opera on android phone, menu div , maincontent div not display scrollbars, divs stretch fit whole paragraph of text inside, leaving menu div shorter maincontent div. html: <div id="contentwrap"> <div id="menu"> <p>less text in here..............</p> </div> <div id="maincontent"> <p>more text in here.......</p> </div> </div> i have specified menu , maincontent inherit height contentwrap div should fill it? i cannot work out though why not display properly, have tried px , percentage values , same result on mobile browser. http://jsfiddle.net/6lcgk/ - displays fine on here, although on opera, blue , green divs not have scrollbars , stretch fit content inside, leaves blue div shorter green div, exposing pink coloured wrapper. anyone know going on? many thanks! try set body @ height 100% .

c# - mapping dto to entities? maybe automapper? should properties match? linq selection -

i trying create linq-to-sql solution using call basic linq-to-sql. not full orm solution via ef or that. point right leverage power of linq , reduce stored procedures (as other benefits). i have done work dtos , entities before... custom implementation. in implementation automapper used. know automapper "works best" when entitiy properties match dto properties. if don't? can configure in custom way? i suppose bigger question is... real solution fact cannot instantiate "linq-mapped" "entities" in query. clear cannot use linq , select new "entity" have select unmapped dto. trying avoid "mapping" entity dto in given query. suppose not big of deal automapper solve problem? i'm not sure you're asking but: i know automapper "works best" when entitiy properties match dto properties. if don't? can configure in custom way? if you're asking think you're asking should .formember ,

ruby on rails - Allow anything through CORS Policy -

how can disable cors? reason wild carded allowed origins , headers yet ajax requests still complain origin not allowed cors policy.... my applications controller : class applicationcontroller < actioncontroller::base protect_from_forgery before_filter :current_user, :cors_preflight_check after_filter :cors_set_access_control_headers # responses in controller, return cors access control headers. def cors_set_access_control_headers headers['access-control-allow-origin'] = '*' headers['access-control-allow-methods'] = 'post, get, options' headers['access-control-allow-headers'] = '*' headers['access-control-max-age'] = "1728000" end # if preflight options request, short-circuit # request, return necessary headers , return empty # text/plain. def cors_preflight_check if request.method == :options headers['access-control-allow-origin'] = '*' headers['access-control-al

ruby on rails - Counting associated objects from an array of parent objects -

i working report counts neighbors in household - looking @ using either helper method, simple query or both a household object has several neighbors , want count total number of neighbors in select group of households. have array of households ids: @household_ids = [31, 15, 30, 38, 1, 5, 32, 25, 10, 26, 14,29] i tried this: def household_neighbor_count(houses) houses.each |id| @neigh = household.find(id).neighbor_count @neigh end end which doesn't work - returns list of ids since rails activerecord query , shot in pseudo sql: neighbors household_id == household_id in @household-ids i using squeel if helps how either -approach fine or recommendation of best approach great it unclear trying do, guess want: houses.map{|id| household.find(id).neighbor_count}.inject(:+) if there duplicates within neighbors among houses, need method set of neighbors given house, not count. , since have not shown such method, guess either not issue, or qu

parsing - Creating a tree/deeply nested dict from an indented text file in python -

basically, want iterate through file , put contents of each line nested dict, structure of defined amount of whitespace @ start of each line. essentially aim take this: a b c d e and turn this: {"a":{"b":"c","d":"e"}} or this: apple colours red yellow green type granny smith price 0.10 into this: {"apple":{"colours":["red","yellow","green"],"type":"granny smith","price":0.10} so can send python's json module , make json. at moment i'm trying make dict , list in steps such: {"a":""} ["a"] {"a":"b"} ["a"] {"a":{"b":"c"}} ["a","b"] {"a":{"b":{"c":"d"}}}} ["a","b","c"] {&q

c++ - Very big persistent container for storing large amount of flags sets -

the problem following: have amount of words (let's 20m), each containing bits used flags; stored in single continuous binary file. what access words in container like style, container_instance[i] allows me access i-th word. things more complicated, cannot store words in memory @ 1 time, have stored file , memory freed not used long period. simplify things whole sequence partitioned 1k fragments, need free , allocate such 1k blocks. memory should freed after time or after number of times container have been accessed. thread safety in nice have. can protect externally. the implementation have allocates blocks on demand (empty or read file if available; file not sparse, after last byte in file allocated empty) , not nicely done. not frees @ all, unused blocks remain in memory forever. i started think nice looking solution , know whether elements stl or boosts can me build such container not engraving step step scratch? i not expecting full solutions, rather pointing &

python - Redirect if failure in django views -

i have function. want execute following 2 lines: list = utils.get_connection().get_list_by_id(mailchimp_list_id) list.subscribe(email_address, {'email': email_address, 'fname': fname, 'lname': lname}) and if fail, want redirect them '/mailing_list_failure' here full function: def add_email_to_mailing_list(request): if request.post['email'] , len(request.post['email']) > 4: email_address = request.post['email'] fname = request.post['fname'] lname = request.post['lname'] #if 2 next lines failure return '/mailing_list_failure/' list = utils.get_connection().get_list_by_id(mailchimp_list_id) list.subscribe(email_address, {'email': email_address, 'fname': fname, 'lname': lname}) return httpresponseredirect('/mailing_list_success/') else: return httpresponseredirect('/mailing_list_failure/&#

.net - C# Application does not crash in VS BUT CRASH on system running -

i'm developing simple test tool verify how many hash(sha1) customer server can elaborate in 1 second. the attached sample use muti-threading start , stop timer counts executed hash. hashes sequential. the application works in visual studio, if run outside vs environment crashes. the problem on increment() function in "using" section. if comment it, works well! static void increment() { try { using (sha1 sha = new sha1cryptoserviceprovider()) { byte[] result; byte[] data = new byte[20]; new random().nextbytes(data); result = sha.computehash(data); } interlocked.increment(ref safeinstancecount); } catch (exception ex) { console.writeline(ex.message); } } the code used start , stop time following: bool stop; static void main() { try { timerqueuet

knockout.js - knockout performance issue with updateValue: 'afterkeydown' -

Image
i have searchbox , table showing 0 - 100 result rows: <input type="text" data-bind="value: vm.query, valueupdate: 'afterkeydown', event: { keypress: vm.keypress} "> <table> <tbody data-bind="foreach: results"> <tr> <td> <p data-bind="text: property1"></p> </td> <td> <p data-bind="text: property2"></p> </td> ... when have 10 rows in results table, ok performance when writing stuff in input-box. yellow = javascript touching 16 ms limit not more: when have 100 rows in results table, performance horrible when writing stuff in input-box. yellow = javascript through roof: if remove valueupdate: 'afterkeydown' there no performance problems have because when user presses enter i'm firing of search using event: { keypress: vm.keypress} . is there performan

android default keyboard layout -

Image
i'm developing app nexus 7, , need edittext show keyboard view numbers , special characters. know can set layout edittext inputtype, problem if set inputtype="number" dialpad appears , not possible switch characters view. need (is customer's request) open keyboard layout shown when click on key "123" in bottom left. i've tried combinations of setrawinputtype , setinputtype no luck. combination shows dialpad txtlinecode.setinputtype(inputtype.type_class_text); txtlinecode.setrawinputtype(inputtype.type_class_number); this combination shows dialpad too txtlinecode.setinputtype(inputtype.type_class_text); txtlinecode.setrawinputtype(inputtype.type_number_variation_normal|inputtype.type_class_number); here screenshots better explain need this default keyboard this layout shown when click on "?123" , need show default this layout shown if set inputtype="number", not allow switch lecters layout by moment edittext preva

Can highslide pop up images be gif object with transparent background? -

i playing arround highslide js , wondering if image pops out can transparent gif or png without white background/or invisible backgroud. yes, image can gif or png transparency. quick demo: (demo removed)

Scala: Why does isInstanceOf[List[Any]] not work? -

i trying solve problem 7 of 99 scala problems , encountered difficulty in figuring out type of list can contain type. looked @ answer , saw list[any] . proceeded code out implementation follows: def flatten(lst: list[any]): list[any] = lst match { case nil => nil case x::xs => (if (x.isinstanceof[list[any]]) { flatten(x) } else { list(x) }) ::: flatten(xs) } however, gives me following compile error: [error] <filename omitted>:<line number omitted>: type mismatch; [error] found : [error] required: list[any] [error] (if (x.isinstanceof[any]) { flatten(x) } else {list(x) }) [error] ^ [error] 1 error found changing isinstanceof[list[any]] isinstanceof[list[_]] gives same compilation error. after short google search , consulting this solution , implemented this: def flatten(lst: list[any]): list[any] = lst match { case nil => nil case x::xs => x ma

sql - Nested Query Variable -

lets have database has table has column of countries (countries), table has column states , column country state in (states), , table has column cities , column state city in (cities). want write query outputs country, state in country, , how many cities in state usa ohio 65 usa maine 52 etc..... my outer query like select countries.country, states.state, count(cities.city) countries, states, cities countries.country = states.country , states.city = cities.city , exists... in exists statement want write nested subquery pull of cities out particular state count function count. there way me write variable or similar pull out cities state? sorry if confusing example, actual query trying write more difficult explain. (using example) subquery pulling out every city in every single state. need change because if trying count number of cities in arizona, don't want seattle or de moines popping up. select country, state, count(cit

c# - WPF: Multiple screens -

i'm writing screensaver in wpf. have screensaver working, however, displays on main monitor. there way "black out" or draw graphics additional monitors when user has multiple displays? i've done searching around, haven't found relevant. update from ananthonline's answer below, able accomplish "black out" effect on non-primary displays using following window: <window x:class="screensaver.blackout" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" cursor="none" windowstyle="none" resizemode="noresize" background="black"> </window> and initializing 1 each screen in app.xaml.cs using following process: foreach (screen s in screen.allscreens) { if (s != screen.primaryscreen) { blackout blackout = new blackout(); blackout.top = s.workingarea

xamarin - Where to put heavy init operations in MvvmCross -

in mvvmcross viewmodel, init method used screen initialization. however, screen not drawn until init completed. have heavy operations (db searching). ideally draw screen progress bar, , run initialization methods, , update screen. put these operations in mvvmcross viewmodel? i heavy stuff in service . in service either: make method triggers done event can listen in viewmodel , there populate properties data. or make async method await on background thread , when returns populate properties. while service runs , fetches data, display else on screen, while data loads. cached data or progress bar or else.

nuget - Library Package Manager menu options not working in Visual Studio 2012 -

the library package manager menu options not work when click on in visual studio 2012. works fine in visual studio 2010. have not been able find answer searching online. have uninstalled , reinstalled nuget package , message installed sucessfully. when opened visual studion 2012 few days ago, did message there problem , written file accidently clicked on not show again , canot find message written. thanks help. on top right of visual studio 2012, there search box. search there console. first result nuget package manager console

c# - Cannot access to simple file "because it is being used by another process" -

i have simple method in class edidocument used load xml : /// <summary> /// method used load specific target file template /// </summary> /// <param name="filepath">file path</param> /// <returns>loading status</returns> public bool load(string filepath) { //file exists bool returnvalue = file.exists(filepath); //file xml returnvalue &= path.getextension(filepath).equals(".xml"); //if file valid if (returnvalue) { xmlreader reader = xmlreader.create(filepath); //load document this._xmldoc = xdocument.load(reader); //load complete returnvalue &= (this._xmldoc != null); } //end of method return returnvalue; } i have unit test method : /// <summary> /// test success on load xml document /// </summary> [testmethod] p

licensing - Do I need to purchase an iTextSharp license for an intranet application? -

this question may have been answered already, haven't been able find answer matching scenario. i'm trying understand when it's required purchase license itextsharp. i want use itextsharp in intranet application within for-profit company. can use free version? or required purchase license? not selling application or source code. application used internally members of organization. the issue not internal/external use. it's not selling application or not. it's matter of license: if release application under agpl-compatible license, don't need purchase itext commercial license. in not, you'll have contact sales department, , purchase one.

cursor.fetchall() vs list(cursor) in Python -

both methods return list of returned items of query, did miss here? or have identical usages indeed? differences performance wise? if using default cursor, mysqldb.cursors.cursor , the entire result set stored on client side (i.e. in python list) time cursor.execute() completed. therefore, if use for row in cursor: you not getting reduction in memory footprint. entire result set has been stored in list (see self._rows in mysqldb/cursors.py). however, if use sscursor or ssdictcursor: import mysqldb import mysqldb.cursors cursors conn = mysqldb.connect(..., cursorclass=cursors.sscursor) then the result set stored in server , mysqld. can write cursor = conn.cursor() cursor.execute('select * hugetable') row in cursor: print(row) and rows fetched one-by-one server, not requiring python build huge list of tuples first, , saving on memory. otherwise, others have stated, cursor.fetchall() , list(cursor) same.

node.js child process - difference between spawn & fork -

this might seem basic question, not find documentation : what difference between forking & spawning node.js process? have read forking special case of spawning, different use cases / repecussions using each of them? spawn command designed run system commands. when run spawn, send system command run on own process, not execute further code within node process. can add listeners process have spawned, allow code interact spawned process, no new v8 instance created(unless of course command node command, in case should use fork!) , 1 copy of node module active on processor. fork special instance of spawn, runs fresh instance of v8 engine. meaning, can create multiple workers, running on exact same node code base, or perhaps different module specific task. useful creating worker pool. while nodes async event model allows single core of machine used efficiently, doesn't allow node process make use of multi core machines. easiest way accomplish run multiple copie

css - Hover Rollover Situation -

here basic code function want do: <style> .cmaxx_rollover { height: 279px; width: 347px; display: block; background: url('http://imperialsystems.biz/imp/files/products/prod_cmaxx.png') bottom; text-indent: -99999px;} .cmaxx_rollover:hover { background-position: 0 0;} </style> <a class="cmaxx_rollover" href="http://imperialsystems.biz/imp/products/cmaxx-dust-fume-cartridge-collector/"></a> so question, have page of dozen products need hover work on. there better way create new class each product? or should create css , class each product? if change shadow behind grey rectangle, set background products , insert product images transparent background img this: <div class="products"> <a href="..."><img src="cmaxx.png" alt="cmaxx"></a> <a href="..."><img src="productx.png" alt="product x"></a> </div>

delphi - JSON data posted with TIdHTTP.Post not received -

i can't server app receive anything. sender code using design-time tidhttp component, property request.accept = text/html, */* procedure tfrmttwebservicetester.button1click(sender: tobject); var ljso : isuperobject; lrequest: tstringstream; lresponse: string; begin ljso := so('{"name": "henri gourvest", "vip": true, "telephones": ["000000000", "111111111111"], "age": 33, "size": 1.83, "adresses": [ { "adress": "blabla", "city": "metz", "pc": 57000 }, { "adress": "blabla", "city": "nantes", "pc": 44000 } ]}'); lrequest := tstringstream.create(ljso.asstring,tencoding.utf8); // or ascii // showmessage(lrequest.datastring); correct data idhttp.request.contenttype := 'application/json'; // idhttp.request.charset := 'utf-8'; lresponse := idhttp.po

php - Wordpress, create user programmatically -

how go creating wordpress users programmatically? i using method below, user being created - when try login password gives me wrong password message, suggestions please? include 'wp-blog-header.php'; include 'wp-includes/registration.php'; include 'wp-includes/pluggable.php'; ini_set("memory_limit","1024m"); ini_set("max_execution_time", "240"); global $wpdb; programmatically $row = array( 'user_name' => "wacek123", 'password' => "wacek123", 'email_address' => "wacek123@gmail.com", 'name' => "wacek123", 'surname' => "wacek123" ); $userdata = array( 'user_login' => $row["user_name"], 'user_pass' => wp_hash_password($row["password"]), 'user_nicename' => $row["user_name"], 'user_email' => $row["

android - Implementing accessability on custom view gives no verbal feedback -

i have turned accessability on, , device speaks navigate around. i have custom seekbar , have implemented folllowing: ontouchevent excerpt: ... case motionevent.action_move: getparent().requestdisallowintercepttouchevent(true); settouchangle(pointtoangle(touchx, touchy)); score = getscorefromangle(anglestart,touchangle); if (onscoresetlistener != null) { onscoresetlistener.onscorepoll(this, score); sendaccessibilityevent(accessibilityevent.type_view_text_changed); } break; ... onpopulateaccessibilityevent method: @override public void onpopulateaccessibilityevent(accessibilityevent event) { super.onpopulateaccessibilityevent(event); logutils.i(tag,"onpopulateaccessibilityevent()",null); switch (event.geteventtype()) { case accessibilityevent.type_view_text_changed: logutils.d(tag,"dispatchpopulateaccessibilityevent() type_view_text_changed",null)

Apache Ant java.lang.NoClassDefFoundError -

possible answer stack on flow question my problem same described in above thread.i went throught solution , not working. ant compile working perfectly. ant jar saying cant load main class exception in thread "main" java.lang.noclassdeffounderror: loadserver (wrong name: org/module/loader/loadserver) @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:791) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ java.net.urlclassloader.defineclass(urlclassloader.java:449) @ java.net.urlclassloader.access$100(urlclassloader.java:71) @ java.net.urlclassloader$1.run(urlclassloader.java:361) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:354) @ java.lang.classloader.loadclass(classloader.java:423) @ sun.misc.launcher$appclassloader.

SQL Server 2008 - TSQL Read CSV file -

i working on project entails on importing csv file sql server 2008 r2 database. csv file generated excel file populated "manager" pr hours employees. includes additional information such job , phase employees working on , includes number of hours equipment (if used). once generate csv file that, it's not usual straighforward "column" based csv file. it's more "row" based csv file each row being kind of unique. due caveat involved, cannot straight dump (using bulk insert or openrowset) sql, essential create (temp) table appropriate column filled data. i looking use fields within csv file based on "location" of field in row. so, positions of data remain same, since every csv based on template file - have navigate through csv file using sql code find right field based on it's position in row. hope gives guys better understanding of trying achieve here. sorry long wall of text. i researched bit , here's have come far: re

jquery - Acquiring IP from which Google Form submission was sent -

this rather long wall of text not need read through all, main part of post below second horizontal line - not have read how did analyze issue :). in advance help! i have webpage custom form sends submissions google spreadsheet (but original google form used of users). need acquire ips of users use custom form, although input ip should hidden. my first idea ip via jquery , have found simple ajax call here @ stackoverflow this. wanted create form input hidden using css , ip acquired via ajax put there (using jquery) , submitted form. however, way went out not acceptable me, because if wanted spreadsheet receive ip input, additional form input field have remain in original google form - not want happen. then thought custom form should send submission 2 places (the spreadsheet , custom php script located on server) @ same time (when user submits) found out single form can have single 'action'. didn not know if can done in other way. finally, such idea came mind: in

GetWebResponse() throws timeout exceptions after a few requests on Mono/Linux -

i have application sends requests server. use getwebresponse() method of webclient class sending requests. after few requests, starts throwing timeout exceptions. happens on mono/linux. same code runs without exceptions on .net/windows. have ideas might problem? note: tried setting timeout , readwritetimeout properties of requests no luck. i try these possible alternatives try solve problem: upgrade mono 3.0.x. there have been lot of fixes in last months around webrequests. if above doesn't help, try mono 3.2 (as defaults use new garbage collector, faster, called sgen). if above doesn't help, build own mono (master branch), this important pull request has been merged recently. if above doesn't help, use "--server" flag when calling mono executable (this feature available in last version of mono, need compile master branch). if above doesn't help, cc in this bug , think i'll have time in august implement fix it, , maybe helps you.

html - puting two class divs inside id div -

i managed achieve design want using style of markup, tell me if practice or not, i'm not sure if going deep classes classifies valit, tidy validator tells me ok. <div id="main"> <div class="submain"> <div class="anothersub">text</div> </div> </div> and css is #main { width: 300px;} #main .submain { width: 200px;} #main .submain .anothersub { width: 100px;} if looking alternative, think better #main { width: 300px;} #main .submain { width: 66%;} #main .submain .anothersub { width: 50%;} heres fiddle, put background colors can see http://jsfiddle.net/v6ud2/

Html page onLoad calling javascript without submit button -

i trying load html page results of "get" link.the idea when open page, should see results of displayed. tried following javascript no success. problem submit button on page. want submit "pre" done! please help. here have: <body onload ="subme()"> <script> function subme(){ document.getelementbyid("formbutton").submit(); } </script> <div align="center"> <div style="display: hidden;"> <form action="http://localhost:8000/getusers/" method="get"> <input type="submit" id="formbutton" /> </form> </div> .. </body> any idea? linked previous post: cgi c program return value main html , display result the problem submitting button, not form. try: function subme() { document.getelementsbytagname('form')[0].submit(); } since have no need submit button, there n

objective c - UITextView space character issue -

i having trouble appending space uitextview. self.textview.text = [[nsstring alloc] initwithformat:@"%@ ", self.textview.text]; //or nsstring *mystr = @"hello!"; mystr = [[nsstring alloc] initwithformat:@"%@ ", mystr]; self.textview.text = mystr; //result should be: hello! <-with space here after end of it. how can go appending space uitextview? neither of these methods work. space seems disappear in textview if being trimmed. thanks! resolution of problem described below: issue fixed mavericks/xcode 5.0.1 update. appears sdk bug. i'm having looks exact same problem in terminal app - when hit space (e.g. read text on remote site displaying more ) crash because textfield has no space character , therefore range out of bounds. (see below code happens) - (bool)textviewshouldendediting:(uitextview *)textview { return no; } this keeps textview focused , handling keys pressed. it's way of grabbing keyboard characters 1 one

matlab - 3d plot of function with symbolic variables -

i have function 2 symbolic variables complicated , long. want have plotted in surface. function looks this: y^(1/2)*x - y^(1/2)*(x - 1)*((40*y^2 + 60*y^(1/2) - 60*y^(3/2) - 10)/(90*y^(1/2)) + ... whenever try plot, get: "undefined function 'plotfunc3d' input arguments of type 'sym'" or "conversion double sym not possible". how can plot surface? thanks. as error indicates, you're trying plot symbolic equation using functions designed matlab's default floating-point datatypes. question terse , didn't indicate how you're trying plot function in question, i'll give suggestions. you have 2 options. can use plot function designed symbolic math or can substitute in floating point values of parameters , values. here a list of ez- plotting methods can used symbolic equations. secondly, can use subs function substitute in values, or vectors/matrices of values symbolic equation. can try using double if end equati

Save a file depending on the user Python -

i try write script in python saves file in each user directory. example user 1, 2 , 3. c:\users\user1\documents\arcgis\file1.gdb c:\users\user2\documents\arcgis\file1.gdb c:\users\user3\documents\arcgis\file1.gdb how can this? as 1 commenter pointed out, simplest solution use userprofile environment variable write file path. like: import os userprofile = os.environ['userprofile'] path = os.path.join(userprofile, 'documents', 'arcgis', 'file1.gdb') or more (with better platform-independence, work on mac osx/linux, too; credit abhijit 's answer below): import os path = os.path.join(os.path.expanduser('~'), 'documents', 'arcgis', 'file1.gdb') both of above may have portability issues across windows versions, since microsoft has been known change name of "documents" folder , forth "my documents". if want windows-portable way "documents" folder, see code here: https

apache - Turn on GZip for Laravel Ajax calls -

i have 2 views make several ajax calls controllers. return json results. google pagespeed claimed should enable achieve 89% compression (my page contacts server every second, update status). i've enabled gzip through .htaccess @ root /public subdirectory - meaning static resources compressed. ajax results not. enable it? add .htaccess somewhere, or enable in php code itself? solved: .htaccess in public directory enough, since served off index.php page. missing application/json @ deflate line.

jasper reports - IReport text overflows to next detail band -

Image
i trying textfield dynamically size within band. when have more 3 rows overflow following detail row. tried setting stretch overflow , float , relative tallest object , , detail overflows values saw recommended here.. stretch row data overflow while having multiple rows in single band did not keep within it's own band. tried in ireport 5.0.0 , eclipse jasperreports compatible 5.1.0. alternative have found far make row bigger bands fewer rows big. note caps supposed in same field. no luck stretch type relativetobandheight try set stretchtype="relativetobandheight"