w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

wordpress: Username referral in url
You cannot pass the vars of www.mysite.com/username to a var in a WordPress page, because that will mean that all the links will lead to the same page and the var as to the username, you will get a lot of conflicts and a lot of problems. I can share you my code on creating a profile page. EG: Profile and having pretty permalink like www.mysite.com/profile/eek That will acces the Wordpress page Profile, that I have set as page-profile.php in my theme, and the next variable (eg: Eek) into a variable, in my example it will be a $who variable. Add this to the functions.php add_filter( 'page_rewrite_rules', 'profile_page_rewrite_rules' ); function profile_page_rewrite_rules( $rewrite_rules ) { end( $rewrite_rules ); $last_pattern = key( $rewrite_rules ); $last_replacement = arra

Categories : Wordpress

How to get a visitor referral with Google Analitycs from within an iFrame?
It is clearly documented in their help center: Installing the Analytics tracking code on a site that uses frames requires some careful consideration to ensure that your traffic is tracked accurately, and that the referral information is retained. We recommend that a site using frames includes the tracking code in the section of the frameset (parent) page, as well as directly before the tag of each child frame that you want to track. If you place your tracking code within a tag thinking that this is equivalent to the body, the code will not run and no data will be recorded. If all frames on the site reside on the same domain, then referral information can be properly recorded as long as you've installed the tracking code on the first page users visit on the site. The So

Categories : PHP

Android referral is received only after user opens the app
Your app will receive broadcasts only once it has been opened, starting Android 3.1 for security reasons. On Android 3.0 and below, you will receive them regardless of whether or not your app has been opened. There is no way around this.

Categories : Android

Why would advert clicks from a website not register as a referral in Google Analytics?
I might be misunderstanding you, but if your links are tagged with utm parameters they will not show up as referrals. Instead they will show up with whatever you have set as utm_source, so you should look into the "All Traffic" report and see if you can find your parameter name there.

Categories : Google Analytics

Programs always output 0
Regarding second problem: str[a]*str[a-1]*str[a-2]*str[a-3]*str[a-4] = p; this assignment seems reversed. In addition str is a string made of characters '0' '1' '2' which are not directly numbers, or at least '0' != 0 since '0' is the character digit 0 which is encoded as 0x48

Categories : C

Dependencies of programs using gtk/gtk.h
You generally build such GTK programs using pkg-config. And I am getting (on Debian/Sid/AMD64) the compile flags % pkg-config --cflags gtk+-x11-3.0 -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/libdrm and the link flags % pkg-config --libs gtk+-x11-3.0 -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 Notice that these shared libraries link some

Categories : Linux

Eclipse will not run C programs
right click your project in eclipse "project explore" -> Run as -> Run configuration =>select your project name then check "Main" tab, in C/C++ application file. is it point to your binary file? E.g: Debug/TestProj.exe

Categories : C

Other programs in pipe
If you're on Linux you can use the /proc filesystem to check how commands communicate over pipes. However, this is not really portable.

Categories : C

Qt5 programs won't compile
I found the answer using qmake --help. This actually says: Note: The created .pro file probably will need to be edited. For example add the QT variable to specify what modules are required. Adding these lines to the .pro file solved the problem: QT += core gui QT += widgets

Categories : Qt

Pseudorandomity in concurrent programs
My question is this: Is it possible to preserve pseudorandomity without having inter-thread communication and if so, how? Yes it is. Make each thread use a separate random number generator (with a different but deterministic seed).

Categories : Java

Is there a way to use GLSL programs as filters?
The typical process for this type of thing is to use a full-screen shader in post processing using the depth buffer from your fully rendered scene, or using a z-pass, which renders only to the depth buffer. You can chain them together and create any number of effects. It typically involves some render-to-texture work, and is not a real trivial task (too much to post code here), but it's not THAT difficult either. If you want to take a look at a decent post-processing system, take a look at the PostFx system in Torque3D: https://github.com/GarageGames/Torque3D And here is an example of creating fog with GLSL in post: http://isnippets.blogspot.com/2010/10/real-time-fog-using-post-processing-in.html

Categories : C++

threads calling other programs
You should look int Boost Threads. There are examples on the web on how to create a program and use Boost Threads to call either a class method or a non-class static method. About using C++ library in C code, this stackoverflow post may be helpful. I guess using extern scope operator is the magic here. C++ cross-compiler is designed using C, so backward conversion is not impossible. If you hit success in using C++ into C Wikipedia listed these for Multithreading libraries for C++. I guess it is worth visiting those and see what is good. Boost is still the best IMPO. P.S. You should checkout intel's Threading Building Block TBB too. They are quite good and simple. Open source projects such as OpenCV uses tbb for their multithreaded class ops. the link is here

Categories : C

How to develop GTK+ programs on windows?
They mean you can develop under Windows and you do not have to compile the libraries for yourself. Binaries for GTK+ and its dependencies can be found here. Cross OS means that the same API is available across all supported platforms. Direct calls to the win32 API can be made normally in a GTK+ application.

Categories : C

How to run java programs in grails?
You have to import class Hello: import Hello class HelloController { def index() { Hello.main(null) } } See Java docs about packages and import statement: http://docs.oracle.com/javase/tutorial/java/package/usepkgs.html

Categories : Java

How do i share a variable's value between C programs
What your code does is wrong; you're trying to share a variable between two processes but what you've done is sharing between two source files so declaring a variable as an extern certainly doesn't help you; because that's what you do if in one process you want to expose a variable in one source file to other source files. A natural way to share a variable between two(or more) processes(programs) is something in UNIX systems called shared-memory. Please check this link for an introduction. http://www.cs.cf.ac.uk/Dave/C/node27.html Edit: Of course, inter-process communication(how two processes talk with each other) isn't limited to shared memory, you can also share a variable by sockets or through pipes

Categories : C

Two different C programs are accessing a file
You should be concerned. I assume you are sure that no other program (than the two executables mentioned in your question) are accessing that file. You should indeed lock to serialize that access. Use flock(2), or lockf(3) which uses fcntl(2) BTW, is the file read and written sequentially? Did you consider using some higher-level thing, e.g. GDBM or some database like mariadb or postgresql or mongodb, etc...

Categories : C

Administrator permission for certain programs
The culprit is User Account Control (UAC). UAC doesn't allow white listing a particular application. You have to disable it to get rid of these messages. To know more about UAC or to diable it see http://www.petri.co.il/disable-uac-in-windows-7.htm

Categories : Misc

PHP executing two C programs with proc_open
If process can run separately one after another You can try put "in-steps", /** step 1*/ $process1 = proc_open($command_exe1, $descriptorspec1, $pipes1, $cwd) ... while(!feof($pipes1[1])) { $StdOut1 = stream_get_contents($pipes1[1]); } echo $StdOut1; /** step 2*/ $process2 = proc_open($command_exe2 $descriptorspec2, $pipes2, $cwd) while(!feof($pipes2[1])) { ...

Categories : PHP

Same Sparql with different result using different programs
I've tried this query with the data that you provided (I had to add the prefixes): prefix wo: <http://purl.org/ontology/wo/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?individual ?type ?label where { ?individual rdf:type ?type . ?individual rdfs:label ?label filter (?type in (wo:Kingdom)) } I ran the query using Jena's command line arq with the following results: $ arq --query query.sparql --data ontology.owl ------------------------------------------------------------------- | individual | type | label | =================================================================== | <file:/nature/life/Animal#kingdom> | wo:Kingdom | "Animals" | |

Categories : Java

Can you explain to me the difference between two programs?
The first program prints the value of the uninitialized pointer p interpreted as an unsigned integer. Since the pointer is not initialized the value printed is whatever value happens to be in that location. The second program prints the address of the pointer p interpreted as an unsigned integer. While not technically legal, it will work on most systems where the sizeof(char *) == sizeof(unsigned int). Since the variable "p" is an automatic variable you will get a value in the address range that your runtime assigns to the C stack. Edit: to clarify from the comments. Printf formats the data passed to it in parameters according to the control string. %u means to print an unsigned integer. So when you pass in p, C passes in the value of the pointer variable to printf. The # of

Categories : C

How to run Frege programs on Android?
I'm not familiar with frege, and I haven't tried to use scala or other JVM languages on Android. That being said, if I were to try something like that, these are the steps I would likely take to try and figure out how to get it to work. Build a simple command line based HelloWorld type application in frege, that can be run with, e.g. java -jar HelloWorld.jar HelloWorld Run dx on HelloWorld.jar, and then try to get the example working on an android device from adb shell, using dalvikvm. i.e. dalvikvm -cp blah.dex HelloWorld Figure out how to reference/use classes from the android.jar provided by the Android sdk in frege Build a simple proof of concept Activity class in frege, and manually build a classes.dex file from it Build a similar proof of concept application in java and use the

Categories : Android

When do C programs not have main function
Just as every C application and C++ application must have a main function as its starting point, every Win32-based application must have a WinMain function. Take a look: http://msdn.microsoft.com/en-us/library/vstudio/bb384843.aspx

Categories : C

Combining large C and C++ programs
I'll tell you the correct answer and you're probably not going to like it. Without knowing all the specifics of your code, it sounds like you need to do some heavy refactoring. In an ideal world, when you write your application, it should be written in such a way that the implementation is done as a formal API and the main() translates/parses the command-line arguments into appropriate calls into the API. If done correctly, the file that has the main() routine is only needed to build the executable for its task. Better still, the implementation would be built as a library and a set of headers for using that library. Then your task would not be blenderizing two executables, but instead building a new application that calls two different libraries. The reason that you're not going to li

Categories : C++

Can't run my own OpenGL 3 programs on Ubuntu
My main() starts with glewInit and glutInit Nope. You don't get a current GL context until glutCreateWindow() returns. You can call glewInit() and glewIsSupported() after that. Something like this: #include <GL/glew.h> #include <GL/glut.h> ... int main( int argc, char** argv ) { glutInit( &argc, argv ); glutInitDisplayMode( GLUT_RGBA | GLUT_DOUBLE ); glutInitWindowSize( 300, 300 ); glutCreateWindow( "OpenGL" ); glewInit(); ... return 0; }

Categories : Linux

Share class between programs
The easiest solution is to put the server and client in the same Eclipse project: Both Server and Client can have a main() and be in the same project. Create two separate run configurations in eclipse (one for Server, one for Client) -- note that run configurations are created automatically if they don't exist when you press the "play" button in eclipse (just make sure the file that has the main() method is open in the editor when you press play), so you probably won't need to do this manually. Then, in eclipse, when you export the program, export it as a Runnable JAR (if "Runnable JAR" isn't available in the export quick menu just select "Other..." and search for it). You can select the run configuration. So export one for client (maybe name it client.jar) and one for the server (maybe

Categories : Java

Can native C programs be used in LibGDX?
To be clear, I believe you have an app written in Java that uses Libgdx currently, and you would like to extend that app by including a C library and making calls out to the C library from the Java application. Libgdx does not provide any special support for third-party libraries, native or Java. You will have to use the backend platform's APIs to call out to native code (JNI, NDK, etc). You should be able to add your library to the Android and Desktop backend projects, and access it via a Platform Interface. It is probably not possible to use the GWT-backend (unless you have a C to Javascript compiler). For iOS you would need to build your library for iOS, and then figure out how to link it into the Xamarin (or robovm) build process for your app. While I'm going to assume this is po

Categories : C

Advice with for loop programs
You're generating the random number outside of your loop. Therefore it will exist as the same number every time. The solution is to move the definition inside of the loop. public static void main(String[] args) { for(int counter = 0; counter < 30; counter++){ int random = (int) (Math.random() *50) +25; System.out.println(random); } } In this way, every time through the loop (30 iterations), your code will (1) generate some random number and (2) print that number.

Categories : Java

Execute Commands / Run Programs
Do not use such components. This is dangerous no matter what creator says. I'm Joomla extension developer and believe me it can ruin your application and make more problems and benefits. Depends on what you want to archive and how big will be your project you have few possibilities: 1. Create component that will execute commands Something similar to what U did but based on custom created component. Its fastest and cheapest way. Problem starts when your Java application will use more resources then website (interface). So its more like good solution for start. 2. Create component that will contact application written in Java via API This is good solution if your Java application use a lot of resources. You can run it on several servers, manage servers load so clients gets results faster

Categories : Java

How to add my program to add/remove programs? VB.NET
I found an indirect way to do it - via cmd. That's not the best way, but it may work. You can write the following text in the resources as name.cmd: 'sets the name of your app to display reg add "HKLMSoftwareMicrosoftWindowsCurrentVersionUninstallYourapp" /v "DisplayName" /d "Yourapp" /f 'sets your app version to display REG ADD "HKLMSoftwareMicrosoftWindowsCurrentVersionUninstallYourapp" /V "DisplayVersion" /D "1.0.0.0" 'sets your app icon to display location REG ADD "HKLMSoftwareMicrosoftWindowsCurrentVersionUninstallYourapp" /V "DisplayIcon" /D "%PROGRAMFILES%Yourappyourapp.ico" 'sets your name to display as publisher REG ADD "HKLMSoftwareMicrosoftWindowsCurrentVersionUninstallYourapp" /V "Publisher" /D "Yourname" 'sets the uninstall path REG ADD "HKLMSoftwareMicrosoftWindowsCurrentV

Categories : Vb.Net

Optimizing console programs
Well... There's always multithreading: Stack Overflow, for example. But it's always a complicated process, especially for C++. I'm afraid you'll have to google some tutorials for your particular case. Here are some: tutorialspoint, codebase, plenty more around. There are a lot of methods, achieved by many distinct libraries, and none of them could be considered simple.

Categories : C++

Is it possible to "hook" classes to running .net programs?
It is quite possible. If you can inject a DLL into an application, you can self host the CLR in that application. This website provides a detailed tutorial on it if you can tolerate the giant photos. However, what you are detailing is a little more complicated than just DLL injection; it's a different question really. You would need to defeat the strong naming of assemblies in .NET, replace the respective .NET assemblies on your machines and then write your new SslStream classes to report back to you. This would require a lot of work though, because you need to re-build each assembly for each class you plan on tinkering with, from the ground up. The alternative would be to hook into the underlying socket provider that .NET is going to use anyway. You can intercept winsock communications

Categories : C#

Avoid website garb programs
You have to tell whether the visitor is human or bot in the first place. This no easy task, see e. g. : Tell bots apart from human visitors for stats? Then, if you detected what bot it is, you can decide wether you want to give it your website content or not. Legitimate bots (like Googlebot) will conveniently provide their own userAgent id; malicious bots / web crawlers may disguise themselves as common browser programs. There is no 100% solution, anyway. If you content is really sensitive, you may want to add captcha, or user authentication.

Categories : Asp Net

Writing unicode programs in python <= 2.7
Is it good practice to prepend every string with u, even if it doesn't contain any characters outside of the ASCII range? Yes, and also use an editor which works with unicode, and declare the encoding type at the top of each file. In general, your pattern should be: read bytes, work internally with unicode, output bytes. When dealing with sqlite3, will a parameterized query automatically encode unicode as utf-8, or does that need to be done manually? Better to be safe than sorry, but in general I recommend that you test this out yourself. When dealing with a 'string' of bytes, should this be left as a string object or decoded into a unicode string? (I believe this would throw an exception in most cases ) Yes, work internally with unicode. No, this won't throw an exceptio

Categories : Python

How to list all the programs that are available to a given account on a cluster?
echo $PATH | tr ":" " " | while read line; do echo $line; ls $line; done Be prepared for tons of output. You might be better off doing echo $PATH first and looking for interesting-looking directories, or just seeing if tab-completion works (just type 'c', tab, see if it shows 'cat', 'cd', etc). Really tho, ask the prof for whatever docs you're supposed to have, the tools you're looking for aren't likely to be obvious just from the name of the command.

Categories : Linux

"aborted (core dumped)" in all programs
The logic in your realloc is wrong. word2 = realloc(word, length*sizeof(char)); if(word2 == NULL) { free(word2); return NULL; } else word2 = word; should be word2 = realloc(word, cursor); if(word2 == NULL) { free(word); return NULL; } word = word2; There are a few changes here word starts out having length bytes allocated so there is no point in reallocating it to the same size. The variable which tracks string size is cursor so you need to reallocate to match its size. (minor) There is no need to use sizeof(char) to help calculate the size of an allocation - this is guaranteed to be 1 If realloc fails, you need to free the original pointer, not the new one (which you know is NULL). If the reallocation succeeds, your heap cell may have been moved, leaving word poin

Categories : C

How to change volumes of individual programs?
Please see this example in Codeproject. it's a sample documentation of Windows Audio Mixer API Wrapper Library Hope will help it.

Categories : C#

When multiple java programs run on the same machine
see How to Daemonize a Java Program? new instance of JVM will be created the same way as memory is shared between all other processes it is managed by O/S other instances are not affected If your instances have to coordinate their work, you can create single main instance which would run/stop other instances. You did not explain why you need multiple JVM instances. Probably, single instance would work better.

Categories : Java

Bootstrapper and Setup in Add/Remove Programs
The documentation says this, have you set these Attributes (DisableModify & DisableRemove) in your bundle? If the "DisableModify" attribute is also "yes" or "button" then the bundle will not be displayed in Progams and Features and another mechanism (such as registering as a related bundle addon) must be used to ensure the bundle can be removed. DisableRemove YesNoType Determines whether the bundle can be removed via the Programs and Features (also known as Add/Remove Programs). If the value is "yes" then the "Uninstall" button will not be displayed. The default is "no" which ensures there is an "Uninstall" button to remove the bundle. If the "DisableModify" attribute is also "yes" or "button" then the bundle will not be displayed in Progams and Features and another me

Categories : Wix

Implementing R programs in hadoop System
If you specify multiple input files they both are streamed through stdin. Order of records is arbitrary. To figure out which one you are actually reading at a certain time you can call Sys.getenv("map_input_file").

Categories : R



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