This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <duktape.h> | |
static duk_ret_t native_print(duk_context *ctx) { | |
printf("%s\n", duk_to_string(ctx, 0)); | |
return 0; // No return value (= undefined) | |
} | |
int main(int argc, char *argv[]) { | |
duk_context *ctx = duk_create_heap_default(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <double-conversion/double-conversion.h> | |
#include <iostream> | |
int main() { | |
double number = 12345.6789; | |
char buffer[100]; | |
double_conversion::StringBuilder builder(buffer, sizeof(buffer)); | |
double_conversion::DoubleToStringConverter converter( | |
double_conversion::DoubleToStringConverter::NO_FLAGS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PackageKit : https://fedoraproject.org/wiki/QA:Testcase_pkcon | |
NetworkManager : https://fedoraproject.org/wiki/QA:Testcase_networkctl | |
Nmcli : https://fedoraproject.org/wiki/QA:Testcase_nmcli | |
accountsservice : https://fedoraproject.org/wiki/QA:Testcase_accountsservice | |
acl: https://fedoraproject.org/wiki/QA:Testcase_acl | |
aha: https://fedoraproject.org/wiki/QA:Testcase_aha | |
alsa-lib : https://fedoraproject.org/wiki/QA:Testcase_alsa | |
alternatives : https://fedoraproject.org/wiki/QA:Testcase_alternatives | |
anthy-unicode : https://fedoraproject.org/wiki/QA:Testcase_anthy_unicode | |
appres : https://fedoraproject.org/wiki/QA:Testcase_appres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creating a .desktop file involves creating a plain text file with a specific format and saving it with a .desktop extension. These files are used in Linux and other Unix-like systems to define how a particular program is to be launched, how it appears in menus, etc. Here's how you can create a simple .desktop file: | |
Open a Text Editor: | |
Open your favorite text editor; this could be gedit, nano, vi, etc. You can usually open a text editor from your applications menu or from the terminal. | |
gedit or nano | |
Enter the Desktop File Content: | |
In the text editor, you need to enter the content for the .desktop file. Below is a simple example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <dbus/dbus.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void send_signal(DBusConnection *conn) { | |
DBusMessage *msg; | |
DBusMessageIter args; | |
msg = dbus_message_new_signal("/com/example/TestObject", // object name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <dbus/dbus.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void send_signal(DBusConnection *conn) { | |
DBusMessage* msg; | |
DBusMessageIter args; | |
msg = dbus_message_new_signal("/test/signal/Object", "test.signal.Type", "Test"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cairo.h> | |
#include <cairo-gobject.h> | |
int main() { | |
cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 240, 80); | |
cairo_t *cr = cairo_create(surface); | |
cairo_select_font_face(cr, "serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD); | |
cairo_set_font_size(cr, 32.0); | |
cairo_set_source_rgb(cr, 0.0, 0.0, 1.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <ares.h> | |
#include <arpa/inet.h> | |
#include <netdb.h> | |
void callback(void *arg, int status, int timeouts, struct hostent *host) { | |
if (status == ARES_SUCCESS) { | |
char ip[INET6_ADDRSTRLEN]; | |
int idx; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <boost/filesystem.hpp> | |
#include <boost/thread.hpp> | |
#include <boost/atomic.hpp> | |
#include <boost/iostreams/stream.hpp> | |
#include <boost/iostreams/device/null.hpp> | |
// Atomic counter | |
boost::atomic<int> counter(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ////////////////////////////////////////////////// | |
* //making sense of the Parallax PIR sensor's output | |
* ////////////////////////////////////////////////// | |
* | |
* Switches a LED according to the state of the sensors output pin. | |
* Determines the beginning and end of continuous motion sequences. | |
* | |
* @author: Kristian Gohlke / krigoo (_) gmail (_) com / http://krx.at | |
* @date: 3. September 2006 |