I have a JS file that has over 100000 lines of code, I want to get rid of the first 25000, I've been trying hard but can't figure out how do I select them all at once (holding left mouse button and scrolling down is not an option as it would take forever).
I guess holding SHIFT and arrow DOWN is the way to go, but I have absolutely no idea how to select them all at once anyway. Maybe selecting 25000th line, pressing shift, left arrow and then HOME would help, but I'm working on OS X and have no HOME button my Macbook. Also shortcut for "going to line" (ctrl+q) doesn't seem to work with selection.
How do I do that? Sorry for so dumb question, would've been a second in VIM, but I'm stuck to SE2 now.
Thanks a lot!
go to line 25000: CMD+L, enter 25000
hit CMD+SHIFT+UP ARROW
done
See this forum topic about the "Mark" feature from Sublime Text: https://www.sublimetext.com/forum/viewtopic.php?f=2&t=16844
Ctrl-G to go to the last line you want to select, by number.
Edit > Mark > Set Mark to set your selection-end marker.
Ctrl-G (or Ctrl-Home) to go to the first line you want to select.
Edit > Mark > Select to Mark
Any programming language will do, for example in python:
lines = open('yourfile.txt','r').readlines()
open('yourfile.txt','w').write(lines[24999:100000])
Related
I know that the title of asking is quite vague. But let's check this page:
https://www.cleaneye.go.kr/user/gongsiCompare.do
So this is one of public data page in Korea which has a data I need in my research.
As you can see, it has some checkbox in ul, and if you check one of the box in left one, the list of checkbox on its right would come up.
So I made a code to check every combinations, and I'll show you the one which cause the problem.
from selenium import webdriver
driver = webdriver.Chrome(CHROMEDRIVER_LOCATION)
driver.get('https://www.cleaneye.go.kr/user/gongsiCompare.do')
in_type = driver.find_elements_by_xpath("//div[#id='divPcomp']/ul/li")
for in_t in in_type:
in_t.find_element_by_xpath("./label/input").click()
region_type = driver.find_elements_by_xpath("//div[#id='divSido']/ul/li")
for r_t in region_type:
r_t.find_element_by_xpath("./label/input").click()
The problem is, when the code execute
r_t.find_element_by_xpath("./label/input").click()
it gives ElementNotInteractableException error, maybe cuz DOM didn't revised after it clicked the checkbox in
in_t.find_element_by_xpath("./label/input").click()
So I've searched how to solve this problem, and most of answers were about using implicit/explicit wait. Before I do that, I put time.wait(30) between click()s, and still it didn't work. So just waiting might not be the solution for this.
As you can see, if you refresh it, the whole page would be reset so... that is not the answer for this as well.
Is there any great solution, or any walk-around it, please enlighten me.
Otherwise, I'll just use mouseclick and keyboard inputting 'tab' haha...
Thanks for your attention to this problem!
your locator is not unique, it finds element that is not visible on screen use :
region_type = driver.find_elements_by_xpath("//div[#id='divSido']/ul/li[#class='rowon']")
I am trying to hide the fourth option of a question in a loop and merge if one of the loop and merge fields refers to a certain name. here is the code i am using at the moment:
Qualtrics.SurveyEngine.addOnload(function()
{
if("${lm://Field/2}"=="76ers"){
$('QR~${lm://CurrentLoopNumber}_QID27~4').hide();
}
});
the idea is, if Field/2 is "76ers", then it should hide the fourth option of this question. I am very new to using java in qualtrics so there is a lot that could be going wrong here. The loop is randomized, and field 2 refers to an embedded data field which at some point will refer to the 76ers. I want to hide the fourth choice option when it does that - but no joy with the code I am using.
In case it helps, I attach the screen where I want is for the fourth option down to be hidden.
enter image description here
Please let me know if anyone has a solution!
Many thanks,
Josh
I'm having trouble inserting a vertical line between the second to last radio button and the last one. Basically to separate the last choice in the likert scale and the "i don't know" option. Can anyone else help please?
Heres's what I want to do
Here's a code I found to hide a radio button (another option I am open to to hide a radio button between the two choice to create "whitespace")
$('QR~QID154~198').up().hide();
It didn't seem to work...maybe I have to specify which answer choice? Any advice can help as I am not a programmer at all. It's just Qualtrics doesn't have the feature to do that. Thanks!
Use the following. You can adjust the style to meet your needs.
Qualtrics.SurveyEngine.addOnload(function() {
$(this.questionId).down('.ChoiceStructure').select('td').last().style.borderLeft = "3px solid grey";
});
P.S. Are you the person who left a comment on the marketinview/Qualtrics_MatrixVerticalLineBeforeLastColumn.js gist a couple of days ago? I don't get notified nor check comments there.
Well I need a bit help here, i just dont get how i can manage to make that script dynamic.
I like to press one continent, and it opens the correct land - then from the land it should open the correct region -> And from there it should open the correct city.
Also it shouldn't try to open one, if this continent/land/region has no child-> no another tab.
Its my part of an search engine. The Php and HTML doesent need to be shown here, it works right.
I like to make an Tab system with that i could close every box, beside the first one.
That should be the box that contains the continents.
From there you select one point from that box, in example Europa. Then the box that contains the lands from Europa should be visible. Then you can again select the next step, here in example you select now in the second box Europa->Spain Then it should open the box with the content of spain and so on.
$(document).ready(function(){
$('#select_land_1').click(function(){
$('.box_land').hide();
$('.box_region').hide();
$('.box_city').hide();
$('#land_1').show();
$('#select_region_12').click(function(){
$('#region_12').show();
$('#select_city_34').click(function(){
$('#city_34').show();
});
$('#select_city_35').click(function(){
$('#city_35').show();
});
});
});
The Css looks like that :
http://img641.imageshack.us/img641/1479/bildnr1error.jpg
Thank you very much for your help :)
This:
$('.box_land'+'#land_1').show();
is weird and almost certainly not what you want. You didn't post any HTML, but perhaps you want just:
$('#land_1').show();
Same for the other one.
I'm looking at creating something like this:
http://konigi.com/interface/kontain-search
alt text http://s3.amazonaws.com/konigi/interface/kontain-search-2.png
I don't suppose anyone has any resources which could guide me? I know I'm not giving much information but I wouldn't know where to start looking.
Cheers!
EDIT Sorry, I meant just the drop down / input box, nothing else on that site.
EDIT AGAIN The drop down list is inside of the input box, hence why I was wondering.
It may be something similar to these examples but with only one main item. and manipulate with jquery each "li" and that action taken
example 1 |
example 2 |
example 3 |
example 4
edition answer: this is done with css.
is all contained in a div -> input + menu.
for the input is removed border styles and background color is the same as the container div.
Well, you put part of the search form in a hidden div and pop it up when the user clicks or hovers on some other element, either inside or outside the form. Use CSS as needed to position the div. Not really sure what problems you could possibly have with something like this.
Maybe you can be more specific and break this problem down in several more focused questions?
I did not drill into the site, but from a logical standpoint, perhaps the search box AND the dropdown are "inside" another element (div?) that forms the complex control...and just formated(CSS)/actions(jQuery) placed on those.
<div id="searchDiv">
<div id="searchText"></div>
<div id="searchDropdown"></div>
<div id="searchButton"><div>
</div>
Easy enough to set somthing like that up.
I think what's going on there isn't that the dropdown is inside an input box, but rather that the input box chrome is hidden and it's placed inside an input-looking div along with the dropdown.