w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Bash alias autocompletion that considers only *.foo files
Try: complete -f -X '!*.tex' g Then, you can type: g <TAB> And get the completions. Note: this doesn't complete directories. Someone else may have a better solution using compgen. There's a helpful autocomplete guide on The Linux Documentation Project too.

Categories : Bash

alias .="cd .." causing bash to start at root
. refers to the current directory, while .. refers to the one upper in the dirs hierarchy. What must be happening is that in your bashrc you have some . after this alias definition, so it gets called and hence you are moved to the parent directory. So: you enter and you are in /home/your_home you set alias .="cd ..". some dot . is found while reading .bashrc. this dot is executed as to be an alias, so you get cd .., which moves you to /home. you probable have more than one . and it must get executed again, moving you from /home to /. Solution: Create an alias with a better name that does not have any predefined meaning. Move your alias sourcing to the bottom of .bashrc.

Categories : Bash

How can one create and then use an alias in a function of a sourced Bash script?
Note that aliases will have limited functionality for scripting. From the Advanced Bash Scripting Guide: In a script, aliases have very limited usefulness. It would be nice if aliases could assume some of the functionality of the C preprocessor, such as macro expansion, but unfortunately Bash does not expand arguments within the alias body. [2] Moreover, a script fails to expand an alias itself within "compound constructs," such as if/then statements, loops, and functions. An added limitation is that an alias will not expand recursively. Almost invariably, whatever we would like an alias to do could be accomplished much more effectively with a function. I would use a variable for this: myFunction(){ zappo="echo" $zappo "foo bar" } Or even a wrapper function: zappo() {

Categories : Bash

bash: propagating exit code of command executed in alias
It's better that you just use functions over aliases: cda() { cd /a exit_code=$? echo "STATUS: $exit_code" return "$exit_code" # optional } cdb() { cd /b exit_code=$? echo "STATUS: $exit_code" return "$exit_code" # optional } As for the alias you could try adding a test in the end: alias cda='cd /a; exit_code=$?; echo "STATUS: $exit_code"; [[ exit_code -eq 0 ]]'; alias cdb='cd /b'

Categories : Bash

git alias with bash conditional logic comparing strings - syntax issues
You could try either the character code of the character you want, or the hex name of the character you want. Here is a link to these things: http://www.utf8-chartable.de/ At the core of what you are doing, you are just writing a bash script in your environment. So whatever lets you write quotes outside of git's bash interface should be able to work here.

Categories : GIT

SSRS set font colour base on background colour
You'll need to set the two properties in two expression based on the same condition. Even if the Textbox is displaying a different field in its text, you can still use any fields in the same row in the property expression. e.g. for BackgroundColor use something like: =IIf(Fields!Date.Value < CDate("01-Jan-2013"), "Black", "White") then for the Color property use something like: =IIf(Fields!Date.Value < CDate("01-Jan-2013"), "White", "Black") Here for dates prior to 01-Jan-2013, the Textbox will be black with white text, and for dates from this year, the Textbox will be white with black text. Edit after comments Just to confirm, there is no readily available way to check report items properties (other than Value) in SSRS expressions. I agree this would be nice but for now thi

Categories : Reporting Services

How to give a colour to particular div by selecting a colour in html5
[Revised answer based on changed request] Here’s how to let the child draw anywhere within a bounding box around the letter First, define the area that the drawing will be restricted to. Any drag-draws outside the drawable area won't be visible. // define the drawable area var minX=60; var maxX=250; var minY=140; var maxY=380; Then in mousemove, draw only if the mouse is inside that drawable area: if(mouseX>minX && mouseX<maxX && mouseY>minY && mouseY<maxY){ ctx.beginPath(); ctx.moveTo(startX,startY); ctx.lineTo(mouseX,mouseY); ctx.stroke(); } Here is code and a Fiddle: http://jsfiddle.net/m1erickson/tAkAy/ <!doctype html> <html> <head> <

Categories : Javascript

Spectrum colour picker post id and colour to php
$.post('colour.php', { colour: color.toHex, id: (this.id) } ); I answered my own question this morning, this now posts the colour and id over to php. Thanks to @RandomSeed for making me think about what I was actually trying to achieve!

Categories : PHP

Colour the first marker of a Google Map a different colour
add an icon URL to the end of the first element in your array, something like: ['<b>Customer</b><br>Address', 52.6699927, -0.7274620, 1, 'http://maps.google.com/mapfiles/ms/icons/blue.png'] use that in the definition of your marker (if it isn't there it will be "null" and the default marker will be used). marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: locations[i][4] }); working example

Categories : Javascript

Subtracting alias from another alias?
In you want direct substraction in SQL Server SELECT ( SELECT count(loanflag) FROM Data WHERE declinegroup="XYZ" AND orginalrating="A" AND score="724-747" AND mode="Open" AND delqdays>"0" ) - ( SELECT count(loanflag) FROM Data WHERE declinegroup="XYZ" AND orginalrating="A" AND score="724-747" AND mode="Open" ) ; Alternatively you could assign the values to a variable first then substract them later DECLARE testa int; DECLARE testb int; SET testa = ( SELECT count(loanflag) FROM Data WHERE declinegroup="XYZ" AND orginalrating="A" AND score="724-747" AND mode="Open"

Categories : SQL

ElementFlow element disables controls
Just looking over the source code for the project, it looks like it is creating a 3D mesh, and painting the controls on the mesh. This would prevent all user interaction. I don't think there is an easy way to work around this. However, since you have the source code, you can do the work yourself to make it happen. You're going to need to modify how the ElementFlow represents its items. Look at the CreateMeshModel function. It is currently creating a mesh and applying a VisualBrush to it. Instead, look at the blog post Interacting with 2D on 3D in WPF to figure out what needs to happen.

Categories : C#

Does using linux capabilities disables LD_PRELOAD
Yes, it's for security reasons (see man sudo). You would have to work around it by explicitly opening the library from within your code at the start of main() using dlopen (or by wrapping main or similar).

Categories : C

rich:message disables commandButton after first use
Problem solved bei using <h:message> instead of <rich:message> <a4j:outputPanel ajaxRendered="true"> <!-- <rich:message for="mainMailOrName" style="color:#aa0000;" /--> <h:messages for="mainMailOrName" style="color:#aa0000;" /> </a4j:outputPanel>

Categories : Jsp

GridSplitter disables my RowDefinition style
If you use DependencyPropertyHelper.GetValueSource(Rowdefinition.HeightProperty) you can see that initially the property value is set by the style, but after the GridSplitter changes the height of the row the height property has a "local" value. Local values take precedence over all other sources for a dependency value, so when the data trigger attempts to set the height property to 0 nothing happens. On top of this, the GridSplitter sets the height of the row above it and as soon as relative (star) values are involved the heights set look somewhat unfriendly. Here is the way I found to work round this problem: when hiding the row clear the value of the height property before attempting to set the height to 0 AND when making the row visible clear the value of the height property of th

Categories : C#

Jquery disables css hover effect
Add an .active class that holds the style for an active div. .active{ background-color: #1A2040; color: white; } Then toggle this class with the JS $('div.vbtn').click( function() { $("div.vbtn").removeClass("active"); $(this).addClass("active"); felt = $(this).attr('felt'); $('div.vniv').each(function() { if($(this).attr('felt') != felt) { $(this).css('display','none'); } else { $(this).css('display','block'); } }); }); JSFIDDLE: http://jsfiddle.net/Cwmpf/1/

Categories : Jquery

URISyntaxException disables ability to create new GUI
A couple of things you can do to fix your problem: Declare as a global variable and... initialize in a static block using a try and catch block. initialize it in a method/constructor using a try and catch block. (Alternatively, instead of using try and catch blocks, you could make it so that your method/constructor throws the URISyntaxException instead) One other alternative is that you could find all occurences where in your Gui constructor the URISyntaxException is being thrown and put specifically that code under a try and catch block. (causing you to remove the throws URISyntaxException from your constructor which will allow you to declare and initialize how you are currently trying to do)

Categories : Java

Why ksh disables stderr when subshell is executed?
This looks like a bug in ksh (My version is u), and it is not specific to pwd or stderr. Below I can reproduce the effect with true and fd 3. (This allows us to keep use the shell trace) The effect appears to be triggered by assigning output from an external process into a variable inside a function. If the assignment is then followed by output to some other file descriptor, that output gets lost. The idea here is that the $( ... ) construct somehow conflicts with the subsequent redirect, but only when the code in ... is run externally. The true and pwd builtins don't trigger a subshell in ksh93. I will ask David Korn for confirmation. function f1 { var=$( /bin/true ) echo 123 >& 3 } function f2 { var=$( true ) echo 123 >& 3 } function f3 { typese

Categories : Shell

Bootstrap Modal-Manager disables overflow
To close the modalmanager loading window, try using $('body').modalmanager('loading'); only instead of 'removeLoading'. 'loading' itself is used to toggle the loading state. (read documentation here - https://github.com/jschr/bootstrap-modal) Also ensure that you have included modalmanager js files after bootstrap js. A similar issue is closed here (without any specific solution) - https://github.com/jschr/bootstrap-modal/issues/97

Categories : Javascript

document.ready disables other function if on the same page
yep.. jquery did it. replaceing this: if(document.myform.notify1.checked == true) with this if($("#notify1").is(':checked')) made it work. <script> function save() { if ($("#notify1").is(':checked')) { var value1 = 1; } else { var value1 = 0; } if ($("#notify2").is(':checked')) { var value2 = 1; } else { var value2 = 0; } $.post('save_settings.php', { notify1: value1, notify2: value2 }); return false; }; </script> thanks guys

Categories : Javascript

ECSlidingViewController disables tabbar item touch
ECSlidingViewController uses its own structure system for managing view controllers. To get back to the top view controller you need to add #import "ECSlidingViewController.h" to your header file and then in the method called when your tab button is pressed add: [self.slidingViewController resetTopView]; That should animate the top view back over your 'under left' or 'under right' view controller as necessary.

Categories : IOS

Does disabling trigger also disables the index temporarily
Disabling triggers wont disable indexes (Why would it?). As for plan for SELECT "users".* FROM "users" WHERE "users"."id" = 1; It may or may not use indexes based on many factors. Mainly - the number of records in the table.

Categories : Postgresql

jQuery - Activating one toggle button disables the other
You can check my example: Toggle Buttons show and hide HTML: <button type="button" id="mobile_bt">Mobile</button> <button type="button" id="social_bt">Social</button> JS using jQuery: $('#mobile_bt').click(function() { var help= $(this); $('#social_bt').toggle('slow', function() { help.hide(); $(this).show(); }); }); $('#social_bt').click(function() { var help= $(this); $('#mobile_bt').toggle('slow', function() { help.hide(); $(this).show(); }); });

Categories : Javascript

Mobiscroll disables all input boxes on refresh
I found this: (Bug With Firefox - Disabled Attribute of Input Not Resetting When Refreshing): This is a "feature" of Firefox which remembers form input values across page refreshes. To fix this behavior, you simply set autocomplete="off" on the form containing the inputs, or just directly to the input. This stops autocomplete from working and prevents the browser from remembering the state of input fields.

Categories : Jquery

Best way to display HTML in Android with images and disables links
I'm not sure if the best way to do this is using a webview (how would I disable interactivity?) or a textview. If your HTML fits within the boundaries of what is supported by Html.fromHtml() -- and here's a blog post of mine from a long time ago giving you an idea of what that supports -- you are welcome to use that to prepare a Spanned for use by TextView. I am happy to have my app dynamically edit the content to remove tags, but there may be a more elegant solution? It depends upon the nature of the "interactivity". For simple hyperlinks, attach a WebViewClient that overrides shouldOverrideUrlLoading() and eats all link clicks. However, if you have POSTed forms, or JavaScript-based "interactivity", you'll probably need to strip that stuff out yourself.

Categories : Android

Unique form token disables multitasking for the user
The browser should keep the correct session id even between tabs and windows the session id should be the same. (dangerous assumption should be tested cross browser to be sure) generate more tokens that should be valid based on session id. so you could check something like this. $tokenCorrect = false; foreach($_SESSION['tokens'] as $token) { if ($token !== $_POST['token']) continue; $tokenCorrect = true; } if ($tokenCorrect == false) { die(); // // Maybe log to database ?? but watch if possible Denial of Service because somebody can write your disk/ shared diskspace full with only making fast requests with a invalid CSRF token }

Categories : PHP

First option in dropdown disables submit button on form
Could it be that if you select a different option from the drop down and then go back to the first dropdown option it works? (Unfortunatly I cannot post comments due to my low rep) I have the feeling that the issue may be that your mailchange function is not called on page load so you have to actually 'select' the all option instead of defaulting to it.

Categories : PHP

How to write a Google Content Experiment that disables a stylesheet?
Here is how I did it: <head> <script src="//www.google-analytics.com/cx/api.js?experiment=EXPERIMENT_ID"></script> <script> // Ask Google Analytics which variation to show the visitor. var chosenVariation = cxApi.chooseVariation(); function redirectVariation($variation) { var url = window.location.href; if ($variation === 1) { var queryString = document.location.search; if (queryString.indexOf("stylesheet_disabled=true") == -1) { if (Boolean(queryString)) { url += "&stylesheet_disabled=true"; } else { url += "?stylesheet_disabled=true"; } window.loc

Categories : Javascript

iOS Storyboard flip horizontal animation disables text fields
I'm not sure this is your problem, but your storyboard setup is wrong. It looks like you're going back and forth with modal segues. Every time you do that you're creating a new instance of the view controller you're going to, so you're piling up more and more controllers, none of which ever gets deallocated. Unless you're using an unwind segue, you should never go backwards in a storyboard with segues. So, when going from the controller you show on the right back to ViewController, you should just use [self dismissViewControllerAnimated:completion:] in code, and get rid of the segue.

Categories : IOS

Clicking "back" in the browser disables my javascript code if I'm using Turbolinks in Rails
Two solutions: Set the cache to 0 so that no pages are cached using HTML5 History. Turbolinks.pagesCached(0); Another solution is to listen to "page:restore" event and call your initialization method. This latter solution is more performant. document.addEventListener("page:restore", function() { app.init(); });

Categories : Jquery

How to write a Google Chrome extension that disables a default keyboard-shortcut?
Unfortunately there's no way to hook into global hotkeys. The best you can do is add a window event keypress listener. Source: a Chromium developer post on the chromium-extensions group. Related Question: Keyboard Shortcuts in Google Chrome / Chromium Extensions

Categories : Google Chrome

SharePoint 2010, pass querystring to external list XsltListView disables built-in filters
I actually found a solution to this. It seems the column filter functionality adds the token without parsing it. So if you have a filter defined as i.e. "{filtername}", this token string will literally be sent to the BCS as the filter value, including the curly braces. So you have to take actions for this by checking in your BCS code (and include all items when the filter passed = "{filtername}" ), or in case of SQL just add extra clause like this (last OR added compared to default generated SQL): WHERE ((@filtername IS NULL) OR ((@filtername IS NULL AND [] IS NULL) OR [] LIKE @CprNr) OR (@CprNr LIKE '%{filtername}%' ) )

Categories : Sharepoint

done button begins enabled and disables itself after start typing the username,skips the validation method
Your done button validation is faulty. You are not checking if password repeat is the same as the first password. Also, make sure that in storyboard the done button disabled by default. Only enable it explicitly.

Categories : IOS

Redirecting standard input in Bash implies that Bash executes a default action?
exec 6<&0 0</tmp/lines.txt; exec 0<&6 6<&- Turns out that bash still executes what remains in the command specified or script before it reads input for commands again that's why your file /tmp/lines.txt is not read since exec 0<&6 6<&- is run before it. Please refer back to the previous solution if you want to execute commands in /tmp/lines.txt before exec 0<&6- is executed. Also it might have not been obvious but you could use . or source to achieve same output: . /tmp/lines.txt source /tmp/lines.txt

Categories : Bash

execute user inputed Windows (or bash) commands from batch (or bash) file?
Do you need a full bash prompt? Or would something like this be enough? #!/bin/bash echo -n "Enter cmd: " read COMMAND echo ${COMMAND} | bash Also, in a script, you can just execute bash and get a full prompt in the current environment.

Categories : Bash

Why does the child of an eval call from bash get orphaned once the parent bash script dies?
This is normal and expected. You sent a signal (presumably SIGTERM) to parent-script and it died, but no signal was sent to another-script. It keeps on running. This is different than what happens when the parent-script job is running interactively on a terminal and you type ^C (or ^Z). In that case, a SIGINT signal is automatically sent to the whole foreground process group. Since another-script is un the same process group as parent-script (by default), they both get the signal and they both die. If you want another-script to die automatically when its parent dies in any other context than when it's a job running in a terminal with job control, you have a few options. parent-script can trap the SIGTERM signal. In the signal handler, it kills its child, and then exits itself. This, o

Categories : Linux

Capture output of a bash command, parse it and store into different bash variables
You can use awk and bash arrays: arr=( $(awk -F ':' '$1 == "inet addr"{sub(/ .*/, "", $2); print $2}' < <(ifconfig)) ) Then you can do: read IPETH0 IPLO <<< ${arr[@]}

Categories : Linux

Pass a full bash script line to another bash function to execute
optout is a command like any other, and so must be preceded by any local modifications to the environment. The command that optout runs will inherit that environment. CC=${BUILD_TOOL_CC} optout ./configure ${ZLIB_CONFIGURE_OPT} --prefix=${CURR_DIR}/${INSTALL_DIR} By the way, this is just one of the problems you are likely to encounter with your optout function. You cannot run arbitrary command lines in that fashion, only a simple command followed by zero or more arguments (and I would expect there are some exceptions to even that restricted set, as well).

Categories : Linux

BASH: how to define an array as environment variable before calling a bash script
Incredibility weird.... I have never seen that before. It looks like the array is not passed to the subshell. One way around this is to source the script instead of executing it: declare -a MYARR=( 1 2 ); . ./myscript.sh

Categories : Arrays

Angularjs checkbox checked by default on load and disables Select list when checked
If you use ng-model, you don't want to also use ng-checked. Instead just initialize the model variable to true. Normally you would do this in a controller that is managing your page (add one). In your fiddle I just did the initialization in an ng-init attribute for demonstration purposes. http://jsfiddle.net/UTULc/ <div ng-app=""> Send to Office: <input type="checkbox" ng-model="checked" ng-init="checked=true"><br/> <select id="transferTo" ng-disabled="checked"> <option>Tech1</option> <option>Tech2</option> </select> </div>

Categories : Angularjs

Cygwin Installation: Package: bash; bash.sh exit code 1
The /dev directory is missing and cygwin fakes it, which makes it read-only. The following code: cd /etc/postinstall/ ./000-cygwin-post-install.sh.done ./bash.sh ... solved that error for me.

Categories : Bash



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