w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Gnome-shell panel shadow
...ok, I've found out where the problem is. Unlikewise HTML, the shadow alpha is also affected by panel background alpha. So a black shadow (alpha=1) on a transparent background panel, would result in a transparent (thus insvisible) shadow. So by setting background-color: rgba(0,0,0,0.5); font-weight: bold; height: 1.86em; box-shadow: 0px 3px 10px rgba(0,0,0,0.5); It would result on a 0.25 alpha shadow (0.5 * 0.5 = 0.25). That's why the box-shadow effect from my question above is not shown. As said, that's a different behaviour than HTML where a transparent background div would not affect its box-shadow effect. Perhaps some gnome-shell developer passing by here might want to consider this implementation.

Categories : CSS

How to get Empathy contact list in GNOME shell extensions?
The Empathy-IM tool is a reference-implementation of the "Freedesktop Telepathy"-specification. From Wikipedia: How Telepathy works Protocol implementations provide a D-Bus service called a connection manager. Telepathy clients use these to create connections to services. Once a connection is established, further communication happens using objects called channels which are requested from the connection. A channel might be used to send and receive text messages, or represent the contact list, or to establish a VoIP call. Applications Empathy [...] Therefor, you can use the DBus interface to communicate with it. Gnome-Shell offers a Gjs/GnomeShell-Extension binding, which is explained nowhere, but example code is available: Mailgroup post Test-file f

Categories : Misc

How to zip a file in windows shell without vb script and with Window default zip only
Yes and no. There is no built in way to do this inside windows. You can use a external application like vbscript, a exe file like 7zip, rar, lots of resources can do this. Since windows is application poor when it comes to command lines is not really surprising. But no you do not need the VB Script for anything. Just not so easy out of the box. Maybe makecab could do it for you? As a general rule you have a hard constraint in your question. A single BAT file which in general can not do almost anything without the support of hundreds of preinstalled or commonly installed other applications. Could you specify a the constraints a bit better. Tel WHY you need this particular constraint? And what does it mean as even most of the bat command you use require more than one file.

Categories : Shell

open file in system default application in C
I know that GFile *g_file_new_for_path(const gchar *path); GAppInfo *g_file_query_default_handler(GFile *file,GCancellable *cancellable,GError **error); gboolean g_app_info_launch(GAppInfo *appinfo,GList *files,GAppLaunchContext *launch_context,GError **error); Create a GFile and get its default handler,then launch it g_app_info_launch will return TRUE if success

Categories : C

How can I default to a login shell for Jenkins shell execution
You could work around by creating a wrapper around bash: #!/bin/sh # for ex.: /usr/local/bin/login-bash exec /bin/bash -l "$@" If you want to use the default ruby just use the rvm-shell, which comes with rvm. Login as the jenkins user and type: $ which rvm-shell /home/jenkins/.rvm/bin/rvm-shell to get the path of the rvm-shell. Use this path for the "Shell executable" option.

Categories : Bash

How to spawn a new application from Gnome/GTK to a CLI application and read its output back into Gnome/GTK application?
top and tail -f are long-running programs (in fact, they never exit), so your strategy of reading the whole output and populating the the textbuffer with it obviously won't work. Instead, you need to create an IO channel that watches what's going on with the pipe, hook the channel into the event loop, and append it to the text buffer as new output arrives. The minimalistic change to your program would be to rewrite the prepare function like this: static gboolean data_ready(GIOChannel *channel, GIOCondition cond, gpointer data) { FILE *fp = data; char line[256]; if (fgets(line, sizeof line, fp)) { gtk_text_buffer_get_end_iter (buffer, &iter); gtk_text_buffer_insert (buffer, &iter, line, -1); return TRUE; } else { fclose(fp); re

Categories : C

How do I start windows 7 explorer in desktop mode when an application is runnig as shell?
According to this discussion on Technet it's not possible. It is NOT possible to set explorer as shell without designating it as shell in the registry key. Keeping explorer as shell in the registry, but killing explorer.exe and launching your shell work as an option for you? I dont see any other clean way around. One user posted a possible solution though. change HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogonShell to "explorer.exe" run "userinit.exe" change HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogonShell back to your custom shell My Code (autoit) RegWrite('HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWinlogon','Shell',"REG_SZ",'Explorer.exe') Run('userinit.exe') ProcessWait('explorer.exe') RegWrite('

Categories : C#

How to Block System Desktop when i Run/Open my Application
You can make you window bordeless and full screen, then hide the task bar, but it wouldn't stop people switching to other applications using the keyboard. I'm not sure you would be able to "lock down" Windows to only run your application, and why would you, it's designed to run multiple applications so to some extent you are fighting the tide.

Categories : Windows

how do I programatically change system-wide desktop picture?
Take a look at Preferences and Settings Programming Guide. This should help. Edit: Here is the sample code: NSString* newImgPath = @"/Users/cody/Desktop/stuff/imgs/Black_mac.png"; NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; NSMutableDictionary* desktopDict = [NSMutableDictionary dictionaryWithDictionary:[defaults persistentDomainForName:@"com.apple.desktop"]]; NSMutableDictionary* bgDict = [desktopDict objectForKey:@"Background"]; NSMutableDictionary* spaces = [bgDict objectForKey:@"spaces"]; [spaces enumerateKeysAndObjectsUsingBlock:^(NSString* key, NSMutableDictionary* obj, BOOL *stop) { [obj enumerateKeysAndObjectsUsingBlock:^(id key, NSMutableDictionary* prefs, BOOL *stop) { [prefs setObject:newImgPath forKey:@"ImageFilePath"]; [prefs setObj

Categories : Osx

can't access remote desktop's opened tcp from local system
Also if it's a firewall issue then rather turning the firewall you can write inbound and outbound rule for specific port. Turning your firewall on server is a dangerous compromise with security.

Categories : Misc

Read / write a file in a shell namespace extension using shell APIs
Try IShellFolder.BindToObject: IStream *stream; if (FAILED(shellfolder->BindToObject (pidl, NULL, IID_IStream, &stream))) return E_FAIL; But I'm not sure if this works with writing files as well.

Categories : Windows

If strings are nullable by default, why do i get Unable to cast object of type 'System.DBNull' to type 'System.String'.?
Because null != DBNull.Value. But you can check if it the value in the DataReader is null with the IsDbNull method: DestributionGroup = dr.IsDbNull("Destribution Group") ? "" : dr.GetString("Destribution Group");

Categories : C#

C++ hidding of member functions in inheritance hierarchy staring with CRTP
I call it bad practice for doing possibly confusing and obfuscating things. 1) A function name should in all base and sub-classes either be virtual or non-virtual. mixing overriding and overloading within the inheritance hierachry is a very bad idea. No one really expects something like that. Thus if A::foo should be virtual as well, or B and C foo should not. 2) Preferably base classes should be interfaces. As such A:foo should be pure virtual and not B::foo. 2b) If a base class has already provided a default implementation don't declare the function pure virtual in a sub-class.

Categories : C++

Shell pipe system in C
You don't need to pass the end argument, instead increment the pointer to your command array. You are passing the initial array to the execvp call so it tries to execute ls multiple times. Further, you need a break statement after setting the listaCommand[cont] to NULL because after the iteration cont is incremented. Also I think you need to protect the execvp call so that the parent does not call it after the processing is done. #include <stdio.h> #include <string.h> #include <unistd.h> #include <stdlib.h> #include <sys/wait.h> #define fatal() exit(1) void pipes (char *listaCommand[], char **argv) { printf("pipes %s ", listaCommand[0]); int cont = 0; for (;listaCommand[cont]; cont++) { if (listaCommand[cont][0] == '|'){

Categories : C

file system that is platform independent and where i receive any changes made to the file system
The Java NIO API can do this, and is already platform independent http://docs.oracle.com/javase/tutorial/essential/io/notification.html

Categories : Java

PHP Distributed File System, File System for downloading from Network Storage
Network file system, using PHP and MongoDB http://verens.com/2014/11/06/distributed-file-storage-using-php-and-mongodb/

Categories : PHP

Bootstrap Layout: Default Grid System VS Fluid Grid System
I think you have answered that in your question yourself. Just assign a fixed width for span classes too: @media (min-width: 1200px) { .container { width: 940px; margin: 0 auto; } .span3 { width: 220px; } } Span classes have a default property of margin-left: 20px. So if you put .container ==> padding: 0 20px; it may not fit. For this, you can make first child of span3 class margin-left 0 i.e. .span3:first-child { margin-left: 0; } Hope this helps.

Categories : HTML

How to set the default app for Trebuchet launcher using adb shell?
Preferred apps are stored in /data/system/users/0/package-restrictions.xml Update this file to set default applications as you need. Remember to reboot afterwards to apply the new settings. It's also worth mentioning that the file seems to be always opened and modified by android on boot, so better check after change and reboot that your settings are still there as it might not always be the case (If there is an error for example). Also if you set an app as default for some intent and this app crashes, you have to change that XML file again to restore your settings as android would automatically unset an app as default if it crashed. Source

Categories : Android

Is it possible to get system(@args) to preserve shell metacharacters?
If you need to mix the list form of system() with redirection, pipes etc., then use the CPAN module IPC::Run: use IPC::Run 'run'; run ["echo", "Hi"], "|", ["tee", "rso.log"] or die;

Categories : Perl

What is the difference between calling a script from the shell and using system()?
.bashrc is only invoked if bash is run as interactive, non-login shell. If it's invoked as non-interactive shell, as when using system() on a script with a bash shebang, it only reads the configuration file pointed to by $BASH_ENV. That means you have the following options: add -l to the shebang - causes the shell to read ~/.profile at startup set $BASH_ENV to the script you want sourced before calling system() add -i to the shebang - invokes bash as interactive shell and causes it to read ~/.bashrc, but will also effect how bash handles input/output. I'd recommend the first option. You can find a detailed explanation of how bash reads it's startup files here. I'm not sure this will solve your problem completely, but it may at leas shed some light on that part of the issue.

Categories : C++

Run the shell commands in Perl using system() function in Windows
You can run the system() command but there are caveats. A nice description is contained in Using system or exec safely on Windows. This article resulted in the Win32::ShellQuote module.

Categories : Windows

os.system command to call shell script with arguments
If you insert the following line before os.system (...), you will likely see your problem. print './script.sh arg1 arg2 arg3' When developing this type of thing, it usually is useful to make sure the command really is what you expect, before you actually try it. example: def Cmd(): return "something" print Cmd() when you are satisfied, comment out the print Cmd() line and use os.system (Cmd ()) or subprocess version.

Categories : Python

Shell utility does not work in perl system() call
system has two purposes. It can used to launch a program: system($program, @args_to_program) Or it can be used to execute a shell command: system($shell_command) The latter is basically equivalent to system('cmd', '/x', '/c', $shell_command) From powershell /?, we see it can be instructed to execute a command using the -Command argument, so the equivalent for powershell would be system('powershell', '-Command', $powershell_command)

Categories : Perl

Cleanse a shell runtime environment to run system Perl?
The -i option of the env command allows you to start programs in a clean environment. From then env manpage: -i, --ignore-environment start with an empty environment For you perl example: env -i perl -V

Categories : Perl

C# Clipboard.ContainsImage() is working differently while copying file from file website and from desktop
The next code demonstrate an appropriate solution IDataObject myDataObject = Clipboard.GetDataObject(); string[] files = (string[])myDataObject.GetData(DataFormats.FileDrop); MessageBox.Show(files[0]); You will show massagebox with the full path to the file you have copied to clipboard before.

Categories : C#

C# File - Read files from desktop and write them to a specific file
@charqus, This should Work if (!File.Exists(fileName)) File.Create(fileName).Dispose(); string[] PDFiles = Directory.GetFiles(sourceDirectory, "*.pdf", SearchOption.TopDirectoryOnly); List<String> fileList = new List<String>(); using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read)) { using (BinaryReader r = new BinaryReader(fs)) { fileList.Add(r.ReadString()); } } string[] textFile = fileList.ToArray(); Calling the Dispose method ensures that all the resources are properly released.

Categories : C#

How can i use exec() family system calls to implement the shell commands cp and rm ???
Here's are examples. The exec functions with l in their name take the list of arguments as their own arguments. The p suffix means that the command should be found using $PATH, so you can just supply the command name. execlp("cp", "cp", "sourcefile", "destfile", (char *)0); The variants with v take the argument in a single array argument ("v" stands for vector). In this case, I didn't use the e suffix, so I gave the full path to the program. char *args[] = {"rm", "file1", "file2", 0); execv("/bin/rm", args); In both cases, the first argument is also the name of the program, since this will become argv[0] in the new process. And the end of arguments is signified with a null pointer. You should provide the typecast explicitly when using the l variants, since varargs functions don't do

Categories : Linux

Configuring sublime text build system to use shell script
Shell variables and functions, including those defined in .bash_profile and other places, are not available to ST2 because it doesn't run inside bash. It's its own independent program - analogous to how Firefox (for example) can't read your $PATH variable. To have your custom functions, variables, etc. available to your build system, you'll have to create a separate build script to run as your build system: { "cmd": ["ST2_build.sh", "$file"], "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)", "selector": "source.python" } then within ST2_build.sh have the following at the top: #!/bin/bash if [ -f ~/hcom-env/conf/sys/hcom-profile]; then source ~/hcom-env/conf/sys/hcom-profile fi # now I can use my cool functions... myfunc($1)

Categories : Osx

Sublime Text 2 How To Change Default Runtime Shell Command For C++?
{ "cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.c, source.c++", "variants": [ { "name": "Run", "cmd": ["${file_path}/${file_base_name}"] } ] } Just drop the compilation command and retain only the executable invocation part. But remember, you have to compile before running otherwise the executable would not have got generated.

Categories : C++

Changing Ruby versions with rbenv from system and "shell" command does not work
Oops! Looks like somebody stuttered. $ ls $HOME/.rbenv/libexec/*shell* /home/tim/.rbenv/libexec/rbenv-sh-shell Looks like there is no shell command, but rather a sh-shell command $ rbenv sh-shell rbenv: no shell-specific version configured Yup. Let's see, if we link to it with a rbenv-shell $ cd $HOME/.rbenv/libexec/ $ ln -s rbenv-sh-shell rbenv-shell then we should get a working shell command $ rbenv shell rbenv: no shell-specific version configured

Categories : Ruby

RoR: Shell/System commands with write property not working in production mode?
On your server you should have a user different from root for security reasons. Than this user should be added to sudoers list: http://askubuntu.com/questions/7477/how-can-i-add-a-new-user-as-sudoer-using-the-command-line now, depending where you want to create this folder, if it's in your app folder where your user has permissions to read/write, (search chmod 755 and chown to set the owner of the folder, better use chown -R to apply this to all subfolders), after this you'll be able to create that folder with: System("mkdir test") but only in folders where your user has access to read/write. If you want to create the test folder in some other path where you need to use sudo you'll have to run: System("sudo mkdir test") normally this is running in a background and you won't be the

Categories : Ruby On Rails

Return just the results from %SYS.ProcessQuery using $SYSTEM.SQL.Shell() in Intersystems Caché on a Unix server
You want to create a Cache Routine for this. You can do this in Cache Studio. http://docs.intersystems.com/ens20131/csp/docbook/DocBook.UI.Page.cls?KEY=GSTD_Routines In the Routine, you want to use either Embedded SQL or Dynamic SQL to run the query, and iterate through the results, and print them using WRITE. I would recommend Dynamic SQL, as it will be more flexible in the future. Introduction to SQL: http://docs.intersystems.com/ens20131/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_intro#GSQL_intro_embeddedsql Dynamic SQL Information: http://docs.intersystems.com/ens20131/csp/documatic/%CSP.Documatic.cls?APP=1&LIBRARY=%SYS&CLASSNAME=%SQL.Statement Embedded SQL Information: http://docs.intersystems.com/ens20131/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_esql

Categories : Shell

Detect Desktop and Redirect mobile browser to Desktop Main Website
So if you want to detect a desktop trying to view the mobile version put this in your .htaccess file: Options +FollowSymlinks <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^m.domain.com$ RewriteCond %{HTTP_USER_AGENT} !(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino [NC] RewriteCond %{HTTP_USER_AGENT} !^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|

Categories : PHP

System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite
The assembly cannot be located due to a HintPath declaration in your .csproj file: <Reference Include="System.Data.SQLite, Version=1.0.88.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> <HintPath>E:Developer SoftSQLitesqlite-netFx20-binary-bundle-Win32-2005-1.0.88.0System.Data.SQLite.dll</HintPath> </Reference> It works on your machine, because you really have the .dll at that location. However, the other person may want to use the System.Data.SQLite.dll file you placed in the root of the repository. Since that is one level up from the .csproj, you can use a relative path, like this: <Reference Include="System.Data.SQLite, Version=1.0.88.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> &l

Categories : C#

System.IO.IOException: "The file exists" when using System.IO.Path.GetTempFileName() - resolutions?
As Sayse suggested, you might try setting the %TEMP% environment variable when your app launches. Environment.SetEnvironmentVariable("TEMP", "<dir>");

Categories : C#

Capture file system system calls on Linux platform
How about write your own profiling tool using a wrapper? See GCC -wrapper: -wrapper Invoke all subcommands under a wrapper program. The name of the wrapper program and its parameters are passed as a comma separated list.

Categories : Linux

How to set wallpaper using system default action
File file = new File(Environment.getExternalStorageDirectory(), "your_image.jpg"); String path = file.getAbsolutePath(); File imageFile = new File(path); if(imageFile.exists()) { Bitmap bitmap = BitmapFactory.decodeFile(path); WallpaperManager mWallpaperManager = WallpaperManager.getInstance(this); try { mWallpaperManager.setBitmap(bitmap); } catch (IOException e) { e.printStackTrace(); } } Add below permission in Menifest.xml <uses-permission android:name="android.permission.SET_WALLPAPER" /> Code for launching cropping activity: Intent intent = new Intent("com.android.camera.action.CROP", myIntent.getData()); if (myIntent.getStringExtra("mimeType") != null) { intent.setDataAndType(myIntent.getData(), myIntent.getStringExtra("mimeType

Categories : Android

How to override system default TCP timeout
You need to call the system command which would change this on your machine you need to be root or have sudo access it changes it for every program you need to know what it is for each platform you support. Or you could upgrade to Java 7. Even Java 6 is end of line.

Categories : Java

How do I set the default system properties for SBT in Windows?
I'm on Mac, but I just put whatever flags I want in the sbt shell script. Not sure how the Windows runner looks like lately, but you could edit the batch file if it's a bat; or make a new batch file if it's using sbt.exe kind of wrapper.

Categories : Scala

iOS- mimic system default tableView header
EITHER You need to set header.frame = CGRectMake(10,1, 100, 18 ); OR Use Datasource method of UITableView - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return @"Header"; // just pass name of your hearder } EDITED: -(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 20)]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50, 2, 100, 18)]; label.text= [self.listOfHeader objectAtIndex:section]; label.backgroundColor=[UIColor clearColor]; label.textAlignment=NSTextAlignmentLeft; [view addSubview:label]; return view; } And also add - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSectio

Categories : Iphone



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