Posts

Showing posts from May, 2014

href - How to find hyperlinks with XPath -

i've tried .//*[@id='post-31']/div/div/div/a[1] on input: <!-- language: lang-html --> <div class="entry-content"> <div class="myaccount"> <div class="user-profile-links"> <a href="http://store.demoqa.com/products-page/your-account/?tab=purchase_history">purchase history</a> | <a class="current" href="http://store.demoqa.com/products-page/your-account/?tab=edit_profile">your details</a> | <a href="http://store.demoqa.com/products-page/your-account/?tab=downloads">your downloads</a> </div> </div> </div> for example posted, there no root element id-attribute, explain why wouldn't work. xpath expression /div/div/div/a[1]/@href finds href first a-element.

.net - Waiting DownloadFileAsync with ManualResetEvent c++/cli -

i'm having little frustrating problem in c++/cli windows forms application. so problem have download file webserver using webclient istance. use downloadfile , not downoadfileasyn, if want show progress bar showing progress of download file, must use downloadfileasyn. how can wait process of downloading until it's finished ? the code is: ref class example{ private: static system::threading::manualresetevent^ mre = gcnew system::threading::manualresetevent(false); public: void download(); void downloadfilecompleted(object^ sender, system::componentmodel::asynccompletedeventargs^ e); }; void example::download(){ webclient^ request = gcnew webclient; request->credentials = gcnew networkcredential("anonymous", "anonymous"); request->downloadfilecompleted += gcnew system::componentmodel::asynccompletedeventhandler(this,&filecrypt::downloadfilecompleted); request->downloadf

multithreading - How to access networking singleton object in separate thread in android? -

my singleton networking object: public class communication implements runnable{ private static communication minstance = null; private bufferedoutputstream socketoutput = null; private printwriter printout = null; private socket socket = null; private scanner reader = null; public static communication getinstance(){ if(minstance == null) { minstance = new communication(); } return minstance; } public void login() { //login functionality } public void run() { //connect server using loopback address try{ socket = new socket("192.168.0.3", 4242); //set inputs , out puts socketoutput = new bufferedoutputstream(socket.getoutputstream()); printout = new printwriter(socket.getoutputstream(), true); reader = new scanner(socket.getinputstream()); } catch( unknownhostexception

c# - EF Code First Migration modelBuilder -

Image
i have 2 entities in c# code: public class currency { public int currencyid { get; set; } public string currencyname { get; set; } public virtual icollection<currencyrate> currentcurrencyrates { get; set; } public virtual icollection<currencyrate> targetcurrencyrates { get; set; } } public class currencyrate { public int rateid { get; set; } public datetime ratedate { get; set; } public decimal ratevalue { get; set; } public int currentcurrencyid { get; set; } public int targetcurrencyid { get; set; } public virtual currency currentcurrency { get; set; } public virtual currency targetcurrency { get; set; } } and have context class: public economicappcontext() : base("economicapp") { } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.entity<currencyrate>().property(v =>

asp.net - A WHERE statement in my SqlDataSource causes invalid character exception (ORA-00911), why? -

i'm using oracle developer tools , generated select command is: selectcommand = "select &quot;firstname&quot; &quot;users&quot; (&quot;username&quot; = ?)">` then removed &quot; , replaced them single quote: ' . then error (mentioned in title). any suggestions how can make work? you should using this select firstname users username='%?' just replace value in condition live values. note down syntax of sql

java - Why isn't this View.setText function call not working -

this question has answer here: unfortunately myapp has stopped. how can solve this? 15 answers the above code executed without problem.but when added "mquestiontextview.settext(question);" app crashes on startup.i guess,syntactically instruction correct.need help public class mainactivity extends actionbaractivity { private textview mquestiontextview; private truefalse[] mquestionbank = { new truefalse(r.string.question_africa,false), new truefalse(r.string.question_americas,true), new truefalse(r.string.question_asia,true), new truefalse(r.string.question_mideast,false), new truefalse(r.string.question_oceans,true) }; private int mcurrentindex = 0; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mquestiontextview

How do I locate the source of a segmentation fault? (CS50: recover.c) -

i trying make program in c cs50 recovers jpg's .raw file (reads 512 bytes @ time , sees if begins jpg stuff), keeps segmentation faulting. how tell source of problem is? guys! (here's code reference) /** * recover.c * * computer science 50 * problem set 4 * * recovers jpegs forensic image. */ //0xff 0xd8 0xff 0xe0 //0xff 0xd8 0xff 0xe1 #define block 512 #define start1end 0xe0 #define start2end 0xe1 #include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <stdint.h> //making variables int found = 0; char* title; file* img; int ifopen = 1; int main(int argc, char* argv[]) { //opening file file* inptr = fopen("card.raw", "r"); //checking if file opening failed if (inptr == null) { return 2; } //sets begins or jpgs uint8_t checkjpg1[4] = {0xff, 0xd8, 0xff, 0xe0}; uint8_t checkjpg2[4] = {0xff, 0xd8, 0xff, 0xe1}; //making buffer unsigned char buffer[512

php - Website on IIS server takes 10-15mins to load -

i have big website many visitors daily. when large increase in visitors website keeps loading 10-15 minutes (for long time). this not dos attack, have figured out. it's iis php, because see many (100+ fastcgi.exe) php fastcgi.exe processes in task manager. my ram , cpu fine, have 128gb ram. use 8-9 gb ram. i think website script loading ever , stuck. has iis setting set script running higher? have checked logs , can see this: the fastcgi process has failed recently i using windows server 2008, can replicate behaviour on windows server 2012 also. i'm using wincache opcode cache.

Convert double and vertex handle into a string in c++ -

i want convert vertex handle(vit) , double value string , write file.i thought works. string buffer = vit->point() + " " +z_co[vit->id] +"\n"; z_co:is vector.(double) but,it throwing error.so,how this? you can't append double string that. instead use e.g. std::ostringstream : std::ostringstream os; os << vit->point() << " " << z_co[vit->id] << '\n'; std::string buffer = os.str();

c# - How to implement two way binding to collection that represents data from externally modifiable database? -

i have model bound view listview using viewmodel observablecollection. the model implements inotifypropertychanged interface. if there change in of properties view getting updated. but if new row gets added database view not getting updated. in case third party webservice writes data database. whenever data gets added/deleted want update ui. how can achieve this? viewmodel.cs public observablecollection<employee> employeelist {get; set;} view: listview.itemssource = viewmodel.employeelist you can write own class raises , event every time , object added , listen it. also , following question has more details how notification on change in observablecollection object

java - How does socket.setSoTimeout works? -

i have code service: inputstream readein = socket.getinputstream(); char [] buffer = new char[1024]; bufferedreader in = new bufferedreader(new inputstreamreader(readein)); while((counter = in.read(buffer)) != -1) { socket.setsotimeout(300000); //read here } i ask 2 questions: if, after 300000 milliseconds, doesn't read anything, there exception? every time while loop comes up, refreshes socket timeout? example read time out @ 100 seconds, when comes return @ 300 seconds? thank answers.

HTML/CSS Image Rollover/Animation, specific case with existing code, how to change animation? -

Image
ok, have don web development in past, new "css/webkit" animations. i have image on website, goes through animation when user "hovers" on image, so: what want change animation. i want remove red "arrows" icon @ bottom-right. think want keep opacity transition, but, want display different image, if user hovering on image. here html code image: <div class="col-md-4"> <div class="team" data-animation-name="fadeinright"> <div class="team-photo"> <figure> <img src="demo/team/dfds_seaways_ship.jpg" alt=""> <figcaption> <a href="#"> <i class="gi gi-resize-full"

c# - Accessing Azure Mobile Service on Windows Phone from Different Projects -

hello having following exception: additional information: request not completed. (bad request) i did not understand why since function worked therefore found following on stackoverflow: mobileserviceinvalidoperationexception when trying retrieve data azure . issue unfortunately not solve issue. the time correct , using https connection. , communication working perfectly. have divided windows phone silverlight application several projects, reason have stated in stackoverflow question: deleting project/pages/usercontrols memory . the application flow is: project 1: login (authenticate mobileservice) navigate mainmenu, upon success. service contacted await mobileservice.invokeapiasync<dto.userinfodto, dto.userinfodto>(userinfodto); success allways! mobileservice saved resources application.current.resources.add("navigationparam", app.mobileservice); , navigating new project done. project 2: navigation parameter retrieved mobileservice = mobi

c++ - Creating a customised shell -

i have created customized shell in c++. currently, shell designed infinite while loop started running corresponding executable terminal (i using ubuntu os). shell implements few new commands each stored separate executables in file system. rest of commands user enters directly executed using execve() wrapper function. so, essentially, executing user commands using execve() function: customised commands stored separate exectuables , " exec ed" providing path executable whereas other "standard" unix command directly exec ed. instead of running separate executable bash , want make user use shell executes on terminal . how can that? i referred following links: processes , sessions , controlling terminals creating unix shell however, unable figure out links association between controlling terminal , shell etc. appreciated in regards. update: this may sound bit illogical but: is there way implement user command user can execute current shell?i know

class - The connection between 'System.out.println()' and 'toString()' in Java -

what connection between system.out.println() , tostring() in java? e.g: public class { string x = "abc"; public string tostring() { return x; } } public class ademo { public static void main(string[] args) { obj = new a(); system.out.println(obj); } } if main class runs, gives output "abc" . when remove code overrides tostring() , gives output "a@659e0bfd" . so, can explain working principle of system.out.println() when use parameter object? connected tostring() method? system.out printstream . printstream defines several versions of println() function handle numbers, strings, , on. when call printstream.println() arbitrary object parameter, the version of function acts on object . version of function ...calls @ first string.valueof(x) printed object's string value... looking @ string.valueof(object) , see returns if argument null, string equal "null"; otherwis

javascript - How to stick the bottom part of a div to top of the screen when scrolling down? -

imagine div has height of 300 px, , @ bottom there div nested height of 100 px. i'd freeze (stick top) 100 px div, background properties (eg. background color) set in container div. jsfiddle body { padding: 0; margin: 0; border: 0; } #first { background: #121212; width: 100%; height: 300px; color: #ffffff; } #nonsticky { height: 200px; } #sticky { background: rgba(255, 255, 255, 0.3); height: 100px; } #second { background: #cecece; width: 100%; } p { padding: 15px 30px; margin: 0; } <div id="first"> <div id="nonsticky"> <p>this div should scroll away when scrolling down page.</p> </div> <div id="sticky"> <p>this div should stick top of screen when scrolling down page. however, "first" div should stick, background properties set there.</p> </div> </div>

javascript - How to copy text inside an HTML element into clipboard using ng-clip? -

i'm creating simple angularjs app using ng-clip . code: <!doctype html> <html> <head> <link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.min.js"></script> <script src="src/zeroclipboard.min.js"></script> <script src="src/ngclip.js"></script> </head> <body> <div ng-app="myapp"> <div class="container" ng-controller="myctrl"> <div class="page-header"> <h3>simple script</h3> </div> <form> <div class="form-group"> <label>name</label> <input type="text" class="form-control" placeholder="" ng-model="name"> </div> &

html - Make element position fixed while width = 100% stays valid -

i'm having problem html , css(still learning both). i'm trying make standard layout image in div fixed top of page, under horizontal navigation bar, footer, , news module in between. this how looks currently: http://pokit.org/get/?05aadb16da601f1aa68bc3321e891107.jpg you can see problem(2 actually). can't position list on navigation bar image, nor can make footer image wide navigation image. this html: <!doctype html> <html> <head> <meta charset="utf-8"> <link rel = "stylesheet" href = "/servis/stilovi/standardstyle.css"> <title>granulo - re d.o.o</title> </head> <body> <!-- element koji cini header --> <div id = "headers"> <img id="aparat_slika" src="/servis/resursi/slike/aparat_slika.png" alt="slika nije ucitana"> <img id="logo_slika&

Dealiasing Types in Scala reflection -

how can resolve aliases given type ? i.e. import reflect.runtime.universe._ type alias[a] = option[option[a]] val tpe = typeof[alias[_]] val existentialtype(quantified, underlying) = tpe how option[option[_$1]] underlying (or tpe )? know typesymbol resolve aliases, seems lose parameters in process: scala> val tt = typeof[alias[_]].typesymbol tt: reflect.runtime.universe.symbol = class option scala> tt.astype.totype res3: reflect.runtime.universe.type = option[a] scala> tt.astype.typeparams res4: list[reflect.runtime.universe.symbol] = list(type a) the method turns out called normalize in 2.10 (deprecated , dealias added in 2.11). don't know how managed miss during first search.

What web server does ASP.NET MVC 5+ use on non-Windows platforms? -

i confused cross-platform aspects of asp.net 5 , beyond relates web applications. if not have iis on linux or mac osx, container use run asp.net (for web)? i saw example using cloud based, if want hosted in-house? asp.net today not run outside windows, vnext due later year (in beta now) will. perhaps take @ beta @ asp.net/vnext

android - My application is crashing when i'm getting push notification -

i updating fragment sqlite when getting push notification server when on same fragment it's update. when on activity , getting push notification application crashing. here exception : 03-28 22:18:03.302: e/androidruntime(17631): fatal exception: main 03-28 22:18:03.302: e/androidruntime(17631): process: com.newt.vdsi.driver, pid: 17631 03-28 22:18:03.302: e/androidruntime(17631): java.lang.illegalstateexception: can not perform action after onsaveinstancestate 03-28 22:18:03.302: e/androidruntime(17631): @ android.support.v4.app.fragmentmanagerimpl.checkstateloss(fragmentmanager.java:1360) 03-28 22:18:03.302: e/androidruntime(17631): @ android.support.v4.app.fragmentmanagerimpl.enqueueaction(fragmentmanager.java:1378) 03-28 22:18:03.302: e/androidruntime(17631): @ android.support.v4.app.backstackrecord.commitinternal(backstackrecord.java:595) 03-28 22:18:03.302: e/androidruntime(17631): @ android.support.v4.app.backstackrecord.commit(backstackrecord.java:574)

android - How do I disable sliding tabs when in contextual action bar, by making the tabs not clickable/swipeable? -

i have toolbar, have attached sliding tab layout, using these 2 classes: slidingtablayout , slidingtabstrip . when long press item, contextual action bar appears , overlays toolbar, using <item name="windowactionmodeoverlay">true</item> in styles.xml. problem tabs still clickable, , swipable. have tried setclickable(false) , didn't work. how make tabs not clickable, can change "state look" of tabs disabled state, code in xml file within drawable folder, seen below. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" android:drawable="@color/primary_dark" /> <item android:drawable="@android:color/transparent" /> any appreciated thanks. put flag in slidingtablayout isactionmodeenabled. set every time action mode created , unset on every destruction. based on configure onclick() of tabclicklistener class if isacti

bash - How to make kate copy (ctrl+c) with xdotool -

i trying make kate editor copy current line or current selection clipboard using xdotool. using xdotool move cursor , delete , other actions not copy. copy shortcut (ctrl+c) works if press in kate not when call xdotool. here code. surprisingly, result of info empty after @ end. dummyclip="dummy!!!" echo -n $dummyclip | xclip -selection clipboard xdotool search --name kate key ctrl+c info=$(xclip -o -selection clipboard) i have struggled lot. highly appreciated.

asp.net mvc - Override ModelBinder to change the way validation happens -

can override modelbinding process model in order change way validators searched model , properties? i want apply validators conditionally depending on parameter passed model binder request context. i wondering if possible @ all?

pdo - JSON response not as expected using php -

i know simple question, can't find answer issue, maybe because basic php programming question. function using pdo (php): <?php function getallusers(){ try { $conn = getconnection(); //connects database, no explanation needed... uses pdo $dbh = $conn->prepare("select * user;"); $dbh->execute(); $users = $dbh->fetchall(); //<---this maybe error $conn = null; return $users; }catch (pdoexception $ex){ echo "error: ".$ex->getmessage(); } } ?> and when consume api i'm implementing, use other php script (using slim framework, still pretty understandable) <?php $app->get("/user",function() use($app){ $app->response->headers->set("content-type","application/json"); $app->response->status(200); $result = getallusers(); //call function getallusers $app->response->body(json_encode($result)); }); ?&

Sieve of Eratosthenes prime numbers up to a million c++ -

so need code. reason keeps crashing when enter number past 500,000. here exact assignment. implement sieve of eratosthenes , use find prime numbers less or equal 1 million. use result prove goldbach's conjecture integers between 4 , 1 million, inclusive. implement function following declaration: void sieve(int array[], int num); this function takes integer array argument. array should initialized values 1 through 1000000. function modifies array prime numbers remain; other values zeroed out. this function must written accept integer array of size. must should output primes numbers between 1 , 1000000, when test function may on array of different size. implement function following declaration: void goldbach(int array[], int num); this function takes same argument previous function , displays each integer between 4 , 1000000 2 prime numbers add it. the goal here provide efficient implementation. means no multipl

javascript - How to extract data from div id using ajax? -

i'm trying figure out how that, don't have clue. need text div using ajax , use php send smtp, believe need know how make ajax part. let's have this: <div id="trajeto-texto1"> <span id="resultado"> <div class="calculo"><label>distância: 0.00 km</label></div> <div class="calculo"><label>duração: 0 min.</label></div> <div class="calculo"><label>custo: r$ 0,00</label></div> </span> </div> and need parse every single text inside div id "trajeto-texto", or inside span id "resultado". it's php echo, in javascript. console debugging, apparently there nothing related form: failed load resource: server responded status of 404 (not found) main.js:61 uncaught typeerror: undefined not function main.js:60 have included google maps api multiple time

JAVA using assigned values from an array in a calculation -

this basic question have started out java , have hit bit of bump regards arrays. what trying populate array 6 pieces of information user: number of employees input, an alphanumeric employee number, a first name, a last name, the number of hours have worked, a number input corresponding pay scale. so far have gotten these inputs array in java wanted use corresponding number input select constant within pay scale array , use constant calculate wages of each employee. for instance employee 1 worked 10 hours @ scale 0 10*4.50 , employee worked 10 hours @ scale 1 10*4.62 import java.util.arrays; //imports array utility import java.util.scanner; //imports scanner utility public class test1 { static scanner keyb = new scanner(system.in); //adds keyboard input public static void main(string[] args) { scanner scanner = new scanner(system.in); system.out.println("enter number of employees: "); int employees = scanner.nextint()

Visual Studio 2013 Crashes When Intellisense Fires -

visual studio crashing when intellisense fires while typing code, new. have been using vs 2013 awhile now, never had issue. had turn intellisense off work done , miss it...anyone know why happening? i haven't changed settings or done updates, i'm stumped! thanks suggestions i found problem ...about 3 weeks ago installed exstention called developer assistant. exstention has never given me problem until other night, after disabled exstention crashes stopped. maybe can else same problem.

Different hover effects [html/css] -

i have menu hover effect on listed links/ items. want put home icon (the house), hover effect switching between 2 identical images different color, ok got this, main hover effect still applies background. for example, when move mouse on of links hover effect orange background around text, , want remove effect home icon only( there's switching between white house , orange house on mouse over). i've tried many things , still nothing successful... thank in advance! picture of i'm talking about html code: <div class="menu"> <div class="ner"> <ul> <li class="home"> <a href="#" ><img onmouseout="this.src='home1.png'" onmouseover="this.src='home2.png'" src="home1.png" width=25px; height=25px;></a></li> <li><a href="#">item1</a></li> <li class="

java - Abstract Class with only abstract methods and Interface - Which should I use? -

this question has answer here: interface vs abstract class (general oo) 32 answers please note. question not abstract class vs interface kind of question. yes. know. it's not necessary class extends abstract class override of unimplemented methods. if child class not giving definition of parent's unimplemented methods, child class considered abstract. but class implements interface should implement of methods ( multiple inheritance possible interfaces). is difference between abstract class abstract methods , interface ? yes, understand. abstract class can have states , method implementations. i'm making question clear. not interface vs abstract class kind of question. here, in question, abstract class not having data members or method implementations. abstract methods only. eg: abstract class shape{ abstract void draw(); } i want know w

java - Returning a HashMap collection with simple property keys in QueryDsl -

in querydsl, return simple map<string, object> collection. imagine there's simple way it. i've used qmap, returns keys qualified properties instead of simple properties. so instead of items looking using qmap collection: { poolmaster.calculatevalue: "y" poolmaster.downloadstats: "y" poolmaster.maxplayervalue: 25 poolmaster.minplayervalue: 5 poolmaster.pickdeadline: 1430366400000 size(poolmaster.poolsequences): 1 poolmaster.year: 2015 } i'd items this: { calculatevalue: "y" downloadstats: "y" maxplayervalue: 25 minplayervalue: 5 pickdeadline: 1430366400000 poolsequencescount: 1 year: 2015 } this elaborate solution far, i'm hoping querydsl has built in. public collection<map<string, object>> findall() { return this.from(poolmaster) .orderby(poolmaster.year.desc()) .list( map(

php - Redirect route with input -

consider scenario, have following pair of routes: route::post('cart/update', ['uses' => 'cartcontroller@update', 'as' => 'cart.update']); route::match(['get', 'post'], 'order/checkout', ['uses' => 'ordercontroller@checkout', 'as' => 'order.checkout']); in cart.update route, if this: return redirect::route('order.checkout')->withinput(); and use dd(input::all()) @ order.checkout , receive empty array. however, instead if use dd(input::old()) , receive array input values expecting. is supposed behave that? shouldn't receive input::all() @ order.checkout route? from laravel docs: http://laravel.com/docs/4.2/requests#old-input you may need keep input 1 request until next request. example, may need re-populate form after checking validation errors. since want flash input in association redirect previous page, may chain inp

unordered map - A non-loop efficient way to erase from unordered_map with predicate C++11? -

algorithms , member functions suggested on looping efficiency when working containers. however, associative containers (unordered_map) not work erase(remove_if) paradigm, appears common method fall on loop. uom std::unordered_map for(auto = uom.begin() ; it!=uom.end(); ){ if(it->second->toerase()) { delete it->second; // omit delete if using std::unique_ptr fpc.erase(it++); }else{ ++it; } } //as per scott meyers effective stl pg45 is efficient possible? seams there should better way using erase(remove_if) paradigm works unordered_map (i understand associative containers cannot "re-ordered" hence non-support of remove_if algorithm). best way erase entries unordered_map using predicate? suggestions? thank in advance. that efficient possible. if want more convenient, use boost's erase_if template - see here . unordered_map maintains linked list of nodes in each bucket, it's cheap erase them. th

CakePHP not inserting into model -

my model: class buyitpackage extends appmodel { var $name = 'buyitpackage'; var $belongsto = array('user', 'auction'); function __construct($id = false, $table = null, $ds = null){ parent::__construct($id, $table, $ds); } } my save action: function add($user_id = null, $auction_id = null) { $this->buyitpackage->create(); // line 23 $data = array ( 'buyitpackage' => array( 'user_id' => $user_id, 'auction_id' => $auction_id, 'name' => '', 'price' => 0.00, 'contract' => '', 'points' => 0 ) ); $this->buyitpackage->save($data); } when navigate add() action error generated undefined property: buyitpackagescontroller::$buyitpackage [app/controllers/buy_it_packages_controller.php, line 2

multithreading - Concurrent queue consumption enigma in java -

trying speed image processing using java opencv, tried use parallel stream consume queue of opencv <mat> . if time algorithm , count left on queue, incoherent results when processing stream in parallel, sequential computing results correct. since used concurrentlinkedqueue() , thought thread safety , asynchronicity, apparently not. know how circumvent problem? remarks: elements still being put on queue during consumption i running 4 real (8 virtual) core processor results sequential stream: frame collection start size (=production): 1455 frame collection end size (=production - consumption): 1360 resulting list size after algorithm run (=consumption): 100 algorithm: 6956 ms results parallel stream: frame collection start size (=production): 1455 frame collection end size (=production - consumption): 440 resulting list size after algorithm run (=consumption): 100 algorithm: 9242 ms my code: public class ovusculetes

node.js - React Components on the Server -

i've been playing around react while still can't wrap head around on how integrate existing node/express/handlebars app. for example, if had feed component required json data fetched aws - how handle this. var videofeed = require('./component/videofeed'); app.use('/', function(res, req) { dataservice.getvideofeed().then(function(data) { res.render('home', {videocomponent: react.rendertostring(<videofeed feed={data} />); }); }); home <!doctype html> <body> sample text. here's video feed {{videocomponent}} </body> </html>

Accessing Azure Service Bus Queue from Azure Website -

i can't access azure service bus queue azure website once deployed cloud. while running on localhost, if works fine , can send message queue, if deploy application, on remote server getting exception while creating queueclient: "the socket connection aborted because asynchronous send socket did not complete within allotted timeout of 00:00:59.4820817. time allotted operation may have been portion of longer timeout." i using queueclient.createfromconnectionstring(connectionstring) method. debugger shows fine connectionstring variable. the connection string is: endpoint=sb://[removed].servicebus.windows.net/;sharedaccesskeyname=rootmanagesharedaccesskey;sharedaccesskey=[removed] i have tried set "copy local = true" references without success. using windowsazure.servicebus 2.6.4 nuget. also, exception not raised on namespacemanager.queueexists(name) if queue exists, exception raised on namespacemanager.createqueue(name) if not exist

powershell - Find out if process is running in a cmd.exe or PoweShell window -

imagine you're writing program in high level language not allowed custom system calls (win32 api) because code cross compiling or language doesn't support that. when process running on windows, there way find out if you're running inside powershell , not cmd.exe? or vice versa? i'm trying print "i'm running in powershell" , "i'm running in cmd.exe" program. in case i'm writing program in golang shouldn't matter because don't want traverse process tree. eryksun might have point usefullness of there post getting parent process . putting following text ps1 script: $parentpid=(gwmi win32_process -filter "processid='$pid'").parentprocessid write-host ("i running in {0}" -f (get-process -id $parentpid).name) running cmd calling powershell: i running in cmd running powershell , ise: i running in explorer so while explorer not useful not cmd think wanted know.

animation - Is it possible to make the background of an android app into a animated background like a gif? -

Image
i don't mean make gif background background moves. in advance. appreciated. android not support gifs. workaround, android offers animation list/animationdrawable . need convert gif individual frames [.png files]. this gif can broken down frames: save them frame01.png, frame02.png, , on, , create animation-list xml file, say, progress_animation.xml <animation-list android:id="@+id/selected" android:oneshot="false"> <item android:drawable="@drawable/frame01" android:duration="50" /> <item android:drawable="@drawable/frame02" android:duration="50" /> <item android:drawable="@drawable/frame03" android:duration="50" /> .... <item android:drawable="@drawable/framen" android:duration="50" /> to begin animation, need cast image animationdrawable , , call start() on it animationdrawable progressanimation = (animationdrawable) yourima