w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Moved Permanently error when running dev_appserver.py
It appears that dev_apserver needs to contact the google app engine servers on the internet every once in a while (even if you do not ask it to check for updates). The problem I had was that it cannot access the google servers when behind a proxy (even though I have properly exported http_proxy and https_proxy). When I use a wired network directly connected to the internet I have no problems at all. Once dev_appserver has 'called home', it will continue to work without issue behind a proxy for a few more days, and then I get this problem again. In the past I have noticed similar behavior when connected on wifi as well. It appears that dev_appserver works best when on a wired network without proxies. This is based simply on my observations; it would be great if someone could give a def

Categories : Python

curL specific data from a webpage
Using a combination of curl and domdocument, you would then be able to (A) download the remote page, and (B) parse the dom document based off of selectors / paths.

Categories : PHP

Using ajax instead of using a php file with curl to get a response from another webpage
This sounds like it is a result of javascript's same origin policy. You will need to use techniques likes CORS or JSONp to get around this. The link above has more details.

Categories : Javascript

Calling rails api through curl
You have to pass an application/json Content-Type so rails can understand you are speaking json. Add to your curl options : -H 'Content-Type:application/json' Additionnaly, if you want to access your params with params[:user], you have to use a json object "user" to hold all the values : {"user" : {"name": "bob", "email": "bob@gmail.com", "password": "password", "company_name": "rs"}}

Categories : Ruby On Rails

Java - Calling onclick method on webpage
Simple Answer : You can't call a javascript function from Jsoup. Jsoup is primarily meant for extracting and manipulating html data. If you are interested in knowing the response to the request made in getDetails, then you can simulate the same request in Jsoup and get the response. But, If its a business logic in javascript without any server interaction which changes the DOM then you can kiss-off your idea.

Categories : Java

calling function in the javascript written in webpage(.cs)
On your url try : "PageName.aspx/MethodName". Also check out this blog post by Dave Ward : Using jQuery to directly call ASP.NET AJAX page methods

Categories : C#

Calling SOAP Web-Services with PHP cURL (moving from SOAPUI)
You can try this. This is what I used when I wound up using cURL in .php for a SOAP Web-Service. $envelope = '<soap:Envelope> .... </soap:Envelope>'; $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "https://ccws-services.ecollege.com/EnterpriseServices/v2.1/EnterpriseCourse.svc" ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $envelope); curl_setopt($soap_do, CURLOPT_VERBOSE, TRUE); curl_setopt($soap_do, CURLOPT_HTTPHEADER, ar

Categories : PHP

Command line curl to PHP curl and PHP curl returning blank file
You didn't set the POST option: curl_setopt($ch, CURLOPT_POST, 1); If that doesn't work: I notice you're connecting via SSL. Unless you have all the certificates sorted, try this curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); But read up on what this means.

Categories : PHP

PHP cURL function related - what is the difference between browser visit, linux curl command and PHP cURL function?
Your first two examples you are making HTTP GET requests. In your failing php/curl example, you are using HTTP POST. I suspect you Try changing the CURLOPT_POST option: curl_setopt($ch, CURLOPT_POST, 0); The following example works for me. Notice I've added the query parameter to the url and changed the HTTP method to GET. <?php $url = "http://<INSERT URL HERE>?list=sh600123"; // ^ use query params instead of post values... $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_VERBOSE, 1); $result = curl_exec($ch); var_dump($result);

Categories : PHP

Directing to a webpage after comparing a input variable in perl webpage
You are looking for the redirect header CGI.pm: Generating a Redirection Header To elaborate, once you've computed the next URL, you add a redirect header to tell the browser to go there. There are two ways. The first way is to call redirect($new_url). The second is to call header('Location', $new_url). I've found that sometimes, the redirect() method doesn't work for me, and I have to resort to the header() method. But that may have been my old, old version of CGI.pm. The other thing to remember, is that neither of those methods end your request processing. They simply add a header to the response's header list. It's up to you to exit correctly from your script.

Categories : Forms

Bring value from one webpage to another webpage in Ruby on Rails website without database
OK, after a night of research, I was able to pull together a few different sources that helped me get an answer to this one. The most helpful answers were here: pass parameter by link_to ruby on rails and Pass Variable between Views in Rails I learned how to use link_to to pass the parameters from one view to another view (one webpage to another, to a user). Here is how I did it: newmaps.html.erb <%= link_to 'Edit', maptry_path(:newsavedmap_id => newsavedmap.id) %> The above code uses the anchor text "Edit" and links the user to the maptry.html.erb view. It also brings over the newsavedmap_id. Then, I updated the maptry_controller maptry_controller.rb @newsavedmap = Newsavedmap.find(params[:newsavedmap_id]) With this in place, I can add any of the information from

Categories : Mysql

How to convert curl file post from command line into PHP cURL
You don't need to open a handle for curl, just have $data = array( 'file' => '@move_file.MOV' ); Curl will see the @ and treat it as a file upload attempt. You also don't have to do http_build_query() either. Curl can accept an array directly and do the query building itself: curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

Categories : PHP

How to ensure a webpage's content extends to the bottom of a webpage using only CSS
Notice you specify header height in pixels and everything else in %'s also note the excess is exactly 155px over the page. The header was pushing everything downwards because you told content to take room already taken by the header new css: html, body, div, header { box-sizing:border-box; } html, body { .... height:100%; .... } #wrapper { height:100%; .... } header { height: 20%; width: 100%; .... /*Top Gradient Defined*/ ..... } #content { ..... height:80%; .... } Here's a jsFiddle example

Categories : HTML

How to Implement Command Line CURL into PHP CURL Request
In the $data array, it should be: CURLOPT_POSTFIELDS => $fields And to set all the options it should be: curl_setopt_array($ch, $data); This line doesn't do anything: $options = $fields + $defaults; You can't use + on arrays, and you never set $defaults. For authentication, you need to use the option: CURLOPT_USERPWD => 'apiuser:yru3472825fhj' instead of putting them in $data.

Categories : PHP

cURL- how to submit youtube captcha using cURL
You don't. The whole point of the captcha is to limit access to humans using web browsers and to block automated tools like the one you appear to be trying to write. Use the APIs provided instead.

Categories : PHP

Page curl in tabbed application (curl all but tab bar)
Standard curl effects are on modalViewControllers, if you use a modalVC it will take the whole screen. You will have to find another way to do the effect. Have a look at this https://github.com/xissburg/XBPageCurl Basically, XBPageCurl can be used in two different ways. It can be used to curl a view and show another view behind it where the user can interact with its elements and then uncurl the view back, pretty much like in the Google Maps app (Simple Curl sample). It can also be used to flip pages like in iBooks, where the user can drag the border of a page and release to flip it or cancel the flip (Page Curl sample).

Categories : IOS

Downloaded webpage looks different than the original webpage
This occurs because your scraped version doesn't include the Cascading Style Sheets (CSS) linked to by the page. It also won't include any images or javascript linked to either. If you want to obtain the linked files, you'll have to parse the source code you scrape for them.

Categories : Python

Log in with cURL and make an other request with cURL after
Taken from php documentation: CURLOPT_COOKIESESSION: TRUE to mark this as a new cookie "session". It will force libcurl to ignore all cookies it is about to load that are "session cookies" from the previous session. By default, libcurl always stores and loads all cookies, independent if they are session cookies or not. Session cookies are cookies without expiry date and they are meant to be alive and existing for this "session" only. So in other words, remove CURLOPT_COOKIESESSION from your second part code and your code should work.

Categories : PHP

How to permanently chmod 777 for PHP
You don't need chmod. Set an ACL on the directory: setfacl -R -d -m u:php:rwx /var/lib/folder/ This gives user php rwx rights for new files (-d = default). You can change the ACL for existing files in the folder with: setfacl -R -m u:php:rwx /var/lib/folder/

Categories : PHP

set iOS applicationIconBadgeNumber to zero, permanently?
The simple answer is no. Game Center will freely set the app badge to the number of active matches the player has in your game (including matches that the player is not the current one in), every time the data is refreshed. You can, as you say, set the app badge to 0 from within your app, but once your app is closed there's nothing to be done about it. In my app I update the app badge every time I load the player's matches from Game Center, to correspond to the number of matches that the player is the current player in.

Categories : IOS

How can I identify permanently certain builds of my app?
I believe you are doing it wrong. If there are differences, it'd be simpler to do two separate builds, otherwise you will face problems with things being overwritten by updates. Alternatively, you may split your app into modules and only these things that differ should be made different APKs - that way you can still push one update for all your users and keep differences intact

Categories : Android

how to permanently save tables in sqlite3
Some debugging steps: Check that the disk file is created when you open the sqlite database. ( Perhaps your app does not have write permission to the location you have specified for the database file? ) Check that the tables are created when execute CREATE TABLE. ( The easiest way to do this is the .SCHEMA command in the command line interface. ) Perhaps there is an error in your SQL code? Check that the data is written to the tables BEFORE you close the session. ( Again use the command line interface ) Perhaps there is an error in your SQL code? General questions: Have you checked the error return from every call to the SQLITE engine? Have you run your app under a debugger to check that the copde you wrote is actually executing?

Categories : Sqlite

Rails create not saving permanently
You might be overriding the data that user_id=2 might have had. Try creating multiple records with different user_ids and see what happens. I think that user_id might be an index in your table, which means when you save a record with user_id=2 you are writing over it.

Categories : Ruby On Rails

ProfileRequiredActionFilter - permanently redirecting user
I don't know how you apply that attribute to action but you shouldn't apply that attribute for actions like RegisterSecondStep or Signout. Just inherit from ActionFilterAttribute. public class ProfileRequiredAttribute : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { // your logic } } and apply that attribute to controller: [ProfileRequired] public class SomeController : Controller { } or action: public class SomeController : Controller { [ProfileRequired] public ActionResult Index() { } } Another option is to provide another attribute that override that behavior and in your ProfileRequiredActionFilter check if that attribute was applied to action. if (filterContext.ActionDescription.IsDef

Categories : C#

How to permanently delete a commit from Git's history?
You can use git filter-branch. Please note that this involves history rewrite, and all clones need to be recreated. You can find a good introduction to the topic in the Pro Git book.

Categories : GIT

How to permanently unpublish a free Android app?
Google Play keeps your app visible to those who purchased it or installed it, even after you unpublish it. They say it prevents users from getting disoriented if one of their apps suddenly disappears from the Play Store. Try logging out of all accounts, or signing in with a new account and looking for the free app again. If unpublished it shouldn't show up. Also note that similar to publishing, apps may take a while to disappear after being unpublished.

Categories : Android

Scrollbar is permanently determining the size of my nav tag
Your nav width is 100%! it's only going to be 100% width of the body. If you scroll to the right, your nav doesn't get any bigger. The text is just overflowing out of it. I'd suggest setting the backgrounds of each nav item to a solid color. EDIT: an odd fix: Change your width: 100% from the nav to min-width: 100%. That (and the fact that nav is a block element) is what is limiting the width. In order to make sure it flows to the right, put display: inline-block in its place.

Categories : HTML

How to backup the iPhone app data, permanently
You may use the game center account to identify the user, I see a lot of games use it. Or you can use their icloud account, not sure about that part.

Categories : IOS

How to permanently delete enemy sprites in XNA
You should consider not using your Alive property at all, and treat the objects that are in your List as enemies that are alive. This in mind, I would refactor your code to the following: protected override void Update(GameTime gameTime) { for (int i = 0; i < Enemies.Count; i++) { //If player intersects enemy if ( player.Bounds.Intersects(Enemies[i].Bounds) ) { Enemies.RemoveAt(i); i--; continue; } } } protected override void Draw(GameTime gameTime) { foreach (Enemy enemy in Enemies) { spriteBatch.Draw(enemy.texture, enemy.position, Color.White); } } In my code, we now loop through each Enemy checking for an intersection. If an intersection is found, we remove that e

Categories : C#

How to permanently change Gemfile in each new rails app
I think this is what you are looking for: http://guides.rubyonrails.org/generators.html#application-templates

Categories : Ruby On Rails

Removing Android fragments permanently
YOu can remove fragment programmatically using following code FragmentManager fm = getActivity().getSupportFragmentManager(); fm.popBackStack("NameofBackstack", FragmentManager.POP_BACK_STACK_INCLUSIVE);

Categories : Java

Is it possible to set an environment variable from Python permanently?
I am not sure. You can return the variable and set it that way. To do this print it. (python program) ... print foo (bash) set -- $(python test.py) foo=$1

Categories : Python

I want to lock the tab's orientation permanently for a application
add this to your class,it will be called automatic : //Can change from PORTRAIT to landscape, this works inside tabs fragments public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if(isVisibleToUser) { Activity a = getActivity(); if(a != null) a.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } }

Categories : Android

How to show marker labels permanently?
There isn't a quick or simple one. The way jVectorMap displays labels is by using a div and a label property/object for the map object, which changes its position and text. If you want static permanent labels you'll have to construct and position and show them from scratch or you could clone the label object and set show() to be the default. Also, you'd have to code out the conflict of overlapping labels on mouse over map.

Categories : Misc

How to permanently change the color of some elements?
You need to persist the state of those elements somewhere, without that it is not possible. To persist the state, you need to determine whether to use a client side storage or server side persistence. If you want to store the data only within the browser, then you can think of either cookie or html5 localStorage, but the drawback is once it is set all the users using the browser will get the updated state. If you have user tracking in the site then you may have to use a server side persistence to store the state in relation with the current user

Categories : Jquery

C# Sql Server Express not Saved Permanently
You are using the User Instances = true + AttachDbFileName "feature." When you use this "feature" each application you use will open a different copy of the original MDF file. So your C# app opens one copy, you insert a row, but this is never seen in the copy that is open in SSMS / Visual Studio or wherever else you might review the data. To fix this, STOP USING THIS "FEATURE". Create/attach your database to a proper instance of SQL Server, and point to it from your app and SSMS / Visual Studio by referencing the server and the logical database name, not the path to an MDF file. You'll notice I called this a "feature" - in quotes - multiple times. This is because it is not a feature and has caused countless, countless users before you to become absolutely confused about why their insert

Categories : C#

How to permanently disable toggle button?
You may do like this, //get the button as ToggleButton tb = (ToggleButton) findViewById(R.id.togglebutton1); // check it is enabled if(tb.isChecked()){ //do something on enabling it tb.setEnabled(false); // disable it }

Categories : Android

Remove resque jobs permanently?
The problem is you're not removing the specific instance of the job that you added to your Redis server through resque. So when you remove the queue then add it back when you restart the server, all the data from that queue could still be in your Redis server. You can work around this in your job.perform depending on your implementation. For instance, if you want to manipulate a model through resque you could check to see if that model has been destroyed before manipulating it.

Categories : Ruby On Rails

How do I set Windows Environment variables permanently?
Right click on Computer, Advanced system settings, select Advanced tab and click Environment variables. Note: once you modify the environment variables, you will have to restart your applications, including CLI.

Categories : Windows

JavaScript image rotate permanently
You need to extract the image from the canvas using its toDataURL() method. You cannot extract any image data from src property (but the original URL). Note: If the original image is from different origin than the page this won't work as CORS kicks in (cross-origin resource sharing). This is by design and intent. You need to rotate and translate the canvas using its context, then draw the image. Now you can call toDataURL() to get the image data (image will be blank if CORS kicked in). Example: /// translate so rotation happens at center of image ctx.translate(image.width * 0.5, image.height * 0.5); /// rotate canvas context ctx.rotate(0.5 * Math.PI); /// 90deg clock-wise /// translate back so next draw op happens in upper left corner ctx.translate(-image.width * 0.5, -image.heigh

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.