w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Creating a simple internet chat
When you are creating a server, you have to use server socket with the ip address of where it's running... The server socket needs to be running on your machine of your machine's ip address. With your router, you need to forward the connections to the port you are running on your that is hosting the server. Then you should be able to connect from outside your local network. Without the code for what your are doing it's hard to tell if that's the only problem here is a simple chat server that might give you guidance. import java.net.*; import java.io.*; public class ChatServer { private Socket socket = null; private ServerSocket server = null; private DataInputStream streamIn = null; public ChatServer(int port) { try { System.out.prin

Categories : Java

Delphi chat dont send message on some ip
This isn't a Delphi issue, but a network configuration issue. The problem is your router receives the message from Comp2 but doesn't know what to do with it. You need to enable port forwarding on your router to forward port 9096 (or whatever TCP port you are using) on to Comp1. You'll also need to configure the router to reserve the same address for your Comp1 PC, otherwise the program will stop working if the PC gets assigned a different IP address when it's rebooted.

Categories : Delphi

How to make voice chat between two application over internet?
Yes. push notifications are the best way. find a nice tutorial here For voice chat, Twilio Client iOS VoIP SDK will be the best choice. It will also support text chatting. You can find docs also here. Dont worry. Everything is free. enjoy coding

Categories : IOS

A chat program. What security solutions can I use?
Indy supports OpenSSL so yo only need to add and configure a OpenSSL handler, and make sure that the firewall allows connections over the secure port. A popular source of information is the Open Web Application Security Project (OWASP). Their pages include lots of technical article, for example https://www.owasp.org/index.php/Category:Vulnerability about vulnerabilities

Categories : Delphi

WWW server reports error after POST Request by Internet Direct components in Delphi
I'm very sure that I'm POSTing the right data Since it does not work - obviously you do not (or Delphi does not - that makes no difference for server). You should start usual debugging loop: Observe reference working behaviour. Observe your program behavior Spot the difference Eliminate the difference Check if the program works now If not - go to step 2. Reference implementation would be some WWW browser working with site: Opera, Chrome, Firefox, MS IE, etc. Observing tool would be some HTTP Sniffer like WireShark or OmniPacket or Microsoft Net Monitor or else, however this tinkers with OS work on rather deep level. Or it can be local proxy with GUI, like Proxomitron or Membrane Monitor - but that would require special setup for both the program and the browser, to route their

Categories : Delphi

Where is the error // why doesn't it work? (Java Chat program)
It appears that your application does not work because you are sending the data to different ports. static int sPort=11111; static int rPort=11112; You need to send it to the same port (and in case of sending it to your own computer, you need to specify either your local ip-address, localhost or 127.0.0.1). As for your first question Why don't I receive any message Are you connecting to 127.0.0.1? What exactly are your parameters? As for your second question why does the program throw "Test123" when I force the program to terminate? because at that very moment you break the while-loop try{ DatagramSocket Socket = new DatagramSocket(); while(true){ String TextSend = scantext.next(); sendData = TextSend.getBytes(); DatagramPacket out = new Datagra

Categories : Java

Java program is loading from system32 folder, not from folder, which it is placed
My theory: if you installed Java for Windows via the traditional installer, in addition to the place you told it to put it (canonically, JAVA_HOME), the installer drops a java.exe in the system32 directory, so it's likely that when you're starting the JVM on startup, system32 is the working directory and that's where it will look for files with relative path names like the one you've provided. The easiest solution is to specify the path to the text file absolutely in your code. I would also recommend specifying the full path to java.exe in your registry key (I would guess that right now it's just java.exe with no path) so that you can guarantee which version you're running; if you have multiple versions of Java installed only the most recently one installed will have java.exe in system3

Categories : Java

Handling multiple different requests and responses in client-server Chat Program
To make things more scalable, your application could benefit from using multiple threads on both client side and the server side. Be sure to use locks when handling common data. First, the client side could certainly benefit from using three threads. The first thread can listen for input from server (the recvfrom() call). The second thread can listen for input from the user and put these messages in a queue. The third thread can process messages from the queue and call socket.send() to send those messages to the server. Since the server is handling multiple clients, it could also benefit from having threads to listen for messages from the client and to process them. Once again, you could use one thread to get messages from the client and then queue them. You can use second thread to proc

Categories : Networking

Resetting a program in delphi
Off the top of my head....This should run. procedure ResetControls(aPage:TTabSheet); var loop : integer; begin if assigned(aPage) then begin for loop := 0 to aPage.controlcount-1 do begin if aPage.Controls[loop].ClassType = TCheckBox then TCheckBox(aPage.Controls[loop]).Checked := false else if aPage.Controls[loop].ClassType = TComboBox then TComboBox(aPage.Controlss[loop]).itemindex := -1; end; end; end; edit: Corrected as pointed out by Remy

Categories : Delphi

how can I add my publisher name into my delphi exe program?
You need a code-signing certificate, and need to digitally sign your executable using that certificate. Search for [windows] code signing here at StackOverflow. There are tons of questions here on the topic; any and all of them (regardless of language used) for Windows applications apply to Delphi as well. Here is a start for you., and here's another one with links to resources. (Both links are here at StackOverflow, and not external sites.)

Categories : Delphi

Multiple Internet Explorer Installer/Folder Trick?
The process you describe of installing IE6 and updating step by step is impossible to achieve under a single OS. You'd have to start with WinXP... and then you'd be stuck when you got to IE9. To get as far as IE11, you'd need to upgrade to at least Win7. I don't want to know how long it would take you to run through all those upgrades, and even then I think you would be unlikely to have working copies of all IE versions at the end of it. There is only one sensible answer to your question: Use a VM for each IE version. It's the only way. Especially given there isn't a Windows version that can run all IE versions. Old IEs won't run in Windows 7/8, and new IEs won't run in XP... there is some cross-over, but none of the OS options is capable of running all the IE versions you need to test --

Categories : Internet Explorer

Log in program on delphi with data source
The fact that you have included the 'database' tag in your question implies that you already know what the solution is - a database. If your program already uses a database, add a table for users which includes their real name, their user name and their encoded password. Your login screen will have to query this table to check whether the user is valid. Make sure that you use parameters to the query; this way you avoid the possibility of sql injection (query 'little bobby tables').

Categories : Database

Use Ctrl+/ as shortcut in Delphi program
If you assign an OnShortCut event handler to your menu's parent TForm, you will see that pressing Ctrl+/ results in a TShortCut value of 16575 from Menus.ShortCutFromMessage(), which is the function that the VCL uses internally when dispatching keystrokes for shortcut handling. Both ShortCutToText(16495) and ShortCutToText(16575) return 'Ctrl+/', so lets break it down: scCtrl = $4000 16495 = $406F 16575 = $40BF Both shortcuts have the scCtrl flag present. ShortCutToText($6F) and ShortCutToText($BF) both return '/'. This is because MapVirtualKey() returns the same scan code ($350000) for both virtual keys $6F (VK_DIVIDE) and $BF (VK_OEM_2 - the /? key for US keyboards). When dispatching a shortcut, the VCL does exact comparisons of TShortCut values. So when you have 16495 assigned as

Categories : Delphi

How can I use a text file from the internet in my C program?
It is much more involved to get a web-resource than to read a file from disk, but you can absolutely do it, for example by using a library such as libcurl. An alternative strategy is to make components and tie them together with bash or other scripting. Your C program could for example read from standard input, and you could make a bash script something like this: curl http://www.ndbc.noaa.gov/data/realtime2/SPLL1.txt | ./the_program This way, you could keep your core C program simpler.

Categories : C

Delphi XE4 iOS open email program not working
I should have through of it myself, but here goes: do work 'mailto:info@example.com?subject=test' 'mailto:info@example.com?subject=test%20test' does not work 'mailto:info@example.com?subject=test test' (i.e. solution is to convert spaces to %20)

Categories : IOS

Adding private chat functionality to simple twisted chat server
Actually I figured it out by changing the for loop in handle_CHAT. As I want the program to send the message to the specific user, a "talkwith" string can be added to the class and this string can hold that specific user's name. Then this change turns the program from public to private chatting. msg = "<%s> %s" % (self.name,msg) for name,protocol in self.users.iteritems(): if name == self.talkwith: protocol.sendLine(msg)

Categories : Python

Swing chat window creates extra chat windows
Just remove the static keyword from private static UDPCS1 chat = new UDPCS1(); and no more chat windows will be there... Hoping it helped... Helped in my case i was doing something too,...

Categories : Java

Comodo internet security detect c++ hello world program as a viruses (trojan)
I faced the same problem. Since I know there is no virus in the programs, I excluded my dev c++ folder and program file folders from antivirus software. Steps in comodo antivirus is: 1.Open CIS 2.click Tasks in upper right corner 3.click Advanced tasks 4.select open advanced settings 5.Expand security settings 6.Expand antivirus 7.click Exclusions 8.Click on the arrow or right click anywhere on the screen. 9.select Add->folders 10.Add the dev c++ folders and program files folder in the list. 11.You have excluded the files Now run your program, will surely get the output without any virus.

Categories : C++

PhoneJS - launching Demos
I also not found this PhoneJS information in documentation. I wrote to support and they told me PhoneJS application is like any PhoneGap based application can be packaged with PhoneGap and in http://build.phonegap.com site. PhoneGap Build worked well, but it is little slow. Do you see any errors or simple black screen?

Categories : Android

Android google maps API Demos
"This is probably an authentication issue" sometimes means that your Maps V2 API key is incorrect, such as: You did not change what was in the project, or You did not use the right signing key when registering to have your Maps V2 API key in the Google APIs Console, or You used the wrong package name when registering to have your Maps V2 API key in the Google APIs Console

Categories : Android

Cuboc libgdx demos can't build
Your libgdx library and demo source are out of sync. The scl method on Vector2 changed 5 months ago. I believe it was after 0.9.8 was released, so its part of the 'nightly' builds. So, you should either update the cuboc demos to a nightly build, or should compile the demo you have against an older Libgdx release.

Categories : Android

PHP AJAX chat - Chat commands logic?
You need to define a syntax for your commands yourself. For example /ban <username> for a ban. First you check whether the message begins with a slash. If so it is a command. Now search for the first space, everything after the slash and in front of the space is the command name. Pass everything after the first space to the command. In this case the username. The command handles the parameters on it's own. It could look like this: $message = '/ban TimWolla'; if (substr($message, 0, 1) === '/') { // $message is a command $firstSpace = strpos($message, ' '); $command = substr($message, 1, $firstSpace); $parameters = substr($message, $firstSpace + 1); if (!hasPermission($command)) error('Permission denied'); switch ($command) { case 'ban':

Categories : PHP

What does the #feedback selector reference in the JQueryUI demos
I think is copy-paste of the example css code of the jQuery UI selectable. It is needed only for the third example Serialize look at the <p id="feedback">. Demo code: <html lang="en"> <head> <meta charset="utf-8" /> <title>jQuery UI Selectable - Serialize</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> <style> #feedback { font-size: 1.4em; } #selectable .ui-selecting { background: #FECA40; } #selectable .ui-selected { background: #F39814; color

Categories : Javascript

EaselJS: Can somebody explain the inheritance pattern used in demos?
I'm trying to wrap my head around this pattern, because it is unlike anything I've come across in the past. Me neither. It doesn't do much magic, but he structure is definitely uncommon. See Correct javascript inheritance for the right pattern. Can somebody explain to me why you would want to use an instance of a class as a new class' prototype? You don't. You want to use an object that inherits from the parent class's prototype object. Unfortunately many people use new ParConstructor for that - which works well if the constructor function is empty. If the constructor does create instance properties or has other side effects, it can cause trouble. Most people don't seem to notice or care about that, though. explanation of this pattern? function Ship() { this.initia

Categories : Javascript

Null location when trying google maps demos
Here's how to detect GPS and Network availability for location LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); boolean GPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); boolean NetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); No, don't store the last location. Use getLastKnownLocation instead.

Categories : Android

Red5 demos are not showing up in the list while installing
Solved..!! Iam using network which uses proxy to connect to the internet. So use this link http://red5.5842.n7.nabble.com/Proxy-related-issue-org-red5-server-service-Installer-Unable-to-connect-to-http-red5-googlecode-com--td4903.html to set proxy for Red5 in Red5.bat or red5.sh based on os

Categories : Misc

Class Not Found Exception when Running YouTube API Demos for Android
Seems to be a bug in a late ADT update. This link explains it all: https://groups.google.com/d/msg/adt-dev/epOfZbKPFdk/v4a-pTbq1OwJ Or to quote it: Project right-click > Properties > Java Build Path > Order and Export > Check Android Private Libraries > OK Then Project > Clean... And rebuild/run.

Categories : Android

which is faster, saving chat history in a text file and display it or using mysql db to save chat history
For a real-world implementation, I wouldn't consider either one of these a good option, but it definitely could be fun to play with. Using files isn't going to scale as well as the db,well... as easily. But really, I'd look into just setting up a jabber server and play with that. Or maybe look into node.js.

Categories : PHP

InstallShield Without The Program Files Folder?
Sounds like you're building a release with the compression turned off. In the solution explorer tree, expand 'Prepare for Release' and select the 'Releases' node. Find the release you're using in the tree that appears on the left side of the window. You should see a setting called 'Compression'. If it's set to 'Uncompressed', that's your problem. Change it to Compressed.

Categories : C#

VBA Write new file to Program Files folder
Writing to %PROGRAMFILES% requires administrative privileges on Windows Vista and above (or XP when running as a limited user). Applications are not supposed to store their data there, and that information has been published for more than a decade now. A good reference here for information about where to store your application's data is in Does Microsoft have a best practices document regarding the storage of App Data vs User Data on different Windows Platforms? However, your question is confusing, because you refer to Program Files folder in your subject, but your code uses a hard-coded path to C:Documents and SettingslocalhostDesktop, which is not the same thing. If that's the actual problem, it's probably because of two issues: You've hard-coded in C:Documents and Settings, which is

Categories : Vba

Can't run program after putting the compiled file to the folder
You have several problems. First: RUN=./dvoram64/main $(RUN): $(Objects) $(CC) $(CCFLAGS) $(Objects) -o $(RUN) $(LBFLAGS) dvoram64/main: src/main.cpp mkdir -p dvoram64 $(CC) $(CCFLAGS) -c src/main.cpp -o dvoram64/main You have two rules for the same target(dvoram64/main). Which do you want to use? Why do you have two? Remove one of them. Next: Objects=dvoram64/main RUN=./dvoram64/main $(RUN): $(Objects) ... You have two variables for (essentially) the same thing, which is untidy but not illegal. But You make one the prerequisite of the other. A thing cannot be it's own prerequisite, and Make must correct the error for you. You should rethink this. Next: RUN=./dvoram64/main run: $(RUN) $(RUN) dvoram64/main: src/main.cpp mkdir -p dvoram64 $(CC) $(CC

Categories : C++

How can I make it so that a program runs when a folder is opened?
This is just an idea (but more than a comment could handle). Windows allows you to attach a thumbnail provider, which will generate thumbnails for files. That's how softwares such as Microsoft Office, LibreOffice, VLC etc. make explorer thumbnails for files. You can use this API and define a thumbnail provider for a file type invented by you, and put an empty file of that type in your folder. When the user opens the folder, your code will be run to generate the thumbnail, it can thus start another program (the one you want to start) and return a failure code (so that no thumbnail is cached, and the code will be re-run when the user re-opens the folder. This only works starting from Windows Vista.

Categories : Batch File

Calling a .exe as Admin from within my code in Program Files folder
Just add a manifest to the target application stating that it should be run as admin. The responsibility for that generally lies with the application being started, not the application which starts it. An exception would be cases like Notepad being called to open a shared configuration file, but you haven't provided enough details to determine that.

Categories : C#

Program that counts txt files in folder and its subfolders throws NullPointerException
File.listFiles() will return null if it is invoked on a file that is not a directory. If that happens, your loop condition will cause the NullPointerException. This makes sense if it is being invoked, as you mention at the end, on something that does not exist. Why this is happening requires more information. What is the "file that [you] can't even find on [your] computer?"

Categories : Java

Wix Toolset - Setting a Property to User Profile Folder path and Program Files
As an alternative to using the properties you're defining, you might be able to use some built-in properties to better effect. Instead of %USERPROFILE, consider LocalAppDataFolder. This will avoid your data from being copied between machines as a user roams between machines on a network domain. I'm guessing you don't need that but, if you do, use AppDataFolder and beware of the latencies involved. Instead of %PROGRAMFILES, consider ProgramFilesFolder. This seems to be what you intend.

Categories : Wix

PowerShell code running as scheduled task fails with Program Files folder
Maybe the execution policy is too restricted for this account. try to set the executionpolicy by adding -executionpolicy unrestricted in the parameters. If that failed, it would help to see the log of the scheduler.

Categories : Powershell

Security problems of world-writable batch files in Windows program folder
Pretty much exactly what you'd expect. If your application calls that batch file, then any user can put commands in it to be run with the privileges of the user running your application. If your application acquires administrative permissions prior to running that batch file, then it's more or less like letting any user use your application to execute commands as root.

Categories : Windows

How to consume TDatasource Component by coding returned through delphi webservice in a delphi VLC Form
You cannot do that as the TADODataSet cannot be remoted as it would need the TADOConnection and such things like ConnectionString on the client as well as on the server. The way to remove data using Delphi us using DataSnap with a TSoapDataModule on the server side containing a TClientDataSet which gets populated from the TADODataSet using a TDataSetProvider, and a on the client side a TSoapConnection plus TClientDataSet on the client. DataSnap then will perform all the read/update traffic for you using SOAP (i.e. XML over HTTP). See the DataSnap videos from Pawel Glowacki to get an idea on how to set this up, then read the documentation at Creating multi tiered applications Index. Note that for DataSnap, you need to have the Delphi Enterprise as minimum edition, and this won't work wi

Categories : Sql Server

How to inherite a custom form (visual inheritance) from delphi Dll in my delphi project
It's not possible to import and use a VCL object from a DLL. When you try to do so you end up with two different instances of the VCL, including two different distinct versions of the imported form type. There's the version in the DLL, and the version in the application. They are distinct, and two versions of the type is one too many. The supported way to import a complex type from another module is to use a package. If you don't want to use packages, then you'll have to use some form of interop that does work across DLL module boundaries. For example, COM interfaces.

Categories : Delphi

Unable to insert Unicode into SQL Server 2008 using Delphi ZeosLib and Delphi 7
I have not tested your example, but I'm able to save and retrieve from database Unicode characters without problem on SQL Server with Delphi 7 VCL/CLX and zeoslib. I think in your case it will be enough changing your save procedure like this : procedure TForm1.Button2Click(Sender: TObject); var sqlstring : widestring; data : UTF8String; begin FZConnection := TZConnection.Create(Owner); FZConnection.LoginPrompt := False; FZQuery := TZQuery.Create(Owner); FZQuery.Connection := FZConnection; FZConnection.Protocol := 'mssql'; FZConnection.Database := 'replace-with-your-db'; FZConnection.HostName := 'localhost'; FZConnection.User := 'sa'; FZConnection.Password := 'replace-with-your-password'; FZConnection.Connect; data:= UTF8String( utf8encode(tntedit1.Text) ); sqlstr

Categories : Sql Server



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