Posts

Showing posts from August, 2010

git merge - Git Subtree Merging reports conflict when merging a simple upstream change -

i'm getting started learning subtree merging in git 1.8.2. have created simple example test change third party repo migrating main project. i'm following 6.7 git tools - subtree merging example. the 'sub' project included subdirectory in 'main' project. after make change 'sub' project, git reports conflict when try merge change 'main' project. test summary created repos projects 'main' , 'sub' (sub instead of rack) add remote named sub_remote main refers sub track sub_remote using sub_branch change , commit 1 line in file in 'sub' project pull changes sub on main/sub_branch merge main/sub_branch main/master. the merge fails conflict. merge confused version of changed line keep. <<<<<<< head main ======= main upstream change >>>>>>> sub_branch main.git sub sub.git tm complete test script #!/bin/sh # initialize empty repos in main sub rm -rf $i{,.g

haskell - Interpreting unsigned integers as signed while widening -

suppose i've got lot of values of type word8 , word16 , , word32 lying around. want widen them, interpreting signed , unsigned, can store them in [int64] . know can write following function, first argument specifies whether want interpret word8 signed or not: convert8 :: bool -> word8 -> int64 convert8 false = fromintegral convert8 true = fromintegral (fromintegral :: int8) this gives me result want: *main> convert8 false 128 128 *main> convert8 true 128 -128 the double fromintegral feels inelegant me, though. there nicer way "interpret word signed integer , stick in bigger int "? from recall, ghc stores integers 1 machine word. (in other words, 32-bit ghc stores integers 32 bits. 64-bit ghc stores them 64 bits.) if request 8-bit integer, stores 32 bits anyway, uses first 8 bits. because of this, i'm sure widening or narrowing using fromintegral no-op @ run-time; change type signature, no run-time cost. (converting unsigned si

Python - Capture exit status of command executed via SSH -

i need way capture exit status command run through ssh. exit status end within variable. cannot seem working though. command simple like: os.system("ssh -qt hostname 'sudo yum list updates --security > /tmp/yum_update_packagelist.txt';echo $?") anyone have idea? i've tried has either not worked @ all, or ended giving me exit status of ssh command, not underlying command. you want use ssh library paramiko (or spur , fabric , etc.… google/pypi/so-search "python ssh" see options , pick 1 best matches use case). there demos included paramiko want do. if insist on scripting command-line ssh tool, (a) want use subprocess instead of os.system (as os.system docs explicitly say), , (b) need bash-scripting (assuming remote side running bash) pass value (e.g., wrap in one-liner script prints exit status on stderr ). if want know why existing code doesn't work, let's take @ it: os.system("ssh -qt hostname 'sudo y

iphone - Why are my images not displayed -

i have class inherits uiviewcontroller lets call 'controller' outlet uicollectionview. class inherited uicollectioncell lets call 'a' , uiimage lets call 'b', has outlet of b i wrote following code in 'controller': - (uicollectionviewcell *)collectionview:(uicollectionview *)p_collectionview cellforitematindexpath:(nsindexpath *)p_indexpath { uicollectionviewcell* cell = [self getuicollectionviewcellfromcollectionview:p_collectionview atindexpath:p_indexpath]; if([cell iskindofclass:[imagecollectionviewcell class]] == yes) { //draw image inside view imagecollectionviewcell* imagecell = (imagecollectionviewcell*)cell; nsstring* imageurl = self.objecttoshow.imagesurl[p_indexpath.item]; uiimage* currentimage = [[uiimage alloc] initwithcontentsoffile:imageurl]; imagecell.imageview.image = currentimage; } return cell; } everything initialized correctly images not displayed, have no clu

python - Issue with Purchase Requisition Module - OpenErp -

i got error when click on "confirm requisition" button in module "purchase requisition" file "c:\program files\openerp 7.0-20130321-002353\server\server\openerp\addons\purchase_requisition\purchase_requisition.py", line 215, in wkf_confirm_order attributeerror: 'purchase.order' object has no attribute 'signal_purchase_cancel' the error code in 'purchase_requisition.py' follows: class purchase_order(osv.osv): _inherit = "purchase.order" _columns = { 'requisition_id' : fields.many2one('purchase.requisition','purchase requisition') } def wkf_confirm_order(self, cr, uid, ids, context=none ): res = super(purchase_order, self).wkf_confirm_order(cr, uid, ids, context=context) proc_obj = self.pool.get('procurement.order') po in self.browse(cr, uid, ids, context=context): if po.requisition_id , (po.requisition_id.exclusive=='exclusive'): order i

java - JOptionPane Multidimensional Array output -

ok have multidimensional array want display in joptionpane.showmessagedialog . know when using system.out.println , use loop. array size determined user input, therefore have use incrementor. for example: userinput[k] next usernumber[k] next row userinput[k+1] next usernumber[k+1] the trouble having using loop, each set 1 @ time in separate windows , not in table in 1 window. for (int k = 0; k < userinput.length; k++){ joptionpane.showmessagedialog(null, userinput[k]); } (int k = 0; k < 2; k++){ joptionpane.showmessagedialog(null, usernumber[k]); } build output single string . you can use html tags provide additional formatting stringbuilder sb = new stringbuilder(64); sb.append("<html><table>"); (int ui = 0; ui = < userinput.length; ui++) { sb.append("<tr><td>"); sb.append(userinput[ui]); sb.append("</td>"); (int k = 0; k < 2; k++){ sb.append("<td

c++ - Why isn't a vector of a vector guaranteed to be contiguous? (or is it?) -

i know std::vector elements guaranteed contiguous in memory. so why can't expect vector containing other vectors have total collection contiguous? the vector supposed guarantee contiguous memory layout enclosed items, , if enclosures vectors, i'd expect full contents of top-most vector in contiguous memory. but there seems contention on issue whether or not true. can 1 safely rely on or not? folks seem go out of way achieve this, while i'd think guaranteed. each of vector inside vector of vectors individual object, , such responsible it's storage. so, no, no means guaranteed contiguous, in fact can 't see situation happen data stored in outer vector , it's inner vectors 1 contiguous block of memory ever.

java - Cannot refer to non variable inside Action listener (Jframe) -

the following program's goal ask user input resistor value, of program output corresponding colors each digit. not include digits. however, program done, i've made attempt incorporate jframe thing, except hung on how print corresponding colors in action listener. this line calls specific methods, 3 digits proceeds print colors, except how incorporate , rest of code jframe, , or actionlistener. line system.out.println(array3[i]);/ i receive errors when trying print color values in action listener "cannot refer non-final variable".... i have tried viewing various tutorials online, , java api , guidelines, none of help. in general seem unaware of how incorporate code written jframe, whether it's tedious process, willing corporate , grateful insight on how tackle predicament. import java.io.*; import javax.swing.*; //import javax.swing.jframe; //import javax.swing.jlabel; //import javax.swing.jbutton; //import javax.swing.jpanel; //import javax.swing.jtex

Get date value in Pacific Standard Time for Ruby? -

we today's date in pacific standard time in ruby using date class (because use mongo , mongo can't handle time class). how can this? essentially, want guarantee today = date.to_mongo date.today returns today's date in pst. we're on rails 3.12 , using mongomapper. thanks. this little low-level (in manipulate offset, rather declare 'pst' somewhere), might trick: d = datetime.now.new_offset('-08:00').to_date not sure if have daylight-saving time, make things more complicated? you could put snippet date.today , over-ride machine settings, i'd recommend more specific like class date def self.today_pst datetime.now.new_offset('-08:00').to_date end end today = date.to_mongo date.today_pst also, warning, if convert time or datetime, zone not preserved.

python - Pyserial not running correctly? -

i'm trying use pyserial running issues. code in larger code follows import serial ser = serial.serial('/dev/ttyama0', 300) ser.write(string) ser.close() but running script not getting past ser = serial.serial('/dev/ttyama0', 300) thanks all

foreach - C# mutilple forms open instead of one -

what did was, created number of instances of different people , added each person list called listofpeople , have each person's named in listbox. created new form print out details of person select listbox, when select 1 person, of details open in multiple forms. example if have bill & jill in listofpeople , view details bill, 2 forms open up, 1 showing details bill , other jill. how can fix 1 form opens? //this create instance open details form person private void detailsbutton_click(object sender, eventargs e) { if (peoplelistbox.selecteditem == null) { messagebox.show("no person selected!"); } else { foreach (person person in listofpeople) { persondetails persondetails = new persondetails(person); persondetails.show(); } } } public partial class persondetails : form { //this constructor takes in paramet

javascript - jQuery if condition for two element mouseleave -

hereis code , online jsfiddle : <div class="blocka"></div> <div class="blockb"></div> $(".blocka").mouseenter(function(){ $(".blockb").show(); }); $(".blocka").mouseleave(function(){ $(".blockb").hide(); }); my question is possible have if $(".blocka") or $(".blockb") mouseleave hide $(".blockb") i tried following doesn't work : $(".blocka" || ".blockb" ).mouseleave(function(){ $(".blockb").hide(); }); you can multiple selections using comma , : $(".blocka, .blockb").mouseenter(function(){ $(".blockb").show(); }); $(".blocka, .blockb").mouseleave(function(){ $(".blockb").hide(); }); updated fiddle: http://jsfiddle.net/jauny/3/

Java Swing application - How can the controller access the UI? -

i'm create desktop application. decided in swing. confused architecture i'm going use. decided like. ui-controller-service-dao i'm confused in relationship between controller , ui. understand controller operations ui needs controller handles events of ui, such when button click. cases when button clicked disable ui, means controller needs acces ui disabling. how can provide access ui controller? the controller have link respective view , model. button click not have go through controller since responsibility of ui handle event. on other hand if opening internal frame , there multiple panels, these should displayed going through controller. , if 1 panel wants change value of panel, should go through respective controller view belongs , not interact directly view.

In fortran, in what scope should I place 'use [module]' statements for the best performance? -

say have subprogram in fortran program/module uses module. performance of subprogram better if place 'use' statement within subprogram or @ program/module scope? if, "performance", mean execution speed, no. positioning of statement make no difference.

c++ - Depth Buffer in Direct3D isn't working -

i can't seem depth buffer working. i've been following rastertek tutorials, models rendered after other models appear closer me, though they're farther away. this have far: depth buffer: zeromemory(&depthbufferdesc, sizeof(depthbufferdesc)); depthbufferdesc.width = screenwidth; depthbufferdesc.height= screenheight; depthbufferdesc.miplevels = 1; depthbufferdesc.arraysize = 1; depthbufferdesc.format = dxgi_format_d24_unorm_s8_uint; depthbufferdesc.sampledesc.count = 1; depthbufferdesc.sampledesc.quality = 0; depthbufferdesc.usage = d3d10_usage_default; depthbufferdesc.bindflags = d3d10_bind_depth_stencil; depthbufferdesc.cpuaccessflags = null; depthbufferdesc.miscflags = null; result = m_device->createtexture2d(&depthbufferdesc, null, &m_depthstencilbuffer); if(failed(result)) { throw "could not create 2d texture"; } depth stencil: zeromemory(&depthstencildesc, sizeof(depthstencildesc)); depthstencildesc.depthenable = true; d

Knockout.js Binding to dropdownlist -

trying bind data dropdown list, function emailtemplate(data) { var self = this; self.etid = ko.observable(data.email_template_id); self.ettypeid = ko.observable(data.email_template_type_id); self.ettitle = ko.observable(data.email_template_title); self.etcontent = ko.observable(data.email_template_content); self.etappyear = ko.observable(data.app_year); self.etsubject = ko.observable(data.subject); self.etactive = ko.observable(data.active); } function emailtemplateviewmodel() { var self = this; self.etlist = ko.observablearray(); var uri = '/admin/services/emailtemplateservice.svc/emailtemplates'; odata.read(uri, function (data, response) { $.each(data.results, function (index, item) { self.etlist.push(new emailtemplate(item)); }); }); } $(document).ready(function () { ko.applybindings(new emailtempl

apache - Too many redirects with Virtual Host and htaccess -

the issue im getting many redirects. i have wamp server hosts few sites, have particular site 5 domains. want them point correct website folder , redirected single domain seo purposes. here looks in virtual hosts file: <virtualhost 50.62.82.101> serveradmin info@hovaness.com documentroot "c:/wamp/www/example" servername example.com serveralias example.net www.example.com www.examples.net www.examples.com examples.com examples.net errorlog "logs/example.com.log" htaccess file looks like: rewriteengine on rewriterule ^(.*)$ http://sellingwarriors.com/$1 [r=301,l] rewritebase / am supposed have 1 or other? have tried in htaccess file: rewriteengine on rewritecond %{http_host} ^(.*?).example(s?).(.*)$ [nc] rewriterule ^(.*)$ http://example.com/$1 [r=301,l] rewritebase / any appreciated you need check hostname redirecting to, otherwise continue redirect: rewriteengine on rewritecond %{http_host} !^example\.com$ [nc] rewriterule ^(.*)

How do I avoid using the dead letter queue using Camel -

i have in/out producer in camel hangs around limited time before getting caller. times naturally results in dead letter item , exception being caught caller when response late. what have caller receive timeout message instead of exception , item never end in dlq. naturally put listener on dlq item has home go shouldn't ever dlq. does have pattern this? how done? there redundant consumer patterns (see camel in action link ) kind of combined producer/consumer problem generated in/out pattern. sounds using dead letter channel error handler, try using noerrorhandler - http://camel.apache.org/error-handler

android - Appcelerator Titanium performance -

last used appcelerators platform in 2010, saw poor performance generating simple table. has had opportunity try out in last few month? how overall speed of apps developed platform? we're developing both ios , android using titanium. ios ios apps fast. won't notice titanium used unless need provide concurrency. if want add rows table view pull-to-refresh or while scrolling slow because can't manage when use ui-thread , when not. handled titanium. nevertheless our application uses features , - , our (business) customers - happy that. android android slower. depends on device , you're going implement. instance again table view many different (in structure) rows can slow while table view thousands of similar rows loaded fast , can scrolled fast (see class attribute table view rows, it's caching). on newer devices (originally shipped android 4.x) performance native development (except special cases on ios). older devices slower. slow on android filli

deployment - Error on deploying a SharePoint 2010 site template -

i have web application in have few document libraries, lists, picture libraries, workflows , few webparts. webparts created using visual studio feature site scoped. workflows created using spd. everyting working fine in local sharepoint server. want copy web application different server. saved site template site actions-> save site template , saved wsp desktop. took wsp other server machine created webapplication . then using powershell command added solution using add-spsolution command. when trying install using install-spsolution command i got error: this solution contains no resources scoped web application , cannot deployed particular web application i tried change scope of webpart feature web/webapplication encountered error when tried deployed using visual studio. how can deploy wsp in different sharepoint server machine? when save site template, you'll save site, not web application. create web application first (maybe without site template), ,

ios - save logs in UIAutomation Tests in text file -

i want save logs created in text file. when run script automation, .plist created in specified folder of logging tab in instruments. how can make conversion or there other way save log messages? on subject, helpful launch instruments command line , you'll logs in text plain. can use uialogger class add own messages.

monodevelop - Xamarin Studio and Mono debug issue with WebPageHttpModule -

there's lot new xamarin studio every time run web project run system.security.securityexception - no access given key. if continue execution , refresh page in safari site works. it's first time site loads. it stops here in disassembler: 0000001d call void system.web.webpages.webpagehttphandler:registerextension (string) 00000022 ldc.i4.0 00000023 call void system.web.ui.pageparser:set_enablelongstringsasresources (boolean) >00000028 ldtoken system.web.webpages.webpagehttpmodule 0000002d call type system.type:gettypefromhandle (runtimetypehandle) 00000032 call void microsoft.web.infrastructure.dynamicmodulehelper.dynamicmoduleutility:registermodule (type) 00000037 newobj void system.web.webpages.scope.aspnetrequestscopestorageprovider:.ctor () 0000003c call void system.web.webpages.scope.scopestorage:set_currentprovider (iscopestorageprovider) 00000041 ret it appears race condition. launching website before it's done compiling? to test a

Strange behavior array in object JavaScript -

why b.first[0] return "t" , how can avoid this? i need safe "q" in b.first[0] var extend = function(o,p){ for(prop in p){ o[prop] = p[prop]; } return o; }; var = {first:['q','w']}; var b = {}; extend(b,a); document.write(a.first[0]); //q document.write(b.first[0]); //q a.first[0] = 't'; document.write(a.first[0]); // t document.write(b.first[0]); // t ????????????????????? this issue relating concept extending b doesn't recreate data a. if of data object (like array), instead "points" array instead of creating new, identical array. you're storing 2 pointers same array, when change one, change other. here answer discusses idea of "cloning" object in javascript in more detail. https://stackoverflow.com/a/728694/1570248

c++ - error_code vs errno -

i studying c++11 standards. wanted understand if error_code , errno related each other? if yes how? if no in conditions should expect errno set , in conditions error_code set? i did small test program understand still little confused. please help. #include <iostream> #include <system_error> #include <thread> #include <cstring> #include <cerrno> #include <cstdio> using namespace std; int main() { try { thread().detach(); } catch (const system_error & e) { cout<<"error code value - "<<e.code().value()<<" ; meaning - "<<e.what()<<endl; cout<<"error no. - "<<errno<<" ; meaning - "<<strerror(errno)<<endl; } } output - error code value - 22 ; meaning - invalid argument error no. - 0 ; meaning - success errno used functions document side effect of encountering error - functions c library or os f

web view content flickering in android? -

Image
i'm using this lib horizontal swipe. check below code swipe functionality works fine when i'm going direct slide doesn't show content on web view. shown below pic more detail:- after above pic when ever i'm swipe works nice when want going directly next slide facing content disappear problem shown below :- and shows below code pagecontrol mpagecontrol = (pagecontrol) findviewbyid(r.id.page_control); mswipeview = (swipeview) findviewbyid(r.id.swipe_view); mswipeview.setpagecontrol(mpagecontrol); (int = 0; < 10; i++) { mswipeview.addview(new framelayout(this)); } (int = 0; < 10; i++) { ((framelayout) mswipeview.getchildcontainer().getchildat(i)) .addview(setupview()); count++; } setupview() public view setupview() { layoutinflater layoutinflator = getlayoutinflater(); linearlayout childlayout = (linearlayout) layoutinflator.inflate( r.layout.webview, swi

php - Fetching mail from pop3 server and leaving copy in the mail server -

This summary is not available. Please click here to view the post.

I allow only one hyphen (-) in regex -

i have text box last name of user. how allow 1 hyphen (-) in regular expression? ^([a-z a-z]*-){1}[a-z a-z]*$ your regular expression allow 1 - . assume want mach "smith", "smith-kennedy", not "smith-", must move hyphen second group: ^[a-z a-z]+(-[a-z a-z]+)?$ btw, in cases when * used + better solution.

c++ - Bison and doesn't name a type error -

i have following files: cp.h #ifndef cp_h_ #define cp_h_ class cp { public: enum cardinalite {vide = '\0', ptint = '?', ast = '*', plus = '+'}; cp(cardinalite mycard); virtual ~cp(); private: cardinalite card; }; #endif /* cp_h_ */ and dtd.y %{ using namespace std; #include <cstring> #include <cstdio> #include <cstdlib> #include "analyseurdtd/dtddocument.h" #include "analyseurdtd/cp.h" void yyerror(char *msg); int yywrap(void); int yylex(void); dtddocument * doc = new dtddocument(); %} %union { char *s; dtdelement * dtdelt; cp *cpt; cp::cardinalite card; } and following strange error: analyseurdtd/dtd.y:20:2: error: ‘cp’ not name type analyseurdtd/dtd.y:21:2: error: ‘cp’ not name type the stange thing if put cp *cpt; after dtddocument * doc = new dtddocument(); have no error :/ include header in scanner file before incl

python - How can I add a tag to a key in boto (Amazon S3)? -

i trying tag key i've uploaded s3. in same below create file string. once have key, i'm not sure how tag file. i've tried tag tagset. from boto.s3.bucket import bucket boto.s3.key import key boto.s3.tagging import tag, tagset k = key(bucket) k.key = 'foobar/somefilename' k.set_contents_from_string('some data in file') tag(k, 'the_tag') as far can see in docs, settags-method available on bucket level , not on individual keys. therefore cannot set different tags uploaded file, have on containing bucket.

java - Best way for multilayered 2D Graphics on JFrame with partial repaint? -

basicly, want make game of chess. the idea have picture of chessboard , individual chess pieces. work jpanel repaint everytime new positions of chess pieces, require positions of chess pieces , repaint board 33 pictures, double buffering , all. a bit resource consuming think. afaik, there option repaint area, guess there're still better ways. imagine is, moving or removing 1 or 2 pictures or rather chess pieces each time rather repainting something. i sadly have limited knowledge of classes out there , ask if there such way or entirely different one, job more efficient painting/repainting. instead of inventing wheel again, use game engine sprite support jgame rendering. also note today, resource consumption render chess small spending minute optimize minute wasted. should aim framework takes least time implement rendering of game don't have spend time on part of game. if feel game engine overkill, how using table custom cell renderer draws each cell? tab

objective c - retrieve xml file using nsxmlparser in ios -

i getting problem while reading xml files through nsxmlparser in ios, <products> <productslist> <productdetails> <headertext> test header </headertext> <description><b style="font-size: x-small;">product, advantages</b></description> </productdetails> </productslist> </products> while read file using nsxmlparser able value(test header) headertext description attribute value contains html tags cant able result (<b style="font-size: x-small;">product, advantages</b>) i getting result empty how can result as( (<b style="font-size: x-small;">product, advantages</b>) ) description attribute? speaking developers perspective not recommend using nsxmlparser due it's laborious way parse xml files. there great write choosing right xml parser . i use kissxml quite often. can find quit tuto

mongodb - Mongo ShardTag Range with Regex -

i running shard 3 replica, each replica has 3 servers. shard-1 shard-2 shard-3 i need regarding shardtags, shard key domain now want add tagrange this. domains names start (^a ^f) should go on shard-1 , domain start (^f ^m) should go shard-2 , domain name start (^n ^z) go shard-3. is possible? br. umar

xslt - Grouping divs in rows (clarification needed) -

i realize @ programming , answers dependable. is possible assist me in resolving issue having xslt code? i'm new progamming appreciate assistance can get. your solution in grouping 3 divs in row found @ link below, not know how apply code. using sitecore , have div block corresponds each page generated produce metro-like blocks, 3 in row. far generates desired divs not put them 3 in row. code found below. xslt how can wrap each 3 elements div? i appreciate can get. <?xml version="1.0" encoding="utf-8"?> <!--============================================================= file: servicesfeatureblocks.xslt created by: sitecore\admin created: 3/27/2013 11:50:57 copyright notice @ bottom of file ==============================================================--> <xsl:stylesheet version="

asp.net - IIS redirects admin to login page -

this in web config file in admin folder <configuration> <system.web> <authorization> <allow roles="admin"/> <deny users="*"/> </authorization> </system.web> </configuration> it worked while on development after deploying on iis server redirects me login after log in admin , try go admin folder pages. how fix it? note : worked before deploying iis. solved problem! use applicationname in providers. for more info on iis troubleshooting go here

Selecting Item inside Child Arrays Javascript -

i produce array , want grab first item in each of child arrays: arrayname = [[item1,item2,item3,item4],[item1,item2,item3,item4],[item1,item2,item3,item4]]; i'm trying in loop: var num = arrayname.length; (i=0; < num; i++) { var title1 = arrayname[i][0]; } but on alert: alert(title1); = [ [ [ i need: alert(title1); = item1 item1 item1 i've tried using .nodevalue, .firstchild, etc still not finding answer. what's right way? var num = arrayname.length; var title1 = new array(); (i=0; < num; i++) { title1.push(arrayname[i][0]); } console.log(title1); better?

Pass PHP session variable into HTML form -

i have session variables posted form on php page, , can echo them using: <?php $_session['newslettersignup'] = $_post['newslettersignup']; echo "email = ". $_session['newslettersignup']; ?> but can't seem insert these html form field: <input type="text" name="email" id="email" size="36" "value="<?php echo $_session['newslettersignup'];?>" class="text-input" onblur="emailval()" /> this should work...the quote before value screwing up <input type="text" name="email" id="email" size="36" value="<?php echo $_session['newslettersignup'];?>" class="text-input" onblur="emailval()" />

webbrowser using ie10 c# winform -

i want force webbrowser use ie10 in c# winform application. know there other questions i've read lot of them , don't know i'm wrong. this code: registrykey registrybrowser = registry.localmachine.opensubkey (@"software\microsoft\internet explorer\main\featurecontrol\feature_browser_emulation", true); registrybrowser.setvalue("myappname", 0x02710, registryvaluekind.dword); //even qword i've tried different ways set value like: registrybrowser.setvalue("myappname", 1000, registryvaluekind.dword); //even qword , string registrybrowser.setvalue("myappname", 1000); //even 0x02710 i write in costructor of main project before initializecomponent(). i've got admin permission set in .manifest file thanks all, blackshawarna edit: discovered registrykey.setvalue(...); created key in path: (@"software\wow6432node\microsoft\internet explorer\main\featurecontrol\feature_browser_emulation")

How can I change the format of this dates in R -

i have dates in r: > head(mydates) [1] "2007-01-01" "2007-01-02" "2007-01-03" "2007-01-04" "2007-01-05" "2007-01-08" > class(mydates) [1] "date" and want change format > head(targetdates) [1] "2007-01-01 gmt" "2007-01-02 gmt" "2007-01-03 gmt" "2007-01-04 gmt" [5] "2007-01-05 gmt" "2007-01-08 gmt" > class(targetdates) [1] "posixct" "posixt" how can (in r)? thanks you can use as.posixct mydates ## [1] "2007-01-01" "2007-01-02" "2007-01-03" "2007-01-04" "2007-01-05" "2007-01-08" class(mydates) ## [1] "date" sys.setenv(tz = "gmt") #necessary of want dates printed in gmt as.posixct(mydates) ## [1] "2007-01-01 gmt" "2007-01-02 gmt" "2007-01-03 gmt" "2007-01-04 gmt" "2007-01-05 gm

ruby on rails - How to get Properties of Video -

does know how properties of video on ruby on rails (methods or gem) ? eg : image properties (width, height, dimension.. etc). thanks for video analysis prefer ffmpeg @ most. did not use in rails projects can find gem streamio-ffmpeg gem , looks promising.

c# - Application taskbar icon set wrong when in a specific path - where is this set? -

Image
i'm working on application (c#/wpf) , when installed in program files folder , run icon on taskbar shows wrongly this; but if rename or copy folder correct icon appears when run. seems icon set file in path. i've had through registry no luck , cleared icon cache. any ideas? that symptom of icon being cached , cache not being refreshed. restart fixes problem.

jQuery value slider with image -

does knows solution (or maybe plugin) create slider on picture below(with jquery, jquery ui, other lib)? image value slider img so idea slide background image, not 1 little indicator. update i'm trying connect ui slider draggable property, not luck. can play here: jsbin edit: can make image. place inside div make overflow hidden. make draggable. when image dragged, call slider function of slider. way slider.

c# - Calling EventHandlers for static method -

i have 1 class has 2 static methods a() , b(). here a() methods needs subscribe events like: push.events.ondevicesubscriptionexpired += new pushsharp.common.channelevents.devicesubscriptionexpired(events_ondevicesubscriptionexpired); push.events.ondevicesubscriptionidchanged += new pushsharp.common.channelevents.devicesubscriptionidchanged(events_ondevicesubscriptionidchanged); i kept them in constructor of class not working static methods when controls pass static method dont pass through constructor. here want 2 things : how set eventhandler in class saved static methods? how subscribe , unsubscribe them can't overlap? you can try doing want in static constructor. public class myclass { static myclass() { // todo : attach static event handlers here } } please note can use static properties, fields, events, etc in here. if object singleton, there other implications , should read jon skeet's article on singleton implementation in

asp.net mvc - Logging SQL statements of Entity Framework 5 for database-first aproach -

i'm trying use entity framework tracing provider log sql staments generated. i changed context class this: public partial class mydbcontext: dbcontext { public mydbcontext(string nameorconnectionstring) : base(eftracingproviderutils.createtracedentityconnection(nameorconnectionstring), true) { // enable sql tracing ((iobjectcontextadapter) this).objectcontext.enabletracing(); } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { throw new unintentionalcodefirstexception(); } //dbsets definition.... } but doesn't log sql statements on output window... should had more in class or in web.config file? (i'm working on asp.net mvc 4 project) i using solution in following post: entity framework 4.1 - eftracingprovider but made changes don't know if important: the class partial instead of abstract, , constructor public instead of protected... what missing? after modifying code, need enabl

ajax - jQuery DataTables: Filter per column -

i have datatables table, getting it's data trough ajax source. i've got table , running, searching works. now i've got request implement search fields every column. there seems datatables plugin column filtering, tried use. this html: <!doctype html> <html> <head> <title>testpage</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script> <script type="text/javascript" src="http://www.company.com/content/dam/workflows/js/jquery.datatables.min.js"></script> <script type="text/javascript" src="http://jquery-datatables-column-filter.googlecode.com/svn/trunk/media/js/jquery.datatables.columnfilter.js"></script> <script type="text/javascript"> $(document).ready(f

r - Joining and grouping two data tables -

suppose i've got following 2 data tables : dt1 <- data.table(id=1:3,val1=c("a","a","b"),key="id") # id val1 # 1: 1 # 2: 2 # 3: 3 b dt2 <- data.table(id=c(1:3,1:2),val2=10:14,key="id") # id val2 # 1: 1 10 # 2: 1 13 # 3: 2 11 # 4: 2 14 # 5: 3 12 let's dt1 list of people identified id , , dt2 list of observations on these same people, correspondent id . now, i'd compute mean of val2 each group of val1 . i've understood can following way : dt1[dt2][,mean(val2),by=val1] # val1 v1 # 1: 12 # 2: b 12 but i've read in faq (section 1.14) it's not efficient (at least large data tables). so, there better, more efficient way ? edit : related question : saw following 2 lines give same result : dt1[dt2][,mean(val2),by=val1] dt2[dt1][,mean(val2),by=val1] are equivalent or there difference between 2 ? in case, it's okay that. documentation ex

php - Conditional clauses using Codeigniter's Active Record -

i have function returning data based on parameters passed. basically, queries change depending on clauses. if(1==$case) return select()->from('db')->where('x',$something)->where('y','fixed')... else if(2==$case) return select()->from('db')->where('x','fixed')->where('y',$something)... is there better way of doing this? also, possible have such clause ...->where('category',*) '*' replaced value or equates "any". this type of queries called "dynamic queries" because can combine clauses in easy way. try this: $query = $this->db->select() ->from('db'); if(1==$case) { $query->where('x',$something) ->where('y','fixed') } elseif (2==$case){ $query->where('x','fixed') ->where('y',$something) } .... return $query->get(); answering sec

javascript - Strange behaviour in jQuery datePicker -

ok, strange , i'm quite amazed. wonder if knows if intended behaviour or bug. on asp.net mvc app use jquery client events. have several datepickers try override standard day color patterns on click events playing onselect attribute on datepicker object. basically, on onselect use ajax calls ask server days want show on determinate color , change them (usually after adding clicked day list of "marked" days). my code don't seem overriding default behaviour (when click on day days standard color , day clicked in highlighted), instead seems execute after (thus redrawing states , colors on datepicker desire). what i've found surprise me if use $.ajax call server, code executes before "default behaviour" showing standard color pattern, if use $.post code executes after "default behaviour" overriding standard color pattern. here's code example: $("#diasnolectivosholder").datepicker({ mindate: arraynolaborables[0],

date - old file still visible -

old, overwritten file on android still visible on pc. on archos 97 carbon have app writes file, debug.txt. that's visible , has right time-stamp on android. if access pc out-of-date , contains old data. if disconnect usb , reconnect, it's still out-of-date. physically deleted app on android. but if power-off , power-on android file seen on pc up-to-date , contains correct data. how can be? keeping copy of old data?

Email Footer Issue jira -

i able recive , send emails properly. email footer content displaying "template.footer.text" instead of text. please provide suggestions. what files need edit , location files. regards, tousif shaikh. i've never worked jira i'd speculate you're missing template file live here: atlassian-jira/web-inf/classes/templates/email/html/includes/ atlassian-jira/web-inf/classes/templates/email/text/includes/ you'll have better luck @ jira forums seems have been based on yours :) https://answers.atlassian.com/questions/

Unable to run cronjob using whenever in rails 3 -

i follow steps whenever reference https://github.com/javan/whenever in schedule.rb require 'yaml' set :environment, 'production' set :output, { :error => "/log/error.log", :standard => "/log/cron.log" } every 1.minute runner "user.weekly_update" end in gemfile gem 'whenever', :require => false output of command localhost:~/project$ whenever -i [write] crontab file updated localhost:~/project$ crontab -l # begin whenever generated tasks for: /home/bacancy/project/config/schedule.rb * * * * * /bin/bash -l -c 'cd /home/bacancy/project && script/rails runner -e production '\''user.weekly_update'\'' >> /log/cron.log 2>> /log/error.log' # end whenever generated tasks for: /home/bacancy/project/config/schedule.rb # begin whenever generated tasks for: store * * * * * /bin/bash -l -c 'cd /home/bacancy/project && script/rails

php - how to get a specific array in codeigniter's active record -

for example if have bunch of data stored in active record so model function get_cdj($id){ return $this->db->select()->from("news_dj")->where("news_id",$id)->get(); } controller public function news_edit($id) { $data['cdj'] = $this->newscms_model->get_cdj($id); $data['id'] = $id; $this->load->vars($data); $this->load->view('admin/news_edit'); } and variable want print is... $cdj->id and want third variable inside it is there way make similar - $data[3] ? is there way control row want print using codeigniter's active record? just php's native <?php echo $data['insert row number want here']; ?> ie: $data[3] thanks you can this model function get_cdj($id) { $this->db->select('*'); $this->db->where("news_id",$id); return $this->db->get("news_dj")->row();