Questions tagged [pop]

If you use this tag, also use the 'stack' tag. To pop an element from a stack is to remove the element at the top of the stack (and possibly read it at the same time).

-1
votes
1answer
17 views

Selenium POP - moving to main page after login, new Object Pattern

I have a conceptual problem when it comes to POP and main page after login. I have LoginPageTest in which I register a new user and login, which redirects me to main page. How do I "redirect" to ? e....
0
votes
1answer
20 views

Create a dictionary out of two list after swapping first one? [duplicate]

I am looking to shift positions of integers in a list dependent on a few variables. For the sake of the example I have hard coded numbers into both range() and pop(). How can I declare the result of ...
0
votes
5answers
73 views

How would you pop an element from the end of a list in scala, and add it to the end of another list?

Sorry if this is a dumb question, but I am currently working with two lists, and I wanted to know what was the best way to pop the last element from one list and add it to the end of another list in ...
1
vote
2answers
54 views

why do the assignment statement in cycle only executes once in python

I think it is different from C language habits in mine. I want to excute assignment statement every times, so how to do it? input a = [0,1,2,3,4,5] for i in range(6): b = a print(len(b)) ...
0
votes
0answers
28 views

Is there any difference between del and pop for column in python pandas dataframe?

I have just learned how to work with DataFrame in python's Pandas through an online course and there is this question: "What is the difference between deleting and popping column?" I thought they ...
0
votes
0answers
45 views

How insert to file one column from table in python

I want to copy and write from one file to another a new one column. I have a file: 1 12 13 14 2 22 23 24 3 32 33 34 4 42 43 44 5 52 53 54 6 62 63 64 I need to copy 4 column to new file. In the code,...
0
votes
1answer
45 views

Will it get release when I pop the element in queue? [closed]

I'd rather know How does memory work when I call pop and push ?
0
votes
2answers
38 views

is there a clean, concise way to push/pop bash verbose and xtrace options for a funtion?

(Linux bash 4.1.2) I have a bash function calling another function. The low level function wants to have -xv set for debugging, but I don't want it to mess with the values of x and v in the parent ...
-4
votes
1answer
64 views

In IOS(swift) which one is best to use segue or instantiate? [closed]

We have used instantiate and segue in all view controllers for navigating. But which one in best to increase app performance. And is there any centralised function for push/pop and present/dismisss. ...
0
votes
0answers
19 views

I am not able to use stack and Queue in my code i want to make calculator

I am not able to use stack and queue how use it for my code. plese help me to use it for my calculator i use script engine but it gives error while i call script enginemanger so i not understand which ...
0
votes
1answer
45 views

How to refresh the first screen after poping the second screen from stack react-native-navigation V2

I am using Wix's react-native-navigation V2 in my app for android. When I am pushing one screen and after a pop or pressing back button the previous or first component not rendering and not executing ...
0
votes
0answers
10 views

mail server proxy suggestions

Currently we i have a mail server for example "mail.mydomain.com". This is a dedicated email server and we are looking to replace it. We are considering outsourcing the email management through ...
0
votes
1answer
56 views

When can std::vector::pop_back throw an exception [duplicate]

I am surprised to see that the standard C++ std::vector::pop_back() mutator is not noexcept, and so is permitted to throw exceptions. Surprised, because it is a destruction type operation, which ...
3
votes
3answers
30 views

In Python, are conditions in a loop re-evaluated before a new iteration is executed?

As with regards to python, when it comes to a for loop, will it re-evaluate the upper bound before re-iteration? Say I have the following scenario: def remove(self,list,element): for x in range(...
0
votes
0answers
39 views

std::queue::pop() is not removing the object

I'm writing a basic single CPU scheduler using a FCFS algorithm. For some reason, when I try to pop the burst from the queue, it doesn't actually remove it. Here's the function: void Simulator::...
-1
votes
5answers
30 views

Wrong output of pop function

While using pop function to read a value from the defined list, I'm not getting the desired result. My code: intList = [1, 5, 4, 9, 7, 2, 15] def manipfunc(a): j = a.index(2) a.append(6....
0
votes
0answers
38 views

Push/pop on subroutine in assembly? [duplicate]

I am trying to figure out what the dx value would be after this subroutine is called: ax = 0008, bx = 0006, cx = 0004, dx = 0002 subr: push ax pop bx push cx pop dx add dx,bx ...
0
votes
0answers
18 views

Routing smtp and pop3 past iptables through proxy

following setup: 172.16.0.x 192.168.0.x Client(Outlook) <-----> |eth1 PROXY eth0 | <------> Interwebs How can I manage iptables and squid to accept smtp, pop3, imap ...
0
votes
0answers
17 views

How do SMTP and POP-Server hand over emails?

For studying purposes I am playing with relaying emails via SMTP (in Python). Now, assuming that I have reached the destination SMTP server, how is the handover to the local POP server realized? I ...
0
votes
0answers
33 views

Need help popping item from a list

How do I take the users input (userDelete) and pop or remove their item from the list? I tried writing something similar to the way I add the users guests to the list but it doesn't seem to work. def ...
0
votes
0answers
15 views

How to read all sent items from hotmail by javax.mail?

I find lot of example for read Inbox by pop3.live.com port 995 ... I find lot of example for sent a message by "mail.smtp.host", "smtp.live.com" port 587 ... But I looking for how to read all sent ...
0
votes
1answer
32 views

Modal isn't shown until Datatables JQuery is finished

I'm having troubles implementing Datatables JQuery (version 1.10) to an ASP NET Project. The thing is I'm loading all the necesarry configuration in a Master JS file. I first bind all the data in a ...
0
votes
0answers
38 views

How to add an item that is popped in set?

fringe = set() seen = set() fringe.add((0,0)) fringe.add((1,1)) fringe.add((2,2)) while not fringe: seen.add(fringe.pop()) print(seen) So far what I have learned is pop() function removes a ...
0
votes
4answers
44 views

Why is my attempt to rotate this array in javascript resulting in indexes being skipped

let arr = [1, 2, 3, 4, 5] let steps = 2 let hold = arr let indlength = arr.length - 1 for (let i = indlength; i > indlength - steps; i--) { hold.unshift(arr[i]) hold.pop() } console....
0
votes
0answers
28 views

Singly Linked List Stack Implementation

I am trying to implement a singly linked list stack of type int (E) in java, but having an issue with my pop() method. In this program, pushing and popping need to be done at the beginning of this ...
-2
votes
5answers
35 views

Number(array.pop) Returns Nan in Equations

When calculating, using a number variable taken with array.pop() a NaN is returned. I will be vary grateful if someone can provide explanation. As we see from the example below the type of both ...
-5
votes
2answers
61 views

What is the difference between Pop and Remove? [closed]

What is the real difference between list.pop and list.remove? I noticed that I can only pop Int objects, but is there anything else? Also, which one is more efficient?
0
votes
5answers
183 views

'tuple' has no attribute 'pop'

Im trying to get this code to select a random value from this 'deck of cards', remove the selected 'card' and then append it to used_deck deck = [('ad','ah','ac','as'),('2d','2h','2c','2s'),('3d',...
3
votes
1answer
33 views

When I equate two lists and delete from one, it deletes from the other as well [duplicate]

I am a MATLAB user that is trying to migrate to Python! I have a list say a = [1,2,3] And I want to have another list that has all but the first element of list a. But I want to keep list a for ...
1
vote
2answers
53 views

How to efficiently pop all elements with the smallest key in heapq?

I am working on a simulation experiment and trying to make my code as efficient as possible. In one part, I have a min heap priority queue that I have implemented using heapq module. Throughout the ...
0
votes
1answer
33 views

Why isn't my input key being removed from my dictionary?

Just learning to code on Python so I created this test dictionary. I want the input to be removed from the dictionary, however every time I print the dictionary after the pop function it does not ...
0
votes
0answers
16 views

Use POP mail account with an IMAP server

So I have an old email account from a free-tier provider that I want to keep for one reason or the other but the problem is, that it only allows me to use POP to retrieve my mails. Since I use this ...
2
votes
1answer
54 views

Is it PROPER to use del or pop() for simply removing a value?

If I want to remove a value from a list in python, is it proper to use delor can I just use pop() even though it returns the popped value? I know the difference in how they can be used I just want to ...
1
vote
2answers
26 views

Efficient way of replacing a key in list of dictionary

What is the best list comprehension method of replacing keys with a prefix of "ble_mac_" as "ble_mac" in a list of dictionary? Given List : [{'ble_mac_2': 'DCE83F3BC820', 'location': '818'}, ...
0
votes
1answer
131 views

TypeScript: How to pop selected row from material data table?

I'm using material data table for my angular project. I use a dynamic table, where data gets added and deleted. How do I pop a given row from the data table? Of course pop doesn't work. I also used ...
1
vote
2answers
119 views

How to remove a key/value pair in python dictionary?

Say I have a dictionary like this : d = {'ben' : 10, 'kim' : 20, 'bob' : 9} Is there a way to remove a pair like ('bob',9) from the dictionary? I already know about d.pop('bob') but that will remove ...
0
votes
1answer
42 views

Relisting a stack

class Stack: def __init__(self): self.container = [] def isEmpty(self): return self.size() == 0 def push(self, item): self.container.append(item) def ...
-1
votes
2answers
52 views

Removing string inside a nested dictionary

Full code here: https://drive.google.com/open?id=1iCfj5fLjuD42LLkfhuZoT_7gmXZgHUdk I am making a game and I am stuck at a point where I need to remove an item out of a room when you pick it up in ...
-1
votes
1answer
110 views

Pushing a stack to another stack in python

I´m trying to push the content of stack A to stack B. Also I want to keep the order of both stacks. For this I wanted to use a stack C. I tried to do it in the following function: class Stack: ......
0
votes
1answer
45 views

Python - Print only when something gets added into a list

So I got an idea where you have a list etc of [1,2,3,4,5] and my idea was that incase a number of those gets pop/deleted then it shouldn't print. let's say etc. we remove number 3. In that case our ...
1
vote
1answer
37 views

Modifying size of iterable during for loop - how is looping determined? [duplicate]

For loops are mentioned in two places in the python docs (that I have found). I did try to find the source code for for loops in cpython but to no avail. Here's what I'm trying to understand: I had ...
0
votes
0answers
39 views

Redis RPOP and LPOP during Redis Connection Timeout Exception

i experienced an exception dealing with my REDIS system. Basically i have a List stored on redis and 2 clients popping items from it using a RPOP. What happened can be summorize like this: 0 -LIST ...
0
votes
1answer
36 views

C# how to use a Stack's Pop method in another method

I am attempting to write a program for an assignment that Pops and adds the first 2 items in a Stack. The program has a Pop method, but I would like to know how to call the method within the Add ...
-1
votes
1answer
59 views

STL queue pop confusion

I'm a little confused as to how the queue pop functionality works, I suppose. Firstly, I'm not sure how queue is implemented, whether it's linked list or queue. But if it's a linked list, pop() would ...
-1
votes
4answers
63 views

Python - Edit a list using pop - Pop is out of range

This is my code so far def filter_list2(elements): for a in elements: if a == (int(a) or float(a)) and a >= 1 and a < 50: elements.append(a) else: ...
1
vote
1answer
239 views

Back to previous route in flutter

First of all, I'm not setting my routs in the MaterialApp like this new MaterialApp( home: new Screen1(), routes: <String, WidgetBuilder> { '/screen1': (BuildContext context) => new ...
0
votes
1answer
97 views

Evaluating an expression using a stack (C)

I need to make a stack that evaluates expression in the same way it would in racket. Here is an example of working output: Please enter the racket expression to be evaluated: (+ 3 (* 2 20)) +--TOP ...
0
votes
0answers
19 views

Back button / Navigation controller

App design I have app with top and bottom menu, how you can see on enclose picture. Message in top menu and gallery and blog in bottom menu has two options. If last view page from message VC/...
0
votes
2answers
25 views

Popping from a list & Subtracting from a Function (Hangman)

I've am having trouble with the last two specifications of this program. 1) Guesser initially gets 6 misses (7th strike and they are out). If they win that game, they play again, but with only 5 ...
-2
votes
1answer
44 views

Confouse about big-O Notation for this source code

Can anyone help me to count the algorithmic complexity of my source code using Big-O notation? This program is about putting the NIM(Student Identity Number) into stack. I still don't know how to ...

http://mssss.yulina-kosm.ru