w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
GSM modem returning what I send via USART terminal
According to this Wikipedia article on the Hayes command set used by modems, there are two commands that control the echoing behavior of the modems: E0 turns the echoing off, so the modem will not repeat the command that was sent to it E1 turns echoing back on What you are looking for is the E0 or the E command, where the latter is only a shorthand for the first one.

Categories : Misc

Problems when simultaneously launching two programs with Bash
The error printouts and logs would be helpful. If I understand you correctly, you want to play a sound and start claws-mail as the sound plays. First of all, break this out to separate lines. omxplayer can't find the file. This is probably due to you standing in the wrong directory, or executing this script from the wrong directory. Try using the complete absolute path, for example: omxplayer -p /home/jason/Music/FileName.mp3 & The & makes this a background job. claws-mail can't find a file in root, you say. I rather guess that it hasn't got read access to a file in root's home directory. This is probably due to an erroneously configured claws-mail - it shouldn't have to access stuff there. Anyhow - to fix this, you should probably run claws-mail This will start claws-mai

Categories : Bash

Mac terminal problems
As the commenters have pointed out, it is recommended that you try to use rvm or its cousins, to install ruby into your home directory, this way, you dont need root to install gems by default, and this is more widely recommended. Alternatively you could try the same chown trick here try sudo chown -R <username>:<username> /Library/Ruby/Gems The second one is usually group name, it can be skipped, or you can let it stay.

Categories : Ruby

Server response terminal line analysis. What is the last part on the response line?
The last part represents the size of the object sent back to the client. This is the detailed in standard Apache log format documentation: The last part indicates the size of the object returned to the client, not including the response headers. If no content was returned to the client, this value will be "-". To supplement: In the Django development server I'm running it says 0 if the server responds with status code 301 The last part will only log the size of the body and does not include the headers. Since 301 is a permanent redirect; it has no body. The reason you are seeing 0 and not - is configurable at the log format string. The default format string is "%h %l %u %t "%r" %>s %b"; if you replace %b with %B, it will log 0 instead of - for those requests that hav

Categories : Django

Can't retrieve custom title of OSX terminal tabs
I'm working on an older version of OSX, so I couldn't duplicate your problem (your code works fine for me), but perhaps try: if ((custom title of (current settings of (tab j of (window i)))) as string) contains "blah" then

Categories : Osx

Problems running terminal command via Python
Your default user shell is probably bash. Python's os.system command calls sh by default in linux. A workaround is to use subprocess.check_call() and pass shell=True as an argument to tell subprocess to execute using your default user shell. import subprocess command = """mplayer -loop 0 -playlist <(find "/mnt/music/soundtrack" -type f | egrep -i '(.mp3|.wav|.flac|.ogg|.avi|.flv|.mpeg|.mpg)'| sort)""" subprocess.check_call(command, shell=True)

Categories : Python

Problems trying to retrieve information from txt file
You can use regular expressions like this: Pattern pattern = Pattern.compile("^\s*d\.href([^=]*)=(.*)$"); // Groups: 1-----1 2--2 // Possibly spaces, "d.href", any characters not '=', the '=', any chars. .... Matcher m = pattern.matcher(line); if (m.matches()) { String dHrefSuffix = m.group(1); String value = m.group(2); System.out.println(value); break; } BufferedReader will do.

Categories : Java

Not able to retrieve JSON response in my JSP
Use "success" (not "Success"). Try this: $.ajax({ type: "GET", url: "AjaxActionController?", dataType: "json", data: "leave_Type="+leave_Type, success: function(data){ alert(data); return_Leave = data.LeaveType; alert(return_Leave); } }); NOTE: If the server sets the Content-Type header value to application/json then jQuery will automatically convert the response to a JavaScript object and you typically don't need to use the dataType property. I would recommend removing async: false so that the request is asynchronous. Synchronous requests are bad practice and you should avoid them. The end-user cannot interact with the page while the synchronous request is being handled by the server and the page will seem to be frozen.

Categories : Javascript

Is there a way to retrieve an ajax response sent from an iframe?
If the child iframe is in a different domain to the parent, you can't really do anything that's going to work across browsers. See jasonjifly's answer below for techniques that will work on some browsers assuming you have control over the client scripts on both frames. If the parent and child are on the same domain, then you can achieve what you are looking for. For example, assuming you're using jquery, you could have this code in your iframe: $.ajax(function() { ..... complete: function() { window.parent.onAjaxComplete('Hi there'); } }); Along with this code in your parent frame: function onAjaxComplete(msg) { alert(msg); } To achieve similar results in a cross-domain scenario you could have the parent frame poll the server. When the server receives an ajax re

Categories : Javascript

Can love2d programs be run as normal Lua programs?
You really need to run it with love.exe It is possible to build love as a shared library so you could, in principle, write an openlib wrapper over it. However, to get it to work in a reasonable fashion as a lua module would need a fair amount of work. I wouldn't want to put you off doing this if that's of interest to you but it's not really intended to work that way.

Categories : Lua

Problems with Twitter API 1.1 - application-only authentication response with PHP
Try outputting any potential cURL errors with curl_error($ch); after the curl_exec command. That might give you a clue about what's going wrong. Completely empty responses usually point to something going wrong with the cURL operation itself.

Categories : PHP

Ember Data 1.0.0: how to retrieve validation errors (422 response)
Not sure if this helps you substitute the bacameInvalid and becameError since states are now being removed, but you could try this as a catchall workaround: Ember.RSVP.configure('onerror', function(error) { console.log(error.message); console.log(error.stack); }); Hope it helps.

Categories : Ember Js

Android Unable to Retrieve JSON response [SC_406]
One way to do it Try using builder.scheme URIBuilder builder = new URIBuilder(); builder.setScheme("http").setHost("api.themoviedb.org").setPath("/3/search/person") .setParameter("api_key", YOURAPIKEY) .setParameter("page", 1) .setParameter("query", query) URI uri = builder.build(); HttpGet httpget = new HttpGet(uri); ..... response = httpclient.execute(new HttpGet(httpget ));

Categories : Java

async/await problems getting system to wait for response
That's exactly what your code does. Calling GetStringAsync() will kick off an asynchronous request. When you await the first one, your method will stop executing until that one finishes; the other request will still be executing during that time. Had you awaited the first task before kicking off the second task, it would not have done what you want.

Categories : C#

response.BinaryWrite problems (Text file contains PDF encoding)
In your admin section: string AttachmentID = selectedRow.Cells[1].Text; In your user section: string AttachmentID = grdAttachments.DataKeys[0].Value.ToString(); I would have to assume that the user section assignment is not doing what you expect it to, since the logic isn't the same for both. Verify what AttachmentID is set to in each case, perhaps via logging.

Categories : C#

Problems handling response.status in auth.authResponseChange event
I have the same problem, but for what it's worth if you subscribe to the event 'auth.statusChange' instead of 'authResponseChange' you can know if he is 'connected' to facebook and authorized your app or if he's connected to fb but not authorized. Also if you use the FB.getLoginStatus, which facebook advise not to, you can know in what of the three states (connected, not_autorized or not_connected) the user is in.

Categories : Facebook

ExtJS 4.2.1: Cannot retrieve HTTP Response headers upon Ext.ajax.request callback
i ran into the same issue and finally i found the solution here: http://www.html5rocks.com/en/tutorials/cors/ here is the part about the headers: Access-Control-Expose-Headers (optional) - The XMLHttpRequest 2 object has a getResponseHeader() method that returns the value of a particular response header. During a CORS request, the getResponseHeader() method can only access simple response headers. Simple response headers are defined as follows: Cache-Control Content-Language Content-Type Expires Last-Modified Pragma If you want clients to be able to access other headers, you have to use the Access-Control-Expose-Headers header. The value of this header is a comma-delimited list of response headers you want to expose to the client. i have not verify it yet, but it seems on the r

Categories : Javascript

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

Receive SMS through GSM modem
Sorry for waiting for my reply, been busy lately. In short this is my code for getting message from GSM USB dongle. I hope that it will be useful to someone... using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO.Ports; namespace SMSget { public partial class SMSLogPanel : UserControl { SerialPort sp; int datab = 0; bool dtr = false; bool encod; Handshake h; Parity p; int wtimeout = 0; StopBits s; #region default constructor public SMSLogPanel() { InitializeComponent(); this.sp = serialPort1 = new SerialPort(); this.datab = serialPort1.DataBits =

Categories : C#

AT command with 3g modem while it is connected
3G modems typically (always?) provides two serial interfaces that can be used for AT command communication. Those serial interfaces ends up as /dev/ttyACM0 + /dev/ttyACM1 or /dev/ttyUSB0 + /dev/ttyUSB1 on Linux, /dev/cuaU0 + /dev/cuaU1 on FreeBSD, and on windows machines they should end up as COM<N> + COM<M> for some N and M number (not necessarily next to each other). So open the device manager and try to find the other serial interface which is not used by hyper terminal and use that one.

Categories : Misc

How can i redirect my laptop mic to gsm modem input..?
It is not that easy. You see, the modem hardware in a laptop is not connected to the audio system in any way. So there is no physical way to route the output of the sound chip to the telephone line connected to the modem. However, some modems support a AT+VTX command that allows you to send uncompressed, 8-bits sampled audio at 8 kHz. That should let you do what you want to achieve. Wikipedia explains the basics of this approach nicely.

Categories : Java

how to get 3g modem signal strength in c++ linux?
I was working on a homework, in which I had to determine the indoor location by means of signal strengths of access points in a building. I was using iwlist wlan0 scanning command in order to see get the signal strength of the access points nearby. Then I was processing the output of it in Bash and redirecting it to C++ executable file, which is easy in Bash. I hope it will help you.

Categories : C++

How to access GSM modem ports via C++ program
If you have the correct driver for your USB device, Windows will show your device as COM port (e.g COM3). You can access the COM port from your code, and manipulate the settings. Your question seems very generic about serial port, so I couldn't be specific. However, here is some help http://msdn.microsoft.com/en-us/library/ff802693.aspx , http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c5425/Serial-Communication-in-Windows.htm

Categories : C++

Talking to modem with AT commands on android
I suggest that you try to send AT command using the atinout program, e.g. instead of redirecting output to the modem device run echo "ATD12345678900;" | atinout - /dev/ttyGS0 - I am guessing, but it could be that the echo command in the adb shell does not interpret as anything special (that would at least explain no response whatsoever). By using atinout you are guarantied that AT command lines are properly terminated with and capturing should be simpler and work much more reliably.

Categories : Android

how to extract the local time from gsm sim card by a gsm modem
If both the modem and the carrier support NITZ then it should be possible to get the network time using the correct AT commands. Here's an example using a Telit GSM862 GSM module: http://note19.com/2009/06/30/how-to-setup-network-time-on-telit-module/ The exact commands will depend on which GSM modem you are using. You don't say which library you are using to send and receive SMS but if it doesn't directly support AT commands you might be interested in this: Accessing GSM Modem in C#

Categories : C#

Android mobile as GSM Modem to send/recieve SMS on PC?
Yes, I think you can do it. Just install your cellphone drivers and then connect your mobile to PC. (Usually there are drivers in the mobile packages disks.) Then open "Phone and Modem" from your windows control panel. Then click on "Modems" tab. Now you can see all of your modems and their COM number. Use you cellphones COM in your .Net application. If you can not see you cellphones name as a modem in "Phone and Modem", it mean that you can not use you cellphone as a GSM modem. (I'm sorry for my bad English speaking)

Categories : Android

Detection of iphone turn modem mode on/off
To be clear, do you need to detect if personal hotspot is on or simply trying to adjust your interface to an enlarged status bar? To detect personal hotspot, there's a solution here by detecting the network interface http://stackoverflow.com/a/16856241/2763891 As far as I know, the status bar doubles it's regular size when: a phone call is going on personal hotspot is on an app is using the microphone at the background ... Usually, view autosizing fits the new size of your view automatically. If you're positioning your views manually, UIApplicationDelegate provides notification on changes of the frame of the status bar. - (void)application:(UIApplication *)application didChangeStatusBarFrame:(CGRect)oldStatusBarFrame

Categories : Iphone

Send SMS using HSPA modem while it is connected to internet
If the modem is being used to "connect to the Internet" there is already a phone call in progress. You can't then use it to dial a second number to send an SMS. Possible solutions: Use a different method to connect to the internet, freeing up the modem Get a second phone line and second modem Use an email-to-SMS service and send the message via email over the Internet instead. For example, for AT&T you can send an email to [phone-number]@txt.att.net to send an SMS to a phone. If you are trying to debug a program that sends SMS over the modem specifically then options 1 or 2 may be the only solution.

Categories : Java

How to record phone call via DialUp modem
Try these: http://code.msdn.microsoft.com/windowsdesktop/TAPI-3-in-C-Get-Lines-and-dd143eaf http://www.codeproject.com/Articles/10994/TAPI-3-0-Application-development-using-C-NET The Telephony API is right from Windows, so it might be pretty low-level, but should support what you need.

Categories : C#

nonce token after ajax response and hash problems using ajax jquery type json
To change hash function, if only '+' is the problem you may keep a check while creating the string, next_char = Randomly-created-char; if(next_char == '+'){ //do nothing } else{ hash .= next_char; } Here is how the html and php files should be like. The ajax call is shown in the .html file. .php that loads your form for the first time. <!DOCTYPE html> <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#check").click(function(){ $("#keyvalue").text($("#key").val()); }); $("#submit").click(function(){ var text = $("#text").val(); var key = $("#key").val(); $.ajax({ url: 'trial.php',

Categories : PHP

Wammu configuration on Ubuntu 3G modem Huawei E1550
problem is your user and group didn't have permission to access you device. you must change permission for user and group. If wanna easy change user and group at /etc/init.d/gammu-smsd to root. user="root" group="root" bin="/usr/local/bin/gammu-smsd" configfile="/etc/gammu-smsdrc" pidfile="/var/run/gammu.pid" Have a nice day

Categories : Linux

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

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 reading Unicode Messages (such as in Persian and Arabic) in C# using AT Commands through GSM Modem?
I don't think UTF8 is supported by GSM. From http://en.wikipedia.org/wiki/Short_Message_Service Short messages can be encoded using a variety of alphabets: the default GSM 7-bit alphabet, the 8-bit data alphabet, and the 16-bit UCS-2 alphabet and from http://en.wikipedia.org/wiki/GSM_03.40 The messages in Chinese, Korean or Japanese languages must be encoded using the UTF-16 character encoding The Data Coding Scheme (TP-DCS) field contains primarily information about message encoding. GSM recognizes only 2 encodings for text messages and 1 encoding for binary messages: GSM 7 bit default alphabet (which includes using of National language shift tables as well) UCS-2 8 bit data In the same paragraph they tell that there is a new national-based encoding (the Na

Categories : C#

Sending/Receiving Bulk SMS via USB Modem and gnokii-smsd-pgsql
I believe you haven't installed gnokii. smsd is NOT gnokii. Just apt-get install gnokii and then try running the gnokii --identify from the command line Also you have to make sure that the port is the exact port your modem is connected to. When I plugged my modem in and did dmesg it didn't list it but luckily I only had 6 USB ports so I just tried all of them until I found the right one. The line in my config file is: port = /dev/ttyUSB3 the number at the end will vary depending on the port. 3.http://rolfblijleven.blogspot.nl/2013/01/raspberry-pi-as-sms-gateway.html

Categories : Postgresql

Redirect domain name mapped with external IP (modem) to a host in its local network
If you want to redirect my domain to the particular host you need to setup NAT-Virtual Server Setup . here you need to map remote port to internal map. In above image IP address is my IP of my host and Default address is my router's IP address Now you have configure NAT in you router as bellow. in above image server IP is you host IP address. I am using D-Link router so this Image is according to that if you are using some different router then you might have different view. After configuring this when you type EXTERNAL_IP:80 your request will be forwarded to application that is running on you host with that port

Categories : Networking

echo new line to terminal only when current terminal line is not empty
Test your variable's value if it's not empty with -n: [[ -n $VAR ]] && echo "$VAR" # POSIX or Original sh compatible: [ -n "$VAR" ] && echo "$VAR" # With if: if [[ -n $VAR ]]; then echo "$VAR" fi if [ -n "$VAR" ]; then echo "$VAR" fi It's actually equivalent to [[ $VAR != "" ]] or ! [ "$VAR" = "" ]. Furthermore in Bash you can test it if it's only filled with whitespaces: shopt -s extglob ## Place this somewhere at the start of the script [[ $VAR == +([[:space:]]) ]] && echo "$VAR" if [[ $VAR == +([[:space:]]) ]]; then echo "$VAR" fi Use [[:blank:]] to only match spaces and tabs and not newlines and the likes if it's more helpful. If you want to remove empty lines from input file or pipe you can use other tools like sed: sed -ne '/^$/!p'

Categories : Bash

Communicate to PC over USB
I was just looking for this one myself and found a good resource over at msdn, IP over USB. As long as you have the windows phone SDK installed you have everything. Edit: A small update, it seems that the server code must be running on the device and the client on the host, but apart from that everything worked as expected. Used regedit to add a new entry under HKEY_LOCAL_MACHINESoftwareMicrosoftIpOverUsbSDK and created values similar to other entries, just different ports. It took a few seconds and a refresh of regedit for IpOverUsbEnum.exe to display the new service.

Categories : C#

.Net Web API throw exception/return response/return error response for 404/400 response?
The CreateErrorResposne extension is for creating content-negotiated responses but it also has logic of how much of this error information should be sent back to the client. The idea is to not reveal too much of information to the client which could be a security issue. For example, httpConfig.IncludeErrorDetailPolicy determines how much information is sent back to the client. The CreateResponse extension above is also for creating content-negotiated responses, but it does not have any of the additional logic that I mentioned above for CreateErrorResponse. In the third scenario, the response is not content-negotiated and you would be sending back content always in text/plain format and also it does not have additional logic as in CreateErrorResposne

Categories : Asp Net Mvc

How should the model communicate?
To expand on Dave Just's comment, model is a layer. The model layer consists of services, domain objects and data mappers. See the chart below. The registry is not part of the model layer, it is something I added before finishing my framework, it isn't in the right spot or have an accurate description in the diagram, but I'm not sure it applies to javascript frameworks anyways. image link: http://i.stack.imgur.com/5ENyB.jpg

Categories : Javascript



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