This happens to me frequently, Please give me a solution.
Edit : I have found the fix and answered below.
The Solution is just 3 Steps:
Step 1 : Press Ctrl + Alt + F
Step 2 : Press Left Arrow (To move to the 3 Lines )
Step 3 : Press Enter on Repaint Desktop
You gotcha !
Related
I have a data frame (Dataset_Events) with seven columns, two of them being eventInfo_ea and eventInfo_el. I'd like to remove the cell value of eventInfo_el in rows where eventInfo_ea = 'add to cart'. See the code below.
Remove = function(Dataset_Events, eventInfo_ea, eventInfo_el){
if(Dataset_Events[["eventInfo_ea"]]=="add to cart"){
Dataset_Events[["eventInfo_el"]] <- NULL
}
}
sapply(Dataset_Events, Remove)
Unfortunately R gives me the following error message:
"Error in Dataset_Events[["eventInfo_ea"]] : subscript out of bounds"
Dimension of the dataframe are 713478 x 7.
Can anybody explain why and how to fix it?
If I simply run the if condition itself, I get a proper TRUE/FALSE reply in the same length as the data.frame
Dataset_Events[["eventInfo_ea"]]=="add to cart"
Here a sample dataset of the two relevant columns (both columns have class factor):
eventInfo_ea eventInfo_el
1 click thumbnail
2 click description
3 click hero image
4 click open size dropdown
5 click hero image
6 click hero image
7 click hero image
8 click description
9 click open size dropdown
10 click hero image
11 click hero image
12 click hero image
13 click hero image
14 click description
15 click open reviews
16 click hero image
17 click open reviews
18 click description
19 add to wishlist hero image
20 click hero image
21 click hero image
22 add to cart hero image
Try this:
Remove = function(Dataset_Events){
ind = Dataset_Events[["eventInfo_ea"]] == "add to cart"
Dataset_Events[["eventInfo_el"]][ind] = NA
return (Dataset_Events)
}
Remove(Dataset_Events)
I removed the second and third arguments from your function (you don't seem to be using them?). As you note, Dataset_Events[["eventInfo_ea"]]=="add to cart" gives you a vector of logicals, so this should be used to index the rows you want to set to NA (I changed from NULL since this was giving problems).
I believe the problem is that theDataset_Events[["eventInfo_el"]] returns a factor. In this case is better to use identical.
Remove = function(Dataset_Events, eventInfo_ea, eventInfo_el){
if(identical(as.character(Dataset_Events[["eventInfo_ea"]]),"add to cart")){
Dataset_Events[["eventInfo_el"]] <- NULL
}
}
sapply(Dataset_Events, Remove)
I actually found a solution that works. I skipped the whole part of defining a function and simply used the following code and it worked
Dataset_Events[ Dataset_Events["eventInfo_ea"]=="add to cart", ]["eventInfo_el"] <- NA
Still happy to hear though why the suggestions from all of you didn't seem to modify my dataset at all. Thanks a lot though!!!
I am using RStudio and recently noticed that when I use the "run" button it will not display comments in the command but just skips the line and goes to the next executable statement. I can run the entire script (with echo) and it displays the comments but any time I try and run a single line with the "run" button it will skip over comment lines. For example if I click the run button three times to execute these three lines of code:
4 + 4
#This is a comment
5 + 5
Console display:
>
> 4 + 4
[1] 8
> 5 + 5
[1] 10
This quirk just happened recently. I used the run button successfully on comments yesterday, is there a setting that might have changed or that I can change to continue to show comments on the console with the "run" button?
I've also noticed this evolution in the latest RStudio version (1.0.36).
Actually the run behavior has also changed in 2 other ways:
When the cursor is anywhere in a multi-line command, clicking "Run" (or pressing Crtl + Enter) now executes the entire command.
When the cursor is anywhere in a comment block, clicking "Run" executes the first command below it.
To come back to the old behavior, go into:
Tools > Global Options... > Code
and uncheck Execute all lines in a statement.
I'm in trouble because in Xcode 7 Apple as introduce the ability to switch between deep and shallow press on the Apple Watch Simulator but the shortcut is also use to change the scale. I was wondering if someone know how to change shortcuts or have another solution.
Thank you
You can use the following shortcuts.
Shallow Press: Shift + cmd + 1
Deep Press: Shift + cmd + 2
The shortcuts to change scale is the following.
cmd + 1
cmd + 2
Is there a way (plugin or something) to use split screen in the Atom Editor?
I've looked inside the menus, but I can't find any related options.
Using the command palette
Open the command palette with cmd + shift + p (OSX) or ctrl + shift + p (Linux/Windows) and type "split". You'll see options for Up, Down, Left, and Right split.
Using keyboard shortcuts
Split the current tab in a direction with the following shortcuts
Up cmd / ctrl + k then ↑
Down cmd / ctrl + k then ↓
Left cmd / ctrl + k then ←
Right cmd / ctrl + k then →
You can close an active split pane with cmd / ctrl + k then cmd / ctrl + w.
Move between panes
If you want to move between open panes (with the keyboard) you have to modify your keymap file. Go to Atom -> Open Your Keymap and include this:
'body':
'cmd-alt left': 'window:focus-pane-on-left'
'cmd-alt right': 'window:focus-pane-on-right'
'cmd-alt up': 'window:focus-pane-above'
'cmd-alt down': 'window:focus-pane-below'
'cmd-alt-2': 'pane:split-right'
'cmd-alt-3': 'pane:split-down'
This is my personal setup. I was used to Sublime's default cmd + alt + arrow. Change the left side commands to your personal preference.
Note
You need to press cmd-alt once, release, and then press the arrow button. Otherwise it won't work.
I found this at Split Windows - issue #64:
It seems like Atom already has support for splitting windows (cmd-k + arrow key)
Right click anywhere on an open file, select "split left"
If it duplicates a file, "x" it out.
Result:
I have created a beginners cheat sheet for Atom that lists some introductory notes and keyboard shortcut commands etc. Its on github #
https://github.com/pd-gmit/atom-cheatsheet/blob/master/atom_cheatsheet.md
You could always just right click anywhere on the file and the split options are available in the context menu.
I am dealing with 2 windows . One is created by Qt Designer and i import it
on test.py program . what i did i make a Widget on the test program and
than add a button to it and on click event I try to popup the other
window(gui1.py) created by Qt Designer but it never pop ups and when i use
break and do line by line debugging it shows me this message after running
this command "myapp2 = MyForm()" on line number 35 test.py .
QCoreApplication::exec: The event loop is already running
and once i pressed enter on the terminal it pop up the other window .
I am confuse where i am wrong .
Thanks
test.py
gui1.py
The reason the other window doesn't appear, is because you are not keeping a reference to it, and so it gets garbage-collected immediately after it is shown.
To fix the problem, you could either store the window instance it as an attribute, or give it a parent:
def local_manag(self):
print "pressed"
# store it as an attribute
self.myapp2 = MyForm()
self.myapp2.show()
# or give it a parent
# myapp2 = MyForm(self)
# myapp2.show()