w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
C# - Save Icon of executable files
You should read this Wikipedia MSDN 16x16 or 32x32 is the standard size of ico. You cant expect a 32x32image to be very HD The Shell Icon Size value allows using larger icons in place of 32×32 icons and the Shell Small Icon Size value allows using custom sizes in place of 16×16 icons.[3] Thus, even prior to Windows XP, a single icon file could store images of any size from 1×1 pixel up to 256×256 pixels (including non-square sizes) with 16, 256, 65535, or 16.7 million colors; but the shell could not display very large sized icons.

Categories : C#

Start an executable from C++ program & continue
You need to understand what exactly is happening when you fork. What you're doing is creating a subprocess that's an exact clone of the forking process. All variables currently in memory are copied exactly, and the subprocess has access to all of those copies of all of those variables. But they're copies, so as you've noticed, fork and exec/system does not on its own handle inter-process communication (IPC). Setting a memory value in one of the processes doesn't alter that variable in any other process, including its parent, because the memory spaces are different. Also, system is very similar to exec, but gives you much less control over the file descriptors and execution environment. You're effectively already doing a fork and exec, which is what you should be doing. When you fork

Categories : C++

Winrar Sfx get Icon from executable
It is not possible to use a *.exe or *.dll file containing icon resources as source for the SFX icon. The source file must be a real *.ico file with at least 1 icon. The icon file can include also several icons in various sizes like 16x16, 24x24, 32x32, 48x48, ... The functions of Windows load and display automatically the most suitable size of the icon. There are lots of free applications which can extract icons from *.exe or *.dll files like multimedia viewer IrfanView or Resource Hacker.

Categories : Misc

Change executable icon through ilasm
You are missing out on a fairly obscure detail in a C# program. The executable the compiler generates also contains unmanaged resources. Required because Windows doesn't know anything about managed resources. This is something you can see with Visual Studio. Use File + Open + File and select a .exe generated by the C# compiler. RTM edition required, it doesn't work for Express. You'll see at least 3 nodes for your program: RT_MANIFEST contains the manifest for the executable. Very important on later Windows versions, it declares the program compatible with UAC. It prevents Windows from treating your program like an earlier Windows program that needs to be lied to when it does UAC verboten things like trying to write files to protected directories and trying to create registry key

Categories : C#

Process.Start () with passed through Stdout
var pi = new ProcessStartInfo { FileName = prog, Arguments = args, UseShellExecute = false, CreateNoWindow = true, RedirectStandardOutput = true, RedirectStandardError = false }; var proc = new Process { StartInfo = pi }; try { if (!proc.Start()) { throw new ApplicationException("Starting proc failed!"); } Console.WriteLine(proc.StandardOutput.ReadToEnd()); proc.WaitForExit(); if (proc.ExitCode != 0) { //throw new ApplicationException(String.Format("proc returned exit code {0}", proc.ExitCode)); } } catch (Exception ex)

Categories : C#

(beginner c GUI program) GTK+ and C program is having problems with showing the icon
I have run this program with a png file at 48x48 pixels, the program works well. My operating system is Ubuntu 10.04 LTS. besides the png file is the same dir as program, or set the absolute directory

Categories : C

Change a icon fonts when clicking on it
<div class="menu"> <span aria-hidden="true" class="btn" data-icon="&#128275;" id="yourspan"></span> </div> Using the id of your span $("#yourspan").on('click',function(){ if($("#yourspan").attr('data-icon')=='&#128275;'){ $("#yourspan").attr('data-icon','&#128274;'); } else{ $("#yourspan").attr('data-icon','&#128275;') } });

Categories : Javascript

Android app restarts when opened by clicking app icon
Try to replace you splash Activity code with this code.. public class Splash extends Activity { protected boolean _active = true; protected int _splashTime = 2000; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splash); Thread splashTread = new Thread() { @Override public void run() { try { int waited = 0; while (_active && (waited < _splashTime)) { sleep(100); if (_active) { waited += 100; } } } catch (InterruptedException e) {

Categories : Android

TinyMCE 4 replicate clicking of a toolbar icon
I also faced this issue today and found a solution. My usecase was to open image dialog on double click. In tinyMCE.init function you need to add this (example): tinyMCE.init({ ... ed.on('DblClick', function(e) { if (e.target.nodeName=='IMG') { tinyMCE.activeEditor.execCommand('mceImageDialog'); } }); ... }); I used a command name 'mceImageDialog' but you can use whatever you want. The key to making this command work is to open image plugin.js and add these lines Path: plugins/image/plugin.js (plugin.min.js): ... editor.addCommand("mceImageDialog", function(ui, val) { showDialog(); }); ... And thats it. After doubleclick on image element, the image dialog appears. For your solution you need i think only the plugin addCommand and use this command for y

Categories : Javascript

c++ executable program test
I use VS2008 and try to answer your question. Right click on the project and select properties on the bottom of popup, then go to Debugging under Configuration properties. You can see command you run and arguments you pass in IDE. I guess you miss some parameters.

Categories : C++

how to get minimum executable opcodes for c program?
You should read this article: http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html. It explains all you need to create really tiny program in great detail.

Categories : C

converting python program into executable
If you want to make it executable, you have to chmod +x /path/to/script.py. This gives anybody permission to run the file. Then you can python /path/to/script.py. You still need to start the command with python, that is ugly. If you add this line #!/usr/bin/env python to the first line of your script. This is callled a shebang or a hashbang. Then (still remember to chmod it) you can /path/to/script.py and it will execute. If you are already in the directory of your script you can ./script.py. (still remember to chmod it and at a shebang) If you still aren't satisfied, and you want to type in just the name of your script, you move the script into one of the folders on your path (which you can find by typing echo $PATH in shell, typically this is /usr/, /bin/, /usr/local/bin, or something

Categories : Python

Export executable program from QtCreator
You need to put that dll in the executable folder. The dll would be in the Qt folder i assume, check it. Also please note that is a debug dll (the last D in the name), you‘d want to ship a release build instead of a debug one.

Categories : C++

How to make c program as executable in windows 7
You need to link with the runtime library which contains the startup function and all other standard functions. Why not skip the preprocessor and assembler step, and go directly to object file? And also use gcc when linking which will add the needed extra libraries automatically? Or for simple single-source-file programs go directly to executable? Either $ gcc hello.c -c -o hello.o $ gcc hello.o -o hello Or $ gcc hello.c -o hello

Categories : C

My c program is multi-threading by default or stdout reordering my print statements?
Look how you call increment value: void increment_value(int* hash, char key) { int value = get_value(hash, key); // calling get_value hash[get_index(key)] = ++value; } so you are printing a char here and you call get_value again in process function. That why you are getting multiples prints of chars before '1'

Categories : C

Unable to start executable built in VS2008 in a clean system
The /MT option will result in the runtime library being statically linked, so the dynamic libraries don't have to be present on a target system. The alternative is to package the redist installer with your installer.

Categories : Visual Studio

Remove item in JCombobox drop down list on clicking Icon next to it
JComboBox (and many other Swing components) rely on renderers to provide custom rendering of the values they display. This makes it easy to provide multiple different views of the same data. Start by taking a read through How to Use Combo Boxes Pay attention to the section on Providing a Custom Renderer

Categories : Java

How to make a Python script an executable program
If you just need to make the python programs executable, then you can add a line to the top like this: #!/usr/bin/python Replace /usr/bin/python with the filepath to python, which can be obtained by typing which python into the terminal, assuming you're using a unix-based system. You can then tell the operating system that the program is executable with chmod +x nameofprogram If the java programs require something more complicated than just being able to run the python parts as executables, then you'll probably need to provide more information for anyone to be able to help you.

Categories : Java

SDL embed image inside program executable
Embedding a file in an executable is easy but there are some gotchas, there are several ways to do it including some portable and non-portable ways. Convert the image to C code Write a script to convert the image to a constant array in C. The script would look something like this in Python: #!/usr/bin/env python3 print("static const unsigned char IMAGE_DATA[] = {{{}}};".format( ",".join(str(b) for b in open("myimage.bmp", "rb").read()))) Just pipe the output to a *.h file and include that file from one other file. You can get the size of the file with sizeof(IMAGE_DATA). Advantages: portable Disadvantages: requires Python to be installed, does not work if array is too large for compiler, requires adding a custom step to the build system Convert the image to an object file

Categories : C++

Code works in debugger but not in executable program
Debuggers generally clears data, i.e. setting variables to zero. If you check for e.g. NULL pointers, but forget to initialize the variable(s) you check, then it will work in the debugger but not when you run the program outside the debugger.

Categories : C++

Getting the program version of an executable file like explorer does in C# .NET 2
Re-reading your post, you want to get the file version of another exe or your exe? For another exe, use FileVersionInfo's FileMajorPart, FileMinorPart, FileBuildPart, FilePrivatePart, or ProductMajorPart, ProductMinorPart, ProductBuildPart, ProductPrivatePart, then format the values however you wish. Be aware that depending on what version fields were used by the company or person who compiled the exe in question, it may or may not contain certain version fields. If you use the FileVersion or ProductVersion property, it returns a 64-bit number where the four 16-bit shorts in the 64-bit long are the major.minor.build.private components. However, this should format correctly if you use the .ToString() so: FileVersionInfo fvi = FileVersionInfo.GetVersionInfo("C:\MyFile.txt"); string = fv

Categories : C#

Make a python program with PySide an executable
You are missing a DLL. The DLL in question can be (at least formerly) obtained from Microsoft by downloading their free compiler package. Alternatively, ensure that this process has the right paths set to find the DLL in question.

Categories : Python

How to make the program to be able to write to own executable at runtime?
The easiest way to do something often is not to do it, but just pretend you did it. For instance, when claiming to delete a file, it is often far easier to just move it to another directory on the same disk. That's just a matter of copying the metadata (directory entry) over. Use that lesson: to "change" your executable, rename it (allowed while running), copy it back to its original name (officially a new file, not in use), and change the new file with the old name.

Categories : C#

How to turn Python program into executable file
Here are a few options: Platypus is not Python-specific. It lets you wrap a simple GUI around a command line tool. py2app is Python-specific and a good choice if you have a GUI, or need to run in the background. PyInstaller is similar to py2app but cross-platform; I've never used it, so I don't know how well it works. The right choice depends on what your program does; who is the expected audience — do you need to redistribute it, if so how, and so forth. If you want to make the application entirely self-contained — not dependent on anything else beyond the OS — then things get more complicated (though certainly not insoluble; there are several commercial Mac desktop apps written in Python.)

Categories : Python

Call java command line program from .net and return output of STDOUT to variable
Yes, use Process.StandardOutput (e.g., StreamReader.ReadToEnd among other possibilities). Be sure to set ProcessStartInfo.UseShellExecute to false, and ProcessStartInfo.RedirectStandardOutput to true.

Categories : Java

How can I compile a python 3.3 program (which uses pygame) into a Windows executable?
I found this, it might not work: 3to2 1.0 Then you can use py2exe on the code.

Categories : Python

python: import error after making program executable
Your program is trying to run like a bash-script, so it seems, your #!/usr/bin/env python had no effect. Make sure that this line is at the top of the program in the first row with no characters before #

Categories : Python

Can I overload /usr/bin/python to dump any exception in program execution into a database in addition to displaying it on stdout?
You can define default exception handler: import sys import traceback def my_handler(typ, value, tb): error_str = traceback.format_exception(typ, value, tb) print 'Here you can write exception to DB: ', error_str sys.excepthook = my_handler print 1 / 0 # here you can execute third party code via execfile/import Look into documentation about exception handling and generating tracebacks.

Categories : Python

debug/run executable fails with: this program is blocked by group policy
I didn't see the answer for this particular issue, so I will post it here to save anybody in my situation some time. The issue seems to be with the name of the executable. Apparently Client.exe will get blocked. Perhaps someone with deeper knowledge can provide a better solution, but my solution was to rename the output executable. Hope this answer is helpful.

Categories : Windows

How do I log the contents of print messages to two files with stdout
Simply use file.write: with open('FILE.txt','w') as output_file: #do something here output_file.write(somedata) # add ' ' for a new line with open('FILE_APPENDING.txt','a') as output_file1: #do something here output_file1.write(somedata) help on file.write: >>> print file.write.__doc__ write(str) -> None. Write string str to file. Note that due to buffering, flush() or close() may be needed before the file on disk reflects the data written.

Categories : Python

Start my application by clicking on widget
Here's what i finally got to work: public class WidgetProvider extends AppWidgetProvider { public static String SWITCH_WIDGET_UPDATE = "MainActivity.Switch"; @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.i("PROJECTCARUSO","onUpdate"); RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget); remoteViews.setOnClickPendingIntent(R.id.widget_button, buildButtonPendingIntent(context)); Intent intentClick = new Intent(context, FragmentChange.class); PendingIntent pendingIntent = PendingIntent.getActivity (context, 0, intentClick, 0); remoteViews.setOnClickPendingIntent (R.id.widget_button, pendingIntent); pushWidgetUpdate(context,

Categories : Android

Start another activity by clicking a button
You need to call another activity like this inside the OnClickListener() of button Button mondayEdit= (Button)findViewById(R.id.button1); mondayEdit.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent intent = new Intent(main.this, secondActivity.class); startActivity(intent); finish(); } });

Categories : Android

avoid creating empty STDOUT and STDERR files
The files are created by the cmd.com before running your program, so you have no control over it. The best you can do is making a batch file that "cleans up" after running your process by deleting out.txt and/or err.txt when they are empty. Here is a link to an answer explaining how to detect and delete empty files.

Categories : Dotnet

How to start a program on instance start on AWS EC2
userdata is only executed the very first time that the instance is created. This is by design. You've got a couple of options - all of which use your userdata script Copy the my_application.lnk to the startup folder Register the application in the registry "run" start key (http://blogs.msdn.com/b/powershell/archive/2006/04/25/how-to-access-or-modify-startup-items-in-the-window-registry.aspx) Register it with the task scheduler to configure it to execute on startup (http://technet.microsoft.com/en-us/library/bb490996.aspx)

Categories : Amazon

How to start new activity by clicking Link in TextView
put an onClick in your xml like this <TextView android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClick="clickFunction"/> Then in your java public void clickFunction(View v) { Intent intent = new Intent(this, nextActivity.class); startActivity(intent); }

Categories : Misc

how to get executable application from .bin files
possible dupe of: Replacing Bitmap Resource in exe You can undoubtedly find a tool to do so, but since this is a programming forum, these are the main APIs you would use: BeginUpdateResource, UpdateResource, and EndUpdateResource. Sample For additional reference/information, here is the spec for the PE file format: http://msdn.microsoft.com/en-us/library/windows/hardware/gg463119.aspx

Categories : Windows

Start a new activity on notification icon click
The pending intent that you give to the Notification builder should contain a intent that will launch an activity when the notification is clicked by the user. You need to create an intent to launch one of your activities: Intent resultIntent = new Intent(this, ResultActivity.class); Then you make a pendingIntent using this intent: PendingIntent resultPendingIntent = stackBuilder.getPendingIntent( 0, PendingIntent.FLAG_UPDATE_CURRENT ); and then you create a notification using it. When a user clicks your notification, ResultActivity will be launched. The whole code snippet: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.notification_icon) .setContentTitle("My notific

Categories : Android

Executable Files Like Launch4j for Other Platforms
Here are some possibilities: http://code.google.com/p/appstart/ http://commons.apache.org/proper/commons-launcher/ http://commons.apache.org/proper/commons-daemon/ (though this seems to be for services) Akuma - http://akuma.kohsuke.org/ (again a service launcher - for POSIX platforms) The other approach is to use something like Install4j to generate installers for multiple platforms and have that take care of the launcher problem for you. Finally, the launch4j site says this: "Running Launch4j on other Java enabled platforms is a matter of getting a binary version of MinGW binutils 2.22 (windres and ld only) for your system or compiling them. If you'll provide these, I'll be able to create a binary package available for download." Note that a launcher does not have to be a na

Categories : Java

package_data files with executable permissions
Figured it out based on some other SO answers - the following works: class my_install_lib(distutils.command.install_lib.install_lib): def run(self): distutils.command.install_lib.install_lib.run(self) for fn in self.get_outputs(): if <this is one of the binaries I want to be executable>: # copied from distutils source - make the binaries executable mode = ((os.stat(fn).st_mode) | 0555) & 07777 distutils.log.info("changing mode of %s to %o", fn, mode) os.chmod(fn, mode) and then pass cmdclass={'install_lib':my_install_lib} to setup.

Categories : Python

Avoid executable text files in SVN
Use a pre-commit hook to check the filename and then modify the executable flag based on the file extensions: http://svnbook.red-bean.com/en/1.6/svn-book.html#svn.reposadmin.create.hooks

Categories : Windows



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