w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Keyboard shortcuts for selecting range using inputbox in Excel does not work. (with this vba code)
Your problem is that there is nothing selected in the workbook so the cursor has nowhere to start from, so your solution is to select something in your newly opened workbook. Just add this before the input box. ActiveWorkbook.ActiveSheet.Cells(1, 1).Select

Categories : Excel

Is it possible to use Autohotkey with an Apple Mac Keyboard to translate OSX keyboard shortcuts to the Windows 7 equivalents on a PC?
Yes, this is possible. You would need to run this script at startup. Source #InstallKeybdHook #SingleInstance force SetTitleMatchMode 2 ; #Include Apple Wired Keyboard.ahk ; Required for Eject Button. See Source. SendMode Input ; -------------------------------------------------------------- ; NOTES ; -------------------------------------------------------------- ; ! = ALT ; ^ = CTRL ; + = SHIFT ; # = WIN ; media/function keys all mapped to the right option key RAlt & F7::SendInput {Media_Prev} RAlt & F8::SendInput {Media_Play_Pause} RAlt & F9::SendInput {Media_Next} RAlt & F10::SendInput {Volume_Mute} RAlt & F11::SendInput {Volume_Down} RAlt & F12::SendInput {Volume_Up} ; swap left command/windows key with left alt LWin::LAlt LAlt::LWin ; add a semicolon in f

Categories : Windows

Keyboard combination shortcuts
I don't know keymaster, but you can easily accomplish that with a timer (setTimeout) from within a keypress event handler. Instead of acting immediately on a key press, add the key to a buffer, and wait for a second key until the timeout expires. In code, that would be something like this: var keyBuffer = [], timer; document.addEventListener('keypress', function(e) { // Add current key to buffer keyBuffer.push(e.which); // Cancel previous timer clearTimeout(timer); // Set new timer timer = setTimeout(function() { // Pass a *copy* of the buffer into another function reactOnKey(keyBuffer.slice(0)); // Clear buffer keyBuffer.length = 0; }, 1000) }, false); function reactOnKey(buffer) { console.log(buffer); } http

Categories : Javascript

Qt: How to Program custom Keyboard Shortcuts
Since CTRL-Q may have a menu item or toolbar entry, too, I think you're looking for QAction. See this: http://doc.qt.digia.com/4.6/qaction.html#shortcut-prop LE: Example of QAction at work: QAction *foo = new QAction(this); foo->setShortcut(Qt::Key_Q | Qt::CTRL); connect(foo, SIGNAL(triggered()), this, SLOT(close())); this->addAction(foo); Just create a new Qt GUI project (I used QtCreator) and add that code to the main window's constructor and it should work as expected. Please note that there is no need of freeing the memory since the Qt framework will take care of that when the app closes.

Categories : Qt

Permanently deleting Firefox keyboard shortcuts
i think the file you are looking for is omni.ja that is a jar file in firfox installation directory. inside that archive you can find at the path /chrome/toolkit/content/global/ a file named platformHTMLBindings.xml that should contain firefox key bindings, but recent firefox versions may have changed the binding system..

Categories : Firefox

How to avoid Eclipse blocking keyboard shortcuts
Try Window / Reset Perspective as the duplicate shortcuts may be still in the perspective. Also try restart specifying -clean option to rebuild the workspace metadata.

Categories : Eclipse

Sending keyboard shortcuts to chrome with Selenium and Ruby
I think you're just using a wrong keys combination. According to this: https://support.google.com/chrome/answer/171571?hl=en&ref_topic=25799, the shortcut to open Developer Tools is Ctrl-Shift-J on Linux and Windows and Cmd-Opt-I on Mac.

Categories : Ruby

What is the intellij idea keyboard shortcut to list all other shortcuts
You can use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac) to see all the actions and their shortcuts. There is no fast way to perform the reverse search yet, but you can open Settings (Preferences on Mac) | Keymap and use the filter by shortcut to find the corresponding action. There is also a feature request to make it easier, feel free to vote.

Categories : Intellij Idea

How to indent part of code in rubymine and keyboard shortcuts
Navigate to the first line Hold down shift Navigate to the last line Press Tab or shiftTab as appropriate

Categories : Ruby

How can I trigger different button events with keyboard shortcuts in JavaScript or jQuery?
Using the keyup event, you can listen for the user releasing a key. You can then translate it to a letter (or an arrow key, in my example), and access the appropriate question/button. You can try something like this: $(document).ready(function () { var $questions = $("div.question"), $activeQuestion = function () { return $questions.filter(".active"); }, $prevQuestion = function (setActive) { var $prev; $prev = $activeQuestion().prevAll(".question").first(); if ($prev.length === 0) { $prev = $questions.last(); } return $prev; }, $nextQuestion = function () { var $next; $next = $activeQuestion().nextAll(".question").first();

Categories : Javascript

MacOS, how to delete unused service item in Keyboard Shortcuts
Look in ~/Library/Services or /Library/Services In the Finder, ~/Library is now an invisible folder by default in Mountain Lion. Of course, people can google for "Mac show hidden files" and find a command to enter into the command-line to make all files and folders visible. As a programmer, I like being able to see everything. Unix Command: defaults write com.apple.Finder AppleShowAllFiles TRUE Reference: http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/

Categories : Osx

Adding modifier-based keyboard shortcuts to a Ruby command-line application
Install highline gem - should permit you to trap all kinds of key combinations (without requiring the user to press enter after the key). See this question for some more detail: How to get a single character without pressing enter? If you do use highline, at least in my testing, you may (or may not) be able to use Kernel.trap to grab key events like Ctrl-C so you should handle those manually. Highline will trap any key and let you detect ctrl-d vs d. It won't detect the difference between ctrl-d and ctrl-shift-d however, nor does it distinguish alt-d from d. Here's some basic code: require "highline/system_extensions" include HighLine::SystemExtensions print "Press any key:" k = get_character Kernel.abort(" Ctrl-C - exiting.. ") if k == 3 puts puts k.chr

Categories : Ruby

How to Work With ControlTemplate.Triggers ,ControlTemplate.TargetType and accessing controls within ControlTemplate Using Keyboard ShortCuts
Modify your Datatrigger like this: <ControlTemplate.Triggers> <DataTrigger Binding="{Binding ElementName=lbl, Path=Content}" Value="UNKNOWN"> <Setter TargetName="exp" Property="IsExpanded" Value="False" /> </DataTrigger> </ControlTemplate.Triggers> and name the expander: <Expander x:Name="exp" IsExpanded="True" FlowDirection="LeftToRight"> ... Note: the expander must be defined before the trigger: <ControlTemplate TargetType="{x:Type GroupItem}"> <Expander ... <ControlTemplate.Triggers> ... </ControlTemplate>

Categories : Wpf

Excel VBA: the keyboard shortcut I assigned on a Macro make my code hang after opening a document
Apparently, after multiples google search about that particular problems, it seems that Application.Workbooks.Open(yourPath) mixed with the Shift keyboard key in your shortcut is the problem. More precisely from this guy if you look at the last answer: The shift key makes a vb script stop at any Open statement. So you have two solutions Remove the Shift key from your shortcut and choose another one Instead of using .Open, you could use .Add which will do the same job, but the code won't hang. So if you do Application.Workbooks.Add(yourPath) it should behave properly. It is funny though, that both Open and Add have the exact same behavior when you look at the screen while running the Macro. Edit: I couldn't find any official link referring to that bug.

Categories : Vba

Maths in php and mysql
This is the string you are printing: "<td> £ $first_number = {$row['bcosts']}; $second_number = {$row['rcosts']}; $third_number = {$row['value']}; $sum_total = $third_number - $second_number - $first_number; print ($sum_total); </td> "; The variables get replaced with their values: "<td> £ = 100; = 25; = 300; = - - ; print (); </td> "; And the browser converts multiple whitespace characters into one space when displaying. You cannot calculate stuff during inside the string. This should fix it: "<td> £"; $first_number = $row['bcosts']; $second_number = $row['rcosts']; $third_number = $row['value']; $sum_total = $third_number - $second_number - $first_number; print ($sum_total); echo "</td> ";

Categories : PHP

Cad/Cam maths required
Linear algebra is definitely a good start. Also, you are probably familiar with polygon meshes, that's good too. If I would interview for a CAD job I would read up on other geometry representations. In particular NURBS and Constructive Solid Geometry (CSG). I don't think rendering APIs are too important here, but you should have a solid understanding of how ray tracing works and how to use the just mentioned surface types in both a ray tracer and in a rasterization-based pipeline.

Categories : Misc

SQL Server 2008 R2 Multiple Row Maths
Your issue is not with sql syntax but normalization. In first normal form your query will be more easy. First CTE statement is intended to simulate a normalized schema: ;with -- here normalized table norm as ( select [crmcref] ,[year] ,[mtdvalue_1] as value, 1 as my_month from [dbo].[CRSpendByPeriod] union all select [crmcref] ,[year] ,[mtdvalue_2] as value, 2 as my_month from [dbo].[CRSpendByPeriod] union all ... select [crmcref] ,[year] ,[mtdvalue_12] as value, 12 as my_month from [dbo].[CRSpendByPeriod] ), -- here fiscal year fiscal_year as ( select 0 as deltaYear, 1 as fiscal_month union all select 0 as deltaYear, 2 as fiscal_month union all select 0 as deltaYear, 3 as fiscal_month union all select 0 as deltaYear, 4 as fiscal_month union all select 1 as

Categories : SQL

Maths Formula Design Pattern
One way to do it would be to create an object with your mass/acceleration/force values and (depending on which values are set) either calculate them or just return them public class NewtonLaw { private Double mass; private Double acceleration; private Double force; public NewtonLaw(Double mass, Double acceleration, Double force) { this.mass = mass; this.acceleration = acceleration; this.force = force; } public Double calcMass() { if (mass != null) { return mass; } else if (acceleration == null) { throw new IllegalStateException("Acceleration is not set"); } else if (acceleration == 0) { throw new IllegalStateException("Acceleration is zero, cannot calculate the mass"); } e

Categories : C#

Javascript algebra/algorithm maths
If it is an algebra question... since h1 = h2 you may exclude them and get. w1*1.98 = w2*0.6355 w1 + w2 = 1367 Put it into some solver and get { w1 = 332.1462435480787, w2 = 1034.853756451921 }.

Categories : Javascript

Creating a dll in C++ which is used to constantly calculate maths function
With the line Array = new double *[width]; you are initialising your array in every function call. If you need to store values (I very much doubt) it is better to use an static initialised vector. But generaly it is a very bad idea to let the result of a function depend on former calls. If you realy need to accumulate state, think about creating a function object for this purpose. Edit: With a function object you can change the behavior of the algorithm with changing operator() and the datastructure to hold your data via member variables. 2nd Edit: You probably want something like this: struct MeasureDistance { double last_x; double last_y; MeasureDistance() : last_x(0), last_y(0) {} double operator()(double new_x, double new_y) { double diff_x=last_x-new_x; double d

Categories : C++

Maths in a while loop causing random negative numbers
The answer lies in Russell Uhl's comment above. Your loop runs one time to many(this is your code): for (( c=$zero; c<=${#ARRAY2[@]}; c++ )) do expr ${ARRAY2[$c]} - ${ARRAY[$c]} done To fix, you need to change the test condition from c <= ${#ARRAY2[@]} to c < ${#ARRAY2[@]}: for (( c=$zero; c < ${#ARRAY2[@]}; c++ )) do echo $((${ARRAY2[$c]} - ${ARRAY[$c]})) done I've also changed the expr to use arithmetic evaluation builtin $((...)). The test script (sum.sh): #!/bin/bash zero=0 ARRAY=() ARRAY2=() first="1 15 1 25 25 1 2 1 3541 853 94567 42 5 1 351 51 1 11 1 13 7 14 12 3999 983 5 1938 3 8287 40 1 1 1 5253 706 1 1 1 1 5717 3 50 1 85 100376 17334 4655 1 1345 2 1 16 1777 1 3 38 23 8 32 47 7 second="1 15 1 25 25 1 2 1 3555 859 95043 42 5 1 355 55 1 11 1 13 7

Categories : Bash

JS Game Programming - Using keyboard events for bluetooth keyboard/iCade with iPad browser?
Apparently, after researching it, this is not possible - only OS calls can do this, and none of them have a JS interface, even via webkit. What I will do is give the option to modify the canvas size for the bar.

Categories : Javascript

In iOS, how do I get keyboard information to prevent keyboard overlay of text fields?
One way you can do this is that instead of setting the text field's frame in the begin editing, you can iterate through your text fields checking the isFirstResponderproperty, and move the frame of the one that is first responder. You can do all that in your method where you get the keyboards frame.

Categories : IOS

Adding my own keyboard instead of default keyboard in Android device as input
You should first take a look here. Then continue with this thread here, as stated there: Some tips: Read this tutorial: Creating an Input Method clone this repo: LatinIME An inputMethod is basically an Android Service, so yes, you can do HTTP and all the stuff you can do in a Service. You can open Activities and dialogs from the InputMethod. Once again, it's just a Service. Here's another tutorial on the topic. I hope all this is helpful for you. Cheers

Categories : Android

How to show numeric keyboard (tab from simple text keyboard) on an EditText
Ok this might work. Use a "onTextChangeListener" in your EditText so when the lenght or some determinative string has been recorded the keyboard will switch. I Have a project where I do something like this: yourEditText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } //Check after user finished writting @Override public void afterTextChanged(Editable s) { //if the lenght of the editText is > 3... if (s.length()>=3){ yourTextView.se

Categories : Android

Custom iOS keyboard repositioned by undocked system keyboard
Undocking by longPress then move is a default gesture of iPad keyboard (default and custom) if undocking setting is on. With custom keyboard, this gesture assign to right lower conner of keyboard. Check when undock keyboard from this and resign or modify you custom keys.

Categories : IOS

Physical keyboard doesn't disable when using a virtual keyboard
First, I feel duty-bound to say: virtual keyboards are almost always terrible, and with the exception of touchscreen-only kiosks, there are virtually no reasons to use them. So, please think of your users. But, that said: to disable key presses in an input, return false from the keypress handler: $("input").on("keypress", function() { return false; });

Categories : Javascript

How to make keyboard event using javascript without keyboard
This is not possible as it violates a browser's sandbox capabilities. However, there are workarounds such as - http://andrew.hedges.name/experiments/fullscreen/

Categories : Javascript

View All Eclipse shortcuts
yes, you can go Window - Preferencee - General - Keys and see all available shortcuts. Also you can reorder keys here. Also you can read more about eclipse shortcuts here

Categories : Eclipse

Java code to run .exe shortcuts
The shortcut you see in your desktop is actually a file with the extension .lnk. It's real full path is, then: C:UsersDesktop otepad.exe.lnk Trying to run it through exec() will yield a "CreateProcess error ... is not a valid Win32 application" error. Fortunately, you can run those as well through the ProcessBuilder utility class. public static void main(String[] args) throws Exception { ProcessBuilder pb = new ProcessBuilder("cmd", "/c", "C:\Users\robert\Desktop\notepad.lnk"); Process p = pb.start(); p.waitFor(); } If you must use Runtime.getRuntime().exec(), you can open the lnk file through rundll32: Process p = Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL " + "C:\Users\ro

Categories : Java

Android multiple shortcuts
You can have as many shortcuts for an App, as many public intents are declared in its manifest. The Activity in example is returning only one Intent and finishing on the spot. You can have your Shortcut Activity show a list of all available intents of your app and return that intent in its result.

Categories : Java

Which class should take care of shortcuts?
Your setup sounds a lot like many of the applications I've built. I generally handle shortcuts via the QAction::setShortcut() method, so it's really more about where does it make sense to store the QAction objects. This usually ends up being my MainWindow class as a lot of the actions are all used in the MainWindw's menus. When these actions are triggered, the result is usually that the TabWidget is notified which in turn notifies all the necessary tabs and can handle things like a "Close All" action triggering only one save prompt. However, if it doesn't make sense to store those QActions on the MainWindow object, then I don't, as in the case of the context menu I usually have available on my individual tabs. Hope that helps.

Categories : C++

Getting path from a ExecutableFile.exe shortcuts
This code will help you. :) namespace Shortcut { using System; using System.Diagnostics; using System.IO; using Shell32; class Program { public static string GetShortcutTargetFile(string shortcutFilename) { string pathOnly = System.IO.Path.GetDirectoryName(shortcutFilename); string filenameOnly = System.IO.Path.GetFileName(shortcutFilename); Shell shell = new Shell(); Folder folder = shell.NameSpace(pathOnly); FolderItem folderItem = folder.ParseName(filenameOnly); if (folderItem != null) { Shell32.ShellLinkObject link = (Shell32.ShellLinkObject)folderItem.GetLink; return link.Path; } return string.Empty;

Categories : C#

c# memory usage for starting lnk shortcuts
In contrast, when I launch the executables directly, the main program doesn't appear to use more memory per process launched Shortcut is nothing in itself. It is just a pointer to the main executable. So assuming/claiming that running from shortcut is taking more memory cannot be true. The main c# program uses around 500 kilobytes per shortcut launched. Even after the "shortcut launched" applications close this memory never seems to be freed. if you think that process is not freeing up memory, you can use it in using using (Process proc = new Process()) { proc.StartInfo.FileName = "c:\somefolder\shortcut.lnk"; proc.Start(); }

Categories : C#

Windows ContextMenu C++ with Shortcuts in Selection
Are we talking about IContextMenu interface here? If so, you should do it like that (mistakes possible, I'm writing without compiler): Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID){ FORMATETC fetc = { CF_HDROP, null, DVASPECT_CONTENT, -1, TYMED_HGLOBAL }; STGMEDIUM stgm; pdtobj->GetData(&fetc, &stgm); UINT count = DragQueryFile(stgm.hGlobal, 0xFFFFFFFF, null, 0); char filename[255]; for (int i=0; i<count; i++){ DragQueryFile(stgm.hGlobal, i, filename, 255); // Here do something with i-th filename } } I omitted error checking for simplicity.

Categories : C++

Can i add css property shortcuts to sublime text?
These are called snippets. For this particular example, Open the Tools menu and select New Snippet..., then paste in the following: <snippet> <content><![CDATA[margin: 0 auto;]]></content> <tabTrigger>m-a</tabTrigger> <scope>source.css</scope> </snippet> Save this file as Packages/User/CSS/margin auto.sublime-snippet and you should be good to go. Open a CSS file, type m-a, hit Tab, and you're all set. Snippets are pretty powerful, and also allow for tab stops to enter customized data. For example, you could set up some boilerplate code that only requires that the colors be customized like so: <snippet> <content><![CDATA[body { max-width: 500px; _width: 500px; padding: 30px 20px 50px; bo

Categories : HTML

Android : Remove all shortcuts associated with the app from code
Try this: appShortcutIntent = new Intent(); appShortcutIntent.setClassName("com.pkg.pkgname", "MainActivity"); appShortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); appIcon = Intent.ShortcutIconResource.fromContext(this, R.drawable.icon); Intent intentDeleteShortcut = new Intent(); intentDeleteShortcut.putExtra("android.intent.extra.shortcut.INTENT", appShortcutIntent); intentDeleteShortcut.putExtra("android.intent.extra.shortcut.NAME", getResources().getString(R.string.app_name)); intentDeleteShortcut.putExtra("android.intent.extra.shortcut.ICON_RESOURCE", appIcon); intentDeleteShortcut.setAction("com.android.launcher.action.UNINSTALL_SHORTCUT"); sendBroadcast(intentDeleteShortcut); And add this permission in manifest file: <uses-permission android:name="com.android.launcher

Categories : Android

Visual Studio custom shortcuts
For VS2010 at least the solution is to use a macro. Once your macro is created see here for information on how to bind it to a shortcut key. I don't have VS2012 available to confirm but according to this question, the macro recording facility has been removed. There are some solutions posted in that question which might help.

Categories : Visual Studio 2010

OpenFileDialog xml Filter allowing .htm shortcuts
You're doing it correctly. Using the Filter property allows you to limit the files displayed in the open dialog to only the specified type(s). In this case, the only files the user will see in the dialog are those with the .xml extension. But, if they know what they're doing, it's trivial for the user to bypass the filter and select other types of files. For example, they can just type in the complete name (and path, if necessary), or they can type in a new filter (e.g. *.*) and force the dialog to show them all such files. Therefore, you still need logic to check and make sure that the selected file meets your requirements. Use the System.IO.Path.GetExtension method to get the extension from the selected file path, and do an ordinal case-insensitive comparison to the expected path. Exa

Categories : C#

making directory shortcuts like $HOME
HOME is a really bad choice, since many programs will use the value of HOME to find the home directory. However, you certainly can do #WARNING: this is a bad idea. It would be better to choose a #name other than "HOME" HOME="cd /p/a/t/h" $HOME Using a function would be more reliable and flexible, but it's certainly possible to put a command in a variable like this.

Categories : Osx



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