Posts

Showing posts from June, 2013

c# - Unrecognized Guid format -

i working on c# application getting error. here stack track of error: stack trace: @ system.guid.guidresult.setfailure(parsefailurekind failure, string failuremessageid, object failuremessageformatargument, string failureargumentname, exception innerexception) @ system.guid.tryparseguid(string g, guidstyles flags, guidresult& result) @ system.guid..ctor(string g) @ projects_addproject.wizcreateproject_activestepchanged(object sender, eventargs e) @ system.web.ui.webcontrols.wizard.onactivestepchanged(object source, eventargs e) @ system.web.ui.webcontrols.wizard.multiviewactiveviewchanged(object source, eventargs e) @ system.web.ui.webcontrols.multiview.onactiveviewchanged(eventargs e) @ system.web.ui.webcontrols.multiview.set_activeviewindex(int32 value) @ system.web.ui.webcontrols.wizard.set_activestepindex(int32 value) @ projects_addproject.proxy_navigate(object sender, historyeventargs e) @ system.web.ui.scriptmanager.raisenavi

single sign on - authenticate user on server side for Swing clients using kerberos/spnego -

i using kerberos protocol authenticate users java swing applications. able authenticate @ client side, having problems when getting user credentials , roles on server side, have got ejbs require roles create ejbs. jboss-app.xml looks like <jboss-app> <security-domain>java:/jaas/spnego-server</security-domain> <loader-repository>paymenttracker:loader=paymenttracker.ear</loader-repository> </jboss-app> the client class calling subject.doas(s, lv); lv class extends privilegedexceptionaction. on server side login-config.xml in jboss server got following setting <application-policy name="spnego-server"><authentication> <login-module code="com.sun.security.auth.module.krb5loginmodule" flag="required" > <module-option name="storekey">true</module-option> <module-option name="debug">true</module-option> <module-option nam

utf 8 - C++ character encoding UTF-8 -

this question has answer here: convert utf-8 unicode c++ 1 answer i've got following code converts unicode appropriate character e.g. when user enters úsername browser %fasername returned code converts úsername. however when browser encoding set utf-8 value passed code %c3%basername converted úsername wrong value expected authentication. how can modify code make utf-8 compatible? no answer there couple of things wrong. ú has unicode number u+00fa, or developers say: 0x00fa. unicode has 3x2^16 characters. in utf-8 multi-byte sequences used. 7-bit pure ascii unicode = ascii. u+00fa more 1 byte needed. %c3%ba seems correct, %xx byte, url encoded. u+0109, ĉ , single byte, %fa not do. for utf-8 decoding/encoding wide char string there exist sufficient code snippets. i afraid handling has change. normal procedure one receives url encoded s

.htaccess - URL Rewrite a previously rewritten URL - htaccess -

ok so... have following url works on site: http://my_domain.net/w/mrd3nkkm the rewrite in root of site is: rewriterule ^([w])/(\w+)$ res/$1/response.php?id=$2 [l] simple stuff , works treat. want redirect traffic hits url unencrypted go on https, below: https://my_domain.net/w/mrd3nkkm so put .htaccess file within res/w/ folder conatining following: rewritecond %{http:x-forwarded-proto} !https rewritecond %{request_uri} ^/response.php$ rewritecond %{query_string} ^id=(.*)$ rewriterule ^(.*)$ https://my_domain.net/w/$1 [r,l] to miind should work, doesn't. to clear, have following url rewrite working: http://my_domain.net/w/mrd3nkkm and this: https://my_domain.net/w/mrd3nkkm thanks you should handle http => https before doing internal forward stuff. following should work you: options +followsymlinks -multiviews rewriteengine on rewritecond %{https} off rewriterule ^w/.*$ https://%{http_host}%{request_uri} [r=301,l,nc] rewriterule ^(w)/

calculating the real size of a python string -

first of computer spec : memory - https://gist.github.com/vyscond/6425304 cpu - https://gist.github.com/vyscond/6425322 so morning i've tested following 2 code snippets: code a a = 'a' * 1000000000 and code b a = 'a' * 10000000000 the code works fine. code b give me error message : traceback (most recent call last): file "<stdin>", line 1, in <module> memoryerror so started researching method measuring size of data on python. the first thing i've found classic built-in function len() . for code function len() returned value 1000000000 , code b same memory error returned. after decided more precision on tests. i've found function sys module called getsizeof() . function made same test on code a: sys.getsizeof( 'a' * 1000000000 ) the result return 1000000037 (in bytes) question 1 - means 0.9313226090744 gigabytes? so checked amount of bytes of string single character 'a' sys.

PHP and MySQL function return -

so have piece of code, it's image upload system: return (getboolpreference('enablefield#images@items')); i have never seen # , @ @ codes. if return , meaning of # , @ , grateful 'enablefield#images@items' nothing more string php in syntax. getboolpreference function can tell how string used in program. your return statement returns output of getboolpreference generated when string 'enablefield#images@items' passed it, nothing more, nothing less.

javascript - Do a jQuery/ajax POST on form submit -

i have html form this: <form action="myserver.com/test.php" method="post"> ... </form> when form submitted, user should redirected myserver.com/test.php , ofc send post data script. @ same time (or before), want post same post data script "myserver.com/test2.php". $.post("myserver.com/test2.php", variablewiththeformpostdata); i tried attach eventlistener form submit, doesn't seem work, maybe jquery post cant submitted fast enough before redirection? i hope can me. :( whenever use method onsubmit, make sure returns true, otherwise won't submit.

javascript - Strange website redirect issue on mobile browser that's influenced by cache -

i'm @ loss here. i have new wordpress site @ synergration.com. if access on mobile device (phone, not tablet) load fine first time. once click on page and/or reload home page jumps redirect loop indefinitely attempting reload same page on , on , over... i've weeded through code , have been unable find js redirects. i've contacted theme developer , they've been unable help. this became issue when started hosting on wp engine. use advanced caching seems culprit here when test mobile site on staging server (where no cacheing exists) loads fine. i contacted wpengine , reply: this being caused our caching systems run on our platform. looks theme handling internal redirect detects user agent (desktop or mobile) , redirects visitor appropriate site based on information. however, redirect getting stuck in cache, causing mobile version load in infinite loop. unfortunately, don’t have easy solution this. if 1 part of site, exempt part of site c

avoid button_to action with javascript in rails -

i making shopping cart , user can add products cart when signed in. i created javascript when user clicks button "add cart", evaluates if signed in , displays message, need stop button action because cause problem render action. thanks. here code <%=button_to 'add cart',line_items_path(:product_id => product.id),:onclick=>"javascript:is_user()"%> you try this: <% if current_user.present? %> <%= button_to 'add cart',line_items_path(:product_id => product.id) %> <% else %> <%= button_to 'login add cart', '' %> <% end %>

iphone - Segue from UITableViewCell to another ViewController -

Image
i have created single view application storyboard, dragged , dropped tableview . able inflate tableview , data on clicking of uitableviewcell need goto next viewcontroller . dragged , dropped viewcontroller storyboard , connected mainviewcontroller newly created viewcontroller . need goto new view controller didselectrowatindexpath method i tried using this -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { testviewcontroller *test = [self.storyboard instantiateviewcontrollerwithidentifier:@"testing"]; [test performseguewithidentifier:@"test" sender:self]; } i getting error 2013-09-03 23:33:21.234 storyboard[946:c07] * terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'storyboard () doesn't contain view controller identifier 'testing'' * first throw call stack: (0x1c92012 0x10cfe7e 0x45b679 0x2f14 0xc3285 0xc34ed 0xacd5b3 0x1c51376 0x1c50e06

c# - How to subclass a class in Web Reference? (class is in reference.cs) -

i building .dll webservice so: namespace mydllfromwebservice { public class animaldll_2013 { public animalapi.animal updateanimal(animal animal) { return new animalapi().updateanimal(credentials, animal) } public animalapi.animal getanimal(int id) { return new animalapi().getanimal(credentials, id) } } //i used public class animal { } } i running issues animal class. want able use animal class in main namespace (not animalapi.animal). how go making happen? (i tried inheriting have xml errors "not excepted) please point me in right direction how use xmlinclude or something. ideally, leave reference.cs if need change it, can (i main class). thanks. used automapper.dll... worked charm!

python - Better way to deploy compressed assets - Django Compressor -

so have tricky problem not able find better solution for. i using django-compressor great job in compressing/minifying files. problem facing during deployment. time, have been using compress tag on production , curl on pages make sure regenerates correct css/js. way, new users don't have feel brunt of compression process. i know has management command can pre-compress files, can pushed cdn , perhaps preload them behind scenes on landing/login pages. here problem, in of javascript code, using context vars , django tags [both custom , native]. var first = '{% some_tag some_context_var %}'; var name = '{{some_context_var}}'; this causes error since during compression tries execute tag doesn't have values. come compress_offline_context not dynamic. did encounter issue before. how do compression if code mixed in django tags/context variables? found way resolve this. basically moved variables own script blocks outside of compressor , use

multithreading - C - Can global pointers be modified by different threads? -

do global pointers have scope exist between threads? for instance, suppose have 2 files, file1.c , file2.c: file1.c: uint64_t *g_ptr = null; modify_ptr(&g_ptr) { //code modify g_ptr point valid address } read_from_addr() { //code uses g_ptr read values memory it's pointing } file2.c: function2a() { read_from_addr(); } so have threada runs through file1.c , executes modify_ptr(&g_ptr) , read_from_addr(). , threadb runs, , runs through file2.c executing function2a(). my question is: threadb see g_ptr modified? or still see it's pointing null? if that's not case, mean pointer global? , how ensure pointer accessible between different threads? please let me know if need clarify anything. thanks my question is: threadb see g_ptr modified? or still see it's pointing null? maybe. if accessed without sort of external synchronization, you're see bizarre, highly non-reproducible results -- in cases, compiler may mak

sql - Resources exceeded during query execution error, Google BigQuery -

any ideas how make query return results on google bigquery? i'm getting resources exceeded error... there 2b rows in dataset. i'm trying artist id appears each user_id. select user_id, artist, count(*) count [legacy20130831.merged_data] d group each user_id, artist order user_id asc, count desc an equivalent query on public data, throws same error: select actor, repository_name, count(*) count [githubarchive:github.timeline] d group each actor, repository_name order actor, count desc compare same query, plus limit on results returned. 1 works (14 seconds me): select actor, repository_name, count(*) count [githubarchive:github.timeline] d group each actor, repository_name order actor, count desc limit 100 instead of using limit, go through fraction of user_ids. in case, 1/3 works: select actor, repository_name, count(*) count [githubarchive:github.timeline] d abs(hash(actor) % 3) = 0 group each actor, repository_name but want "to artist id app

c# - How to quickly load approximately 1 million rows of data in a form? -

Image
we have little c# winforms application connected sql server database. we using radgridview (tabbed) control display data approximately 10 different views stored in sql server. we have thread running each view (tab) grabbing data , populating each radgridview tab. our problem taking way long load. how speed data retrieval? here's control looks like: you cannot load 1,000,000 rows quickly, because that's lot of data rdbms's disk through network memory of application. however, not mean application bound slow: long give end-users perception data there ready see it, consider application fast. the users think loaded data if load data top few thousand rows on initial page first, load remaining data initial page, , start loading data other tabs. as go tab-by-tab in background, load top hundred rows in each tab, when end-users click tab, see data there. code should load rest of data when user opens tab: chances are, never open of tabs, helping applicati

c# - minimizing the connection cost of a rest web service -

i connecting iis 7 rest web server , sending gps readings. save reading every 20 seconds submit web service every 60 seconds. here connection: var readings = reading.getunprocessreadings().tolist(); var gpsreadings = new list<truckgpsreading>(); history.history = "truckgpsreading count: " + readings.count(); var count = 1; while (readings.any()) { { gpsreadings = new list<truckgpsreading>(); if (readings.any()) { history.history = "no. transactions process: " + count; foreach (var reading in readings) { history.history = "currently reading #" + count; history.history = "processing reading: " + reading.datetimeofreading; logging.log("starting processgpsfile.processreading 3", "processreading", apps.remotetruckservice); var gpsreading = new truckgpsreading(); gpsre

c# - Acrobat restriction -

i want add function manipulate pdf file such creating or editing annotation. searched web , found 1 forum indicated there acrobat-forms check if modified third party tools , if it's can't show pdf via adobe reader. forum posted on april in 2010. still same? your forum correct. things changing on time particular restrictions in place not constant. some features useful in pdf adobe define them "extended features". means enabled in acrobat reader if pdf created using acrobat pro. this means adobe can continue provide free reader @ same time encourage people purchase acrobat pro since can used create type of document. the way detected via digital signature inserted pdf. if signature not present or has been invalidated modifying document see message along these lines. “this document enabled extended features in adobe reader. document has been changed since created , use of extended features no longer available. please contact author original v

javascript - Why does not jQuery .attr() work in IE9? -

the following code combination of html, css , javascript "injected" existing iframe ('iframe_id'). although following code works firefox, chrome , safari, not work in ie9. checked of related , existing answers, , of them related issues in ie8 or older, not in case. related jquery .attr()? ie9 have issues (like older ie versions)? if yes, how can fix it? $("#iframe_id").attr( "src", "data:text/html;charset=utf-8," + "<!doctype html>"+ "<html>"+ "<head>"+ "<style>"+ "/********** css stuff here **********/"+ "</style>"+ "</head>"+ "<body>"+ "<!--------- html stuff here ---------->"+ "<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js\"><" + "/script>" + "<script>"

pivot - Excel PivotTable based on cube - how to split measures based on two members of a dimension -

my cube has sales value. also item dimension. members of item hierarchy 'cat1' , 'cat2'. cat1 , cat2 can each have variety of different values. i trying define member based on specific values cat1 , cat2. the new member used in pivottable columns split sales new member. "1cup" cat1 = coffee , cat2 in (cup,cup1) "othercoffee" cat1 = coffee , cat2 in (creamer,accessory,box) "allothersales" cat1 = ops , cat2 in (accessory,battery,electronics...and on , on) how go this? if cannot change cube, there no easy possibility create calculated memebrs, except - according this blog post , if have excel 2013. in older excel versions, possibility know install olap pivot table extensions , plugin excel allows add mdx calculated measures can use in query. assuming have 1 of these possibilities write mdx member definitions, , assuming item hierarchy in dimension dim , 'cat1' , cat2 levels, attributes on based named '

Python regex to determine whether a character is numeric, alphanumeric or in a specified string -

i unsure how 1 use python regex determine whether character numeric, alphanumeric or in specified string. something (fake code warning): if 'a' in re.['a-z']: print "alpha" if '.' in re.['.,;']: print "punctiation" you can use match function module re : import re x = 'a' if re.match('[a-za-z]', x): print "alpha"

shapefile - Reading DWG files in R? -

is there way open dwg file in r , save esri shapefile? don't know package available yet. thanks in advance. you can using rgdal package port gdal . access ogr functionality supports vector topology want readorg , writeogr functions. here list of vector formats supported gdal/ogr

Selenium WebDriver clicks JQuery mobile button, but does not load new page -

i trying use selenium webdriver automate mobile web app team creating our company using jquery. since using jquery mobile, of html retrieved in single request, , clicking on buttons brings new pages on default page. the test writing should click button brings new request page: defaultselenium selenium; ... selenium.click("css=a[href='#new-request-page']"); the driver seems finding button fine because selenium doesn't throw exceptions. however, no page ever pops on default page, user can't see going on. despite this, test seems keep running normal until runs later (unrelated) error. is selenium finding , clicking new request button? if so, can driver load new request page? if not, why not letting me know can't find new request button? i have read others may need tell test wait ajax calls finish before starting next step of test, next solution. however, wondering if else out there having similar issues. unfortunately, cannot post link web app

serialization - How to serialize container classes using custom serializer in C# -

i need serialize container classes hasvalue property evaluated true. i don´t need remove invalid elements container list prior serialization. serializer should able determine objects need serialized or not. guess custom serializer can suitable need don´t know how figure out this. other solution / best practice appreciated. here classes public static class containerfactory { public static container create() { var container = new container(); container.persons.addrange(new[] { new person { firstname = "thomas" }, new person { firstname = "andrew", lastname = "martin", vehicles = new vehicles {

java - Getting the current URL in an Android browser -

i'm searching way current url user visiting on android browser application. figured out can last visited url browser.bookmarks_uri database using following technique: cursor cursor = context.getcontentresolver().query(browser.bookmarks_uri, browser.history_projection, null, null, browser.bookmarkcolumns.date + " desc"); cursor.movetonext(); string url = cursor.getstring(browser.history_projection_url_index); cursor.close(); the problem this, browser.bookmarks_uri db doesn't updated when user presses in order navigate previous page in browser, , query returns incorrect results. see following example: user navigates www.google.com -> query returns "www.google.com" user navigates www.imdb.com -> query returns "www.imdb.com" user presses return www.google.com -> query returns "www.imdb.com" (!!) does have idea how return correct url user viewing? i think did not have gone through following

xml - How to compare two date variables in XSLT? -

i've written simple xslt below. long , short want 2 things. first, want print whether or not new order. purposes, order new if ordercreatedate , ordereditdate fields same. second, want print 2 dates (to check work; formatting isn't important, yet.) <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:output method="text" indent="yes"/> <xsl:template match="/arrayofdp_rundatesall"> <xsl:variable name='ordercreatedate' select='dp_rundatesall[1]/ordercreatedate'/> <xsl:variable name='ordereditdate' select='dp_rundatesall[1]/ordereditdate'/> <xsl:choose> <xsl:when test='ordercreatedate != ordereditdate'>

asp.net mvc - How to include custom folders when publishing a MVC application? -

i have "uploads" folder logos within in. vs2012 one-click publish include folder. not. how can achieve this? thanks help. i believe need set folder's "build action" "content": what various "build action" settings in visual studio project properties , do?

resize - using jquery to vertically center container while respecting a media query -

i need jquery vertically center div on document ready , also if there resize of browser i'm having difficulty combining 2 scripts. can see below have call twice work in both instances. i'm sure there better way write little unsure of how clean. $(document).ready(function() { if ($(window).width() >= 770){ var $el = $('#main'); $el.css('position', 'absolute').css({ left: ($(window).width() - $el.width()) / 2, top: ($(window).height() - $el.height()) / 2 }); } $(window).resize(function(){ if ($(window).width() >= 770){ var $el = $('#main'); $el.css('position', 'absolute').css({ left: ($(window).width() - $el.width()) / 2, top: ($(window).height() - $el.height()) / 2 }); } });

git - How can I checkout a subdirectoy from bitbucket to jelastic? -

i using cloud platform jelastic. there can specify git repository checkout. documentation ( http://jelastic.com/de/docs/bitbucket-project-maven ) explains how so. e.g. can checkout whole project url such https://bitbucket.org/<user>/<project>.git but want checkout sub directory "www". there way checkout this? thanks, marcel from to pull ? you should add remote , choose use one. see git pro book, working remotes details on this

Control does not immediately return to first row in UITableView after dismissing UIImageView in iOS -

i have ios application displaying uitableview, in turn composed of custom rows made of uitextfields, , uilabels. on first launch, have uiimageview covers uitableview until user presses button in order dismiss uiimageview (thus revealing uitableview behind it). however, problem instead of returning control first row of uitableview, selecting last row of uitableview, , on top of that, despite me making explicit call method, "becomefirstresponder", uitextfield in last row of uitableview not allow me enter text until explicitly select row table. , able enter text. assuming method "cellforrowatindexpath" populates table top down, why last row of table being selected, , not top (this guess, , if wrong please correct me). what enable first row of uitableview once user dismisses uiimageview , have become "firstresponder" automatically, allowing user enter text right away without having explicitly select particular row. my code dismisses uiimageview af

ios - textFieldShouldReturn does not get called (textField loaded programmatically) -

i'm loading - uitextfield programmatically , trying make keyboard go down once click on 'search'. i declare -uitextfeild inside .m file uitextfield *searchtextfield; inside .h file indeed declare -uitextfield 's delegate @interface firstchannel : uiviewcontroller<lbyoutubeplayercontrollerdelegate, uitableviewdelegate,uitableviewdatasource, nsxmlparserdelegate, uitextfielddelegate, avplayeritemoutputpulldelegate>{ this how add uitextfield programmatically. searchtextfield = [[uitextfield alloc] initwithframe:cgrectmake(10, -26, 300, 30)]; searchtextfield.borderstyle = uitextborderstyleroundedrect; searchtextfield.font = [uifont fontwithname:@"heiti tc" size:13]; searchtextfield.autocorrectiontype = uitextautocorrectiontypeno; searchtextfield.clearbuttonmode = uitextfieldviewmodewhileediting; searchtextfield.contentverticalalignment = uicontrolcontentverticalalignmentcenter; searchtextfield.placeholder = @"sea

c# - Get top level entity based on lower level criteria being met -

Image
i have below database setup. i'm hoping accomplish search worker in worker tabe , return of businessareas resulting user fall under per diagram. i'm hoping accomplish in lambda expression , return top level businessarea entities. if need workers , through number of processes level i'm wanting require me iterate through different levels till top level. it sounds want this, business areas single user: var results = wfe.businessareas .where(ba => ba.processes .any(p => p.workerprocesses .any(wp => wp.userid == "pmarshall"))); or in query syntax: var results = ba in wfe.businessareas ba.processes.any(p => p.workerprocesses.any(wp => wp.userid == "pmarshall")) select ba; or alternatively: var results = ba in wfe.businessareas p in ba.processes wp in p.workerprocesses wp.userid == "pmarshall" select ba; if you'd find areas users, you'd want t

c - Win32: Using functions from a static .lib inside a .dll -

i relatively new win32 native programming. have written small c library windows. uses functions polarssl. polarssl open source library distributed vc++ .sln file, can built , generates static .lib file. originally, library built static .lib too, , programs want make use of have link polarssl , library. both libraries written in c (not c++). now need convert library .dll. can change code export functions , recompile .dll, wanted know if can leave polarssl .lib file untouched. application not need functions polarssl, use functions library. want convert .dll because want call functions mozilla firefox add on (using js-ctypes). so, can link static .lib polarssl lib .dll library , export functions .dll? thanks! yes, that's possible. have full copy of polarssl contained in dll, without of static lib exposed dll.

html - How To Right Align Image Inside Input Field? -

how right align jpeg image inside input field? .input-field { background: #fff url("../images/search.jpg") no-repeat; } by default, image left aligned. just add "right" .input-field { background: #fff url("../images/search.jpg") no-repeat right; } more informations background position: http://www.w3schools.com/cssref/pr_background-position.asp

swing - Progress bars in Java -

i have code 2 methods. public void fondo() { ... } //gathers jframe background , system time public void recuperardatosinternet() {...} //connects url , gets data. when jframe running, @ beginning takes 4 or 5 seconds perform operations of methods. while it's loading, frame displays totally empty 3 or 4 seconds until methods complete, frame shows , it's right. how can make progress bar shows user it's loading? don't mean progressbar predetermined take "4000 ms". referring progressbar can take whatever takes, , bar doesn't reach 100% until methods complete. if run heavy task in the event dispatch thread it's gonna freeze until finish avoid can execute download in thread using swingworker . follow link see complete example progressbar , special attention setprogress() publish() , process() . example: public class myworker extends swingworker<integer, string> { @override protected integer doinbackground() t

php - .htaccess setup to redirect domain's IP to domain.com and remove WWW -

i've been looking , can't seem find proper htaccess both of these. i don't want people able visit site ip address. 1.1.1.1 instead, redirect 1.1.1. >> mydomain.com i don't want people able view www.mydomain.com, instead ridirect mydomain.com how can both of these? thank you!

eclipse - maven - resolve compiltetime dependency to glassfish system libraries -

i've created small ejb project in eclipse glassfish 4. followed tutotial: http://programming.manessinger.com/tutorials/an-eclipse-glassfish-java-ee-6-tutorial/ in project have dependencies "glassfish system libraries" (stuff javax.ws.rs-api or javax.annotation-api) now converted project maven , i'm stuck on how resolve dependencies maven. (those system libraries - lot...) ejbs have compile errors in eclipse because @ejb unknown, or @stateless. how solve dependecy? btw: jpa annotations work/are recognized because added dependecy pom: <dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>org.eclipse.persistence.jpa</artifactid> <version>2.5.0</version> <scope>compile</scope> </dependency> @esej absolutely correct. solve problem add dependency: <dependency> <groupid>javax</groupid> <artifactid&

android - getActionBar().setDisplayHomeAsUpEnabled(true); throws NullPointerException on new activity creation (Google - Basic Tutorial) -

i following this tutorial , getting nullpointerexception @ oncreate method of displaymessageactivity @ block of code: if (build.version.sdk_int >= build.version_codes.honeycomb) { // show button in action bar. getactionbar().setdisplayhomeasupenabled(true); //exception here } i running app @ emulator following nexusone avd template. when click send button text typed in exception. here log: 09-03 23:02:07.586: e/androidruntime(7095): fatal exception: main 09-03 23:02:07.586: e/androidruntime(7095): java.lang.runtimeexception: unable start activity componentinfo{com.mypackage.myfirstapp/com.mypackage.myfirstapp.displaymessageactivity}: java.lang.nullpointerexception 09-03 23:02:07.586: e/androidruntime(7095): @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 09-03 23:02:07.586: e/androidruntime(7095): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 09-03 23:02:07.586: e/androidruntime(7095): @ android.ap

html - specificity issue w/ CSS opacities: overriding the opacity of the parent div -

i have div (id=alertpanel) want put in front of div (id=captchapanel). captchapanel div has opacity of .25 -- want front alert div tp 100% opaque. (i going lightbox-like effect). both divs have ids , not in classes. assign div opacity of .25 , front div opacity of 1 -- front div still not opaque (in chrome , safari @ least... in ff , ie). making id-specific rule in simple application of css, confused why getting result. here html: <div id='captchapanel'> <div id='alertpanel'> in middle </div> //some html </div> here css: #alertpanel { height: 10%; width: 10%; margin-left: auto ; z-index:1; margin-right: auto ; position: absolute; background-color:blue; float:none; opacity:1 !important; } #captchapanel { height: 60%; width: 57%; background-color:#580200; vertica

vba - Reading cells with DDE data from Excel in Visual Basic -

i using rslinx read c5:0 data file plc , put microsoft excel file. purpose of use data , convert stadistic data. the main issue i'm having right have use data plc , show in lcd 4x20 display. planning read data excel file using visual basic , send via serial port when read data cells , try show in form (to confirm value want send correct) , data shown in textbox not number in excel cell....

c# - Button event doesn't fire inside Update panel for FileUpload -

Image
i have asp.net web form page uses master page also. this simple page displays text , has form, page allows user upload resume in .doc, .docx & pdf format. problem code not able trigger reason <asp:button id="btnuploadcv" runat="server" text="upload" cssclass="btnupload" onclick="btnuploadcv_click"/> <%@ page title="" language="c#" masterpagefile="~/en/sitemasterpage.master" autoeventwireup="true" codefile="career.aspx.cs" inherits="career" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="asp" %> <asp:content id="content1" contentplaceholderid="head" runat="server"></asp:content> <asp:content id="content2" contentplaceholderid="contentplaceholder1" runat="server"> <!

vba - Excel Drop Down + search function -

Image
i have drop down lot of list in it. taking long time search / scrolling down through list. is there way make easier? example: can extend scroll range longer (which 8 items only), or maybe sort of autocomplete typing item name. its search item easier in drop down list. thanks! you can use: cascading dropdown (such xls cascading lookup based on pivot table style datasource? , http://www.contextures.com/xldataval02.html ) use formula in named range list validation simulate autocomplete create named range test kind of formula : =offset($a$2,match($c$1&"*",$a:$a,0)-2,0,count($a:$a)) where: your list of data in column (values should sorted alphabetically) the current cell applying validation on c1 then can: start typing text want in cell a1, instance wash then click on drop-down list the dropdown list begin @ whashington , on i've translated 1 of old workbook tell me if doesn't work. [edit] quick test seem make work (you shoul

ios - how to use [UIImage resizableImageWithCapInsets:] -

Image
i'd stretch image size 170x50 , show in image view size 240x140. original image looks like: i want keep 4 corners , stretch center part. use following code: uiimage *originalimg = [uiimage imagenamed:@"imagenamed"]; uiimage *resizeimg = [originalimg resizableimagewithcapinsets:uiedgeinsetsmake(20 ,10, 10, 10)]; self.originalimgv.image = originalimg; self.resizedimgv.image = resizeimg; both originalimgv , resizedimgv set "aspect fill". run on simulater, , result : what can't understand is: resizedimgv has 2 arrows! 1 tell me why , how can use correctly? thanks your issue values pass uiedgeinsetsmake . values top, left, bottom, right. due arrow in top left, need make sure left value big enough go left edge of image right of arrow. given image posted, want like: uiedgeinsetsmake(12, 32, 4, 4) btw - image should left + right + 1 pixels wide , top + bottom + 1 pixels tall. image doesn't need big is.

javascript, ajax, PHP insert onSubmit not working...POST not set -

i'm trying insert mysql database onsubmit() function... main part, function works. however, keeps inserting 1 db logbook_id field (the logbook_id should not 1 every time). here's (relevant) html: echo '<div class="logbook_box" id="logbook'.$id.'" style="display: block; overflow: hidden;">'; echo '<form action="cgi-bin/read_log.php" method="post" onsubmit="return ajaxsubmit(this, ' . $id . ');">' . '<input type="hidden" value="'.$id.'" id="id" name="id" />'. '<input style="float: right; width: 20%" type="submit" value="mark read" />' . '</form>'; here's onsubmit function: <script type="text/javascript" src="cgi-bin/jquery-2.0.3.js"></script> <script> var ajaxsubmit = function(form, id) {

twitter bootstrap - Haskell Equality Constraint -

i'm trying build bootstrap 3 compatibility yesod. however, doing making "renderbootstrap3" function impossible because can't add class inputs. so, i've opted making bootstrap versions of fields in form.fields . idea can clone normal fields add class declaration in attributes array. here relevant code: import qualified yesod.form.fields f injectclass :: (text -> text -> [(text,text)] -> either text -> bool -> widgett (handlersite m) io () text -> text -> [(text,text)] -> either text -> bool -> widgett (handlersite m) io () injectclass f b attrs d e = f b attrs d e textfield :: (monad m, rendermessage (handlersite m) formmessage) => field m text textfield = addinputclass f.textfield addinputclass :: (monad m, rendermessage (handlersite m) formmessage) => field m -> field m addinputclass f = f { fieldview = (injectclass $ fieldview f)} so, intention take normal version of text field , use record syntax modi

command line arguments - how to host an exe with a dynamic commandline parameter -

i have installer exe takes channel_id param command line parameter , uses it. channel_id may different different downloads , installs. want host installer exe on web in such way when it's downloaded , executed (by double clicking) channel_id passed in someway ,which should equivalent running installer exe in cmd channel_id below. cmd> myinstaller.exe channel_id . how possible ? you can append data end of .exe file.

compilation - Undefined reference to functions in xlib.h while compiling Qt-Everywhere 4.6.3 -

i compiling qt-everywhere 4.6.3 on ubuntu 12.04.1 32bit use on mini2440. able compile qmake mini2440 failed compile laptop testing. ./configure gave me no errors (i had install libx11-dev & libxext-dev so). on running make , got many linker errors : .obj/release-shared/qpaintengine_x11.o: in function `qx11paintengine::drawpixmap(qrectf const&, qpixmap const&, qrectf const&)': qpaintengine_x11.cpp:(.text+0x25fb): undefined reference `xcopyarea' qpaintengine_x11.cpp:(.text+0x264c): undefined reference `xsetcliporigin' qpaintengine_x11.cpp:(.text+0x2691): undefined reference `xsetclipmask' qpaintengine_x11.cpp:(.text+0x2723): undefined reference `xcopyarea' qpaintengine_x11.cpp:(.text+0x2871): undefined reference `xsetcliprectangles' qpaintengine_x11.cpp:(.text+0x28bf): undefined reference `xcreatepixmap' qpaintengine_x11.cpp:(.text+0x28e2): undefined reference `xcreategc' qpaintengine_x11.cpp:(.text+0x28fd): undefined reference `x