Posts

Showing posts from January, 2011

is it possible to pull images of the internet with Google app script? -

i wondering if possible use google app script search image using key word , pull image document or spreadsheet , if how. thanks yes, can use urlfetchapp fetch image , store blob in drive. var blob = urlfetchapp.fetch(image_url).getblob(); var file = driveapp.create(blob);

ruby on rails - cap rubber:create_staging failed near end -

i trying deploy aws sample rubber test in quick start wiki https://github.com/rubber/rubber/wiki/quick-start i past part prompts local machine password write hosts file ( creates roles, instance, , lot of other things; got through error not connecting - renamed private key without .pem extension , fixed ), , runs on while, , gives error here: failed: "/bin/bash -l -c 'sudo -p '\''sudo password: '\'' bash -l -c '\''export debian_frontend=noninteractive; apt-get -q -o dpkg::options::=--force-confold -y --force-yes install postfix build-essential git-core libxslt-dev ntp mysql-client libmysqlclient15-dev subversion curl autoconf bison ruby zlib1g-dev libssl-dev libreadline6-dev libxml2-dev libyaml-dev apache2 libapache2-mod-proxy-html libcurl4-openssl-dev libapache2-mod-xsendfile apache2-mpm-prefork apache2-prefork-dev collectd libperl-dev monit mysql-server percona-toolkit openjdk-7-jdk unzip python-django python-django-tagging python

javascript - 'undefined' is not a function (evaluating 'Backbone.$(window).on('hashchange', this.checkUrl)') -

i'm trying configure router backbone.js , receiving exception @ line 1414 of backbone.js 1.1.2 the error exists safari , chrome: [error] typeerror: 'undefined' not function (evaluating 'backbone.$(window).on('hashchange', this.checkurl)') start (backbone.js, line 1414) (anonymous function) (index.html, line 27) here's index.html file, line 27 backbone.history.start() <!doctype html> <html lang="en"> <meta charset="utf-8"> <head> <link rel="stylesheet" href="bootstrap.min.css"> </head> <body> <div class="container"> </div> <script src="../jquery.js"></script> <script src="../underscore.js"></script> <script src="../backbone.js"></script> <script src="../json2.js"></script> </body> <!-- backbone --> <script type

postgresql - install pyscopg2 on windows 7 64 bits + python 3.4 -

i've read several links that. if try python port windows : i'm using python 3.4 fails. for both downloading archive + "setup.py install" or "pip install pyscopg2" got below error. had visual studio 2012 installed, installed 2010 version rid of "vcvarsall.bat not found" error: c:\program files (x86)\microsoft visual studio 10.0\vc\bin\link.exe /dll /nologo /incremental:no /libpath:c:\python34\libs /libpath:c:\python34\pcbuild /libpath:c:/progra~1/postgr~1/9.3/lib ws2_32.lib advapi32.lib secur32.lib libpq.lib shfolder.lib build\temp.win32-3.4\release\psycopg\psycopgmodule.obj build\temp.win32-3.4\release\psycopg\green.obj build\temp.win32-3.4\release\psycopg\pqpath.obj build\temp.win32-3.4\release\psycopg\utils.obj build\temp.win32-3.4\release\psycopg\bytes_format.obj build\temp.win32-3.4\release\psycopg\connection_int.obj build\temp.win32-3.4\release\psycopg\connection_type.obj build\temp.win32-3.4\release\psycopg\cursor_int.obj build\t

c# - Which Lucene SearchAnalyzer to be used for special character search -

i using lucene.net standard analyzer in asp.net project search. search not return results keywords c#, .net etc. if type c or net (removing . , #) works. on stackoverflow (which uses lucene too), noticed when type .net changes [.net] while searching, got links standard analyzer not able handle special character search, , white space analyzer not work not give expected results. can on how manages search? i'll characterize doing bit more closely here: while i'm not privy implementation details of stackoverflow, you'll note same behavior when searching "java" or "hibernate", though these have no issues standard analyzer. transformed "[java]" , "[hibernate]". denotes tag search. doesn't happen searching "lucene" or "junit" has popularity of tags. suspect tag titles indexed in un-analyzed form. for interesting example, try out "j++". dead-end java implementation has mere 8 questions u

mysql - Can I Add SQL QUERY in EXPRESSION MAPFILE? -

can add sql query in expression mapfile ? .. class name '> 0' expression (select * tb_kelurahan id_kecamatan='[id_kecamatan]' > 0) color 20 215 0 outlinecolor 0 0 0 end # class no. alternative can add sql additional column data statement , reference in expression. data "the_geom (select case when id_kecamatan>0 1 else 0 end myexpress, the_geom, ...) foo ...." and use: expression ([myexpress] = 1)

javascript - Using PHP variables in jQuery plugin initialization? -

i have jquery image gallery plugin i'm using extensively throughout site i'm building php templates. in properties plugin initialization, of values remain same throughout site, aside few exceptions. in these instances, i'm wondering if it's ok me pass in value property via php; e.g. if there property called "thumbnailsvisible" in cases want set true, , in others, false. thus, there wrong assigning value corresponding variable , including following in jquery initialization within template: thumbnailsvisible : <?php echo $thumbnailsvisible; ?> i realize externalize initialization in js file , create different versions needed, simpler provided there isn't wrong approach... also, if there's different approach optimal, i'd appreciate sort of assistance. thanks. yes. can this. php processed on server side , sent client when it's processed. you write php script return javascript , pass in argument. eg. <?php $thumbn

objective c - IBAction Method not being called when button is pushed. But View controller is being pushed -

i attempting pass information 1 viewcontroller using push segue ibaction button named *line . can tell method not being called , nslog(@"%@", see); inserted test method not displaying message. here code first viewcontroller . detailcontroller.m #import "detailcontroller.h" #import "city.h" #import "viewcontroller.h" #import "videocontroller.h" #import "helper.h" @interface detailcontroller () @property (nonatomic, strong) iboutlet videocontroller *videoviewcontroller; @end @implementation detailcontroller @synthesize city, clubname, price, vip, promo, remain,p,deal,money,camera,tweet,post; - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { // custom initialization } return self; } - (void)viewdidload { self.videoviewcontroller = [[videocontroller alloc] init]; [scroller setscrollenabled:yes]; [scr

qwidget - Qt widgets not placed correctly -

i've subclassed qwidget , defined constructor way: loupingwidget::loupingwidget(qwidget *parent): qwidget(parent) { qgroupbox *topgroupbox = new qgroupbox(this); qgraphicsview *xrgbplot = new qgraphicsview(this); qgraphicsview *yrgbplot = new qgraphicsview(this); qgraphicsview *loupe = new qgraphicsview(this); qslider *slider = new qslider(this); qgridlayout *boxglayout = new qgridlayout; boxglayout->addwidget(xrgbplot, 0, 0); boxglayout->addwidget(slider, 0, 1); boxglayout->addwidget(loupe, 1, 0); boxglayout->addwidget(yrgbplot, 1, 1); topgroupbox->setlayout(boxglayout); } next, trying add in qdialog: window::window(qwidget *parent): qdialog(parent) { loupingwidget *firstloupindwidget = new loupingwidget(this); loupingwidget *secondloupindwidget = new loupingwidget(this); // qgraphicsview *mainpicture = new qgraphicsview(this); qgridlayout *gridlayout = new qgridlayout; // gridlayout->addw

Meteor methods wait before execution on client proceeds -

could please tell me how make clients wait until called function on server executed? my code: meteor.methods({ marklettersasread: function(userid) { if(servervar) { users.update({_id: userid}, {$set: {letters: []}}); // removing references } } }); template.letter.events({ 'click a': function() { meteor.call('marklettersasread', meteor.userid(), this._id, function(err) { if (err) { console.log(err); } }); var usersexistswiththisletter = users.find({letters: {_id: this._id}}).count(); console.log(usersexistswiththisletter); } }); in example usersexistswiththisletter 1 because users.find() doesn't wait until meteor.call done. verified checking database , no users exists entries in letters array. any appreciated. you need query collection inside callback, because can server method has been executed. (note self variable declaration): var self = this; meteor.call('markletters

google spreadsheet - Link columns so data updates are properly reflected -

i have column data values , want link other columns in same , different sheets in same spreadsheet. is, having same data in different columns in spreadsheet while keeping linked updates on source 1 affect of them. i've tried with: =sheetname!columnindex:columnindex (e.g. =sheet1!a:a ) but, although works, cell reference not column reference. what best way achieve it? maybe want array version of have tried: =arrayformula(sheet1!a:a) (if not, please clarify!)

codeigniter - rename a file to "frameset.php" in a CI project, in phpstorm/intelliJ -

today when i'm coding in ci project, renamed controller "dashborad.php" "frameset.php", , checked “search reference”. files icon named "frameset.php" in project became plain text icon , code assistant not work. how can fix it? thanks @lazyone's answer. remembered rename "dashborad.php" "frameset"(without .php) before. that's work me: settings | file types | text files scroll bottom, find , remove "frameset.php" in "registered patterns".

ios - App Store description translation in non supported language -

i've been tearing hair out trying understand how translation systems works on app store : wanted release app poland , discovered polish not supported on app store. fine ! let's put polish references, description , screenshot in "english" default language while keeping normal english in "uk_english" non default language. (my app not available in us). my app live , polish users see non default "uk-english" description ... according : localized app description not appear on app store have settled every international parameters of iphone in polish, polish app store account, , don't see default "english" setting, non-default "uk english". why ? typically there no "default" language. rather there list of languages in order of preference. since uk closer poland usa, makes sense uk english preferred on english. i send email apple asking how deal situation.

hadoop - Jobtrackernotyetrunning Error? -

exception in thread "main" org.apache.hadoop.ipc.remoteexception: org.apache.hadoop.mapred.jobtrackernotyetinitializedexception: jobtracker not yet running when trying run mr job, getting error. any clues ? it problem namenode not being formatted.

php - How to get data from udp tracker? -

i appeal tracker follows: http://tracker3.torrentino.com/scrape?info_hash=x%f7%0d%d1%ed0%fe%cf%d15%af%f8%81%c3t-%d7%94%bb%9f and in return: d5:filesd20:x÷ Ñí0þÏÑ5¯øÃt-×”»Ÿd8:completei22e10:downloadedi121e10:incompletei4eee5:flagsd20:min_request_intervali1800eee i know can through file_get_contents but how data udp tracker? how access it?

python - Search a nested list against items from alternative list, returning subsets that contain partial match -

say have 2 lists such as: nestedlst = ['1234567', 'abc456789', ['cde678945']] searchlst = ['123', 'cde'] how search nested list partial matches of items of search list , return each search item subset list. in case want output be: ['1234567', 'abc456789', ['cde678945']] , ['cde678945'] i have tried doing below: indices = [] eachitem in searchlst: i, elem in enumerate(nestedlst): if eachitem in elem: indices.append(i) print indices but returns [0] . appreciated. new python full explanation of code helpful me learn. thankyou below example nested list in practice: [['bmnh833953:0.16529463651919140688', [[['bmnh833883:0.22945757727367316336', ['bmnh724182a:0.18028180766761139897', ['bmnh724182b:0.21469677818346077913', 'bmnh724082:0.54350916483644962085'], ':0.00654573856803835914'], ':0.04530853441176059537'],

c# - Perspective Projection Matrix appears to have incorrect FOV -

i'm using sharpdx write "3d soft engine scratch" per tutorial on msdn. however, cannot expected , actual fields of view match up. my now-simplified world comprises of 4 3d vertices z=0 @ (0,1,0);(0,-1,0);(1,0,0);(-1,0,0). place camera @ (0,0,2) , @ (0,0,0) (0,1,0) up. setup projection matrix fov of 90 degrees (pi/2 radians) , prepare render each of 4 vertices calling vector3.transformcoordinate(vector3, matrix) . my understanding fov used calculate scale factor 1/tan(fov/2) can applied every (y,z) pair such y' = y * scale / z . similarly, given aspect ratio, scale calculated (x,z) pairs too. for (vertical) fov of 90 degrees , camera distance 2, have expected of vertices reasonably far edges of bitmap. however, top , bottom vertices have y-values of -0.49 , +0.49 means they'd practically touching screen boundary if rendered. have misunderstood concept of fov? results i'm seeing i'd expect fov of 53 degrees. it's though tangent being halved be

c# - Regex : How to extract some fields in text -

i've text file contains below informations : add comment=user1 disabled=yes name=usera password=123456 profile=\ internet-128k service=pppoe add name=user2 password=123 profile=internet-2m service=pppoe add disabled=yes name=user3 password=316 profile=internet-2m service=\ pppoe add disabled=yes name=user4 password=1216 profile=internet-512k service=\ pppoe add caller-id=8c:89:a5:68:18:9a name=user5 password=308 profile=\ internet-256k remote-ipv6-prefix=::/64 service=pppoe ... as can see each row starts add contains information(fields) example comment, disabled, name, password, profile , on. want extract pieces of information(fields) in each row. how can that? first can extract each block, second extract information: string text = file.readalltext("sample.txt"); string[] items = regex.matches(text, "add .*?(?=\r\nadd|$)", regexoptions.singleline) .cast<match>() .select(m =>

go - Golang on OpenShift, I can't find local module -

i want use openshift test environment golang applications. i made test application: myproj/ ------web.go ------/mylib/ -------------mylib.go web.go standard openshift file: package main import ( "fmt" "net/http" "os" "runtime" "./mylib" ) func main() { http.handlefunc("/", hello) bind := fmt.sprintf("%s:%s", os.getenv("host"), os.getenv("port")) fmt.printf("listening on %s...", bind) err := http.listenandserve(bind, nil) if err != nil { panic(err) } } func hello(res http.responsewriter, req *http.request) { str := mylib.lib(); fmt.fprintf(res, "hello, %s %s", str, runtime.version()) } and created "mylib" package mylib func lib() string { return "world" } and when run "go run web.go" works fine on local computer. when try upload code openshift following error: re

haskell - How to stop leksah from replacing chars like the not sign? -

i use leksah version 13.3.3.0. when have haskell line this: let s = "¬" :: string in reality, source file not that. if open source file in emacs, reads this: let s = "not" :: string how can stop behaviour of leksah? you have "tocandy" option set in configurations. menu->congifuration->tocandy.

php - Get specific key values as an array from array of object -

this code: $a = array( array("a" => 1, "b" => 2), array("x" => 2, "a" => 2), array("d" => 100, "a" => 3, "b" => 2, "c" => 3) ); $myarray = array(); foreach ($a $arr) { $myarray[] = $arr['a']; } print_r($myarray); so, get array ( [0] => 1 [1] => 2 [2] => 3 ) is there other way without for loop? using 1 2 php array functions same response. the above correct still if there other better way appreciable! because same array $a in code required iterate many times. if have better way can reduce iteration( php still iteration in built-in fns, don't bother it). yes (since you're on php 5.4, array_column() isn't option), $result = array_map(function($x) { return $x['a']; }, $a); but note, still use loop internally (i.e. in end always loop)

node.js - NodeJS - MongoClient.Connect with URL to DB Other Than Default -

i'd use mongoclient.connect(url) option connecting node , in fact work authenticated connections admin database. however, if try specify different database "auth fails" code 18. i think means credentials setup on admin database and, unfortunately, can't change arrangement (for now, anyway). it seems url syntax direction driver heading, i'd use if possible. there way use syntax, authenticate , connect admin database, , connection 1 of other databases on server? i found out how this: use instance ("admin") open database have access to: db2 = db.db("name of other name"); see hidden inside the documentation

android - Google Play Publish Supported devices 0 -

i developed app works on phone using andengine 1.0 , live wallpaper. having uploaded app play store get: supported devices 0 . app activated , here manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="some.package" android:versioncode="4" android:versionname="1.0"> <uses-sdk android:minsdkversion="15" android:targetsdkversion="15" /> <uses-feature android:name="android.software.live_wallpaper"/> <uses-permission android:name="android.permission.read_external_storage"/> <uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-feature android:name="android.hardware.camera.autofocus" androi

bluetooth - Characters not properly displayed in serial monitor in arduino -

can tell me why characters not getting printed in serial monitor of arduino? pasting arduino code. #include <softwareserial.h> #include <liquidcrystal.h> // initialize library numbers of interface pins liquidcrystal lcd(12,11,5,4,3,2); int bluetoothtx = 15; int bluetoothrx = 14; softwareserial bluetooth(bluetoothtx, bluetoothrx); int incomingbyte; void setup() { pinmode(53, output); serial.begin(9600); lcd.begin(16, 2); lcd.clear(); bluetooth.begin(115200); // bluetooth mate defaults 115200bps delay(320); // important delay! (minimum ~276ms) bluetooth.print("$$$"); // enter command mode delay(15); // important delay! (minimum ~10ms) bluetooth.println("u,9600,n"); // temporarily change baudrate 9600, no parity bluetoo

versioning - How do I set an upper bound on Gradle dynamic versions? -

i can't find explicit documentation on gradle dynamic version syntax -- examples in official docs 1.+ , 2.+ , neither of appears have upper bound. say have 1.0-snapshot , 2.0-snapshot in repository, , want project pull in first or future stable 1.x , not second. i've tried both maven syntax ( [1.0,2.0) ) , ivy syntax ( [1.0,2.0[ ). both of these pull in 2.0-snapshot . why? 2.0-snapshot considered "less than" 2.0 ? on assumption, tried obvious hacks: [1.0,2.0-snapshot) , [1.0,2.0-snapshot[ , both of fail dependency resolution. how can tell gradle want version 1.x ? looks answer + includes implicit upper bound. 1.+ means "any version starts 1. " this doesn't seem anywhere in gradle docs, documented ivy : end revision + selects latest sub-revision of dependency module. instance, if dependency module exists in revision 1.0.3, 1.0.7 , 1.1.2, "1.0.+" select 1.0.7.

Crop triangle from image in CSS -

Image
our designer wants that: but can't figure out way triangle crop: with :after takes width , uses kind of borders trick make triangle with big :after element rotated , white, should not hide other text with magic filter don't know? by using canvas, cropping in js, loading image base64 url? (maybe overkill :d) what think? edit: version 2: http://jsfiddle.net/mtau8/4/ works changing bg. here ya go: http://jsfiddle.net/mtau8/ html: (i used div background, use img element.) <div class="container"> <div class="img"></div> </div> css: (mostly fluff setup, use transform:rotate() on :after content, position slices picture nicely. contain in container , you're go.) .container { width: 250px; height: 100px; position: relative; overflow:hidden; } .img { width: 250px; height: 100px; background-color: blue; position: relative; } .img:after{ content:"";

android - How to set gravity to layout programmatically? -

i creating chat application in need align chat messages accordingly.i need align user right side , others left side.i have listview in messages displayed.for now,i using bundled json getting data.here code this appending string message typed user checked , splitted inorder recognize messages user. final edittext et = (edittext)findviewbyid(r.id.edittext1); final button imb=(button)findviewbyid(r.id.btn_send); imb.setonclicklistener(new onclicklistener() { @override public void onclick(view arg0) { string str = et.gettext().tostring()+":aeiou"; web.add(str); scrollmylistviewtobottom(); et.settext(" "); adapter.notifydatasetchanged(); } after that, splitting string , stored in array.if message user.ie,if has appended string,then gravity of layout need set right,else left. used code in adapte

ruby - cucumber filter out scenario in runtime -

i'm looking way how can manage ruby cucumber scenarios in runtime. i'd filter scenarios out having information sut can gather in runtime. for instance, i've following scenarios @automated scenario: customer want run ... scenario 1 given ... @automated @debug scenario: debugger want run ... scenario 2 given ... @automated scenario: customer want run ... scenario 3 given ... @automated @release scenario: releaser want run ... scenario 4 given ... i'm able determine whether debug or release application testing now. , debug 1 want see scenarios 1,2,3 run release app want see 1,3,4 run. i know how using rake or other wrapper script it'd better find solution without such wrapper scripts. also, cucumber profiles might not choice here because there several parameters each number of values. might require crazy number of combinations.

c# - Why is autofac registering all instances of apicontroller instead of just the one i specify -

im having trouble understand why classes derived apicontroller registered , accessible. have 2 apicontrollers: mastercontroller : apicontroller slavecontroller : apicontroller and here how setup server container action<iappbuilder> appbuilderaction = appbuilder => { var httpconf = new httpconfiguration(); httpconf.dependencyresolver = new autofacwebapidependencyresolver(container); httpconf.routes.maphttproute("defaultapi", "api/v1/{controller}/{action}", new { action = "get" }); appbuilder.usewebapi(httpconf); }; return webapp.start(baseaddress, appbuilderaction); the problem im having when creating nunit test though try register single controller, both of them accessible during test. if register mastercontroller instance, expect url valid (master) var response = await client.getasync(new uri(http://localhost:8080, "api/v1/master/mytest&q

vbscript - Calling one vb script to another Vb script file wont run in task scheduler -

hello , trying run vb script file in schedule task, works fine when set run administrator privileges in schedule task. when trying call second script, runs first script, second script wont run. tried run through batch file, runs first script, second script not getting call. following code first script. dim objshell set objshell = wscript.createobject("wscript.shell") objshell.run "testscript.vbs" not working when run through scheduler task. could make reply. solution appreciated here.. try specifying full path testscript.vbs . when scripts run scheduler, current directory windows system folder, not folder script being run from. alternatively, can set current directory before calling script. set objshell = createobject("wscript.shell") objshell.currentdirectory = "c:\scripts" objshell.run "testscript.vbs"

apache - How can we make a redirect in .htaccess for the “git” project? -

there project on “git”. there hosting service , document_root refers http_public. have no possible way change it. i clone repository http_public, web-tool located @ http_public/zzz. redirect htaccess: <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_uri} !^zzz rewriterule ^(.*)$ zzz/$1 [l] </ifmodule> when refer website example.com, web-tool being opened. how can make website work referring example.com not working directly example.com/zzz/?

ios - Removing the text background of a label in a cell -

Image
noticed cell label got background around text, cell got bigger text others (probably because of background). there way remove kind of behaviour ? try use this: [cell.textlabel setbackgroundcolor:[uicolor clearcolor]];

Using PHP what is the best way to get multiple rows in one MySQL query? -

this question has answer here: mysql php - select id = array()? [duplicate] 6 answers which best way multiple rows in 1 mysql query. i have array of ids: $id_array = array('34','341','342','334','344','354','3234','33234','3234','3234'); i get title associated id's mysql database . i have 2 approaches: 1) example : foreach($id_array $id){ $query = mysqli_query($con, "select title content id = '$id'"); $id_db = mysqli_fetch_row($query); echo $id_db['title']; } 2) example : $query = mysqli_query($con, "select title content id = '$id_array[1]' , id = '$id_array[2]' , id = '$id_array[3]' , 'id = $id_array[4]' , id = '$id_array[5]'"); while($result = mysqli_fetch_assoc($query)){ ech

amazon web services - Elastic Beanstalk .ebextensions config file not getting deployed with git aws.push -

i've linked git branch elastic beanstalk environment , using git aws.push deploys correctly. i've added .extensions directory contains config script should creating couple of directories. however, nothing appears happening. i understand .extensions directory should copied across ec2 instance i'm not seeing it. i've checked eb-tools.log , it's not mentioned in upload. is there additional that's required? the script contains: commands: cache: command: mkdir /tmp/cache items: command: mkdir /tmp/cache/items chmod: command: chmod -r 644 /tmp you can find run logs @ /var/log/cfn-init.log . in here see mkdir commands had worked subsequently failed directory existed. turns out eb extensions run commands in alphabetical order had change commands to: 01command1: 02command2: etc. point on worked fine. something else confusing me .ebextensions directory in local git repo not appearing on target instance directory. beca

android - How set my ACTION BAR to support right to left -

this question has answer here: how handle rtl languages on pre 4.2 versions of android? 2 answers i new on android , want write application support rtl languages. wrote android:supportsrtl="true" on application part of manifest file , call forcerighttoleft on oncreate method of android. method have following body: @targetapi(build.version_codes.jelly_bean_mr1) private void forcertlifsupported() { if (build.version.sdk_int >= build.version_codes.jelly_bean_mr1) { getwindow().getdecorview().setlayoutdirection( view.layout_direction_rtl); } } but understand on sdk api 16(android 4.1) , version before didn't supported , action bar show left right. search couldn't find solution. please don't minus code let me know , delete if not true question. try bidi class see answer also.

sql server - why do Non-English words not saved correctly in SQL database? -

i working mssql server 2008r2 , have field of type nvarchar(255) had changed collation arabic_100_ci_as field still showing '???' instead of arabic words. i tried restart server after collation changed did not work ! note : old collation latin noote inserting directly db , if write query problem raise, if edit table directly , there no problem , arabic words displaying correctly ! should done ? thanks thanks adrianm solution prefixing text n such : n'myarabictext' thanks cooperation..

uiwebview - IOS print pdf in A4 Format -

i'm trying print pdf uiwebview , output pdf not fill a4 format. why? how resolve that? any appreciated =) if found solution avoid printing form iuwebview . directly download pdf in nsdata format. _data represente nsdata download request. if (_data) { uiprintinteractioncontroller *printcontroller = [uiprintinteractioncontroller sharedprintcontroller]; printcontroller.delegate = self; uiprintinfo *printinfo = [uiprintinfo printinfo]; printinfo.outputtype = uiprintinfooutputgeneral; //printinfo.jobname = [path lastpathcomponent]; printinfo.duplex = uiprintinfoduplexlongedge; printcontroller.printinfo = printinfo; printcontroller.showspagerange = yes; printcontroller.printingitem = _data; void (^completionhandler)(uiprintinteractioncontroller *, bool, nserror *) = ^(uiprintinteractioncontroller *printcontroller, bool completed, nserror *error) { if (!completed && error) { nslog(@"fail

How to show error line number in R studio -

Image
is possible see syntax error or runtime error line number (highlight also) generated after running code in r studio? i searched options couldn't find. first, have @ ?traceback . there many ways debug r code/script. 1 example. in rstudio, debug drop down menu option on error , choose error inspector (what think is) easiest debug mode finding line number of error/bug. can choose break in code show highlighted line of r script contains error. when error occurs, can click either of small areas marked show traceback , rerun debug . screen shot below shows effect of clicking "show traceback" (hence says "hide traceback"). tells me error occurred when r attempted call sample (the third call). length had not yet been defined.

Auto generate master-detail crud views based on a class in Android -

in same respect orm libraries sugarorm have black-boxed sqlite database operations, there similar library aids in creation of master-detail lists , edit screens based on class? that is, if have few pojos client or order follows: class order { private string foo; private string bar; /* .. other members ..*/ public orders() { ... } /* getters , setters */ } and class client { private string foo; private long bar; /* .. other members ..*/ public client() { ... } /* getters , setters */ } for example, might there method create editview private strings? well started project on github out in creating android view based on class. pojomojo

ios - CMMotionActivityManager ignores cycling -

i've been researching new m7 chip's cmmotionactivitymanager , determining whether user of device walking, running, in car, etc (see apple documentation ). seemed great step forward on trying determine previous using locationmanager , accelerometer data only. i notice cmmotionactivitymanager not have cycling activity, disappointing, , deal-breaker complete usage new activity manager. has else found convenient way use cmmotionactivitymanager cycling without having reincorporate cmlocationmanager + accelerometer try test cycling too? note, not include general transport options things train. instance, commute hour day on train. automotive made more generic @ least, similar how moves uses transport. cmmotionactivity has these defined motion types only: stationary walking running automotive unknown useful notes apple's code, not solve issue, helpful: cmmotionactivity an estimate of user's activity based on motion of device. the a

android - My game shows white textures using LIBGDX and AdMob -

i have succefully add , admob ad game. first time load it, , first time, after lock device or go home when open again game textures white rectangles game still running , can hear sounds , actors still working correctly ad showing fine. pd. discovered happens if open game after installing it. if finish instalation, close installation wizzard(?) , open normaly game problem not happen. i don´t know whats reason of this. my code follows: mainactivity.java public class mainactivity extends androidapplication { private adview adview; relativelayout layout; view gameview; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); androidapplicationconfiguration cfg = new androidapplicationconfiguration(); cfg.usegl20 = false; cfg.useaccelerometer = false; cfg.usecompass = false; // create layout layout = new relativelayout(this); // stuff initialize() requestwindowfeature(window.feature_no_title); ge

dictionary - How would you index a table that is being initialized? -

an example of desire: local x = {["alpha"] = 5, ["beta"] = this.alpha+3} print(x.beta) --> error: [string "stdin"]:1: attempt index global 'this' (a nil value) is there way working, or substitute can use without code bloat(i want presentable, fenv hacks out of picture) if wants take crack @ lua, repl.it testing webpage quick scripts no there no way because table not yet exist , there no notion of "self" in lua (except via syntactic sugar table methods). have in 2 steps: local x = {["alpha"] = 5} x["beta"] = x.alpha+3 note need square brackets if key not string or if string characters other of [a-z][a-z][0-9]_ . local x = {alpha = 5} x.beta = x.alpha+3 update: based on saw on pastebin, should differently: local alpha = 5 local x = { alpha = alpha, beta = alpha+3, gamma = somefunction(alpha), eta = alpha:method() } (obviously alpha has no method because in example nu

ios - UIImageView isn't showing completely on 3,5 screen -

Image
i'm trying show uiimageview images on iphone 4, doesn't appear completely. bottom part hidden...this result: i have tryed 0 constraints on left, right, top , bottom margins no effect... adding width 320 height allways 568px (4 inch screen height ) is not image aspect problem. i'm using aspect fill case , works good, imageview height 568px. if resize manually heigth 480px image ok. thanks lot! don't know can do... try use this, [imgview setcontentmode:uiviewcontentmodescaletofill]

java - How to know in log4j , that ERROR level is triggered? -

how know in log4j , error level triggered. in code have written if exception occurs i.e if error level triggered show log file path in console , wont show message other levels. in log4j can configure different levels in log4j.properties or xml file ever choose use. there predefined pattern error levels , runs lower upper. lowest id debug in sequence. 1.debug 2. warn 3. error etc so if want error messages configure error level error. wot debug , warn if configure debug everything ex. <logger name="org.springframework..."> <level value="error" /> </logger>

Android animate text when calling setText() -

i want animated text fade in , out when changing extending textswitcher in order define once since have many textswitcher objects. however keep on getting null pointer "java.lang.nullpointerexception android.widget.textswitcher.settext(textswitcher.java:80) when doing : hometeamtextview.settext("text"); i decided extend textswitcher class this: public class mytextswitcher extends textswitcher{ public mytextswitcher(context context, attributeset attrs) { super(context, attrs); // todo auto-generated constructor stub setinanimation(context,r.anim.fade_in); setoutanimation(context,r.anim.fade_out); }} activity private mytextswitcher hometeamtextview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); hometeamtextview = (mytextswitcher) findviewbyid(r.id.hometeam); awayscoretextview = (textview) findviewbyid(r.id.awayteamscore); ho

java - Adding a new object to an array according to loop returns -

i did research on subject (i'm quite new java excuse me poor/incorrect wording) , didn't find related answers, so, here goes. i'm working on program can print prime numbers , ran following problem. here's code: public class pnumba { public static void main(string[] args) { int pnlimit = 100; system.out.println("printing prime numbers"); (int numer = 2; numer <= pnlimit; numer++) { if (checkforprime(numer)) { system.out.println(numer); } } } public static boolean checkforprime(int numer) { (int = 2; < numer; i++) { if (numer % == 0) { return false; } } return true; } } my program prints prime numbers up 100 , not 100 of them. idea make array hold 100 prime numbers , break loop when said array reaches limit fix problem. my questions following: how make loop fill array when checkforprim

php - nette, lighttpd - url rewrite? -

i new nette framework , have no experience url rewriting, apologize question. the default syntax of nette's router is: <presenter>/<action>[/<id>] so urls in format localhost/mypage/articles/view/35 my question how configure lighttpd accept these urls , bind them valid content? i found configuration apache in documentation: http://doc.nette.org/en/2.1/troubleshooting#toc-how-to-allow-mod-rewrite try using magnet-module + lua script add magnet module lighttpd modules server.modules = ( ... "mod_magnet", ... ) lighttpd virtual host example: $http["host"] =~ "^(example.com)$" { server.document-root = "/var/www/example.com/document_root" magnet.attract-physical-path-to = ( server.document-root + "/rewrite.lua" ) } create rewrite.lua file in document_root folder (according setting above) attr = lighty.stat(lighty.env["physical.path"]) if (not attr) l

c++ - Getting memory address of class member variable (non-dynamic) -

i want print memory address (i.e. 0x7ffff0...) of variable in class, gives me value of object. i'm doing learn. don't think syntax incorrect. try 2 ways , neither works. appreciate on why doesn't work. #include <iostream> using namespace std; class test{ public: char i; }; int main(){ test x; x.i='w'; char * y = &(x.i); cout<<"address : " <<&x.i<<endl; cout<<"address : " <<y<<endl; } output: address : w address : w you should cast pointer void* before passing stream. you're passing char* interpreted null-terminated string.

Put jquery mobile autocomplete and select side by side -

i trying put jquerymobile mobile (using version 1.3) selectmenu , autocomplete side side, autocomplete search-box not aligned selectmenu , cut-off @ top. i've tried <div class="ui-grid-a"> <div class="ui-block-a" style="float:left;"> <label for="targettypelist" class="ui-hidden-accessible">all uses</label> <select name="targettypelist" id="targettypelist"> <option value="standard">standard: 7 day</option> <option value="rush">rush: 3 days</option> </select> </div> <div class="ui-block-b" style="float:left;"> <ul data-role="listview" data-inset="true" data-filter="true" data-filter-reveal="true" data-filter-placeholder="search cars..."> <li><a href="#">acura</a></li> <li><a href=&

OpenCV image conversion from RGB to Grayscale exception -

i'm getting strange exception (exception: cv::exception @ memory location 0x002eb6cc) when try convert rgb image grayscale. can me? const cv::mat img1 = cv::imread(filename, 0) cv::mat gs_rgb(img1.size(), cv_8uc1); cv::cvtcolor(img1, gs_rgb, cv_rgb2gray); you loading image gray scale , trying convert gray scale gray scale again. the line const cv::mat img1 = cv::imread(filename, 0) will load image where second argument =0->cv_load_image_grayscale->load gray scale =1->cv_load_image_color->load color <0->cv_load_image_anydepth->return loaded image (with alpha channel). so either load image gray scale , use like, const cv::mat img1 = cv::imread(filename, 0)//load gray or load color , convert gray scale like, const cv::mat img1 = cv::imread(filename, 1);//load color mat gray;//no need of allocation, allocate automatically. cv::cvtcolor(img1,gray, cv_bgr2gray);//opencv default color order bgr see more info here in i