Posts

Showing posts from July, 2013

templates - I'm trying to use this Boost C++ code and I have a problem -

first i'll explain, i'll paste code. copied code example http://www.boost.org/doc/libs/1_45_0/libs/graph/example/prim-example.cpp , i'm trying work input text file, did boost kruskal algorithm. using debugger, know second argument of function wants "end" array of edges. that's i'm giving function call, don't understand. graph g(edges, edge_array + num_edges, weights, num_nodes); i error 1>c:\users\edmond\documents\visual studio 2008\projects\boost prim algo\boost prim algo\main.cpp(61) : error c2661: 'boost::adjacency_list<outedgelists,vertexlists,directeds,vertexproperty,edgeproperty>::adjacency_list' : no overloaded function takes 4 arguments 1> 1> [ 1> outedgelists=boost::vecs, 1> vertexlists=boost::vecs, 1> directeds=boost::undirecteds, 1> vertexproperty=boost::property<boost::vertex_distance_t,int>, 1> edgeproperty=boost::p

javascript - Create HTTPS client in NodeJS -

i've been having heck of time figuring out how use node.js (v0.3.8) securely connect http server. have following code: var http = require("http"); var client = http.createclient(443, host, /* secure= */ true); var request = client.request("get", relativeurl, { host: host }); when run it, get: node.js:116 throw e; // process.nexttick error, or 'error' event on first tick ^ error: parse error @ client.ondata [as ondata] (http.js:1287:27) @ client._onreadable (net.js:648:27) @ iowatcher.onreadable [as callback] (net.js:156:10) i've been googling answers past half hour, , have read documentation @ http://nodejs.org/ . missing? it turns out using old version of node documentation, didn't include reference https module. referring current docs, found http://nodejs.org/docs/latest/api/https.html#https_https_get_options_callback , provides example: https.get({ host: 'encrypted.google.com', path

Mobile module for OpenERP -

i want build mobile module openerp. can tell how make mobile module openerp? it looks else working on a mobile client openerp . you're asking about?

Mozilla firefox problem in javascript -

how can (if)any text selected in textbox , want in variable of javascript.... mozilla firefox...? above description not enough let me give definition.. extension of firefox extension double clicks word webpage , finds possible meaning database... user can write in textbox , double click same finding meaning.. please suggest way complete selection textbox's selected text....? in addition using dblclick event handler dont suggest solution.... problem web page can site's webpage textarea or control specific tho page how slice text ...thanxx in advance.... you can use document.getselection() returns selection object containing highlighted text in document. however, calling @ right time can tricky. can't onclick handler on button, instance, because time onclick handler fires, selection's focus has been removed text , moved button.

org mode - Can we make an Emacs buffer to be static/pinned? -

i use org file keep track of activities, because it's loosing track of aiming :) now, reserved top buffer window 5 lines tall , show narrowed todo org file. other window/buffer activites not touch static/pinned buffer. is there way achieve result??? thanks! edited : can make buffer have different background color? pressume it's not, because have set-background-color... hope wrong.. if clock in org todo item, task displayed in modeline of current buffer; might find helpful reminder of you're working on.

javascript - How to share jQuery .data() data through iframe's? -

i'm trying share jquery data 1 or more iframe'd html pages parent html document. need inter-iframe communication , if possible (highly desireble) share/exchange .data() i.e. $.cache of both jquery objects (in parent , child iframe). someting similar this: parent html: <!doctype html> <html> <head> <title >iframe-data</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" ></script> <script type="text/javascript" > jquery(function($){ var testdata = 'hello world #div1'; $('#div1').data('test',testdata); var newtestdata = $('.div2').closest('.div1').data('test'); $('#div2').append( 'parent window: "' + testdata + '" === "' + newtestdata + '&q

java - Looking distributed cache solutions for implementing a distributed MVC pattern -

i building client/server application have complex (but not large -say 10,00 objects) object model @ heart. multiple clients need view model (via eclipse rcp gui), server node can directly edit model. want edits model published out clients. new clients able request model, , register updates. its standard model-view-controller pattern really. can suggest good, open source, replicated cache solutions handle distribution of object model, plus distributing changes model. want 'deltas' sent clients, rather sending complete model every time 1 field changes. also, need able replicate object graph , maintain coherence, e.g., if have 'person' object: public class person implements serializable { private person manager; private string name; public person (person manager, string name) { add 3 people cache: person boss = new person(null,"theboss"); person employee1 = new person(boss,"employee 1"); person employee2 = new person(boss,"

php - How ffmpeg is command executed in this code -

want know how ffmpeg command executed taking screenshot in code. not able figure out when screenshot created, function or line done. $ffmpeg = '/usr/bin/ffmpeg'; $video = $sourceurl;// input video file $thumbid = uniqid(); $thumbid .= ".jpg"; // you'll save image $image = "uploads/$thumbid"; // default time image $second = 1; // duration , random place within $cmd = "$ffmpeg -i $video 2>&1"; if (preg_match('/duration: ((\d+):(\d+):(\d+))/s', `$cmd`, $time)) { $total = ($time[2] * 3600) + ($time[3] * 60) + $time[4]; $second = rand(1, ($total - 1)); } // screenshot $cmd = "$ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -s 120x90 -vcodec mjpeg -f mjpeg $image 2>&1"; $return = `$cmd`; $thumblink = ""; this line executes command

iphone - tablerow delete but still showon in table view -

my data show on table whn select data delet delted database not table , go other view , again come delete table view delete data not show again using code ... - (void)deleterowsatindexpaths:(nsarray *)indexpath withrowanimation:(uitableviewrowanimation)animation { nslog(@"hello"); } -(void) tableview:(uitableview *)tableview commiteditingstyle:(uitableviewcelleditingstyle)editingstyle forrowatindexpath:(nsindexpath *)indexpath { // int row = [indexpath row]; [self.table beginupdates]; if (editingstyle == uitableviewcelleditingstyledelete) { hadits *delhadit = [self.allbookmarks objectatindex:indexpath.row]; dbaccess *dbmethods = [[dbaccess alloc] init]; nsinteger delhaditid = delhadit.haditid; [dbmethods deletebookmark:delhaditid]; [dbmethods release]; } [self deleterowsatindexpaths:[nsarray arraywithobject:indexpath] withrowanimation:uitableviewrowanimationfade]; [self.tab

How can I add the build version to a scons build -

at moment i'm using magic current git revision scons builds.. grab version stick cppdefines. works quite nicely ... until version changes , scons wants rebuild everything, rather files have changed - becasue define files use has changed. ideally i'd generate file using custom builder called git_version.cpp , have function in there returns right tag. way 1 file rebuilt. now i'm sure i've seen tutorial showing how .. can't seem track down. , find custom builder stuff little odd in scons... so pointers appreciated... anyway reference i'm doing: # lets version git # first base version git_sha = subprocess.popen(["git","rev-parse","--short=10","head"], stdout=subprocess.pipe ).communicate()[0].strip() p1 = subprocess.popen(["git", "status"], stdout=subprocess.pipe ) p2 = subprocess.popen(["grep", "changed not updated\\|changes committed"], stdin=p1.stdout,stdout=subprocess.

MySQL Join using "contains"? -

i have these 2 tables: table: orders id - name - data --------------------------------------------- 1 - order 1 - node_checkout_nid";i:141;s:10: 2 - order 2 - node_checkout_nid";i:142;s:10: table: nodes nid - description -------------------- 141 - bla bla bla 142 - bla bla bla 2 i need sql join query can join 2 tables on nid, keeping in mind nid in "data" column. i need end this: table: result id - name - data nid - description ----------------------------------------------------------------------------------- 1 - order 1 - node_checkout_nid";i:141;s:10: - 141 - bla bla bla 2 - order 2 - node_checkout_nid";i:142;s:10: - 142 - bla bla bla 2 i wanted use "like" join, think (if it's possible) "contains" join better? appreciated! you can use: select id, name, data, nid, description orders inner join nodes on data concat('%;i:', nid, ';%') anyway it's

c# - Search file -

i have search filepath filename harddisk. i wondering if there way use main windows 7 search manager (start->edit text "search programs , file". or if there quick way find filepath within computer can me? you'll need windows search sdk . edit: check out related msdn docs .

javascript - How to extract a text using regex? -

my text 1618148163#@#jasser-pc#-#1125015374#@#anas kayyat#-#1543243035#@#anas kayyat#-# result should be: jasser-pc anas kayyat anas kayyat i using : (?<=#@#)(.+)(?=#-#) but gives me : jasser-pc#-#1125015374#@#anas kayyat#-#1543243035#@#anas kayyat javascript’s regular expressions don’t support look-behind assertions (i.e. (?<=…) , (?<!…) ), can’t use regular expression. can use this: #@#(.+)(?=#-#) then take matched string of first group. additionally, match little possible, make + quantifier non-greedy using +? .

reading huge data from database and writing into xml Java -

i have huge data billions of records in tables best way read in plain java , write in xml file? thanks if best mean fastest - consider using native database tools dump files way faster using jdbc.

javascript - Embedding a JS file in Silverlight Class Library -

i trying create silverlight class library needs call few javascript methods. have put these methods in single .js file , have added project. when try call of methods in js file, failedtoinvoke error. understand problem can solved adding reference of js file in head section of aspx or html page. developing class library , not possible. know how tackle issue? using silverlight 4 , visual studio 2010. add .js file library probject sounds have done, make sure build action "resource". you can retrieve content application.getresourcestream :- streamresourceinfo srijs = application.getresourcestream(new uri("yourassemblyname;component/mystuff.js", urikind.relative)); note structure of uri, assembly name of class library needed followed literal ";component". tells silverlight resource inside dll included in final application's xap. now need turn content of info's stream property string:- streamreader reader = new streamreader(srij

java - javax.transaction.RollbackException -

i have been occuring below exception while committing transaction. getting transaction on javax.ejb.sessioncontext error code: ejb_error title: ejb error message: unexpected ejb error occurred. triggered when cmp bean fails persistance operation, should rare. severity: 3 additional message: transaction commit failed due enclosed exception. error location: dealerdataloaderbean.commit original exception error stack: javax.transaction.rollbackexception @ com.ibm.tx.jta.transactionimpl.stage3commitprocessing(transactionimpl.java:1221) @ com.ibm.tx.jta.transactionimpl.processcommit(transactionimpl.java:991) @ com.ibm.tx.jta.transactionimpl.commit(transactionimpl.java:913) @ com.ibm.ws.tx.jta.tranmanagerimpl.commit(tranmanagerimpl.java:377) @ com.ibm.tx.jta.tranmanagerset.commit(tranmanagerset.java:161) @ com.ibm.ws.tx.jta.usertransactionimpl.commit(usertransactionimpl.java:293) @ com.ibm.ejs.container.usertransactionwrapper.commit(usertransactionwrapper.j

XML validation against an XSD fails in Oracle but it gets validated in XMLSpy -

xsd registered in oracle. using xmltype.schemavalidate validate xml against registered xsd. api gives error "lsx-00295: field element "item" not simple type". same xml file same xsd gets validated fine in altova xmlspy. somehow oracle giving complex type error. anonymous script below: declare lxml xmltype; l_err varchar2(4000); l_transformxml clob:='<?xml version="1.0" encoding="utf-8"?> <tdvpf:products numproducts="2" xsi:schemalocation="http://www.techdata.com/vpf vendorpricefiletemplate_volume.xsd" xmlns:tdvpf="http://www.techdata.com/vpf" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <product> <base> <distributorsku numitems="1"> <item index="2">a</item> </distributorsku> <vendor numitems="1"> <item index="2"

asp.net - System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\TEMP\xxxxxx.dll' -

we have public website uses asp.net 4, nhibernate 2.2. website running without issue past 1 year. noticing following error. nhibernate.mappingexception: not compile mapping document: project.nhibernatedata.mappingfiles.myentity.hbm.xml ---> system.io.filenotfoundexception: not find file 'c:\windows\temp\osj2cokr.dll'. @ system.io.__error.winioerror(int32 errorcode, string maybefullpath) @ system.io.filestream.init(string path, filemode mode, fileaccess access, int32 rights, boolean userights, fileshare share, int32 buffersize, fileoptions options, security_attributes secattrs, string msgpath, boolean bfromproxy, boolean uselongpath) @ system.io.filestream..ctor(string path, filemode mode, fileaccess access, fileshare share) @ microsoft.csharp.csharpcodegenerator.fromfilebatch(compilerparameters options, string[] filenames) @ microsoft.csharp.csharpcodegenerator.fromsourcebatch(compilerparameters options, string[] sources) @ microsoft.csharp.csharpcode

autostart - Ubuntu 10.10 rc.local ignores half the command? -

i have java program on autostart in rc.local (in ubuntu /etc/init.d/rc.local ) reason in ubuntu on autostart command execute java , log output half works, while works expected in command line , works on rhel distro (in rc.local , command line). command im trying execute is: java -server -cp '/foo/bar/' someserver &> '/foo/bar/log.txt' & at boot in ubuntu starts server , rewrites log.txt blank log, doesnt log more of output of server program... permissions set right.. not sure else into.. appreciated. thanks. so here's answer :) do: command > some/logfile.txt 2>&1 & rc.local executed /bin/sh not /bin/bash , makes difference.

What is the difference between managed and unmanaged DLL -

i newbie....i know detailed difference between two, , when use these? the term "managed code" refers code written in managed language, such java or c#. term "unmanaged code" refers code written in unmanaged language, such c or c++. if you're coming .net world, "managed" means c# or vb.net, , "unmanaged" means c or c++.

I need an EU-located email provider with a good API - any suggestions? -

i have web application provides email box each of our customers. once acquire new customer, automatically create mailbox him. use rackspace that, , has served well. rest api. however, have stop using rackspace since stores emails in us. have legal constraints force store emails within eu. what alternative rackspace suggest? requirements are: api , location within eu. amazon ses. has servers located in eu. you can here

How do I use nightly builds of Scala 2.9 with maven? -

recently wanted try of new features in scala 2.9 in small project. use maven building it. how can tell maven use latest nightly build of scala 2.9? if knows how sbt instead of maven, too. you can try repository: http://www.scala-tools.org/repo-snapshots with scala version: 2.9.0-snapshot here snippet pom.xml : <repositories> <repository> <id>scala-tools.org</id> <name>scala-tools maven2 repository</name> <url>http://scala-tools.org/repo-snapshots</url> </repository> </repositories> <pluginrepositories> <pluginrepository> <id>scala-tools.org</id> <name>scala-tools maven2 repository</name> <url>http://scala-tools.org/repo-snapshots</url> </pluginrepository> </pluginrepositories> and sbt : val scalatoolssnapshots = "scala tools snapshots" @ "http://scala-tools.org/rep

.htaccess - Download htaccess protected files using PHP and CURL -

i tried download files in htaccess protected directory using php , curl. code: $username = "myusername"; $password = "mypassword"; $url = "http://www.example.com/private/file.pdf"; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_userpwd, "$username:$password"); curl_setopt($ch, curlopt_httpauth, curlauth_basic); $output = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); but code nothing... how can initiate download of file.pdf? thank you! also, if echo $output, this: array ( [url] => http://www.example.com/private/file.pdf [content_type] => application/pdf [http_code] => 200 [header_size] => 264 [request_size] => 116 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.007898 [namelookup_time] => 0.006777 [connect_time] => 0.006858 [pretransfer_time] => 0.006922 [size_upload] =&

Hit-Count (reads) of an array in Java -

for evaluating algorithm have count how items of byte-array read/accessed. byte-array filled contents of file , algorithm can skip on many of bytes in array (like example boyer–moore string search algorithm). have find out how item read. byte-array passed around multiple methods , classes. my ideas far: increment counter @ each spot byte-array read. seems error-prone since there many of these spots. additionally have remove code afterwards such not influence runtime of algorithm. use arraylist instead of byte-array , overwrite "get" method. again, there lot of methods have modified , suspect there performance loss. can somehow use eclipse debug-mode? see can specify hit-count watchpoints not seem possible output hit count?! can maybe reflection api me somehow? somewhat 2), in order reduce effort: can make java method accept arraylist wants array such transparently calls "get" method whenever item read? there might out-of-the-box solution i

ioc container - Autofac: how do I pass a reference to the component being resolved to one of its dependents? -

with following: public class aclass { public adependent dependent { get; set; } } public class adependent { public adependent(aclass ownervalue) {} } with following registrations... builder.registertype<aclass>().propertiesautowired().instanceperdependency(); builder.registertype<adependent>().propertiesautowired().instanceperdependency(); when resolve aclass, how make sure 'ownervalue' instance of aclass being resolved, , not instance? thx follow on the example above doesn't catch problem properly, how wire adependent when registering when scanning... example public class aclass : iaclass { public iadependent dependent { get; set; } } public class adependent : iadependent { public adependent(iaclass ownervalue) {} } // registrations... builder.registerassemblytypes(assemblies) .assignableto<iaclass>() .as<iaclass>() .instanceperdependency() .propertiesautowired(); builder.registerassemblytypes(assembl

asp.net - Set ASP Literal text with Javascript -

i have asp:literal on page ( which cannot converted label or other control ) need change text of via javascript. have following code works label . can help? <script type="text/javascript"> function changetext() { document.getelementbyid('<%= test.clientid %>').innerhtml = 'new text'; } </script> <a href="#" onclick='changetext()'>change text</a> <asp:label id="test" runat="server" text="original text" /> thanks update: cannot change literal code behind writes html/css information message e.g: litmessage.text = "<div class='success'>information updated</div>" <asp:literal> controls don't create own html tag. therefore, there no element can manipulate. instead, can wrap <asp:literal> in <div> tag id.

Problem using Microsoft Expression Blend -

i newbie expression blend. when draw shapes in workspace, border appears around shape. want remove border. please me in doing that. is blue square border few pixels outside of shape? or black border around outer surface of shape? if blue border, can't rid of it, bounding box around , disappear deselect element. if black border, can remove clicking on "stroke" property in properties panel , clicking button below far left (the square diagonal line through it.) eliminate stroke. hope helps!

dependency injection - Help me to recognize the technique i use in this php example and naming it -

ok @ work have discovered method fetch related data / objects near awesome. right example, have class related objects inside: class country { private $language; //$language object of class language private $regions; //$regions array of region objects //in constructor don't load regions or language //magic method public function __get($name) { $fn_name = 'get_' . $name; if (method_exists($this, $fn_name)) { return $this->$fn_name(); } else { if (property_exists($this, $name)) return $this->$name; } return $this->$name; } public function get_language () { if (is_object($this->language)) return $this->language; $this->language = new language($params); //example return $this->language; } public function get_regions () { if (is_array($this->regions)) return $this->regions; $this->regions = a

python - How can remove a widget and resize the main window? -

i have test app uses python , tkinter present number of text boxes user using grid layout manager. to reduce clutter on screen have show/hide button removes , show several non-critical widgets: if show_all: # display widget widget.grid() else : # hide widget widget.grid_remove() what next force main window resize after widgets have been modified. any suggestions welcome. by default main window should resize, assuming user hasn't resized window. if user has resized window, might want rethink need shrink it. if resized it, want @ size resized to. regardless, try setting window geometry of main window (eg: root.wm_geometry("") ) empty string. trigger main window re-layout children.

javascript - Document position of an element in an iframe -

i have javascript code uses obj.offsetleft , obj.offsettop image position, hovers element @ location. however, long story short, ive had embed html inside iframe sits inside main page. in ie7, hover element appears in correct location fine, until user scrolls page. page scrolled downwards, hovered element seems move downwards also, losing sync real position. i tried using while loop cycle through offsetparent, adding offsets. seems high iframe. is there other way accurately retrieve position of element inside iframe, relative entire page? and can't use css positions achieve that? otherwise, have calculate iframe position , add positions calculated inside iframe position "document wise"

Iphone SDK UITextView text length -

how can know text out of fit (that text need scrolled)? have methods or this? thanks. use nsstring uikit additions. allow calculate height of string given size , font. can calculate height in way: cgfloat textviewwidth = cgrectgetwidth(textview.bounds); cgsize inset = cgsizemake(5.0,5.0); cgsize stringsize = [mystring sizewithfont:textview.font constrainedtosize:cgsizemake(textviewwidth-2*inset.width,1024) linebreakmode:uilinebreakmodewordwrap]; bool textoutoffit = stringsize.height+2*inset.height>cgrectgetheight(textview.bounds); note code requires fine tuning. infact text inside text views has internal margin (that took account using inset structure), required text view height higher calculated string height. code ask nsstring calculate size when horizontally constrained in textview boundaries (while 1024 in height maximum uiview height possible). check if returned string height inside or not text view boundaries.

msvcrt - Microsoft vs. GNU C/C++ standard library implementations -

which 1 better , cleaner implementation stand point 1 can recommend study guide? way see it, 1 can learn lot looking through c library(with c++ things ugly imho) implementations , toying them, since rather simplistic in design , concept. expecting non-biased answers people have looked through both implementations. for people didn't know, of microsoft's implementation of c/c++ libraries available debugging purposes . can find them in visual studio installation folder under vc\crt\src\ . eg. vs2008: c:\program files\microsoft visual studio 9.0\vc\crt\src (assuming installed copy in c:\program files\ ). i wondered why c++ stl implementation used visual studio hard read, cannot recommend sure. don't know others implementations. e.g. stlport

c++ - Implicit Template Parameters -

the following code generates compile error in xcode: template <typename t> struct foo { foo(t value) { } }; int main() { foo myfoo(123); return 0; } error: missing template arguments before 'myfoo' changing foo myfoo(123); foo<int> myfoo(123); fixes issue, shouldn't compiler able figure out appropriate datatype? is compiler bug, or misunderstanding implicit template parameters? the constructor in theory infer type of object constructing, statement: foo myfoo(123); is allocating temporary space myfoo , must know fully-qualified type of myfoo in order know how space needed. if want avoid typing (i.e. fingers) name of particularly complex template, consider using typedef : typedef std::map<int, std::string> stringmap; or in c++0x use auto keyword have compiler use type inference--though many argue leads less readable , more error-prone code, myself among them. ;p

Convert string/numeric date in Excel to a date formatted object using only formulas -

folks, i have string date can convert numeric using: =datevalue("1/2/2011") results in 39084 i'm trying use formulas convert either string or numeric date date formatted object. using ui formatting not option. use text() example: =text(datevalue("1/2/2011"), "yyyy/mm/dd")

Add bookmarks to Safari using Perl? -

is there way programmatically add bookmarks safari using perl? i prefer solution works if safari running, of course—if there no other way—i settle solution requires closing application first. if helps, i'm running in os x. just in case else looking solution. i've managed directly editing safari's bookmarks file (located in ~/libary/safari/bookmarks.plist ). in order read, modify , update plist using perl went osx foundation module ( this article might helpful ).

wpf - What is the way to reuse a XAML DrawingImage changing only the PathGeometry LineSegments? -

Image
i have 3 buttons in wpf application want display image of triangle. i'm not using shape class because it's heavyweight needs, i'm using drawingimage instead. here markup image (i post clean-looking image can't yet i'm new): <image> <image.source> <drawingimage> <drawingimage.drawing> <geometrydrawing brush="lawngreen"> <geometrydrawing.pen> <pen brush="black" thickness="1" /> </geometrydrawing.pen> <geometrydrawing.geometry> <pathgeometry> <pathfigure isclosed="true"> <linesegment point="-10, 20" /> <linesegment point="30, 20" /> </pathfigure>

objective c - Programatically check whether monitor is switched off -

mac os x has power saving feature allows os turn off monitor. there api detect in code whether monitor switched on or off? check out iokit's power management section. http://developer.apple.com/library/mac/#documentation/devicedrivers/conceptual/iokitfundamentals/powermgmt/powermgmt.html#//apple_ref/doc/uid/tp0000020-tpxref104 you might able use ioregistryexplorer , find node state information on setting looking for. there can multiple monitors on mac in different states, have enumerate tree looking nodes class type need. sleep state handled in iopmrootdomain.cpp in darwin kernel. can probe iokit believe. http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/iokit/kernel/iopmrootdomain.cpp something like: mach_port_t masterport; io_registry_entry_t root; kern_return_t kr; boolean_t flag = false; kr = iomasterport(bootstrap_port,&masterport); if ( kioreturnsuccess == kr ) { root = ioregistryentryfrompath(masterport,kiopo

ruby on rails - Username in "Welcome text" -

how can use current username in welcome text field of redmine? thanks that's not possible put of box, can write very simple plugin adds wiki macro. or try 1 below :) just create new directory in vendor/plugins directory called redmine_username_macro . put code vendor/plugins/redmine_username_macro/index.rb . require 'redmine' redmine::plugin.register :my_user_plugin name 'user macro plugin' url 'http://dev.holgerjust.de/projects/redmine-misc' author 'holger just' description 'add macro inserting current user.' version '0.1' end redmine::wikiformatting::macros.register desc "insert name of current user. example: !{{username}}" macro :username |obj, args| h(user.current.name) end end

How do I Drop Table from slony -

i have database being backed slony. dropped table replicated db , re-created same table using sql scripts , nothing through slony scripts. i found on post , tried it: recreate table get oid recreated table: select oid pg_class relname = <your_table>' , relkind = 'r'; update tab_reloid in sl_table problem table. execute set drop table ( origin = n, id = zzz); n node # master, , zzz id # in sl_table . but doesn't seem work. how drop table replicated db? or there way use newly created table in place of old one? the authoritative documentation on dropping things slony here . it's not clear state things in before ran commands above, , haven't clarified "doesn't seem work". there 1 significant "gotcha" know off dropping tables replication slony. after remove table replication, can have trouble physically dropping table on slaves (but not on master) slony 1.2, getting cryptic error this: error: "

php - How to get rid of a logo in wordpress? -

i using theme "designed by" logo obnoxious place. right in middle of page on left hand side... how can rid of , move footer? http://detailhavasu.com/ that illegal if haven't bought it, see style.css file: notice: theme free personal use. commercial use or removing wordspop link, please buy theme .

c++ - while accepting socket connection -

unsigned __int8 decrypt(unsigned __int8 data[]); for(;;) { if((sconnect=accept(slisten,(sockaddr*)&addr,&addrlen)) != invalid_socket) { print("socket connected successfully!"); char buf[4095]; recv(slisten,buf,sizeof(buf),0); decrypt(buf); // error:intellisense: argument of type "char *" incompatible parameter of type "unsigned char *" } how can fix prob :-s cast buf unsigned __int8 when call decrypt. decrypt((unsigned __int8*)buf);

How can I encrypt or hide passwords in a Perl script used to connect to mysql database -

i wondering best way store usernames , password connect mysql database? an easy , safe way — if right — config file. dbi/dbd mysql connection string like– dbi:mysql:my_dbname;mysql_read_default_file=/non-web/path/to/.my.cnf –and pass no user or password dbi connection call. the .my.cnf file have password. ways keep safe include– file only readable webuser. file outside web root; visiting url cannot possibly reach it. the config file contains bare minimum connect, not need user name example. make sure there no exploits in application might allow browsing of file system. the webuser's mysql account has limited privileges: no grant, no create|drop tables, etc, etc.

r - Separate Comma Delimited Cells To New Rows -

hi have table comma delimited columns , need convert comma delimited values new rows. exmaple given table name start end 1,2,3 4,5,6 b 1,2 4,5 c 1,2,3,4 6,7,8,9 i need convert like name start end 1 4 2 5 3 6 b 1 4 b 2 5 c 1 6 c 2 7 c 3 8 c 4 9 i can using vb script need solve using r can solve this? here's approach should work you. i'm assuming 3 input vectors in different objects. going create list of inputs , write function process each object , returns them in form of data.frame plyr. the things take note of here splitting of character vector it's component parts, using as.numeric convert numbers character form when split. since r fills matrices column, define 2 column matrix , let r fill values us. retrieve name column , put in data.frame . plyr nice enough process list , convert data.frame automatically. library(

java - What client-side browser languages are widely available? -

i've read bit on client-side browser languages , tried few out i'm not convinced know of options. make clear, i'm looking can processed either through browser or otherwise on clients computer minimal need additional installations/configurations. at moment know of javascript, java, , flash ( i'm aware isn't language, seems pertinent mention still option). if @ possible seems avoiding flash best, it's still consideration. know there various flavors of js , java don't know of make end-product different raw language. java , javascript both seem relatively slow when comes down more complex , weighty apps, though performance improving our browsers , libraries better. all said, there available or available things better? javascript native browser language that’s supported. flash isn’t native, it’s widely-supported plug-in. nothing else yet seems installed enough worth considering in general, although should try figure out actual/intended audienc

"Cannot create an instance of the abstract class or interface" C# error message -

i changed base class abstract project , i'm receiving following error: cannot create instance of abstract class or interface am receiving error because naming new instance of abstract class not allowed? newplane = new airplane_abstract(name, position); you can't create instance of abstract class. think of interface may contain implementation logic well. expect happen if called abstract instance method no definition?

how to I get the Facebook profile photo with PHP? -

i trying user's current profile photo... can assist on here? thanks !! not specific php, user's profile picture public, if have users facebook id, request: http://graph.facebook.com/user-id/picture more info on: http://developers.facebook.com/docs/reference/api

sql - Insert select continue with error -

i have sql scripts use insert secondtable (field, field1) select field, field2 table; i use oracle 9.x , sqldevelopper. when launch them, on insert select foreign key error(s). , didn't insert set work. is possible oracle continue same when error appear , if possible display or log error ? you can't continue failed set-based insert in oracle 9. either have make statement failsafe, or accept rolled back. options: if such errors rare, try set-based effort , add exception handler row-based solution if error occurs, , displays errors (or stores them somewhere further processing) when errors occur. yes, duplicates effort times doing efficient operation , when errors occur handle them decide. if common occurance, suck , switch row-based solution above. optimize best can , hope someday can take advantage of #3) upgrade oracle 10 , take advantage of dml error logging

jquery - Set max width 800px on Lightbox plugin -

hello use lightbox plugin 1 of website , when picture open have max width 800px, because i'm beginner in jquery have no idea suppose set here : /** * jquery lightbox plugin * jquery plugin inspired , based on lightbox 2 lokesh dhakar (http://www.huddletogether.com/projects/lightbox2/) * , adapted me use plugin jquery. * @name jquery-lightbox-0.5.js * @author leandro vieira pinho - http://leandrovieira.com * @version 0.5 * @date april 11, 2008 * @category jquery plugin * @copyright (c) 2008 leandro vieira pinho (leandrovieira.com) * @license ccattribution-sharealike 2.5 brazil - http://creativecommons.org/licenses/by-sa/2.5/br/deed.en_us * @example visit http://leandrovieira.com/projects/jquery/lightbox/ more informations jquery plugin */ (function($){$.fn.lightbox=function(settings){settings=jquery.extend({overlaybgcolor:'#000',overlayopacity:0.8,fixednavigation:false,imageloading:'css/images/lightbox-ico-loading.gif',imagebtnprev:'css/images/l

Sending email from php, through exchange -

i need send mails php via exchange box. i've been given ip, account , password. there standard libs handle this? i suggest phpmailer http://phpmailer.worxware.com/

django - Pinax : Add new tab to the basic_projects application : Confused by documentation -

just cloned basic_project , trying customize following - http://pinaxproject.com/docs/0.7/tabs/#ref-tabs created new app "myapp", added new tab right_nav , edited "site_tabs.css" well. when click on tab, although page change myapp, background color of tab doesn't change. this line in documentation - create myapps/base.html template pages under tab extend. make sure defines block body_class content myapp confusing me. what "body_class" content myapp ?, "div" class having "{% block body_class%}" ? my code of myapp page pretty simple right - {% extends "site_base.html" %} {% load i18n %} {% load ifsetting_tag %} {% block head_title %} {% trans "custom app page" %} {% endblock %} < div class="myapp"> < h1 > {% trans "custom app page" %}</h1> {% if user.is_authenticated %} < p >you signed in !!</p> {% else %} < p >you not signed in !

WPF Charting + Grid help -

we i'm looking wpf toolkit (ones cost money) can provide both powerful grid , charting. i'm not up-to-date whats out there, hoping can assist me should for. of needed features need: grid: hierarchical tree grid charting: panning , zooming 3d charts empty data point display line chart / scatter plot any suggestion highly appreciated. you might want read this: https://stackoverflow.com/questions/1152016/best-charting-tool-for-silverlight-and-wpf

jquery - Why does this Ajax work in IE 7 and 8 but not FF or Chrome? -

say i'm using following ajax call: $(document).ready(function () { $.ajax({ type: "get", url: "http://www.w3schools.com/xml/cd_catalog.xml", //test xml datatype: "xml", success: xmlparser, error: alert("we can't find xml!"), asynch: true }); }); function xmlparser(xml) { $(xml).find("cd:lt(3)").each(function () { $("#offers").append('<h1>' + $(this).find("artist").text() + '</h1><p>' + $(this).find("year").text() + '</p>'); }); this works fine in ie 7 , 8, doesn't work in ff or chrome. empty xml file , following error in browsers: xml parsing error: no element found location: moz-nullprincipal:{77f5fd10-d793-4d35-9a4b-b8280b704fba} line number 1, column 1: when googled error, thought due ajax cross-domain issue. if case, wouldn't disabled in brow

Ruby On Rails - "undefined method `id' for 4:Fixnum" -

i decided wanted list users in ruby on rails application - since couldn't figure out how list them other way, decided use partials. have following on administration page (just hooked own administration controller): <%= render :partial => user.find(:all) %> i have file called _user.html.erb in users view folder. contains following: <ul> <% div_for @user.object_id %> <li><%= link_to user.username, user.username %></li> <% end %> </ul> when application runs , go administration page, following error: undefined method `id' 4:fixnum it says it's because of line (which in partial file): <% div_for @user.object_id %> i'm unsure why happens (and have googled hours try , find results , find solutions don't work me). think it's usage of @user instance variable, i'm not totally sure. you error because div_for expects active record object argument, calls id method on. pass

Tomcat + managing properties files -

we have 1 tomcat server running 2 webapps; 1 sites, , webapp eu. have functionally partitioned app & db along these lines; 1 logical instance running site, , eu site. currently, our release process follows: - deploy 2 identical war's on tomcat, except before re-starting tomcat change properties file identify us, or eu webapp what we'd automate whole process. i'd deploy 2 wars, without modifying properties files without changing build scripts much. suggestions how remove manual step? if using ant build script can use filterset feature of copy command set properties. need: a template property file two property files (one each webapp) your template file: ... locale = @deploy.locale@ other.stuff.int = 123 other.stuff.string = test string ... (note @deploy.locale@ placeholder) your property file: ... deploy.locale = ... you eu property file: ... deploy.locale = eu .... in ant build file can: wipe tmp directory compile project

ASP.NET MVC data annotate domain model in the web project -

i've seen somewhere how before on blog forgot or how. lets have domain in class library. i'd data annotate properties of domain viewmodel in web project. how accomplish this? for example. domain in class library: public class person { public int id {get; set;} public string firstname {get; set;} } in web project, there this: //do need set attribute here? public class createpersonviewmodel{ [required()] [displayname("first name")] public string firstname {get; set;} } this code can mapped person without tool. partial or something. the whole idea of using view model decouple domain model , have adapted needs of view. view model should declared in web project , contain necessary properties , formatting attributes particular view might require. domain model shouldn't polluted view specific data annotations. if model looks this: public class person { public int id { get; set; } public string firstname { get; set; } }

c++ - Array of Pointer and call-by-reference -

i have little problem few simple lines of code. following lines used call method: char** paras = new char*; inputlength = charutils::readparameterfromconsole(paras, paracount, stringbeginningindex); the method looks following: int charutils::readparameterfromconsole(char** &inputs, int &paracount, int &stringbeginningindex) { char input[buffer_string_length]; cin.getline(input, buffer_string_length); if(strlen(input) > 0) { bool stringbeginning = false; char* part = ""; string partstring = ""; for(int = 0; < paracount; i++) { if (i == 0) part = strtok(input, " "); else part = strtok(null, " "); inputs[i] = part; } } else { cout << "error! no input!" << endl; } cout << &inputs[0] << endl; cout << inputs[0] <<