Posts

Showing posts from June, 2011

mongodb - How to query username from userId in a collection in Meteor? -

i trying implement basic search bar functionality in app. i have bunch of articles, , has owner. specified userid in user parameter of each article. right can search keywords within article, title, , date. want able query username of author of article, have userid available me... var keyword = session.get("search-query"); var query = new regexp( keyword, 'i' ); var results = articles.find( { $or: [{'user': query}, // searching userid of author! {'title': query}, {'articletext': query}, {'datetime': query}] } ); return {results: results}; i'm not sure how this... welcome non-relational databases! you're coming rdbms environment expect joins. there none. store username in article belongs to, yes, if user change username, you'll need loop through collection , update username _id matches. please here mongo strategies (thi...

javascript - Loading a html table with PHP via a JQuery .load call -

aim i trying create page delete records database.the page consists of populates upon page load.upon selecting value , clicking submit button, php page called , results of php loaded table below .i can click on delete button beside values echoed delete value database my form: <!doctype html> <html> <head> <!--loads jquery script--> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <!--gets list of item categories on page load--> <script type="text/javascript"> $(document).ready(function(){ $("#viewsubcat").load("getcategory.php"); }); </script> <script type="text/javascript"> $("#viewsubcatsubmit").click(function(){ var cat=$('#viewsubcat').val(); $('#deletetable').load('delsubcategory.php?cat='+cat); }); </script> </head> <body> <form style="width:500px" id="viewsubcategory...

sql - Database not Updating 1000 -

hi heres code has no errors when check database nothing added private sub button4_click(byval sender system.object, byval e system.eventargs) handles create_btn.click call getconnect() if new_username.text = "" , new_password.text = "" , new_pass_code.text = "" msgbox("check empty textbox or wrong admin password", msgboxstyle.critical, "needed") else con.open() sql = "insert accounts (username, password, pass_code) values('" _ & new_username.text & "','" _ & new_password.text & "' , '" _ & new_pass_code.text & "')" dim sqlcomd new sqlclient.sqlcommand sqlcomd.commandtext = sql sqlcomd.connection = con sql = sqlcomd.executenonquery ...

graphics - What shape would this make in Java? -

Image
struggling drawing out trying derive graphic create. appreciated. comments or helps, i'm stumped. marker.forward(120); marker.turnright(45); marker.forward(80); market.turnleft(90); marker.forward(80); marker.turnleft(90); marker.forward(80); marker.turnleft(90); marker.forward(80); your shape should somthing that: it may little bit diffrent not original size , draw in paint.

node.js - where to code business logic in nodejs with expressjs, mongoosejs and redis -

my business logic includes mongodb operations , redis operations on 1 request. not know should put logic code to. in java project, have dao , service , controler objects. in nodejs projects, don't know put code. shall put logic code routes/index.js ? app.post('/deal', function(req, res) { ... //todo: here }); or create kind of service objects such in java proejct? here's question might help: mongoose-based app architecture you should @ http://mean.io stack, templates show how best structure app, including store logic.

java - org.hibernate.StaleStateException:Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 -

when trying update key fields in database problem comes using session.flush() , session.clear() methods. bean.java sessionfactory sf = hibernateutil.getsessionfactory(); session s = sf.opensession(); criteria crit3=s.createcriteria(roletable.class); roledata=crit3.list(); for(roletable rt:roledata){ transaction tx = s.begintransaction(); roletable rot=new roletable(); rot.setsno(1); rot.setobtype(rt.getobtype()); rot.setobid(rt.getobid()); rot.settext(rt.gettext()); rot.setsdat(rt.getsdat()); rot.setedat(rt.getedat()); rot.setupdate(rt.isupdate()); rot.setcreate(rt.iscreate()); rot.setdelete(rt.isdelete()); rot.setread(rt.isread()); s.update(rot); s.flush(); s.clear(); tx.commit(); } s.close(); sf.close(); } it because commit transaction after flushing session, change sequence of bel...

jquery - Getting a height of a table which is inside a div -

Image
i have div inside there table doesn't have id or css class select. how can height of table. i want set height of div[ class="t-grid-content"] table height inside it. how can this? this may helpful. $('div.t-grid-content table').height($('div.t-grid-content').height())

css - Changes not shown after commit (Heroku Java) -

i working on java project on spring framework. project cloned heroku site. encountered 2 issues... i have created jsp file (testing.jsp) , committed + pushed heroku. created in src/main/webapp/web-inf/jsp/testing.jsp <servlet-name>spring</servlet-name> <url-pattern>/people/*</url-pattern> <url-pattern>/testing/*</url-pattern> i have edited in web.xml file , pushed heroku. however, when tried view in browser, shows me same interface default people.jsp page. my web.xml file: https://skydrive.live.com/redir?resid=2fc5994fbeb75cc5!174&authkey=!apyqgwzbkhkoaym i have created css file , pushed heroku. have added following... <link href="/imagecss.css" rel="stylesheet"> when view in browser, shows "http status 404 - /imagecss.css" i new , can't seem google useful helps me in issue. you need to: add mvc:resources config in applicationcontext.xml following: <mvc:resources m...

cancan - Fetch record based on role rails -

i using devise , cancan projects , works fine. there users table in database. there 3 types of role ->admin ->publishers ->players now want fetch record users table expect admin's record. i little confused how this. if role string in user table: scope :with_role, lambda{|role_name| where(:role => role_name) } if user belongs_to role: scope :with_role, lambda{|role_name| includes(:role).where(:roles => {:title => role_name}) } and can fetch admins: user.with_role('admin')

javascript - deferred for chaining ajax wont work -

i wanna using $.deferred objects handle recursive function's requests. but here have problem $.when wont wait call1 success call2! it wont send returned data call1 call2 function! note : want implement ajax's async:true; thanks in advance! m.mov //********************************************************************* var = 3; // run queue 3 times function getnode(node_object_array) { $.when(call1(node_object_array)).then(call2); i--; if(i >= 0) getnode(next_level_childs); } function call1(node_object_array) { var root_array = new array(); var d = new $.deferred(); $.each(node_object_array , function(index , each_root_node) { console.log("making request for"+each_root_node.node_guid ); $.ajax({ url: url , datatype: 'json', success: function(json) { ...

html5 - Assign the VB6.0 Combo box value to Html drop down from vb 6.0 Code -

i have html form having dropdown controls on it. want select combo box text vb6.0 form , combo box text assign html drop down, how can this?. my vb6.0 having same controls on html form. for example html code <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test application</title> </head> <body> title : <select name="ddltitle" id="ddltitle" style="width: 70px;"> <option value="mr.">mr.</option> <option value="mrs.">mrs.</option> <option value="baba">baba</option> <option value="baby">baby</option> </select><br /> </body> </html> for vb6.0 try code getting id of drop down want assign value html dropdown box vb6.0 combo box dim htmli htmlinputelement each htmli in targetie.document.getelementsbytagname("select") select case h...

javascript - fullscreen not working in firefox in extjs -

i working on full screen in chrome working in mozilla not working properly.pls it.when fullscreen icon changes n when come original screen again icon gets change not working in firefox extjs version 3.4, jquery 1.9 <script> /* native fullscreen javascript api ------------- assumes mozilla naming conventions instead of w3c */ (function() { var fullscreenapi = { supportsfullscreen: false, isfullscreen: function() { return false; }, requestfullscreen: function() {}, cancelfullscreen: function() {}, fullscreenenabled: function() {}, fullscreeneventname: '', prefix: '' }, browserprefixes = 'webkit moz o ms khtml'.split(' '); // check native support if (typeof document.cancelfullscreen != 'undefined') { fullscreenapi.supportsfullscreen = true; } else { // check fullscreen support vendor prefix (var = 0, il = browserprefixes.length; < il; i++ ) { fullscreenapi.prefix = browserprefixes[i]; if (typeof do...

c# - Image animation when it's loaded -

i have listbox image control , binding source. what want: when image loaded (i think it's imageopened event?), animate opacity property 0 100. som apps, facebook, use effect. image control inside datatemplate , there lot of listbox items. how solve? p.s. tried create trigger image control changes opacity property after imageopened event, app crushed without showed causes in debugger. you may set image opacity 0 , attach imageopened handler animates opacity one. <datatemplate> <image source="{binding}" opacity="0" imageopened="onimageopened"/> </datatemplate> the imageopened handler: private void onimageopened(object sender, routedeventargs e) { var opacityanimation = new doubleanimation { = 1, duration = timespan.fromseconds(1) }; storyboard.settarget(opacityanimation, (dependencyobject)sender); storyboard.settargetproperty(opacityanimation, ...

java - How to get Equivalent class depends on user input? -

my rdf: <rdf:description rdf:about="http://earthquake.linkeddata.it/resource/isolator"> <owl:equivalentclass rdf:resource="http://earthquake.linkeddata.it/resource/vibrationabsorber"/> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#class"/> </rdf:description> <rdf:description rdf:about="http://earthquake.linkeddata.it/resource/magnetorheological(mr)damper"> <owl:equivalentclass rdf:resource="http://earthquake.linkeddata.it/resource/**semiactivedamper**"/> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#class"/> </rdf:description> and code: public static void main (string args[]) throws ioexception,interruptedexception { // create empty model ontmodel m = modelfactory.createontologymodel(ontmodelspec.owl_mem,null); // use class loader find input file inputstream in = filemanager.get().open(inputfilename); if (in == null) { throw new illegalar...

Faster way to access 2D lists/arrays and do calculations in Python? -

i running 2 nested loops (first 1 120 runs, second 1 500 runs). in of 120x500 runs need access several lists , lists-in-lists (i call them 2d arrays). at moment 120x500 runs take 4 seconds. of time taken 3 list appends , several 2d array accesses. arrays prefilled me outside of loops. here code: #range 0 119 cur_angle in range(0, __ar_angular_width-1): #range 0 499 cur_length in range(0, int(__ar_length * range_res_scale)-1): v_x = (auv_rot_mat_0_0*self.adjacent_dx[cur_angle][cur_length])+(auv_rot_mat_0_1*self.opposite_dy[cur_angle][cur_length]) v_y = (auv_rot_mat_1_0*self.adjacent_dx[cur_angle][cur_length])+(auv_rot_mat_1_1*self.opposite_dy[cur_angle][cur_length]) v_x_diff = (v_x+auv_trans_x) - ocp_grid_origin_x v_y_diff = (v_y+auv_trans_y) - ocp_grid_origin_y p_x = (m.floor(v_x_diff/ocp_grid_resolution)) p_y = (m.floor(v_y_diff/ocp_grid_resolution)) data_index = ...

Loop through nodes collection in Groovy -

i have map of names or nodes in groovy key os parent , value dependent on parent childs. 'a' -> 'b', 'c' 'b' -> 'c' 'c' -> 'd' 'd' the node doesn't have leafs not specified key in map. i need specify ranking every of node based on level. means create new map or change existing contain rank starting 100 nodes doesn't have leafs. 'd' -> 100 'c' -> 101 'b' -> 102 'a' -> 103 what best way in groovy? thank you. you try (runs on groovyconsole ) //the list of nodes def nodes = ['a','b','c','d'] //the map of children each node(children in lists) def children = [a:['b', 'c'],b:['c'],c:['d']] //the map rankings def ranking = [:] //define closure first can called recursively def calculate calculate = { if(children.containskey(it)){ //if key in children map has children -...

html - spring mvc 3:how i can get tiles in iframe?what shoud be src attribute of iframe? -

i have several spring mvc tiles page , tiles.xml file this: <?xml version="1.0" encoding="utf-8"?> <!doctype tiles-definitions public "-//apache software foundation//dtd tiles configuration 3.0//en" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"> <tiles-definitions> <definition name="base.definition" template="/web-inf/views/layout.jsp"> <put-attribute name="title" value="" /> <put-attribute name="header" value="/web-inf/views/header.jsp" /> <put-attribute name="menu" value="/web-inf/views/menu.jsp" /> <put-attribute name="body" value="" /> <put-attribute name="footer" value="/web-inf/views/footer.jsp" /> </definition> <definition name="home" extends="ba...

android - how to use string as reference in java? -

this question has answer here: dynamic resource loading android 3 answers i have edittext reference set "dimrix_1" . have string has value "dimrix_1" . how can use string reference in case dont know value of string if "dimrix_2" refer "dimrix_2" edittext , on ... dimrix_1 = (edittext) mroot .findviewbyid(r.id.dimrix_et); dimrix_2 = (edittext) mroot .findviewbyid(r.id.dimrix2_et); dimrix_3 = (edittext) mroot .findviewbyid(r.id.dimrix3_et); string mannotneeded = "dimrix_" + totalnumbers; now want go make edittext match "mannotneeded" value setvisibility(view.gone) hope clear on explanation ... update : int r = getresources().getidentifier( "edit_text_id", "id", getactivity().getpackagename()); dimrix_1...

asp.net - Use the same sql Server table to do different updates, is there a way to do that? -

im using asp.net (vb.net), in database : have 1 table called (trade), same rows of table used 3 different users , these users can make different updates on table, should see basic informations of table (i mean basic, before table (trade) has been updated) the problem here when first user wants modify table's rows, second , third user cannot see basic information more, , if decide change or update data, first lose updated rows.. the data overwritten every time users make updates on table. what want, know if there way copy, or image of table 3 users, , every user can update normally, without creating same table same rows 3 times??! update table structure is: trade(trname, carrier, pol, pod, vgp, qgp) there no primary key.. thank you.. solution problem 2 copies of original table. show original table user initial data. , in second table keep updated data always. trick comes here maintain log, have maintain log table, table have fields of original table al...

apache pig - How to read the .doc or .docx file -

how read the.doc file using apache pig latin programming using map reduce a = load './pig/test.docx'; b = foreach generate flatten(textloader((chararray)$0)) word; c = group b word; d = foreach c generate count(b), group; store d './wordcountone'; you need create custom load function pig script. first start simple .doc or .docx parsing java, example available here: how read doc or docx file in java? i'm sure find more on google. once know how data word document need implement pig function. example of custom pig loader (step step) can found here

ios - How keep things DRY with afnetworking -

i'm writing ios app has send , receive data api @ various screens in app. each view controller calling code // afappdotnetapiclient subclass of afhttpclient, defines base url , default http headers nsurlrequests creates [[afappdotnetapiclient sharedclient] getpath:@"stream/0/posts/stream/global" parameters:nil success:^(afhttprequestoperation *operation, id json) { nslog(@"app.net global stream: %@", json); } failure:nil]; i want keep things dry , created requested builder , response handler create request , parse responses. want move api calls 1 class since uses blocks don't know how this. can explain how done call 1 method enum , params request , nsdictionary without having api calls , blocks in view controllers. thanks this concern model part of mvc architecture. example project has implementation of this: post.h + (void)globaltimelinepostswithblock:(void (^)(nsarray *posts, nserror *error))block; define class methods on mo...

git - Github - using someone elses repository -

i'm busy project uses libraries git clone http://github.com/adafruit/adafruit-raspberry-pi-python-code.git i've downloaded above code , put in code , want post code on github. i want make sure latest code adafruit used there way can put link in code adafruit pulls latest version. ive done reading on git , think might called fork? when putting code put adafruit code in repository, or there can put link in original? unless you're contributor project, won't able push directly repository. in case general usecase fork project (i.e. create copy under name) , work on that. can create pull-request ask them pull specific changes repository. this github article explains process , tells how keep fork up-to-date (if don't special, it's snapshot).

java - Spring MVC Daylight saving issue -

i've working on spring mvc quite time , bumped problem i set application timezone new_york following code: public class applicationlistenerbean implements applicationlistener { @override public void onapplicationevent(applicationevent event) { if (event instanceof contextrefreshedevent) { timezone.setdefault(timezone.gettimezone("america/new_york")); system.out.println("eastern time zone"); } } } next, i'm submitting form , reading code: @requestmapping("/saveschedule") @responsebody public string saveschedule( @modelattribute commonschedule schedule, modelmap map, httpservletrequest request) { system.out.println(">>>>>>>>>>>>>>>> " + schedule.getsendingtime()); system.out.println(new date()); } if select time, 15:30:00, i'm getting output i'm getting following output: >>>>>>>...

c++ - Correct mouse event order on a doubleclick -

what's correct order of events should see when user double click? down - - down - doubleclick - up down - - doubleclick - down - up down - - doubleclick - up is platform specific? how should work in windows? for windows api - variant 3: only windows have cs_dblclks style can receive wm_lbuttondblclk messages, system generates whenever user presses, releases, , again presses left mouse button within system's double-click time limit. double-clicking left mouse button generates sequence of 4 messages: wm_lbuttondown, wm_lbuttonup, wm_lbuttondblclk, , wm_lbuttonup. http://msdn.microsoft.com/en-us/library/windows/desktop/ms645606(v=vs.85).aspx

powershell - How to exlude a directory -

i'm beginner on powershell scripting keep cool ^^ i delete file on directory d:\test delete file more 15 days i'don't want delete files on directory in directory d:\test. my script #----- define parameters -----# #----- current date ----# $now = get-date #----- define amount of days ----# $days = "15" #----- define folder files located ----# $targetfolder = "d:\test" #----- define extension ----# $extension = "*.bak" #----- define lastwritetime parameter based on $days ---# $lastwrite = $now.adddays(-$days) #----- files based on lastwrite filter , specified folder ---# $nomatch = "d:\test\zz - archives","d:\test\zz - cloture paye" $files = get-childitem $targetfolder -include $extension -recurse | {$_.lastwritetime -le "$lastwrite"} | where-object {$_.fullname -notmatch "$nomatch"} foreach ($file in $files) { if ($file -ne $null) { write-host "dele...

c++ - How can I free memory for unused elements in 3D vectors? -

i generated 100*100*500 vector (or lets array). fill in elements randomly. elements stay empty. can free memory unused elements. or, vector data structure it? thank you you cannot free memory occupied single element inside array. arrays allocated , freed contiguous memory blocks. might consider storing data inside linked list instead, accomplish functionality. if question saving memory, sparse vectors come mind. edit: have clarified (in comment section) aim store , graphically represent given set of 3d data, can come more detailed answer: a commonly used way sparsely store 3d data octree . use kind of voxel-engine, octree implemented this: enum atomtype { notype, solidtype, strangetype }; class octreenode { public: virtual octreenode* getsubnode(unsigned index) = 0; virtual atomtype getcontent(void) = 0; }; class octreebranchnode : public octreenode { public: octreenode* getsubnode(unsigned index) { ...

node.js - Wrong time format fetched -

i using node fetching data mysql. in database, got record : 2013-08-13 15:44:53 . when node fetches database , assigns value 2013-08-19t07:54:33.000z. i need time format in mysql table. btw ( column format datetime in mysql) in node : connection.query(post, function(error, results, fields) { usersocket.emit('history :', { 'datamode': 'history', msg: results, }); }); when retrieving database date object exactly should work with (strings display dates, working on string representation of date nothing want do). if need string representation, create based on data stored in date object - or better, library adds proper strftime -like method prototype. the best choice such library moment.js allows string format want: moment('2013-08-19t07:54:33.000z').format('yyyy-mm-dd hh:mm:ss') // output (in case on system using utc+2 local timezone): // "2013-08-19 09:54:33" however, when sending t...

python - How to make rpm module work with (non-system) Python2.7 -

i haven't found comprehensive answer issue far. sorry in advance if missed answer somewhere. i have rhel5/oel5 64 bit os native python-2.4 on , rpm-python-4.4.2.3-27.0.1.el5 installed. when doing 'import rpm' python-2.4 works expected. i (must) use python rpm module python-2.7.5 on same machine , not sure proper way of doing that. python 2.7.5 installed. when calling 'import rpm' got import error. i've found few rpms python-2.7.5 however, not rhel5/oel5 64 bit appreciate pointers/advise! a solution python 2.7 use virtualenv . in nutshell, virtualenv allows manage several versions of python on same computer (even same user) without getting in each other's way. allows have several "flavors" of same python version, each different set of modules. the process described in detail in documentation . in case, create environment , use pip install rpm module environment. when activate environment, python scripts able import rpm mo...

Error 403 You are not authorized to perform this action in yii framework -

i have followed http://www.larryullman.com/2010/01/04/simple-authentication-with-the-yii-framework/ creating login system using database. after login , trying access admin pages got error 403 not authorized perform action idea why how solve issue? see access rule public function accessrules() { return array( array('allow', // allow users perform 'index' , 'view' actions 'actions'=>array('index','view'), 'users'=>array(' '), ), array('allow', // allow authenticated user perform 'create' , 'update' actions 'actions'=>array(), 'users'=>array('@'), ), array('allow', // allow admin user perform 'admin' , 'delete' actions 'actions'=>array('admin','delete','create','update' ), // 'users'=>array('admin'), ...

android - FileNotFoundException when trying to get acess token of Instagram API -

i filenotfoundexception while trying retrieve access_token: java.io.filenotfoundexception: https://api.instagram.com/oauth/access_token&client_id=e909da82f8544a70bb9b29434xxxxxx&client_secret=fa34037e0f534628bb9becd1a3xxxxxx&grant_type=authorization_code&redirect_uri=x-oauthflow-instagram://callback&code=520401255.e909da8.244c14ba79e842868a695192835c83ac 01-01 11:50:39.371: w/system.err(21868): @ libcore.net.http.httpurlconnectionimpl.getinputstream(httpurlconnectionimpl.java:186) the error occurring @ line jsonobject jsonobj = (jsonobject) new jsontokener(streamtostring(urlconnection.getinputstream())).nextvalue(); what doing wrong? just replace instagramapp.java current class in library. package br.com.dina.oauth.instagram; import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import java.io.outputstreamwriter; import java.net.httpurlconnection; import java.net.url; i...

python - Trouble with loading a tree structure in django models -

i have 2 django models this class thread(models.model): title = models.charfield(max_length=255, blank=true) class post(models.model): message = models.textfield(blank=true) thread = models.foreignkey(thread, related_name='posts') depth = models.positiveintegerfield(default=0) reply_to = models.foreignkey('self', null=true, related_name='replies', blank=true) i noticed when this roots = thread.posts.filter(depth=0) post in roots: replies = post.replies django execute query roots executes new queries children of specific post, know working posts in specific thread. i want know if there way make django load posts 1 query , use model's relation children recursively. it's not built-in django, can use apps treebeard or django-mptt this. https://tabo.pe/projects/django-treebeard/ https://github.com/django-mptt/django-mptt

c# - Printing with XPSDocumentWritter on an Epson printer PrintQueue -

we have application have print function works on printers except products epson on windows 8 . i've manage make minimal sample reproduce problem. call following method, providing full path correct xps file. private void print(string xpsfilename) { if (string.isnullorempty(xpsfilename)) { return; } printdialog printdialog = new printdialog(); printdialog.showdialog(); printqueue defaultprintqueue = printdialog.printqueue; try { // seems fail epson printers: no job in spooler, no print ... printsystemjobinfo xpsprintjob = defaultprintqueue.addjob("print through 'addjob' on printqueue", xpsfilename, false); } catch (printjobexception printjobexception) { console.writeline("{0} not added print queue.", xpsfilename); console.writeline(printjobexception.message); } catch (exception exception) { console.writeline("{0} unknown error:", xpsfilename); console.writeline(exception.message); ...

python 2.7 - Implementing deep belief network for topic modelling -

i'm trying implement deep belief network semantic hashing article ( http://www.cs.toronto.edu/~hinton/absps/sh.pdf ) geoffrey hinton , ruslan salakhutdinov. have hard time figuring out how implement constrained poisson model in restricted boltzmann machine (rbm), model take real valued word-count vectors , update weights correctly? below find essential code rbm: for epoch in range(epochs): errsum = 0 batch_index = 0 _ in self.batches: # positive phase - generate data visible hidden units. pos_vis = self.__get_input_data__(batch_index) n = sum(pos_vis, axis = 1)[newaxis].t batch_size = len(pos_vis) if self.final_layer: pos_hid_prob = dot(pos_vis,self.weights) + tile(self.hidden_biases,(batch_size,1)) elif self.first_layer: pos_hid_prob = dbn.bernoulli(dot(pos_vis,self.weights) + tile(self.hidden_biases,(batch_size,1))) else: ...

php - GhostScript - text misplaced after converting from pdf to jpg -

i using php exec() , ghostscript convert pdf files jpg, however, there seems issue text - letters gets misplaced. here example screenshots how turns out: this how on pdf - http://screencast.com/t/vmf2kjdlts , how turns out on jpg - http://screencast.com/t/btfnmkrc here's command i'm using: exec("/usr/bin/gs -dnopause -sdevice=jpeg -soutputfile=test.jpg -djpegq=100 -r814x1149 -q test.pdf", $out, $rcode); the pdf generated dompdf , custom installed font if helps. any suggestions doing wrong? after converting gs9.07win text looks fine (text rendered default font, arial). problem opensans , opensans-bold fonts substitution or incomplete glif maps.

amazon web services - Private Key Error in AWS EC2 Tools -

i'm getting following error when run describe region command. i'm in ubuntu 12.04 $ ec2-describe-regions required option '-k, --private-key key' missing. i have setup following lines $ export ec2_home=<path-to-tools> $ export path=$path:$ec2_home/bin $ export aws_access_key=your-aws-access-key $ export aws_secret_key=your-aws-secret-key can please me? the option -k, --private-key key 1 of deprecated options , see common options cli tools : for limited time, can still use private key , x.509 certificate instead of access key id , secret access key. however, recommend start using access key id (-o, --aws-access-key) , secret access key (-w, --aws-secret-key) now, private key (-k, --private-key) , x.509 certificate (-c, --cert) won't supported after transition period elapses. more information, see tell tools are . i highly recommend follow advise , use your access key id (-o, --aws-access-key) , secret access key (-w, -...

cloud - Rackspace connecting to a server using Pyrax in python -

i have started using pyrax , python binding rackspace api. have test account on rackspace , server running there. using username , api_key can authenticate , list servers found in region. how connect particular server given name, server id, ipv4 address, ipv6 address, flavor etc.? pyrax used interact rackspace cloud api in provisioning resources. a different library required if wanted connect server via ssh. check out http://www.lag.net/paramiko/

Update XML variable in SQL Server 2005 with namespace -

i'm trying add new node xml variable containing namespaces using transact sql, there no error, nor variable updated. here have far: declare @xml xml; set @xml = '<xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema"> <xs:element name="ecasdata"> <xs:complextype> <xs:all minoccurs="1" maxoccurs="1"> <xs:element id="cmbzona" name="cmbzona" minoccurs="0" maxoccurs="1"> <xs:simpletype> <xs:annotation> <xs:documentation>#zona#</xs:documentation> </xs:annotation> <xs:restriction base="xs:string" /> </xs:simpletype> </xs:element> </xs:all> </xs:complextype> </xs:element> </xs...

MySQL JOIN Statement - Referenced Field in same Table -

how list of orders in table except (orders has been referenced , type of -1) orders table: id | reference_id | type ---------------------------------- 1 | | 1 ---------------------------------- 2 | | 1 ---------------------------------- 3 | 1 | -1 ---------------------------------- something like: list = arraylist(); if( order.type > 0 ){ if( order.id != other_order.reference_id ) list.add(order) } how in mysql statement? also same result of statement using join....etc: select * orders a.type > 0 , not exists (select * orders b a.id = b.ref_id) thanks this give records referenced , valid select * yourtable inner join yourtable b on a.reference_id = b.order_id b.reference_type > 0;

c# - Does Mono / .NET 4.0 implement AppDomain.FirstChanceException? -

i porting c# app .net on windows mono on linux (both using .net 4.0). when compiling code following code: error cs1061: type system.appdomain not contain definition firstchanceexception , no extension method firstchanceexception of type system.appdomain found. missing assembly reference? (cs1061) (v8.net-console) for following code: appdomain.currentdomain.firstchanceexception += currentdomain_firstchanceexception; when looking @ appdomain via assembly browser not see definition firstchanceexception . missing mono or issue on machine? if missing, alternative available? according source file containing appdomain class , not implemented on mono yet.

excel - Using R to reformat data from cross-tab to one-datum-per-line format -

i'm using r pull in data through api , merge of single table, write csv file. graph in tableau, however, need prepare data using reformatting tool excel cross-tablulated format format each line contains 1 piece of data. example, taking format: id,gender,school,math,english,science 1,m,west,90,80,70 2,f,south,50,50,50 to: id,gender,school,subject,score 1,m,west,math,90 1,m,west,english,80 1,m,west,science,70 2,f,south,math,50 2,f,south,english,50 2,f,south,science,50 are there existing tools in r or in r library allow me this, or provide starting point? trying automate preparation of data tableau need run single script formatted properly, , remove manual excel step if possible. in r , several other programs, process referred "reshaping" data. in fact, tableau page that linked to speaks of "excel reshaper plugin". in base r, there few functions reshape data, such (notorious) reshape() function takes panel data wide form long form, , stack(...

Can I host a SSAS Cube in AppHarbor? -

i looking deploy ssas cube platform service. wondering if has done on appharbor? in end want web based pivot table. data updated "rebuilds" may needed or re-population of source data (which in sql server) or have better suggestion? thanks -ken

import - Importing library project in Android Studio -

i'm trying import this android library project application android studio (0.2.5, gradle 1.7), error, no matter try. i have tried follow voted answer post , (i tried helloword project scratch , actionbarsherlock) @ end error, gradle: problem occurred evaluating project ':libraries:actionbarsherlock'. > gradle version 1.6 required. current version 1.7 can me? can import either filedialog or sherlock library android studio project? i solved upgrading android studio 0.2.6. here, "new module" issue has been fixed, can add new library module project. then, replicated library project new module (adding manually activities, files, resources...), , i've working gradle project. i know bit tricky, had make work!

c# - How to populate a combobox with SQL Server stored procedure -

using: asp.net , c# i'm trying populate combobox values sql server stored procedure. have combobox loading , working, don't know how make values show drop down list customer choose. listitem correct way load drop down menu? here have far: .aspx page: <asp:toolkitscriptmanager id="scriptmanager1" runat="server" /> <div> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <asp:combobox id="combobox1" runat="server" datasourceid="sql" datatextfield="datatext" datavaluefield="datavalue" maxlength="0" style="display: inline;"> <asp:listitem value="0">please choose item......</asp:listitem> //what put here load , display stored procedure in list </asp:combobox> <asp:sqldatasource id="sql1" runat="se...

calendar - Android How to create a recurring task that will happen every friday? -

my problem want application download information database every week. new promotion every week , updated on database every friday. i know how check day of week using calendar. but don't know how find out when next occurring friday be. is possible or should make weekly check starting day application installed? store timestamp of last update in sharedpreferences . use alarmmanager interval_day . when wakes app, check if it's friday, or has been more 156 hours since last update. if is, run updates. alternatively, check last update time when launching, , if it's been more x days since last update, update then.