shortcut

Run .jar through Windows shortcut passing arguments

偶尔善良 提交于 2019-11-28 04:57:42
问题 Is it possible run .jar through Windows shortcut (.lnk) passing arguments? 回答1: In Java 7, yes. You can point the shortcut to c:\windows\system32\java.exe or javaw.exe as appropriate and include the same arguments you would use on the command line. In a clean Java 8 installation, not easily. Unfortunately Java 8 no longer puts copies java.exe and javaw.exe into the system folder, but instead puts symbolic links in a ProgramData folder. Windows doesn't like shortcuts to symbolic links;

Shortcut for: $foo = explode(“ ”, “bla ble bli”); echo $foo[0]

坚强是说给别人听的谎言 提交于 2019-11-28 04:47:24
问题 is there a way to get the n-th element of a splitted string without using a variable? My PHP code always looks like this: $foo = explode(" ", "bla ble bli"); echo $foo[0]; Is there a shorter way maybe like in Python? print "bla ble bli".split(" ")[0] Thanks in advance. 回答1: This is what people should be using instead of explode most of the time: $foo = strtok("bla ble bli", " "); It cuts off the first string part until the first " " . If you can't let go of explode, then the closest idiom to

How to disable automatic mnemonics in a Qt application on KDE?

邮差的信 提交于 2019-11-27 23:58:17
In any Qt application on KDE when I add a QPushButton in designer and check it's text by: void MainWindow::on_pushButton_clicked() { qDebug()<<ui->pushButton->text(); } The output is preceded by an & : &PushButton This behavior does not exist on Windows. It seems that Qt applications on KDE automatically add shortcuts to all push buttons, which is not desired for me. I should note that the ampersands are not created by designer and you can not see them in the .ui file. Actually when the button is added to a widget, an & is placed somewhere in it's text. Is it possible to disable automatic

How can I have a home screen shortcut launch a dialog?

对着背影说爱祢 提交于 2019-11-27 22:49:43
问题 Okay, I asked another question here trying to make my activities look like dialogs. I'm thinking maybe instead of asking about a specific method, I should ask about what I'd like to do, and perhaps there is a different way to go about it... Here's what I have. My app allows shortcuts to be placed on the home screen. The code and logic for creating the shortcuts all works flawlessly, and the shortcuts then launch the proper activity which shows what it's supposed to... again, all works

What's the best way to use shortcuts and autocomplete to create a new object in Intellij IDEA?

浪尽此生 提交于 2019-11-27 21:28:00
Object + shortcut ➜ Object object = new Object(); Whether there is such shortcut? new Obj , Tab to complete to new Object() , Ctrl + Alt + V ( Refactor | Introduce Variable ): Object o = new Object(); Change name if needed and press Enter to confirm. For the more convenient solution utilizing the live templates feature please check the answer below from @MarcG . As of 2017 , improving on @aleksander's answer, I believe the best way to create a new object as efficiently as possible in Intellij IDEA, is this (click to enlarge): Go to Settings > Live Template . Then click the + to the right of

How to automatically generate getters and setters in Android Studio

只谈情不闲聊 提交于 2019-11-27 16:49:37
Is there a shortcut in Android Studio for automatically generating the getters and setters in a given class? Ajay S Using Alt + Insert for Windows or Command + N for Mac in the editor, you may easily generate getter and setter methods for any fields of your class. This has the same effect as using the Menu Bar -> Code -> Generate... and then using shift or control button, select all the variables you need to add getters and setters Vasiliy Kulakov In OSX, ⌘ + N by default. Right-click and choose "Generate..." to see current mapping. You can select multiple fields for which to generate getters

how to create a shortcut which leads to a non-launcher activity?

别说谁变了你拦得住时间么 提交于 2019-11-27 16:28:37
问题 I want to create a shortcut in an android app, it lead to another activity which is not launcher of the app. 回答1: To create the shortcut itself you need a specially crafted activity which must: Be defined in your AndroidManifest.xml with an intent filter with the action android.intent.action.CREATE_SHORTCUT. Return a result, an Intent, containing your actual shortcut. The shortcut itself is represented by another Intent. This activity will then show up when you longpress your desktop and

listen for a key when the application is not focused

自古美人都是妖i 提交于 2019-11-27 15:32:40
I've an application(C# 4.0-WPF), which is hidden and can be displayed by clicking on the systray icon or on an other frame I created(small frame which is docked left and topmost). My customer wants to add a new way to display the application: When pressing on a "F" key (e.g. F9 ). How do I know in my application if the user presses this key when the application is not the current window /or is not focused? Global keyboard hooks are not the right solution if you only want a few global hotkeys. A global keyboard hook using WH_KEYBOARD means that your dll will be injected into every process that

How to add app's shortcut to the home screen

元气小坏坏 提交于 2019-11-27 14:59:47
I know it's not documented and won't work on every device, but I see more and more apps placing their shortcuts on the home screen after they got installed. Found bunch of code chunks how to do it but for me they don't fit together. This is what I got for now. Need a permission in the manifest. <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> Create an Intent of activity that should be called. Ex (from cgeek): Intent shortcutIntent = new Intent(); shortcutIntent.setClassName("com.example.androidapp", "SampleIntent"); shortcutIntent.addFlags(Intent.FLAG

Creating a file shortcut (.lnk)

做~自己de王妃 提交于 2019-11-27 14:37:08
问题 I have been looking for a simple way to create a shortcut to a file in C#, but I've only found external dlls that do that. It's actually quite surprising, there's no built in way to do that.. Anyway, I know that lnk files are just text files with a certain command and a given path. I thought that maybe I could create a text file (in the code) set it's text to the right command and change it's extension to .lnk I've tried to do that manually first, but failed to do so. Is there a way to do