w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
generate code using form button and then display generated code on page
You can use tag to show HTML entities You need to encode all Your HTML entities like < => < like way. Also you can show a text area in which all those HTML code need to echo, it will not execute your code simply it will print it.

Categories : PHP

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 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++

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++

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

Generate php code to pdf
You're storing all your PHP-generated output into $categoriile. Then you're checking if IS NOT set $session->data['finalizat']... Perhaps you're not meeting this condition. Check $session->data['finalizat']. You also do not have ob_start (per Nanne's notice)

Categories : PHP

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

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 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#

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

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#

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

Php code to Generate Log File
<?php $filename = "logs.php"; $lines = file($filename); if(count($lines)!=0){ $data = explode( " :- ", $lines[count($lines) -1 ]); if(date('d-M-y') == $data[0]){ $data[1]++; $lines[count($lines) -1 ] = $data[0].' :- '. $data[1]; }else{ $lines[] = date('d-M-y').' :- 1'; } }else{ echo 'Empty'; $lines[] = date('d-M-y').' :- 1'; } file_put_contents($filename, implode(" ", $lines ) ); ?>

Categories : PHP

Generate code with recursion
It happens because you do nothing with the return value. You pass helper to the recursion, but do not place the return value anywhere. your method should look like this: string regenerateCode(string toParse) { string helper = ""; int parseCode = int.Parse(toParse); helper = new string('0', 4 - parseCode.ToString().Length); helper += parseCode + 1; using (SqlConnection conn = new SqlConnection(cString.c_String)) { conn.Open(); using (SqlCommand cmd = new SqlCommand("SELECT Product.productID FROM Product " + "WHERE Product.PLU = '" + helper + "' ", conn)) { using (SqlDataReader rdr = cmd.ExecuteReader()) { // Return the next code that doesn't exist return rdr.HasRows ? regenerateCode(helper) : helper; } } } } Also, re

Categories : Wpf

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

Generate QR code to special page
If the link from the QR code is simply www.myweb.com, I'm afraid you are out of luck. There is absolutely no difference between reading a QR code and accessing the link and manually typing in the address. The only possibility is you may be able to catch certain visitors if they are using an app to read the QR code, subsequently view the target page in-app, and said app has something identifiable about it's User Agent string. I have not experimented with this, but I would suspect this is actually not the case.

Categories : PHP

How to Code in Java to generate the given series
... and why not for(int f=0;f<7;f++) System.out.println("JDK1."+f); also, you were getting the compilation problems because of this: float f = 1.0; // Compilation error 0.1 is by default a double, it must be: float f = 1.0f;

Categories : Java

Getting JAX-WS to generate code with parameters that have namespaces?
Wow. Apache is really good at putting out lots of documentation. Lots. So, here I am, eyes bleeding, having read through a bunch of the JAX-WS alphabet soup and the answer was very simple. I found this by checking out the source for JAX-WS. Really. And in there I found: svn co http://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/ modules/samples/wsdl/perf.wsdl And so I see that I need to go to the top of my WSDL and change: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://__HOST__/cgi-bin/WebObjects/__APP__.woa/wa/abcsoap"> to: <xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://__HOST__/cgi-bin/WebObjects/__APP__.woa/wa/abc

Categories : Java

Why does this code generate all 1s in the result instead of a mixture of 0s and 1s?
In main() (which should return an int, btw), change this: if (h[i][j]='1'); To this: if (h[i][j]=='1') for hopefully obvious reasons. Next, your lookup array is not being initialized after allocation (and though you may not think it need be, it is required for the next error fix after this to work): Change this: unsigned long long *lookup = (unsigned long long*) malloc(N * sizeof(unsigned long long)); To this: unsigned long long *lookup = calloc(N, sizeof(*lookup)); which will zero-fill the lookup array on inception. You could also memset if you wanted to. The choice is yours. And next, you're overwriting your lookup value for each row for multiple bits. I.e. the last bit you write into any row's lookup entry is the only one that is saved. You need to accumulate them usi

Categories : C

What's the easiest way to generate code dynamically in .NET 4.5?
The easiest way to generate code dynamically in .NET 3.5+ is by converting LINQ Expression Trees to executable code through the Compile method of the LambdaExpression class. .NET 4.0 has greatly expanded the possibilities, adding support for code structures beyond simple expressions of .NET 3.5, letting you construct fully functional methods. The resultant code gives you the same high performance as regularly compiled code would, assuming that your expression generator has applied the same kinds of optimizations a C# compiler would while generating the code. Here is how you could generate the code from your snippet: // nameToProperty is a dictionary with keys representing string parameters // that you pass to drow's indexer, and values representing names of properties // or fields of the

Categories : Dotnet

Generate unique code from primary key
The easiest way (if you want an alpha numeric code) is to convert the integer primary key to HEX (like below). And, you can Use `PadLeft()' to make sure the string has 8 characters. But, when the number of orders grow, 8 characters will not be enough. var uniqueCode = intPrimaryKey.ToString("X").PadLeft(8, '0'); Or, you can create an offset of your primary key, before converting it to HEX, like below: var uniqueCode = (intPrimaryKey + 999).ToString("X").PadLeft(8, '0');

Categories : C#

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

Generate code at build (compile) time
I think something like this will work for you. You'll need individual macros for returning a value vs. not, and for each possible number of parameters. // pt<x>: Parameter type <x> // pn<x>: Parameter name <x> #define METHOD_PAIR1(name, pt1, pn1) void name(pt1 pn1); void name(void* ptr, pt1 pn1) { name(pn1); } void name(pt1 pn1) #define METHOD_PAIR2(name, pt1, pn1, pt2, pn2) void name(pt1 pn1, pt2 pn2); void name(void* ptr, pt1 pn1, pt2 pn2) { name(pn1, pn2); } void name(pt1 pn1, pt2 pn2) #define FUNCTION_PAIR1(ret, name, pt1, pn1) ret name(pt1 pn1); ret name(void* ptr, pt1 pn1) { return name(pn1); } ret name(pt1 pn1) #define FUNCTION_PAIR2(ret, name, pt1, pn1, pt2, pn2) ret name(pt1 pn1, pt2 pn2); ret name(void* ptr, pt1 pn1, pt2 pn2) { return name

Categories : C++

How to call code to generate a random number?
import java.util.Random; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.TextView; public class MainActivity extends Activity { Random rndNumbers = new Random(); int d20 = rndNumbers.nextInt(20) +1; Button roll; TextView display; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); roll = (Button) findViewById(R.id.bRoll); display = (TextView) findViewById(R.id.tvDisplay); roll.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub d20 = rndNumbers.nextI

Categories : Android

Generate same unique hash code for all anagrams
Hashing with the sorted string is pretty nice, i'd have done that probably, but it could indeed be slow and cumbersome. Here's another thought, not sure if it works - pick a set of prime numbers, as small as you like, the same size as your character set, and build a fast mapping function from your chars to that. Then for a given word, map each character into the matching prime, and multiply. finally, hash using the result. This is very similar to what Heuster suggested, only with less collisions (actually, I believe there will be no false collisions, given the uniqueness of the prime decomposition of any number). simple e.g. - int primes[] = {2, 3, 5, 7, ...} // can be auto generated with a simple code inline int prime_map(char c) { // check c is in legal char set bounds retur

Categories : Algorithm

Will declaring a function generate any issues in the code
Headers should have include guards so that they are only processed once: #ifndef SOME_UNIQUE_STRING #define SOME_UNIQUE_STRING // Everything else here #endif By "Everything" I mean "everything", starting with your #includes if any. SOME_UNIQUE_STRING could be the name of the module as long as it is unlikely to coincide with another define somewhere else. If you look in your library headers, you will notice they use include guards like this.

Categories : C++

Yii generate a model file using php code instead of gii tool
You can customize gii tool and make it dynamically generate model such as Yii::app()->getModule('ssgii')->SSGenModel($dynamictableName, $dynamicModelName); public function SSGenModel($tableName, $modelName){ $_ccodeGen = $this->controllerMap; $ccodeGen = new CCodeGenerator('', null); $ccodeGen->codeModel = 'ssgii.generators.model.ModelCode'; $model=$ccodeGen->ssAutoGenModel($tableName, $modelName); return ($model); } There still need some more updates to get it work. But from your requirement what I read, it seems not to be fit with your need. You have expected much things to dynamic your relation, and it seems more further necessary things what Yii provides, you should have to comprehend around template knowledge. I can s

Categories : PHP

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

Generate Interactive Source Code Documentation Automatically
Check out literate programming This allows you to create a runnable documentation. Instead of embedding comments in the code, you will embed code in your documentation. this npm module will help you to extract a runnable source file out of 'markdown' doc file. For instance , you can produce a API tutorial like this: https://github.com/node-opcua/node-opcua.github.io/blob/source/source/_includes/tutorials/creating_a_server.md $ npm install literate-programming $ literate-programming my_doc.md

Categories : Javascript

Coded UI Test Builder fails to generate code
There is no simple answer to this from the very small amount of information in your question. Searching the web for the error message (eg searching for "coded ui Object reference not set to an instance of an object" and variations) provides many cases of people getting the same message plus, in some cases, their solutions. One possible cause is that the UI Map file has been edited in a text editor, leaving XML that the Generate tool does not understand. Another possibility is that Visual Studio has become corrupted and should be reinstalled. To narrow down the possibilities, determine whether the problem is specific to one project, to one computer or to one user. Try creating a new Coded UI test in a new Visual Studio solution to drive a simple application (eg the Windows Calculator) an

Categories : Visual Studio 2010

I have a code to generate cycles in a graph but it gets slow when the points are more
How about something like this? int[,] graph = { {1, 2}, {1, 3}, {1, 4}, {2, 3}, {3, 4}, {2, 6}, {4, 6}, {7, 8}, {8, 9}, {9, 7}, {2, 3}, {1, 5}, {2, 4}, {4, 6}, {7, 4}, {3, 5}, {4, 5}, {2, 8}, {8, 1}, {9, 1}, {14,1}, {2,14}, {5, 1}, {7, 3}, {6, 2}, {10,1}, {10, 4}, {10, 6}, {10, 3}, {10,2}, {8, 3}, {1, 7} }; var g = graph.Cast<int>().ToArray(); var edges = Enumerable.Range(0, g.Length / 2) .Select(i => Tuple.Create(g[i * 2], g[i * 2 + 1])); var edgeLookup = edges.ToLookup(x => x.Item1); var stack = new Stack<Tuple<int, int>>(edgeLookup.First()); var visited = new HashSet<Tuple<int, int>>(); while(stack.Count >

Categories : C#

Simulink generate code with unsupported istruction (ceil)
You could write your own ceil function and include it in whatever your output code is for your target device. Assuming you are generating C-code, the function would look something like: int ceil (double number) { if (number == 0) return 0; if (number > 0) { if (number - (int) number > 0) return (int) number + 1; else return (int) number; } else { if (number - (int) number < 0) return (int) number - 1; else return (int) number; } } With a prototype in your header file like: int ceil (double); Now your C-code can call integerValuedNumber = ceil(doubleValuedNumber) and it should work. You can also do this with macros in the C-file (see nintendo's answer). EDIT: I correc

Categories : Matlab

How to Generate a Sequence Diagram from Java Source Code
There are many products that can generate sequence diagrams from Java source code. Unfortunately, all of the good ones cost a lot of money. If you are using the community edition of Visual Paradigm, it does not allow you to generate any diagrams. You must upgrade to one of the paid versions. You can compare the paid vs the free edition here http://www.visual-paradigm.com/product/vpuml/features/?edition=ce You need to buy standard edition of Visual Paradigm that support Code engineering. Check out some of these links for alternative programs which also can generate diagrams / source code. Posiden UML http://www.gentleware.com Argo UML http://argouml.tigris.org Other Resources How can I generate sequence diagrams from Java source code? Sequence Diagram Reverse Engineering http:

Categories : Java

Jenkins generate email when a user commits code in svn
If you want to send an email, every time a commit happens in svn, then I would solve this in svn. Use a post commit hook for this If you want to send an email each time a build in jenkins happens, add the mail command to your ant build script, build.xml. There is a special Mail task for this. You may say that it does not matter whether the email is sent on svn commit or on jenkins build. But this is not exactly true: Normally you configure jenkins in a way that it polls svn for new commits, let's say every 30 minutes. If new commits happened jenkins will trigger the build script to run. But note that in 30 minutes more than 1 commit could happen. Therefore you'll have to decide if you want to send a email on every commit or every build: On every build : use a special ant task in your b

Categories : Jenkins

Auto generate registration code in custom format
$query = "SELECT MAX(cast(registration_code as decimal)) id FROM accounts "; if($result = mysql_query($query)) { $row = mysql_fetch_assoc($result); $count = $row['id']; $count = $count+1; $code_no = str_pad($count, 4, "0", STR_PAD_LEFT); } This will generate 0000,0001,0002...wen it will reach to 0099 it will generate 0100..

Categories : PHP

Generate an Auto Increment Key Code using a TextView in Android
You can save the value in preferences: SharedPreferences sp = getSharedPreferences("key_code", MODE_PRIVATE); int code = sp.getInt("code",0); if(code <= 0){ code = 1; //--set default start value-- }else{ code++; //--or just increment it-- } sp.edit().putInt("code",code).commit(); //--save new value-- //--use code variable now-- String newKey = "13-T0" + code; You can place this code in onStart() of activity.

Categories : Android

Generate non-duplex proxy code for a SOAP webservice
The most easiest way is using Add Web Service reference instead of using Add Service Reference. Because your service is a simple structured soap service, without any advanced scenario such as duplex communication, you will not lose anything on client side. In 'Add Service Reference' window, click on Advanced button, provide address and click add reference. It will generate a client side for you based on .NET 2 technology Let me know if any other information is needed. Good luck

Categories : Dotnet



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