w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Linux terminal input: reading user input from terminal truncating lines at 4095 character limit
I do not have a workaround for you, but I can answer question 2. In linux PIPE_BUF is set to 4096 (in limits.h) If you do a write of more than 4096 to a pipe it will be truncated. From /usr/include/linux/limits.h: #ifndef _LINUX_LIMITS_H #define _LINUX_LIMITS_H #define NR_OPEN 1024 #define NGROUPS_MAX 65536 /* supplemental group IDs are available */ #define ARG_MAX 131072 /* # bytes of args + environ for exec() */ #define LINK_MAX 127 /* # links a file may have */ #define MAX_CANON 255 /* size of the canonical input queue */ #define MAX_INPUT 255 /* size of the type-ahead buffer */ #define NAME_MAX 255 /* # chars in a file name */ #define PATH_MAX 4096 /* # chars in a path name including nul */ #define PIPE_BUF

Categories : Linux

How to send information from HTML element to using JavaScript .innerHTML?
Add name="date" to your form tag like below. Else document.date.user.value will not work. <form id="date" name="date"> Another way to get around the issue, is accessing the date property of the window object. window.date.user.value; This is possible because you've set an id on the form. Or you might consider accessing the form using its id and then get user value as follows: var user = document.getElementById("date").user.value;

Categories : Javascript

HTML terminal like text input
I can't just make the text the same color as the background because the background is not a single color. What about a transparent color? Does this help? input[type="text"] { color: transparent; } JSBin Demo #1 Update: I implemented @Shomz idea, You can simply keep the cursor at the beginning or change all the characters to *. I've used jQuery to bind event: jQuery Version: var holder = [], exceptions = [13]; var hideChar = function(elm) { elm.value = ''; // Or // elm.value = elm.value.replace(/[^*]/, '*'); }; $('#console').keydown(function(e) { if (e.which === 8) { holder.pop(); } }).keypress(function(e) { if ($.inArray(e.which, exceptions) === -1) { holder.push(String.fromCharCode(e.which)); } var _this = this; setTimeout(function() { hi

Categories : Javascript

How to get Applescript input to run Terminal Command
choose from list returns a list of the selected items. choose from list {"Hide", "Show"} with prompt "Do you want to hide or show hidden files?" if result is {"Show"} then do shell script "defaults write com.apple.finder AppleShowAllFiles -bool true" else do shell script "defaults write com.apple.finder AppleShowAllFiles -bool false" end if quit application "Finder" I use a script like this to toggle showing hidden files: do shell script "x=$(defaults read com.apple.finder AppleShowAllFiles) [ $x = 1 ] && b=false || b=true defaults write com.apple.finder AppleShowAllFiles -bool $b" tell application "Finder" quit delay 0.1 -- without this delay Finder was not made frontmost launch -- open Finder in the background delay 0.1 -- without this delay there was

Categories : Osx

Terminal input does not start new line
Non printing characters, like escape codes for color, have to be surrounded with [ and ] so that bash knows to exclude them when calculating the length of the line. http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/nonprintingchars.html

Categories : Shell

Input only to bottom line of terminal
The JCurses library will do exactly what you need. http://sourceforge.net/projects/javacurses/ It's a Java implementation of ncurses from the *nix operating systems. On Windows, you'll need to include the .dll files, on most linux distros, you don't need to do anything except include the jar in your classpath. The reason you need a library to build a "command line gui" is because standard java is not capable of manipulating the local command line in this fashion. This is likely due to how Java is not built for a specific platform - but that's just a guess.

Categories : Java

read command is not taking input from the terminal
Most likely read executes with standard input redirected from a file that has reached EOF. If the above is not the whole of your configure code, check that there are no input redirections. Could the code above be a part of a function which was invoked with some input from a pipe or a file? Otherwise check how configure is executed - are there any redirections? Otherwise, the universal advice applies: try simplifying and stripping down your code until it is obvious what's happening. BTW, it is not a good idea to make configure interactive, if you want to have your program packaged for a distribution - it's not easy to control execution of interactive programs. Consider adding support for supplying parameters through command line options.

Categories : Linux

sed not working from java program, but the input line works from terminal
Does the Java program perhaps run with a different environment, perhaps one where sed is not in the path? Otherwise perhaps it runs as a user who does not have write permission to the network scripts?

Categories : Java

Using ipython as the gimp py-fu interpreter, sending all output and input to the terminal
Gimp's python-console uses pyconsole module to talk to Gimp Python interpreter. Try to embed IPython console as described here into python-console.py plugin. On a 64bit machine, this plugin is located at /usr/lib64/gimp/2.0/plug-ins/python-console.py.

Categories : Misc

sentence as user input - multiple times from terminal - bash script
This is because in your second call to read, you are using the -a argument which does: The words are assigned to sequential indices of the array variable aname, starting at 0. aname is unset before any new values are assigned. Other name arguments are ignored. That appears to be not what you want.

Categories : Bash

iOS - Read information from website input
The best solution for implementing it in an iOS app would be using a JSON web service. Vary basically, you'd have a page on your server, that would display a JSON representation of the weekley menu : { "Monday" : [ "First option", "Second option", "Third option", ], "Tuesday" : [ "First option", "Second option", ], ... } Then, get this data using a classic iOS network query (or using a library like AFNetworking if you want). After, parse if using + (id)JSONObjectWithData:(NSData *)data options:(NSJSONReadingOptions)opt error:(NSError **)error from NSJSONSerialization. From how I've defined the JSON representation, you would get your informations like that (assuming that dic is the NSDictionary resulted from JSONObje

Categories : Iphone

Using JQuery Terminal how do I setup an authentication routine that uses a javascript (not php) function?
The first parameter of .terminal(...) is either a url to your rpc-service (string) or it is an object containing the commands you want to add (object). The json-rpc implementation that is used does not need to be written in php. The rpc definitions are just a standardized way to provide a interface for remote procedure calls. So if you don't want to use the rpc you would do something like this: function test1(name, password, callback) { console.log("ok"); if(name == "Derek") { callback("some token"); } else { callback(false); } } jQuery(document).ready(function($) { $('body').terminal({}, { login: test1, greetings: "You are authenticated", onBlur: function() { // the height of the body is only

Categories : Jquery

Mac OSX Terminal Vim displays javascript code with weird and horrid shade
Try changing your colorscheme. Open the file in Vim, then do :colorscheme blink To cycle through all possible colourschemes, type :colorscheme, then a space, then press Tab. When you reach a colorscheme that sounds promising, press Enter, and see if the text looks OK. Keep doing this until you find a colorscheme that you like. Once you have found a colorscheme that you like, copy its name, and put the following in your .vimrc: colorscheme name (name is the name of the colorscheme you like.) My favourite colorscheme is blink, but there are many good ones. You can even go online and download new ones if the defaults are not good enough.

Categories : Vim

Angularjs $watch provides the latest input even when all the information was deleted
May be it is enough to check if the old and the new values are not equal? Like this: if (newValue != oldValue) { $scope.bar = newValue; } Plunk: http://plnkr.co/edit/Ooh1am?p=preview

Categories : Angularjs

How to switching magnitude and phase information between two input images?
Oh... I feel so sorry for you. You should be answering your homework questions by yourself! function I_must_understand_this_code_before_I_submit_my_homework( ) % read images im{1} = im2double( imread( 'image1.bmp' ) ); im{2} = im2double( imread( 'image2.bmp' ) ); assert( all( size(im{1}) == size(im{2}) ), 'images must have same size' ); % FFT - separate magnitude and phase no fftshift mag = cell(1,2); phz = cell(1,2); for ii=1:2 I = zeros( size(im{ii}) ); for c = 1:size(im{ii},3) % for color images I(:,:,c) = fft2( im{ii}(:,:,c) ); end mag{ii} = abs( I ); % magnitude of fft phz{ii} = angle( I ); % phase end % combine (still in Fourier domain) C{1} = mag{1}.*exp( j * phz{2} ); % mag of first with phase of second C{2} = mag{2}.*exp( j * phz{1} ); % mag of se

Categories : C

Pseudo-terminal will not be allocated because stdin is not a terminal ssh bash
You seem to assume that when you run ssh to connect to a server, the rest of the commands in the file are passed to the remote shell running in ssh. They are not; instead they will be processed by the local shell once ssh terminates and returns control to it. To run remote commands through ssh there are a couple of things you can do: Write the commands you want to execute to a file. Copy the file to the remote server using scp, and execute it with ssh user@remote command Learn a bit of TCL and use expect Write the commands in a heredoc, but be careful with variable substitution: substitution happens in the client, not on the server. For example this will output your local home directory, not the remote: ssh remote <<EOF echo $HOME EOF To make it print the remote home directory

Categories : Bash

php remove unwanted input information & concatenate text fields
I think you are on the right track. Keep in mind that your form is going to POST its data to whatever address is listed in the action attribute of the <form> tag. In this case, you are sending all the form data directly to PayPal. You don't have an opportunity to run any PHP code before the data gets sent. Two choices: 1) change the action attribute on your form and POST the data to a PHP file on your own server. That file would do the processing and then send a new request on to PayPal. 2) This is probably easier. Use javascript to formulate the invoice number after the user clicks Submit but before the data gets sent. You can do this by adding an onsubmit attribute to the form. It'll look something like this: <form id="depositForm" name="_xclick" action="https://www.paypal.co

Categories : PHP

JavaScript: Enabling/ disabling "text input" according to the value selected from "select input"
document.getElementById('inputWarning').disabled="" http://jsfiddle.net/rKQjp/ The element gets disabled by setting the disabled attribute to "disabled" and it gets enabled again if you set this attribute to an empty string.

Categories : Javascript

Query website(that requires login information) with input parameters and retrieve results
You have two options I can think of: 1) Figure out what the fields generated by the javascript are named, or their naming scheme, and submit the values directly to the form handler -- eliminating the need to even deal with the input page. 2) Use a framework that emulates a "real" browser and is capable of processing javascript. This question has some suggestions for frameworks, but having never used one, I can't suggest any myself.

Categories : Python

if input two input tag have same value then give alert - javascript only no jquery
How about this: <script type="text/javascript"> function getResults() { var radios = document.getElementsByTagName("input"); var values = new Array(); for (var i = 0; i < radios.length; i++) { if (radios[i].checked) { var found = false; //Represents if we have a duplicate for(var j = 0; j < values.length; j++) { //Loop through previous items if(values[j] == radios[i].value) { //Duplicate? found = true; // Flag it break; //Exit 'j' loop } } values[values.length] = radios[i].value; //Add value to previous items if(!found) continue; //If there was no duplicate, continue to next item alert(radios[i].value); //The

Categories : Javascript

Send information from the WCF to JavaScript
SignalR is a good way to do it, you can see this in detail in the following question: Use SignalR to notify from wcf to JS

Categories : Javascript

Get information about the Visitor (Javascript / PHP)
If you would like to Geo Locate your visitors, and discover their physical location based off their IP, MaxMind has a great service with a free option. http://www.maxmind.com/en/geolocation_landing

Categories : PHP

gnome-terminal font resize (zoom in, zoom out), but adjust terminal height and width contrariwise for getting a "lock in" of window dimensions
I can’t tell you for sure, but since this is GNOME and moreover GNOME 3, it’s unlikely that the Terminal has this kind of customization built-in. But in Linux, you can always improvise. How about the following. Find a program that can send keys to an X11 window. Maybe xdotool. Find a program that can control an X11 window’s geometry. Maybe xdotool. Write a short script that locates the terminal window (probably just the focused one), sends it Ctrl-Plus / Ctrl-Minus, waits a tiny bit, then sets its geometry to the one you like (or to whatever it was initially, which you can also query with xdotool). Bind this script to a keyboard shortcut of your choice, say Win+Plus / Win+Minus. No idea how to do this in modern Ubuntu / GNOME 3, but GNOME 2’s Metacity used to have GConf keys f

Categories : Misc

use javascript to copy input values to another input
Try this. It should be .val() not .value on a jquery object. You can use the val() as getter as well as val(somevalue) as setter as you are using already. var addrCopyFromVal = $('#ShippingContactInfo .address1').val(); //<-- Here var addrCopyTo = $('#BillingContactInfo .address1'); addrCopyTo.val(addrCopyFromVal); // <-- And here or just simply write: $('#BillingContactInfo .address1').val($('#ShippingContactInfo .address1').val()); See .val()

Categories : Javascript

How to get Device Information Using HTML5 Javascript & Phonegap
Although I never worked on such area. But what I can suggest is- You will need to write android native plugin to achieve the same. I think there should be android api to read memoryinfo and cpuinfo file if not you can directly read /proc/cpuinfo and /proc/memoryinfo to get ram and cpu related information. Hope it will give you some insight. Below is the link of related question - Android How do you get total memory RAM in the device?

Categories : Javascript

How to access html information that is generated by javascript?
Selenium is probably what you're looking for; it's a browser automation framework. You can use Python but Selenium actually uses Firefox to parse a site's content (last time I heard). You can get the python version here but there are other options.

Categories : Java

Look for in Mysql table and pass information from the javascript
What you are doing now is pretty much the standard. If you dont want to use this method then I suggest that you look into session. On your first page you will need to include the line: <?php session_start(); then your normal code. Once you have read the information from the database then place the values into session variables; $_SESSSION['var1'] = $result['id']; //--- continue for all the values you want to save On the second page you will need to do the reverse <?php session_start(); $id = $_SESSION['var1'];

Categories : PHP

Passing value input by user to another html page using javascript and redirect using javascript function
For this kind of stuff you have to use a server-side language (PHP, ASP, etc.) as you can pass variables thru files and so forth. Doing this with HTML/JS only is going to get you in trouble as you are basically giving the user, pass and id to anyone openly. Have a look here: PHP Codecademy.com

Categories : Javascript

How to use this dictionary to show the file information in template in javascript?
Use ajax call : say your ajax_template.html : {% for choice in overview %} <tr> <td><input type="checkbox" name="choice_stop" id="choice{{ forloop.counter }}" value="{{ choice.id }}" onchange="checkChecked_stop()"/></td> <td><label for="choice{{ forloop.counter }}">{{ choice.name }}</label></td> <td>{{ choice.source }}</td> <td><div id="remPercentage{{ forloop.counter }}"></div></td> <td>{{ choice.start_date }}</td> <td><div id="remTime{{ forloop.counter }}"></div></td> <td>{{ choice.human_size }}</td> <td><input type="checkbox" disabled {{ choice.flag_email }} /></td>

Categories : Javascript

When I click on the button show more information in the same page javascript
You can use JQuery which is a really nice framework to make the coding easy! You want to use the .click() event and the .show() function So you could have something like this $("#clickme").click(function() { $("#hidden").show(); }); and for your html <html> <body> <p id="clickme">Read More</p> <p id="hidden" hidden>COOL STORY BRO</p> </body> </html> Example

Categories : Javascript

JavaScript to store jquery result set information in an array
you can use $.each to iterate over the elements. var arr = []; $('.option').each(function() { arr.push( $(this).text() ); }); console.log(arr.join()); Check Fiddle You can also use the .map method var arr = $('.option').map(function () { return this.innerHTML }).get().join(); console.log(arr);

Categories : Javascript

JavaScript Date format conversion using locale information
use toLocaleDateString var date = new Date(Date.UTC(2012, 11, 11, 3, 0, 0)); date.toLocaleDateString('en-GB'); // "11/12/2012" date.toLocaleDateString('en-US'); // "12/11/2012"

Categories : Javascript

Passing Map Location information from PHP to javascript for use with Google maps v3 api
Get the values from DB, by using PHP while loop and store the values in a variable as below $location .= '['. $row['latitude'] . ',' . $row['longitude'] . ',"' . $row['city'] . '","' . $row['state'] . '"],' ; In Javascript, assign the PHP variable to a Javascript variable as below. var locations = [<?php echo isset($location)?$location:''; ?>]; var len = locations.length; for (i = 0; i < len; i++) { var image = 'GIVE HERE THE PATH OF IMAGE'; marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: image }); google.maps.event.addListener(marker, 'mouseover', (function(marker, i) { return function() { infowindow.setContent(content); infowindow.open(map, marker);

Categories : PHP

Event object in Javascript, trouble finding information
Official W3c reccomendation clientX and clientY are the official event property handlers you are looking for. Although you might want to consider screenX and screenY too. Events (API) Events Creating, triggering events Event handlers Orientation and motion data Window Event X and Y property Explanation event.x and event.y, what are those? First of all, the x and y properties are not in all events. It is relative on the event triggered. Here is an example: document.body.onclick = function(){console.log(window.event.x)}; If you paste and execute that code in your browser's console, it will log you the x position of the cursor each time you click. Although taking a look at this example: document.body.onkeyup = function(){console.log(window.event.x)}; The console will

Categories : Javascript

How to read the information in configuration files(.properties) in JavaScript?
It is not advisable to read configuration files from JavaScript. Instead you could do this: Read the file on server-side (using PHP, .Net or Python or any other language that you prefer) Render the valid values to JavaScript. Something like: var maxTime = "<?php echo maxTime; ?>"; var upVotePostMaxTime = "<?php echo upVotePostMaxTime; ?>"; where <?php echo maxTime; ?> and <?php echo upVotePostMaxTime; ?> will have values 60 each. This would show on the client-side as: var maxTime = "60"; var upVotePostMaxTime = "60"; and then you may use it in JavaScript. Values are assigned in double quotes to prevent breaking of JavaScript code in case null values are sent from the server. Please ensure that proper values are assigned to JavaScript variables.

Categories : Javascript

Formating a javascript object not to display extra locale information
I know nothing about ms ajax templates. But assuming that the Date format behaves the same as in standard javascript, you can format your date manually. You can find more instructions here. If you have a lot of date formatting to do, you may want to check Moment.js

Categories : Javascript

use css property content on element to exceptionnaly store information for javascript
The css 'content' property is only valid on pseudo elements: https://developer.mozilla.org/en-US/docs/Web/CSS/content As much as this seems like a cool idea, I wouldn't feel comfortable using it in production. I think that you should accept that your js variables and css variables will be in 2 different files and then just apply the values via data-attributes. However, if you really want a creative way to do this only from the css files that can print to the html and thus interact with the javascript, what about using valid properties that will not affect the design? All you are really doing is storing a string in the html, so you could use a rather obscure element such as counter-reset, and then grab the value via jquery.css() variables.less: @bkpoint = 500; css: #any-div { counter

Categories : Javascript

Iterating through a javascript object and outputting certain information based upon criteria
use a simple template and loop though each item to generate your output: var data=[ { "SeatId": "29A", "passengerName": "Mr test1 test1", "sectorSequence": 1 }, { "SeatId": "22A", "passengerName": "Mr test1 test1", "sectorSequence": 2 }, { "SeatId": "29B", "passengerName": "Mrs test2 test2", "sectorSequence": 1 } ] function template(ob, str){ return str.replace(/{([ws.$]+?)}/g, function(j,a){ return ob[a]||""; } ); } strTemplate="First {passengerName} {sectorSequence} + {SeatId}"; out=$(data).map(function(i,item){ return template(item, strTemplate)}).toArray().join(" "); alert(out); /* result: First Mr test1 test1 1 + 29A First Mr test1 test1 2 + 22A First Mrs test2 test2 1

Categories : Javascript

Need parser for Javascript (used in Java app) to get basic property value information about Ext.define objects
As you do not try to parse the complete javascript language, you might not need a full blown javascript engine. Have you had a look at ANTLR? As you can simplify your problem to a hand full of properties (if I understood you correctly) I'd think you should be able to write a more or less simple grammar for your problem.

Categories : Java

I am trying to create a link on an HTML page using information that a user inputs via JavaScript alert box
What you have is almost correct. var favoriteSiteName = '', favoriteSiteURL = ''; favoriteSiteName = prompt('What is your favorite web site?'); favoriteSiteURL = prompt('What is the URL of that site?'); document.write('<a href="' + favoriteSiteURL + '">' + favoriteSiteName + '</a>'); You were missing the semi-colons to indicate the end of the lines and adding the site name to the link. Also, the h1 and h2 elements don't belong inside the script element. JSFiddle.

Categories : Javascript



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