WPF: Create a dialog / prompt

The “responsible” answer would be for me to suggest building a ViewModel for the dialog and use two-way databinding on the TextBox so that the ViewModel had some “ResponseText” property or what not. This is easy enough to do but probably overkill. The pragmatic answer would be to just give your text box an x:Name … Read more

To get a prompt which indicates Git-branch in Zsh

__git_ps1 is from git-completion.bash. In zsh you probably have to provide your own function to determine the current directories git branch. There are quite a few blog posts about a git prompt for zsh. You just need: a function to provide the branch name enable prompt (command) substitution add the function to your prompt For … Read more

Detecting Unsaved Changes

Using jQuery: var _isDirty = false; $(“input[type=”text”]”).change(function(){ _isDirty = true; }); // replicate for other input types and selects Combine with onunload/onbeforeunload methods as required. From the comments, the following references all input fields, without duplicating code: $(‘:input’).change(function () { Using $(“:input”) refers to all input, textarea, select, and button elements.

Different bash prompt for different vi editing mode?

Fresh bash 4.3 and readline 6.3 have something for you guys.. from the changelog: 4. New Features in Readline j. New user-settable variable, show-mode-in-prompt, adds a characters to the beginning of the prompt indicating the current editing mode. So putting set show-mode-in-prompt on into /etc/inputrc or ~/.inputrc (thx stooj) should affect all your readline-enabled programs … Read more

Prompt Dialog in Windows Forms

You need to create your own Prompt dialog. You could perhaps create a class for this. public static class Prompt { public static string ShowDialog(string text, string caption) { Form prompt = new Form() { Width = 500, Height = 150, FormBorderStyle = FormBorderStyle.FixedDialog, Text = caption, StartPosition = FormStartPosition.CenterScreen }; Label textLabel = new … Read more

Why doesn’t “total” from ls -l add up to total file sizes listed? [closed]

You can find the definition of that line in the ls documentation for your platform. For coreutils ls (the one found on a lot of Linux systems), the information can be found via info coreutils ls: For each directory that is listed, preface the files with a line `total BLOCKS’, where BLOCKS is the total … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)