Posts

Showing posts from September, 2010

search engine - Keep bots and crawlers from recognizing images -

i want present image visitors, , don't mind if download (they can take screenshot anyway), don't want image appear in search results ever. while know can politely ask bots not index content, don't trust them. therefore, want them not recognize image. 2 ideas: create image through e.g. php's image functions: <img src="image.php"> . guess google understands this. publish image table, each cell 1x1 pixels , background color of pixel: <td style="width:1px;height:1px;background-color:#36ef2a"></td> . better ideas? does include not trusting /robots.txt file in setup? not sure if meant. what type of images they? if text, , can represented drawings, can try using html5 canvas element and/or inline svg present image. i'm not sure if can use background images point inside css.

In Visual Studio exception handling, how do you target the exception away from the browser so you can view the call stack interactively? -

until recently, when vs 2013 code hit exception, grey dialog box pop up, , call stack window in vs fill call stack. able click on different lines in stack, take me point , let me view variables. this good. sometime recently, ninja broke secure home office, , changed configuration setting of sort, because now, when code hits exception, information sent browser window. in ways ok, because entire call stack visible in browser window. vs releases information , there's nothing in call stack window, , no way interactively go stack. i've done bunch of research cannot life of me figure out did (i mean, ninja did) change this, or how change back. answer turned out in "related" stack overflow: somehow had unset "thrown" checkbox next common-language-runtime in debug/exceptions dialog box. see: how jump line of code threw exception in visual studio 2010 debugger?

regex - using regular expression pattern replace to convert cents to dollars -

am new regex and, have situation store price in cents need search them using dollar equivalent. trying write pattern replacer converts cents dollars (basically divide 100) eg: 2349 -> 23.49 18 -> .18 any appreciated there should easier ways of doing this. regex: \b(?\d*?)(?\d{1,2})\b first group $ , second group cents. replace regex: ${dollar}.${cent} this search numbers (any length) in string , split in $ , cents. explain: \b : word boundry \d : digit *? : lazy select (as few matches possible) {1,2} : match 1 or 2 characters. fill before lazy *? selection ( ) : grouping

java - What are auxiliary classes? -

i know these questions may sound stupid, in java, auxiliary classes, how 1 write one, , how compiler know auxiliary class? edit: reason ask because compiler generating warning regarding object in external library, , want know why. edit 2: here compiler warning want it: warning: auxiliary class pattern in jregex/pattern.java should not accessed outside own source file as descried in java specification here , can specify more 1 class in 1 .java file. class name matches .java file name main class can declared public , visible other classes. other classes in file therefore "auxilary" classes. auxilary class can not declared public , (as @trashgod rightfully pointed out) therefore declared package-private access. instance aclass.java file: public class aclass { private auxilaryclass a; } class auxilaryclass { private int b; } auxilaryclass class can't public , not visible outside aclass.java file. however, using auxilary classes considered ex

java - Android Login input to be send via HttpGet JSON to server and return list of user profile information -

i have login window, want user information next window , share username. both stored password , username in database , want array result. here code. 2 edittext have values , pass them via json. link request ..../userprofiles?username=. so, when type username have receive basic info. in json this: { "content": [ { "id": 4, "email": "email@domain.com", "password": "this_will_not_be_set", "firstname": "john", "phonenumber": "11223344", "username": "newuser", "birthdate": 1394204315000, "gender": "male", "blacklisteddate": null, "userpicture": "oik=", "blacklisted": false }], "size": 25, "number": 0, "sort": null, "totalpages": 1, "numberofelements": 1, &qu

try catch - try except statement error python -

def validnumber(): notvalid=true while(notvalid==true): number=input('enter number between 0 , 9->') if number=='': print('empty input!') else: try: number=int(number) except valueerror: print('number not int value!try again!') else: if number>=0 , number<=9: notvalid=false return number def main(): myvalidnumber=validnumber() print(myvalidnumber) main() hey guys. wrote program , had 1 question. -> program not end if enter number between 0 , 9. explain why happening?. thanks in advance :) python's variables case sensitive. notvalid not same notvalid . so, when say notvalid=false you creating new variable. change to notvalid = false and fine.

Watching a CSS property change from Bootstrap in AngularJS -

i working on responsive website. site uses bootstrap 3.1 , angularjs. bootstrap has class called "visible-xs". class says let visible on small screens , hidden on larger screens. changing css display property value between none , block . currently, have div looks following: <span id="smallcontent" class="visible-xs">mobile content</span> i need stuff programmatically in controller when smallcontent changes visible hidden , vice-versa. question is, how watch changes on display property of smallcontent ? i've noticed $watch method on scope ( http://docs.angularjs.org/api/ng/type/ $rootscope.scope). however, seems watch changes property in scope, not changes property in dom. is there way i'm trying? if so, how? thank you! you don't need javascript watchers want. can, kind of hacky , potentially bad on performance. another point "responsiveness" should handled (a maximum) html/css only. if start havi

visual studio 2010 - How to insert check mark "✓" in std::string in c++ programming using VS2010 -

in 1 of application i'm developing in c++, have display "✓" mark. need first insert same in std::string or in char. when that, i'm getting "?" mark output. i'm using vs2010 code. please suggest how solve same. in advance. there seems basic misunderstanding. the checkmark character unicode 0x2713. cannot store single character in std::string. maximum value char 0xff (255). won't fit. if developing gui using c++ windows guess mfc. if using std::string perhaps that's not so. choices: for mfc, can rebuild application in unicode mode. chars short (16 bits) , checkmark fit fine. you use std::wstring instead of string. means changes existing code. you use utf-8, replaces character multi-byte sequence. not recommended in windows, if think know you're doing. unfriendly. in case, if using gui , dialog boxes have make sure unicode dialog boxes or nothing work. with few more details, give more specific advice.

javascript - XMLHttpRequest with status 0 -

i'm trying use xmlhttprequest, when call xmlhttp.send(post), received xmlhttp state 1 , status 0. think state equals 1 ok, because mean server connection established, why status 0? unfortunately, other side doesn't receive request. function ajaxrequest(method, url, post, callback_fn){ var xmlhttp; if (window.xmlhttprequest) { //code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else { //code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.open(method,url,true); if (method=="post"){ xmlhttp.setrequestheader("content-type", "text/plain; charset=utf-8"); xmlhttp.setrequestheader("content-length", post.length); } xmlhttp.send(post); console.log("xmlhttp.readystate = " + xmlhttp.readystate); // = 1 console.log("xmlhttp.status = " + xmlhttp.status); // = 0 } can me? cancel click , see i

regex - Windows equivalent to grep -B (before context) and -A (after context)? -

in grep understand there -b switch will... print num lines of leading context before matching lines. ... example might run command like: cvs log -n -s -w<userid> -d"1 day ago" | grep -b14 "some text" > afile is there equivalent in windows? i've got is: cvs log -n -s -w<userid> -d"1 day ago" | find "7492" > output.txt but pipes text on same line 7492 in output, whereas need of preceding lines usefully interpret information. far can see find command doesn't have switch equivalent -b switch of grep . there way of replicating aspect of grep functionality in windows? use select-string 's -context argument. example: git log | select-string limit -context 5,0 this 5 line before, 0 lines after. example happens hash matches git commit message. if enter 1 number value of parameter, number determines number of lines captured before , after match. if enter 2 numbers value, first number

regex - Regular Expression replace whole word in Hebrew -

i've created working function using vbscript replace first occurrence of whole word problem it's not working in hebrew. works in english when use hebrew doesn't not found pattern. suggestions ? function : function regexreplace(strinput,findtext,replacetext) dim re set re = new regexp re.pattern="\b(" & findtext & ")\b" re.ignorecase=true regexreplace =re.replace(strinput,replacetext) end function

gruntjs - Running multiple Grunt tasks of the same task type -

i need able run multiple tasks of same type of task within grunt (grunt-contrib-concat). i've tried couple of things below neither work. ideas on how appreciated. concat: { dist: { src: [ 'js/foo1/bar1.js', 'js/foo1/bar2.js' ], dest: 'js/foo1.js', src: [ 'js/foo2/bar1.js', 'js/foo2/bar2.js' ], dest: 'js/foo2.js' } } and.. concat: { dist: { src: [ 'js/foo1/bar1.js', 'js/foo1/bar2.js' ], dest: 'js/foo1.js' } }, concat: { dist: { src: [ 'js/foo2/bar1.js', 'js/foo2/bar2.js' ], dest: 'js/foo2.js' } } and.. concat: { dist: { src: [ 'js/foo1/bar1.js', 'js/foo1/bar2.js' ], dest: 'js/foo1.js'

security - How to connect mobile server over "ssl" ? -

i working project required provide "connectivity of mobile server on ssl". have made project on eclipse using ibm worklight plugin. using remote server on cloubees.com. my question : "how connect mobile server on ssl ?" novice on security please help. you can make connection adapter back-end server using ssl. ssl can configured between worklight adapters , back-ends importing server's self signed certificate worklight keystore. use keytool program complete configuration , configure back-end server work keystore. for procedure see: configuring ssl between worklight adapters , back-end servers using self-signed certificates

lua - How do I invert this equation? -

i'm making simple animation ball bounces repeatedly. equation bounce h = rt / 16t^2, h height, t time in seconds, , r initial speed. problem ball bounces up-side-down. i've been playing around equation, can't right. can see wrong this? function move_ball() count = count + 0.3 local h = (ints*count)-(16*(math.pow(count,2))) if (h < 0) count = 0 move_ball() collision() else ball.y = h / scale end if (ball.x - ball.rad < 0) ball.dir = ball.speed collision() elseif (ball.x + ball.rad > length) ball.dir = -ball.speed collision() end ball.x = ball.x + ball.dir end perhaps need like: ball.y = height - (h / scale) with test sure ball.y doesn't go negative.

android - How to access 'Activity' from a Service class via Intent? -

i new android programming - not have clear understanding of 'context' , 'intent'. want know there way access activity service class ? i.e. let's have 2 classes - 1 extends "activity" , other extends "service" , have created intent in activity class initiate service. or, how access 'service' class instance 'activity' class - because in such workflow service class not directly instantiated activity-code. public class mainactivity extends activity { . . @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); startservice(new intent(this, communicationservice.class)); . . } public class communicationservice extends service implements ..... { . . @override public int onstartcommand(final intent intent, int flags, final int startid) { super.onstartcom

cpu usage - Making sense of cpu info -

i know more number of processors more processes (watching movie, playing game, running firefox youtube playing simpson's episode, simultaneously) can have simultaneously going without computer slowing down. want know how make sense of linux commands cpuinfo , lscpu. lscpu architecture: x86_64 cpu op-mode(s): 32-bit, 64-bit byte order: little endian cpu(s): 8 on-line cpu(s) list: 0-7 thread(s) per core: 2 core(s) per socket: 4 socket(s): 1 numa node(s): 1 vendor id: genuineintel cpu family: 6 model: 42 stepping: 7 cpu mhz: 1600.000 bogomips: 6800.18 virtualization: vt-x l1d cache: 32k l1i cache: 32k l2 cache: 256k l3 cache: 8192k numa node0 cpu(s): 0-7 and cpuinfo: ===== processor composition ===== processor name : quad-core amd opteron(tm) processor 2354 pac

Run Time Error : java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable -

// myactivity.class package com.example.maps; import android.app.activity; import android.os.bundle; public class myactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); } } // main.xml <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.mapfragment"/> // andoidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.maps" android:versioncode="1" android:versionna

libsvm cross validation with precomputed kernel in matlab -

i trying 5 fold cross validation libsvm (matlab) using precomputed kernel, but, following error message : undefined function 'ge' input arguments of type 'struct'. because libsvm return structure instead of value in cross validation, how can solve problem, code: load('iris.dat') data=iris(:,1:4); class=iris(:,5); % normalize data range=repmat((max(data)-min(data)),size(data,1),1); data=(data-repmat(min(data),size(data,1),1))./range; % train tr_data=[data(1:5,:);data(52:56,:);data(101:105,:)]; tr_lbl=[ones(5,1);2*ones(5,1);3*ones(5,1)]; % kernel computation sigma=.8 rbfkernel = @(x,y,sigma) exp((-pdist2(x,y,'euclidean').^2)./(2*sigma^2)); ktr=[(1:15)',rbfkernel(tr_data,tr_data,sigma)]; kts=[ (1:150)',rbfkernel(data,tr_data,sigma)]; % svmptrain bestcv = 0; log2c = -1:3 cmd = ['ktr -t 4 -v 5 -c ', num2str(2^log2c)]; cv = svmtrain2(tr_lbl,tr_data, cmd); if (cv >= bestcv) bestcv = cv; bestc = 2^log2c

css - Setting horizontal menu and footer links to the right -

i can't set menu aligned way right of page, , footer links also. here's have http://prntscr.com/32snbr , want http://prntscr.com/32snrm this html, please help <head> <title>index</title> <meta name="description" content="lab exercise 4"> <meta name="keywords" content="finki, lab exercise, web design"> <style> body{ background-color: #f5f5f5; color: #4f8295; } li { float:left; } ul.foot{ display:inline; list-style-type:none; } </style> </head> <body> <div style="width: 100%; margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: 0; max-width: 62.5rem; background: #fff; padding: 15px;"> <div style="display:inline-block; width:49%;"> <img src="ukim-logo-9.png"/> <img src="finki-logo-9-en.png

C++ template inheritance does not see base class members -

please @ following code: template<class mt> class classa { public: int cnt; }; template<class mt> class classb : public classa<mt> { public: void test() { cnt++ ; } }; when compiled, g++ gives error "cnt" not declared in scope. if change cnt this->cnt, works. however, confused. can please explain why not work otherwise? the reason cnt not dependent name (doesn't depent on template paremeter), rules of language state have qualify this-> or base:: .

postgresql - how to sync django models with pre-existing database? -

i having hard time trying come reasonable design project. have existing postgres database gets updated other python scripts. web server built on django framework access postgres database update user models , display blog information logged in users. blog information being updated overnight other python scripts. now question, if have syncdb blog model existing postgres database, cause problem? ex: models.py class blog: title=... content=... author=.... and postgres db called mydb has many tables, 1 of blog table , contains columns title , content , author . how make model in sync existing database? lets included new column in db date of entry . if update model : class blog: title=... content=... author=.... date of entry=... will work. what potential problems here , simpler solutions these? p.s: have used south in past. situation here different. using db read-only django's point of view, , no data migration necessary of now. if

setting batch variables using python -

python seems process attempt : subprocess.call(['set' , 'logfile=cat'], shell=true) it returns no errors. when try using logfile variable or %logfile% , doesn't seem have set logfile anything. how 1 make batch variables within python script? what attempting is: have batch script sequentially runs several python scripts. wanted set variable within 1 of python scripts persist throughout batch script. your variable set, call returns, instance of shell ends , variable goes away. what trying accomplish exactly? sounds xy problem.

Android drag and drop image: ACTION_DROP never called -

i followed tutorial here: http://www.tutorialspoint.com/android/android_drag_and_drop.htm want make image draggable on screen. added framelayout xml file , added image inside of it. problem dragevent.action_drop never gets called. made sure implement ondrag on container framelayout , return true, still isn't getting called. //mainactivity.java public class mainactivity extends activity { imageview ima; private static final string imageview_tag = "android logo"; private android.widget.framelayout.layoutparams layoutparams; string msg; int x_cord = 0; int y_cord = 0; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); framelayout container = (framelayout) findviewbyid(r.id.container); container.setondraglistener(new ondraglistener() { @override public boolean ondrag(view arg0, dragevent arg1) { return true; } });

php - Is there a maximum number of SQL UPDATE queries, is it sensible to make them via a loop? -

i need rewrite field in large number of records in 1 of tables. i'm planning run php loop like foreach($array $k=>$v) { $sql = "update table set `time`='".$v['time']."' id='".$v['id']."' "; try { $pdo->setattribute(pdo::attr_errmode, pdo::errmode_exception); $stmt = $pdo->prepare($sql); $stmt->execute(); echo $stmt->rowcount(); // 1 } catch(pdoexception $e) { echo 'error: ' . $e->getmessage(); } } where array has close 300,000 elements. i have no idea if that's much, or trivial? in danger of crashing server way? i array slice 50,000 entries @ time, seems bit cumbersome. mysql db. my server has 2gb of "real" memory, 1.6 of free. since you're using pdo, why not prepare statement once , execute different parameters on each iteration of loop? $pdo->setattribute(pdo::

java - OSGI Classloading & Object Sharing -

ok. know class instantiated classloadera can not passed directly classloaderb because in jvm's eyes, "class" of object different in different classloader. i know serializing object send classloaderb slow , can't see osgi containers using method. if have bundlea exports service bundleb (which imports service) , method "servicemethod()" called returns objecta, how objecta passed bundlea bundleb? thanks! if import same package in 2 bundles both wired same classloader package. lets assume have bundle providing service interface , associated classes, bundle b providing service internal service impl , bundle c using service. bundle b import service interface , other packages classes of service. if new on class imported package trigger own classloader (b) load class. classloader delegate classloader package imported. service classes loaded classloader a. the same applies bundle c common classes imported loading delegated classloader a. both bun

c# - Connection string in Database First using EF doesn't work correctly -

i made model via ef when trying execute query got error: code generated using t4 templates database first , model first development may not work correctly if used in code first mode. continue using database first or model first ensure entity framework connection string specified in config file of executing application. use these classes, generated database first or model first, code first add additional configuration using attributes or dbmodelbuilder api , remove code throws exception. i added model references mvc project , added connection string mvc project same error . <connectionstrings> <add name="educationdbentities" connectionstring="data source=.; initial catalog=educationdb;user id=sa;password=ehsanakbar" providername="system.data.sqlclient" /> </connectionstrings> i exception line : protected override void onmodelcreating(dbmodelbuilder modelbuilder) { throw new uninte

jquery - hide/show multiple buttons with Select menu onChange -

i not sure if can me have < select menu > onchange shows 2 different forms when toggle. problem have update button outside of form , trying change button when form changes. below codes. can me figure out. javascript: hide/show function changelocation(val) { var id = val; //alert(id); if (id == '1') { $('#tr_1').css('display', 'table-row'); $('#tr_2').css('display', 'none'); } if (id == '2') { $('#tr_2').css('display', 'table-row'); $('#tr_1').css('display', 'none'); } } display save button out of form $(document).ready(function () { $("#location1_update").click(function () { $("#location1").submit(); }); }); $(document).ready(function () { $("#location2_update").click(function () { $("#location2").submit();

Android application not launched -

Image
i new in android development. i make simple application. when run on avd, fails. error follows :- [2014-03-22 22:46:43 - calculator] ------------------------------ [2014-03-22 22:46:43 - calculator] android launch! [2014-03-22 22:46:43 - calculator] adb running normally. [2014-03-22 22:46:43 - calculator] performing com.jhamb.calculaor.mainactivity activity launch [2014-03-22 22:46:46 - calculator] launching new emulator virtual device 'nexus4_avd' [2014-03-22 22:47:17 - emulator] emulator: emulator window out of view , recentered [2014-03-22 22:47:17 - emulator] [2014-03-22 22:47:17 - calculator] new emulator found: emulator-5554 [2014-03-22 22:47:17 - calculator] waiting home ('android.process.acore') launched... [2014-03-22 22:53:27 - calculator] home on device 'emulator-5554' [2014-03-22 22:53:27 - calculator] uploading calculator.apk onto device 'emulator-5554' [2014-03-22 22:53:28 - calculator] installing calculator.apk... [2014-03-22 2

javascript - Jquery changing focused input -

i trying make system when fill text box moves onto next. have code: $('#txt1').keyup(function() { if(this.value.length == $(this).attr('maxlength')) { $('#txt2').focus(); } }); i want make continues go on echo #txt3 #txt4 ect. there way change focused text box via arrow keys. e.g. when arrow key pressed selected changed #txt4 #txt3 , opposite down key. thanks in advance. here code address first question. added class attribute convenience , replaced "maxlength" attribute html "size" attribute. html <p><input type="text" class="navigable" id="txt1" data-number="1" size="2" placeholder="dd"></p> <p><input type="text" class="navigable" id="txt2" data-number="2" size="2" placeholder="mm"></p> <p><input type="text" class="

javascript - page with video content not display the video when i use loadXMLDoc () in my php file -

i want open link page contain flowplayer-3.2.18 in div form same page .i using loadxmldoc () in php file. when click on link page open contents display correctly video not show. script <script type="text/javascript"> function loadxmldoc(id) { var xmlhttp; var myid=id; if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else { // code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("content").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("post","videopage.php?name="+myid,true); xmlhttp.send(); } </script> and accessing code <a href="javascript: loadxmldoc('<?php echo $

jquery - Replace Text but not inside url -

i have following structure: <div class='xx'> awesome!! <a href="http://www.his-stuff.com">yodel</a> </div> <div class='xx'> can't touch </div> now want replace occurrances of "is", no matter if standing alone or not. made way: $('.xx').each(function() { $(this).html($(this).html().replace("is","was")); }); i want following results: that awesome -> awesome can't touch -> can't touch thwas this works, url containing "is" modified www.hwas-stuff.com i not want url replaced others info: cannot use text() instead of html() because "real" code bit more complex (inserts images instead of text) try this: $('.xx').contents().filter(function() { return this.nodetype == node.text_node && this.nodevalue.trim() != ''; }).each(function() { this.nodevalue = this.nodevalue.repl

php - MYSQL count subquery on current row -

i having trouble query , hoping can help. select mytable.id, mytable.subject, mytable.upvotes, mytable.downvotes, (select count(id) mytable mytable.thread = mytable.id) comments_count mytable basically have table posts , comments, comments thread tied id of original post. in query want show how many relpies (how many threads = id) rows current id/row. i hope makes sense :) you need specify the table new alias match in subquery other wise match thread id same table select m.id, m.subject, m.upvotes, m.downvotes, (select count(id) mytable mytable.thread = m.id) comments_count mytable m or better use left join select m.id, m.subject, m.upvotes, m.downvotes, count(mm.id) comments_count mytable m left join mytable mm on(mm.thread = m.id) group m.id

.ddl missing error when trying to install libs on Python 2.7 - Win 8.1 -

i trying install python 2.7 , usual libs. python 2.7 installed (and shell seems ok) - config : win8.1 64bits setuptools, pip , virtualenv installed after that microsoft visual c++ 2008 redistribuable installed (to fix [vcvarsall.bat] error), , unistalled basic 2010 visual studio. when try install libs these popup errors: installation on virtual env = msvcr100.dll missing installation without env = python27.dll missing here 1 sample trying install psyopg2 writing manifest file 'pip-egg-info\psycopg2.egg-info\sources.txt' warning: manifest_maker: standard file '-c' not found error: ---------------------------------------- cleaning up... removing temporary dir c:\users\xcpro\appdata\local\temp\pip_build_xcpro... command python setup.py egg_info failed error code 1 in c:\users\xcpro\appdata\local\temp\pip_build_xcpro\psycopg2 exception information:

java - Unable to load AWS credentials from the /AwsCredentials.properties file on the classpath -

using code setting class path awscredentialsprovider credentialsprovider = new classpathpropertiesfilecredentialsprovider(); ec2 = new amazonec2client(credentialsprovider); below format awscredentials.properties file # fill in aws access key id , secret access key # http://aws.amazon.com/security-credentials accesskey = keyhere secretkey = secretkeyhere below exception getting exception in thread "main" com.amazonaws.amazonclientexception: unable load aws credentials /awscredentials.properties file on classpath @ com.amazonaws.auth.classpathpropertiesfilecredentialsprovider.getcredentials(classpathpropertiesfilecredentialsprovider.java:81) @ com.amazonaws.services.ec2.amazonec2client.invoke(amazonec2client.java:8359) you getting exception because aws sdk unable load credentials. should goto preferences goto aws , add secret key , access key. project can retrieve both keys.

Lua's tostring() in C? -

is there lua api function equivalent tostring(), or have following in c code? lua_getglobal(l, "tostring"); // ... push value convert, and: lua_call(l, 1, 1); the long story: i'm writing alert(message) function in c (callable lua) show message user. if message isn't string (e.g., boolean or nil), want convert sane. there's lua function this, tostring() , wondering if lua's c api provides "direct" way this. use lual_tolstring from reference: [-0, +1, e] const char *lual_tolstring (lua_state *l, int idx, size_t *len); converts lua value @ given index c string in reasonable format. resulting string pushed onto stack , returned function. if len not null , function sets *len string length. if value has metatable " __tostring " field, lual_tolstring calls corresponding metamethod value argument, , uses result of call result.

web services - How to Parse SOAP Response from a third party server using Java -

i newbie soap services, want extract xml following soap response belongs corresponding soap request, xml contained in string tag. want extract xml string tag. please give me solution example <?xml version="1.0" encoding="utf-8"?> <string xmlns="http://www.webservicex.net/"> <stockquotes> <stock> <symbol>string</symbol> <last>0.00</last> <date>n/a</date> <time>n/a</time> <change>n/a</change> <open>n/a</open> <high>n/a</high> <low>n/a</low> <volume>n/a</volume> <mktcap>n/a</mktcap> <percentagechange>n/a</percentagechange> <annrange>n/a - n/a</annrange> <earns>n/a</earns> <p-e>n/a</p-e> <name>string</name>

html - How to prevent a CSS animation from going back to its original position? -

so, css moves div -40px after 3 seconds. after doing so, div moved original position. here code: #jsalert { width: 100%; height: 40px; position: absolute; left: 0px; top: 0px; background-color: rgba(0, 0, 0, 0.6); animation:mymove 3s; animation-delay: 3s; /*safari , chrome*/ -webkit-animation: mymove 2s; -webkit-animation-delay: 2s; } @keyframes mymove { {top: 0px;} {top: -40px;} } @-webkit-keyframes mymove /*safari , chrome*/ { {top: 0px;} {top: -40px;} } how prevent div returning original position? you need use animation-fill-mode value set forwards from mozilla developer network: the target retain computed values set last keyframe encountered during execution. last keyframe encountered depends on value of animation-direction , animation-iteration-count demo

css - Why does addClass() work before start animation in jQuery? -

i use queue() . cannot div turned red only after animation ends. how correctly? fiddle: http://jsfiddle.net/hrt6u/ html: <div class="ext_div"> <div> <span>a</span> </div> </div> js code: $("div.ext_div div").queue( function() { $(this).animate({opacity: "1", right: "400px"}, {duration : 1200, step : function() { $(this).css("overflow", "visible"); $(this).addclass("animation_end"); } }).dequeue(); }); change "step" "complete" this: $(document).ready(function() { $("div.ext_div div").queue( function() { $(this).animate({opacity: "1", right: "400px"},{duration : 1200, complete : function() {

jsf - TagException ... null (File not found) on creating custom Facelets tag -

this question has answer here: filenotfoundexception when using facelets tagfile 1 answer i creating application based on jsf 2.2 (mojarra). using java ee ear project , dynamic web project generated eclipse, , glassfish server. i created facelet tag file shown in https://stackoverflow.com/a/5716633/2266635 . when load page containing tag error (and http 500 error): 2014-03-24t00:32:10.904+0100|warning: standardwrappervalve[faces servlet]: servlet.service() servlet faces servlet threw exception javax.faces.view.facelets.tagexception: /index.xhtml @19,19 <fmk:login-form> null @ com.sun.faces.facelets.tag.usertaghandler.apply(usertaghandler.java:144) @ javax.faces.view.facelets.compositefacelethandler.apply(compositefacelethandler.java:95) @ javax.faces.view.facelets.delegatingmetataghandler.applynexthandler(delegatingmetataghandler.java:137)

Is EJB MDB is JMS Push model or Pull model? -

know using ejb mdb can consume messages through pub/sub or p2p. when saw comparision according jms specification, pub/sub using push model , p2p using pull model. true, can't consume p2p messages in mdb using push model? should configuration changes or purely server providers implementation or both. thanks you speaking difference between topic , queue. so, pub/sub topic , p2p queue. implementing push or pull model depends of server , cannot change behavior.

database - #1130 - Host ‘localhost’ is not allowed to connect to this MySQL server -

i issued command of: drop user 'root'@'localhost'; grant privileges on . 'root'@'%'; ...in phpmyadmin. after execution, forced out phpmyadmin. got: error #1130 - host 'localhost' not allowed connect mysql server, how resolve problem? use ip instead: drop user 'root'@'127.0.0.1'; grant privileges on . 'root'@'%'; for more possibilities, see this link . to create root user, seeing mysql local & all, execute following command line (start > run > "cmd" without quotes): mysqladmin -u root password 'mynewpassword' documentation , , lost root access in mysql .

java - How to display an image from a url in android -

i working on first android application. need display image url in app. tried in following way: mainactivity file: public class mainviewactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main_view); int loader = r.drawable.loader; // imageview show imageview image = (imageview) findviewbyid(r.id.image); // image url string image_url = "http://..../landing.png"; // imageloader class instance imageloader imgloader = new imageloader(getapplicationcontext()); imgloader.displayimage(image_url, loader, image); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.activity_main_view, menu); return true; } } here getting error in line int loader = r.drawable.loader; the class file are: