Posts

Showing posts from February, 2011

linux - java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit -

i'm working on xubuntu 13.04 , developing swing applications. wanted try application ran java.lang.noclassdeffounderror: not initialize class java.awt.toolkit on startup. i've found several questions server/client vms , noticed have server vm , linux 64 there no client vm anymore. nevertheless imho problem shouldn't depend on vm i'm running on. has else noticed problem , has solved it? doing wrong? 64bit jdk works fine, when try use 32bit jdk startup fails. thanks in advance! p.s.: java version 1.7.0_25 , same 1.7.0_09 edit when using headless mode, following exceptions occur: java.lang.reflect.invocationtargetexception @ java.awt.eventqueue.invokeandwait(eventqueue.java:1272) @ java.awt.eventqueue.invokeandwait(eventqueue.java:1247) @ javax.swing.swingutilities.invokeandwait(swingutilities.java:1349) @ main.main(main.java:218) caused by: java.awt.headlessexception @ java.awt.graphicsenvironment.checkheadless(graphicsenvironment.j...

c# - Control.PointToScreen on Windows Phone -

is there way control's absolute screen co-ordinates on windows phone? also, if method work usercontrol components. wpf seems have control.pointtoscreen, isb't in wp apis the idea i'm trying use callout control point usercontrol on screen bubble, , anchor point doesn't take in absolute coordinates either - it's huge connected problem i'll build answer post. use uielement.transformtovisual() something should trick: var control = this; // assign control want position of. var transform = control.transformtovisual(application.current.rootvisual); var controlposition = transform.transform(new point(0, 0));

map - How to get Latitude and longitude from typed address by a user in Ios 6 -

i new in ios. , learning mapkit , corelocation. have 2 view controllers in program , in first view controller there text field there user can type address. , button. after fill address if user tap on button redirect second view controller map view controller. there 2 annotation. 1 user's current location , user's typed address. can please tell me how lat, long user's typed address , show annotation on map view lat long. thanks in advance. here code #import <mapkit/mapkit.h> #import <corelocation/corelocation.h> +(cllocationcoordinate2d) getlocationfromaddressstring:(nsstring*) addressstr { double latitude = 0, longitude = 0; nsstring *esc_addr = [addressstr stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; nsstring *req = [nsstring stringwithformat:@"http://maps.google.com/maps/api/geocode/json?sensor=false&address=%@", esc_addr]; nsstring *result = [nsstring stringwithcontentsofurl:[nsurl urlwith...

c# - Uploading images with asp.net generic handler -

i trying upload multiple files using following code. html & jquery <%@ page language="c#" autoeventwireup="true" codebehind="webform1.aspx.cs" inherits="fileupload.webform1" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="scripts/jquery-1.8.2.min.js"></script> <script src="scripts/jquery-ui-1.8.24.min.js"></script> <link href="content/themes/base/jquery.ui.all.css" rel="stylesheet" /> </head> <body> <form id="form1" runat="server"> <asp:fileupload id="fileupload1" runat="server" allowmultiple="true" /> <br /> <br /> <asp:button id="button1" runat="server" text="upload selected fil...

c++ - find files in whole hard disk -

this question has answer here: enumerating available drive letters in windows 5 answers i have program searches files of particular extension in specific drive (i using windows), let it's "c:\" , print these files on console. want generalize program. want program search in partitions (drives) .. how can this.. function should use..here code sample int searchdirectory(std::vector<std::string> &refvecfiles, const std::string &refcstrrootdirectory, const std::string &refcstrextension, bool bsearchsubdirectories = true) { std::string strfilepath; // filepath std::string strpattern; // pattern std::string strextension; // extension handle hfile; // handle file win32_find_dat...

Wix Burn Prerequisite Step - Windows Installer 4.5 Download details (RemotePayload element) -

where, oh where, find full url, certificatepublickey & certificatethumbprint , sha-1 hash values various windows installer 4.5 redistributables (i.e. windowsxp-kb942288-v3-x86.exe, windowsserver2003-kb942288-v4-x86.exe, windowsserver2003-kb942288-v4-x64.exe, windows6.0-kb942288-v2-x86.msu, etc.)? i need these details wix burn "remotepayload" element in order perform silent prerequisites-step download , install of windows installer 4.5 when missing target systems. example given in https://stackoverflow.com/a/11308837/2430722 , posted in answer different question: <exepackage id="winxp_x86" cache="no" compressed="no" permachine="yes" permanent="yes" vital="yes" name="redist\windowsxp-kb942288-v3-x86.exe" downloadurl="http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/windowsxp-kb942288-v3-x...

php - CakePHP - How to change default plugin router config -

i new in cakephp. have added plugin in cake app, , name "admin". it's working fine, when use "localhost/admin/..." access it. question is, want hide /admin users, instance, want use "localhost/console/..." replace default route config. googled lot, never got answer. how change default route config of plugin in cakephp? thanks. if want applicable plugin controllers/actions, need little more verbose. try: router::connect('/console/:controller/:action/*', array('plugin'=>'admin')); but if that's want, you're better off renaming "admin" plugin "console". re-routing plugin controllers , actions make debugging not fun. :)

Rails - Why is OR not working here? -

i want loop through params , exclude params, used loop: params.each |key, value| html += "#{key}: #{value}</br>" if key !='authenticity_token' && key != 'utf8' end now, works && when tried replace || : html += "#{key}: #{value}</br>" if key !='authenticity_token' || key != 'utf8' it didn't work. makes more sense work or because loops through each key, value pair , if key a_token or key, should skip it. there can't both on same line. think don't quite understand how rails processes loops here , why && condition works, please explain me? thanks. key !='authenticity_token' && key != 'utf8' this return true when key neither authenticity_token nor utf8 whereas key !='authenticity_token' || key != 'utf8' this return true every key including authenticity_token , utf8 because for utf8 key key !='authenticity_token...

c# - Reference c++ unmanaged libraries in WCF service -

i have strange problem referencing c++ (unmanaged) libraries in wcf service. here there code using system; using system.collections.generic; using system.data; using system.linq; using system.text; using varspace.elaboration.operations.managedwrapper; //unmanaged c++ namespace using customilexception; namespace ilcommonlibrary.core { /// <summary> /// singleton class obtain unique-per thread instance of wpc core client. /// </summary> public class wpccoreclient { private static readonly object objlock = new object(); private readonly client managedwrapperclient= null; //class coming c++ private static volatile wpccoreclient theinstance; private wpccoreclient() { managedwrapperclient= new varspace.elaboration.operations.managedwrapper.client(); } /// <summary> /// <exception cref="customilexception.coreexception">core internal error.</exception> /// </summary> /// <returns>...

request - Zend 2.x, setValue from url -

i want setvalue in form class depending on get request. set value in form sth : class bookingform extends form { $this->add(array( 'name' => 'end', 'type' => 'text', 'options' => array( 'label' => 'date to', ), 'attributes' => array( 'value' => '2013-09-18 15:45', ), )); } but it's hard coded , want avoid this, there method $this->getrequest()->get('var extracted url') ?? i founded solution in : class bookingcontroller extends abstractactioncontroller { ... $get = $request->getquery('start'); $get = str_replace('_', ' ', $get); $form->get('start')->setvalue($get); ... } and that's all.

linux - where is the mmc write command data source from? -

i new boot loader world, have question when send write command how assign data source , relate function argument *src ? traced source code can't find assign data source in c code. answer myself: found when #mmc write 1 0x4 2 argument means dev # 1, block # 4, count 2 below function's argument mmc->block_dev.block_write( curr_device, blk, cnt, addr ); but, still want know, is possible assign external data source directly? is mmc write or mmc read write/read internal memory? is possible assign external data source, such usb port or sd card? best & regard. static unsigned long mmc_bwrite(int dev_num, unsigned long start, lbaint_t blkcnt, const void *src){ int err; struct mmc *mmc = find_mmc_device(dev_num); if (!mmc) { printf("mmc device %d not found\n", dev_num); return 0; } if (blkcnt > 1) return mmc_bwrite_multi(mmc, start, blkcnt, src); else if (blkcnt == 1) return mmc_bwrite_single(mmc, start, src); return 0; } ...

json - Spring MVC with Jackson 2.2: "HttpMediaTypeNotAcceptableException: Could not find acceptable representation" -

so i'm struggling beans encoded in json... first tried codehaus' jackson 1.9.13 , spring mvc 3.1.1. had issues until managed "direct self-reference" exception. looking found needed fasterxml's jackson 2. found ( here ) need spring 3.1.2 because prior versions aren't supporting jackson 2. so, after this... i'm still getting same exception. maven dependencies indeed including spring mvc 3.1.2 release jackson's 2 jars (and in build path) <!-- jackson json --> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-databind</artifactid> <version>2.2.2</version> </dependency> <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>jackson-annotations</artifactid> <version>2.2.2</version> </dependency> <dependency> <groupid>c...

multithreading - Multiple client and a server communication -

i novice client server programming, how understood things , trying communicate between client , server. code buggy not dislaying entire string, can 1 tell me how send entire string(which has spaces) server client. output: rhu>> confgiure cm port (this entire string) server reply=configure rhu>> server reply=cm rhu>> server reply=port the above entire thing output 1 string configure cm port and 1 more things there way catch these arguments in argv[] above case. here server code. //create socket socket_desc = socket(af_inet , sock_stream , 0); if (socket_desc == -1) { printf("could not create socket"); } puts("socket created"); //prepare sockaddr_in structure server.sin_family = af_inet; server.sin_addr.s_addr = inaddr_any; server.sin_port = htons( 8888 ); //bind if( bind(socket_desc,(struct sockaddr *)&server , sizeof(server)) < 0) { //print error message perror("bind failed. error"); return...

http - Play framework WS set cookie -

how can set cookie in ws request? val request = ws.url("http://testurl.com/test.pdf") is possible? i'm using play version 2.1.1 ws.url(theurl).withheaders("cookie" -> "cookiename=cookieval; name2=val2")

oracle - SQL UPDATE using BASH loop -

we changed usernames in our application there history etc. in database needs updated. there file update_users.list has old username , new username separated space, 2 user names per line. would below script correct, or there noticeable issues it? #!/bin/bash cat update_users.list | while read old_user new_user sqlplus -s $user/$pass@$db > user_output.log <<eof update auf_kopf set kopf_sach = '%${new_user}%' kopf_sach = '%${old_user}%'; update auf_prot set sach_bearb = '%${new_user}%' sach_bearb = '%${old_user}%'; update auf_prot_hint set sach_bearb = '%${new_user}%' sach_bearb = '%${old_user}%'; update ordhist set user_code = '%${new_user}%' user_code = '%${old_user}%'; update liefer_daten set sach_bearb = '%${new_user}%' sach_bearb = '%${old_user}%'; update shipment_head set shipment_sach = '%${new_user}%' shipment_sach = '%${old_user}%'; update lager_bew set lb_sachbearb ...

decorator - Can I pass an exception as an argument to a function in python? -

i new python. trying create retry decorator that, when applied function, keep retrying until criteria met (for simplicity, retry 10 times). def retry(): def wrapper(func): in range(0,10): try: func() break except: continue return wrapper now retry on exception. how can change such retries on specific exceptions. e.g, want use like: @retry(valueerror, abcerror) def myfunc(): //do i want myfunc retried of throws valueerror or abcerror . you can supply tuple of exceptions except .. block catch: from functools import wraps def retry(*exceptions, **params): if not exceptions: exceptions = (exception,) tries = params.get('tries', 10) def decorator(func): @wraps(func) def wrapper(*args, **kw): in range(tries): try: return func(*args, **kw) except exceptions: ...

iphone - how to set the scroll view contentsize dynamically? -

i had application in setting content size of scroll view dynamically according number of buttons creating array.like ` for(int =0;i<[sarray count];i++) { nsmutabledictionary *dicttable=[sarray objectatindex:i]; nsstring *head=[dicttable objectforkey:@"cat"]; btn= [uibutton buttonwithtype:uibuttontypecustom]; int j=i+1; btn.frame = cgrectmake((j-1)*87,0,87, 44); [btn setbackgroundimage:[uiimage imagenamed:@"bar.png"] forstate:uicontrolstatenormal]; [btn setbackgroundimage:[uiimage imagenamed:@"bar_hvr.png"] forstate:uicontrolstateselected]; btn.backgroundcolor = [uicolor clearcolor]; btn.titlelabel.font = [uifont fontwithname:@"helvetica-bold" size:14]; btn.titlelabel.textcolor = [uicolor whitecolor]; [btn settitle:head forstate:uicontrolstatenormal]; btn.tag = i; [btn setshowstouchwhenhighlighted:yes]; [scroller ...

date - Get a PHP DateTime difference in days, considering midnight as a day change -

what simplest way difference in days between 2 php datetimes , considering midnight day change (just datediff(day) sql function does)? for example, between today @ 13:00 , tomorrow @ 12:00, should 1 (day), though interval less 24 hours. $date1 = new datetime("2013-08-07 13:00:00"); $date2 = new datetime("2013-08-08 12:00:00"); echo $date1->diff($date2)->days; // 0 you ignore time portion of date string $date1 = new datetime(date('y-m-d', strtotime("2013-08-07 13:00:00"))); $date2 = new datetime(date('y-m-d', strtotime("2013-08-08 12:00:00"))); echo $date1->diff($date2)->days; // 0

events - Automatically resize vim gui according to number of vertical splits -

i writing small plugin gvim automatically increases or decreases width of gui according number of vertical splits. plugin works this if has("gui_running") augroup resize autocmd winenter * call <sid>resizesplits() autocmd winleave * call <sid>resizesplits() autocmd bufleave * call <sid>resizesplits() augroup end endif here resizesplits() function resizes gui window: function! s:resizesplits() let l:count = 0 windo if winwidth(winnr()) < &columns | \ let l:count += 1 | \ endif if l:count > 0 let l:totwidth = l:count - 1 + l:count*80 else let l:totwidth = 80 endif if &columns != l:totwidth execute 'set co=' . l:totwidth endif endfunction the plugin works want to, not quite. seems bufleave event (and similar ones) executes before windows closed. problem instance when <c-w>o or :only . problem resizesplits function not work, since still count...

php - MySQL Syntax for Where clause -

im not in php. have web application displays data mysql database. not getting erros need fetch data want. ex. code. <?php $dbhost = 'localhost'; $dbuser = 'user'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); $token = $_get['token']; if(! $conn ) { die('could not connect: ' . mysql_error()); } $sql = "select * table token = '" . $token . "'"; mysql_select_db('database'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('could not data: ' . mysql_error()); } while($row = mysql_fetch_array($retval, mysql_assoc)) { //displays data echo "the token here"; } mysql_close($conn); ?> i have no errors in here. need like, if token data not yet added table, put echo message like.. "the token not yet added here". can put syntax here? please me. new in php. use this: if(mysql_num_rows($retval)) {...

asp.net mvc 4 - Web Server to Host my MVC4 Web Application -

hi i'm trying host mvc4 web application on web server , not working. need install in particular works? , type of web server best type of situation? you need: iis, preferably iis 7+ .net installed on server make sure framework set correctly take here if have set up, let know error seeing.

flash - HTMLLoader: Navigate Back and Forward in Page History -

i never had problems navigating , forward through page history of htmlloader child of main native window stage. have use: htmlloadervariable.historyforward(); but when add htmlloader child new native window, doesn't seem work. here code: function createnewhtmlwindow(pageurl:string):void{ //everytime click button, function creates seperate native window each containing htmlloader class load webpage var myhtml= new htmlloader(); myhtml.width = 1000; myhtml.height = 780; myhtml.addeventlistener(event.complete, myhtmlloaded); var myhtmloptions = new nativewindowinitoptions(); myhtmloptions.transparent = false; myhtmloptions.systemchrome = nativewindowsystemchrome.standard; myhtmloptions.type = nativewindowtype.normal; var exthtmlwindow = new nativewindow(myhtmloptions); exthtmlwindow.title="new title"; exthtmlwindow.width = 1015; exthtmlwindow.height = 800; exthtmlwindow.activate(); exthtml...

jquery - KnockoutJS get JSON from remote source with mapping plugin binding issue -

Image
i have jquery: $.ajax({url : surl, datatype: "jsonp", type: "get", contenttype: "application/json;charset=utf-8", headers: { "accept": "application/json;charset=utf-8" }, error: function (a, b, c){ alert(a); alert(a.status); alert(b); alert(c); }, success: function (data) { alert(data); var viewmodel = ko.mapping.fromjs(data); alert(viewmodel); /*$.each(data, function (index, element) { alert(index); alert(element); });*/ } }); the alert(data); gives me this: second alert gives me: function c(){if(0<arguments.length)return c.equalitycomparer&&c.equalitycomparer(d,arguments[0])||(c.k(),d=arguments[0],c.j()),this;a.q.bb(c);return d} the .each run until index > 100, there row set returned. here small piece of json (when manually hit url var surl : ([{ "0":"c55...

html - Automatically Open URL in an iframe (XSL) -

i using xsl create specific url different variables based on values in excel sheet. have working expect have click link created open url in iframe. hoping accomplish without click link load when page opened. here relevant piece of code: <xsl:when test="fieldname[starts-with(., 'uniqueid')]"> <b> <a target="iframe"> <xsl:attribute name="href"> file:///c:/users/me/documents/<xsl:value-of select="fieldvalue"/>.html </xsl:attribute> <xsl:value-of select="fieldvalue"/> </a> </b> </xsl:when> you can create directly iframe: <xsl:when test="fieldname[starts-with(., 'uniqueid')]"> <iframe> <xsl:attribute name="src"> file:///c:/users/me/documents/<xsl:value-of select="fieldvalue"/>.html </xsl:attribute> </iframe> </xsl:when>

orchardcms - Using orchard how to display content itmes & send email to user -

using orchard 1.6 i've setup 3 content parts, each viewable 3 separate forms, automatically navigate 1,2,3 user fills them out (by selecting booking option on main menu): 1) records name & phone number input fields 2) records equipment user has selected rent (from drop down , input fields) 3) confirmation should display user has entered on first 2 so far im on part (3) want display user has chosen first 2 forms (i know stored content items) how can both of them display on confirmation page. also when 'submit' button clicked on confirmation page send email owner. how can this? thank you use rules module (workflow in 1.7+) send email when content item created. to display data create simple little module displays latest 2 items created current user. or something. i've never used orchard forms i'm not sure if has better ways of accessing content have created it.

php - Location Search for Database -

i trying set mysql database website have list of various locations. possible set location-based search list? example, if searches "albany, ny, usa" there should results nearby "new york, ny" if database has no results albany. i think neat way use latitude , longitude coordinates. however, if user enters in random city, there way acquire geographical coordinates of city website? also, if user spells query wrong, there neat way still process information? for first option use query in php following: $sql = "select distinct * (`yourtable`) (`cityname` '%".$_post('search')."%')" this query search word typed in searchfield called 'search' so example: <input type="search" name="search"> for second part of question use bit more complex query searchterm. so match first 2 characters example. if want search nearby location use google geolocation api calculate distance between 2...

gnu make - how Makefiles work exactly -

i'm writing code gtk application written in c, , have questions it. # compiler cc = gcc cflags = -wall -g -o rm = rm -f # additional header path gtkinc = `pkg-config --cflags gtk+-3.0` gtklib = `pkg-config --libs gtk+-3.0` inc = $(gtkinc) liblnk = $(gtklib) # sources, objects, executable srcs = hello.c objs = $(srcs:.c = .o) exec = hello .phony: clean all: $(exec) @echo compile complete $(exec): $(objs) $(cc) $(inc) $(cflags) $(exec) $(objs) $(liblnk) clean: $(rm) *.o *~ $(exec) previously, when wrote makefiles,i added lines each object files for example blah blah a.o: 1.h a.c b.c $(cc) blah blah blah blah and then, got little lazy , tried make more easy-to-modify file googling up, , product above code. 1. same thing did previously?(like in example) found out code compiles properly, i'm not sure if checks out-of-date object files.(which whole meaning of 'make') 2. have to use 'depend' on header files in order chec...

Search for Youtube videos by town -

i'm using youtube api v3 , want search video city of origin. in documentation filter , covers how see videos specific country. how can narrow search? currently, filtering town not supported, hope have soon.

java - How the buffer byte array is continuously filling while streaming? -

the below piece of code using reading files int bytesread; byte[] bytes = new byte[1000]; //buffer fileinputstream fis = new fileinputstream(uploadedfile); while ((bytesread = fis.read(bytes)) != -1) { fis.read(bytes, 0, bytesread); } fis.close(); as per api of read() method reads b.length bytes of data input stream array of bytes. method blocks until input available. there no specified refills bytes array,but stream filling array until file read. . but how internally it's maintaining magic done ?? i saw source code or read method public int more ...read(byte b[]) throws ioexception { 214 return readbytes(b, 0, b.length); 215 } and readbytes 's source code 200 private native int more ...readbytes (byte b[], int off, int len) throws ioexception; there noting mentioned how bytes .. i uploaded 500mb file without problem,with allocation 1000 bytes array . if you're asking...

c++ - how to read cmyk tiff image pixels and store it in separate buffers? -

i can read , load data fine bitmap image, not sure how can read data multiple channels. understand, read image header information , store entire image data (width*samplesperpixel) 1 large buffer, how divide buffer , load respective c,m,y,k data separate buffers? help? thanks.

jQuery: Limit the scope of a jQuery selector to avoid selecting other selectors that are not children -

i have made content shield (i.e. tabs) jquery. , works perfectly. i know want put second 1 on page , wrap them both within larger content shield. however, when click links of first 1 starts effecting second one. this overview of html <div class="taptabs pages"> <nav class="content-follower tapnav ui-ticklist cr-nav"> [ul navigation switch between content shield 1 & 2] </nav> <div class="taptabs page"> <nav class="content-follower tapnav ui-ticklist cr-nav"> [ul tabs content sheild 1] </ul> </nav> <div class="pages"> <div class="page"> content sheild 1 - section </div> <div class="page"> content sheild 1 - section b </div> </div> </div> <div class="taptabs page"> <nav class="content-follower tapnav ui-ticklist cr-nav"...

how to get initial parameters during updating a form in Django with TemplateView -

i have following class based templateview, want templateview updateview.but not sure set form instance parameters. try in get_context_data didn't work. ideas ? class profileupdateview(generic.templateview): template_name = "profile/update_profile.html" def dispatch(self, *args, **kwargs): if self.request.user.is_authenticated(): return super(profileupdateview, self).dispatch(*args, **kwargs) else: return httpresponseredirect('/profiles/login') def get_context_data(self, *args, **kwargs): context = {} try: profile.objects.get(user__id=self.request.user.id) user = profile.objects.get(user__id=self.request.user.id) context['profile_form'] = profile_form(data=request.post, instance=user) except: context['profile_form'] = profileform(data=self.request.post) context['profile'] = profile.objects.filter(u...

java - Checking equals for JAXB object considering some of the fields -

my autogenerated jaxb class public class employee { private int id; private string name; private string department; /* getters , setters */ } employee emp1 = new employee(); emp1.setid(1); emp1.setname("a"); emp1.setdepartment("d1"); employee emp2 = new employee(); emp2.setid(2); emp2.setname("b"); emp2.setdepartment("d1"); list<employee> emplist1 = new arraylist<employee>(); emplist1.add(emp1); emplist2.add(emp2); employee emp3 = new employee(); emp2.setid(3); emp2.setname("a"); emp2.setdepartment("d1"); list<employee> emplist2 = new arraylist<employee>(); emplist2.add(emp3); i want compare both list emplist1 , emplist2 , result list matches name , department fields of employee object. basically, need intersection of 2 list based on custom comparison of fields in 2 objects. i looking @ google guava , lambdaj not able find solution/sample doing intersection custom com...

r - Creating a custom Stat object in ggplot2 -

i'd create custom stat object ggplot2. (specifically i'd create smoother works differently ones stat_smooth allows- instance, without y~x modeling function- there other custom stats i'd create if there workaround specific case). i found this suggested solution hadley wickham : statexpo <- proto(stat, { objname <- "expo" desc <- "exponential smoothing" default_geom <- function(.) geomline calculate_groups <- function(., data, scales, variable="x", ...) { data$y <- holtwinters(data$x, ...) } }) stat_expo <- statexpo$new however, when try get: error in proto(stat, { : object 'stat' not found upon looking around ggplot code , found where stat defined . however, stat object is, far can tell, never exported ggplot2 . i write new stat object within ggplot2/r folder , reinstall package, cumbersome , make solution difficult share others. how can create custom stat object outside of ggplot n...

Dependency error with excel interop dll in .NET app -

i running .net app on local machine uses microsoft excel interop library. has been working until today when removed library , added project. until few weeks ago had been using trial version of excel application work , working after trial had expired. afraid since trial expired , removed library project , put in causing error. correct here? should re-installing excel fix problem? here error when try run application: parser error message: not load file or assembly 'microsoft.office.interop.excel, version=14.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) and logs: === pre-bind state information === log: user = aaron-pc\aaron log: displayname = microsoft.office.interop.excel, version=14.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35 (fully-specified) log: appbase = file:///c:/users/aaron/documents/visual studio 2012/websites/...

actionscript 3 - How to switch to another column when exporting to csv -

i need export data ms excel. laod data bytearray , print file. nevertheless wasn't able find out, how switch next column. tried '\t', "\t", char(9) , many others, in excel file unknown character symbol ... "\n" works fine... i'm programming app in as3, if have connection.. csv stands "comma separated values". default delimiter columns comma ( , ). also, can designate character want use column delimiter (tabs, example), when importing excel

Linux Mint 15 - Recieving DKPG error 127 when modifying packages -

*after operation, 44.1 mb of additional disk space used. want continue [y/n]? y extracting templates packages: 100% setting install-info (4.13a.dfsg.1-10ubuntu4) ... /etc/environment: line 5: java_home: command not found dpkg: error processing install-info (--configure): subprocess installed post-installation script returned error exit status 127 errors encountered while processing: install-info e: sub-process /usr/bin/dpkg returned error code (1)* this error running whenever try modify packages, in case trying install lxde. environment file looks : *path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" java_home=/usr/lib/jvm/jdk1.7.0_25/ to give more context, dkpg error began happening after went through long , arduous process setting android studio. feel solution simple, have been searching while , haven't been able resolve issue. appreciated, thank in advance export java_home before executing command expo...

html - SVG : I need an SVG file that reads 'TEST' and auto-expands 100% -

this file have. <svg width="700" height="500"> <g id="layer1"> <text style="font-size:100%;font-family:bitstream vera sans" x="6" y="37" id="">test</text> </g> </svg> i want test automatically occupy whole thing somehow. 100% kind of thing. right text miss-alligned due x , y ordinates. try setting viewbox instead of specific width , height: <svg viewbox="0 0 240 70"> <g id="layer1"> <text style="font-size:100px;font-family:bitstream vera sans" x="0" y="70" id="">test</text> </g> </svg> note chrome has rendering inconsistencies svg no specific height .

resources - Visual Studio 2012 (C++) - Use included .png file -

i encountering yet problem directx 9 & c++. have been working on 2d games using lpd3dxsprite , lpdirect3dtexture9. can load in textures, when comes distributing finished game, need distribute resources (which can edited, deleted or something, not convenient). know possible import "resource file" visual studio, when refer using d3dxcreatetexturefromfile() not load it. have no idea how this. if possible, in advance. i'm not sure it's idea store game assets in windows resource file. if want try it: method 1. d3dxcreatetexturefromresource() , d3dxcreatetexturefromresourceex() functions looks want. use case: // suppose have resource `idb_sprite1` in resource file linked in current executable // , initialized g_pd3ddevice lpdirect3dtexture9 sprite1_texture = 0; hresult hr = d3dxcreatetexturefromresource( g_pd3ddevice, getmodulehandle(null), makeintresource( sprite1 ), &sprite1_texture ); if(failed(hr)) { ...

sql - Types don't match between the anchor and the recursive part in column of recursive query -

given category @categoryid , query should recursively navigate top super-category, has been accomplished. now i'd generate along string concatenation of categoryname in process. declare @categoryid int = 217; categories ( select parentcategoryid, categoryname, '' strcategory category categoryid = @categoryid union select c.parentcategoryid, c.categoryname, (c.categoryname + ': ' + cts.strcategory) strcategory category c join categories cts on c.categoryid = cts.parentcategoryid ) select top 1 categoryname, len(categoryname) strlength categories order strlength desc with above code i'm getting following error: types don't match between anchor , recursive part in column "strcategory" of recursive query "categories". thanks helping try changing query cast varchars varchar(max). something like declare @categoryid int = 217; categories ( select parentcategoryid, categoryname,...

Forcing Jquery Mobile to reload in Rails app -

i working on mobile site uses rails , jquery mobile. problem have button when triggered suppose go link. link starts controller generates data shown in page , saved in database. problem works first time around , when try doing again, jqm loads cached data , uses ajax, page never reloaded again.. button: <div data-role="button" data-ajax="false"><%= link_to "get basket",basket_path%> you should place data-role="button" , data-ajax="false" inside anchor tag, this: <a href="..." data-role="button" data-ajax="false">...</a>

objective c - Resize a view when another is hidden -

i have 2 views on iphone screen, 1 above other (mediacontrols above devicewebview). when hide top view want bottom view take entire screen, , when reveal top view want bottom view resize again below top view. seems simple having trouble it. i've tried hiding view adjusting layout constraints show below. heres code: -(void)hidevideobuttons{ self.mediacontrols.hidden = yes; [self.view removeconstraint:self.devicelayoutconstraint]; [self.devicewebview setneedsdisplay]; } -(void)showvideobuttons{ self.mediacontrols.hidden=no; self.devicelayoutconstraint = [nslayoutconstraint constraintwithitem:self.devicewebview attribute:nslayoutattributetop relatedby:nslayoutrelationequal toitem:self.mediacontrols attribute:nslayoutattributebottom multiplier:1 constant:0]; [self.view addconstraint:self.devicelayoutconstraint]; have tried uiview animatewithduration: animations: method? can animate uiview(s) whatever location you'd like, can resize them, , m...

Is it possible to force case-sensitivity in MATLAB for file operations like LOAD? -

matlab case-sensitive calling functions, on windows: >> edit untitled >> untitled cannot find exact (case-sensitive) match 'untitled' is there way enforce case sensitivity on windows other functions, load? >> = 3; >> save a >> load the problem code run fine on windows, error if send friend on unix. one way enforce case-sensitivity functions dealing files, regardless of platform running, write wrapper such functions. for example, in case of load , came following drop-in replacement: function varargout = myload(fname, varargin) % make sure filename ends mat extension [~,~,ext] = fileparts(fname); if isempty(ext), fname = [fname '.mat']; end % open file (searching entire matlab path) fid = fopen(fname,'r'); if fid < 0, error('file not found'); end % fullpath opened file, , close file handle filename = fopen(fid); fclose(fid); % extract filename [~,name,e...

java - How do we know threadPoolExecutor has finished execution -

i have parent thread sends messages mq , manages threadpoolexecutor worker threads listen mq , writes message output file. manage threadpool of size 5. when run program, have 5 files messages. works fine until here. need merge these 5 files in parent thread. how know threadpoolexecutor finished processing can start merging files. public class parentthread { private messagesender messagesender; private messagereciever messagereciever; private queue jmsqueue; private queue jmsreplyqueue; executorservice exec = executors.newfixedthreadpool(5); public void sendmessages() { system.out.println("sending"); file xmlfile = new file("c:/filename.txt"); list<string> lines = null; try { lines = fileutils.readlines(xmlfile, null); } catch (ioexception e) { e.printstacktrace(); } (string line : lines){ messagesender.sendmessage(line, this.jmsqueue, th...

How to change color of bar in column chart with different level of percentage in highcharts -

i want change color of bar column @ different percentage. suppose there 10 columns represented in column graph. out of 3 below 60% , 5 above 60% , 2 above 80%. columns below 60% should pick color green, column above 60% should pick color amber , above 80% should pick red. please me... <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>highcharts example</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script> $(function () { var chart; var input = [34.4, 62.5, 80.1, 70, 69.6, 69.5, 89.1, 68.4, 18, 17.3], data = [], categories = ['orcl1 ','orcl2 ','orcl3 ','orcl4 ','orcl5 ','orcl6 ','orcl7 ','orcl8 ','orcl9 ','orcl10 ...

html - Struts tags substitution -

i wondering if replace struts tags html, when output data. projects in company still using struts tags seems it's not easy use compared html. of course can, long duplicate: whatever html emitted tag, and... ...whatever java logic tag implements. for example, custom form tags is: emit form elements (possibly embedded in other markup depending on s2 theme) set form element value action property display error messages relating form element (depending on s2 theme) some tags don't emit html of own, example, <s:iterator> loops on collection, pushes each object onto value stack, , processes tag body other jsp custom tag. should reproduce existing framework logic , write either: a lot more html, or... ...your own complete suite of custom tags? i doubt it, there valid usecases doing so–i can't think of them.

Using PHP and Javascript in onblur function -

so have form: <form enctype="multipart/form-data" action="cgi-bin/upload.cgi?upload_id=" method="post" onsubmit="return startupload(this);" target="xupload"> <table> <tr> <td class="first"><span class="right">upload file: </span></td> <td class="second"><input name="file_1" type="file" onchange="checkext(this.value)" accept=".mp4, .avi, .wmv, .mov, .camrec, .flv, .zip, .rar"></td> <td class="third"><span class="left">(required)</span></td> </tr> <tr></tr> <tr><center><h2>video information</h2></center></tr> <tr></tr> <tr> <td class="first"><span class="right">your name: </span></td> ...