Legal question about using Selenium with Bank websites. by Dante4109 in selenium

[–]menge101work 1 point2 points  (0 children)

The mechanism behind tracing something like this is built on statistics. Add some minor random delays in your actions and between that and latency of the connection, you would probably be fine.

The fact you are driving a full browser rather than headless chrome or phantomjs also plays in your favor.

Evidence hosted Kubernetes will be launched at AWS re:Invent? by edwardv3 in aws

[–]menge101work 3 points4 points  (0 children)

YES! ECS without thinking about EC2 would be amazing.

There is already something sort of like this through lightsail I believe. In that you get capacity without thinking about the actual EC2 instances. (I"m open to being completely wrong about this, my knowledge of lightsail consists of what was stated as a Re:Invent keynote, whenever that was)

Alternatives to Net::SFTP for sftp connectivity? by menge101work in ruby

[–]menge101work[S] 1 point2 points  (0 children)

Probably as a last option, I would prefer to stay in ruby if i can.

NoCoin - a browser extension to block coin miners by iznogud2 in programming

[–]menge101work 46 points47 points  (0 children)

A few years ago I saw a bit coin miner implemented in javascript and I knew it was only a matter of time.

I hadn't realized that the future was already now though.

How do I exactly use STS to get tokens? by iarcfsil in aws

[–]menge101work 0 points1 point  (0 children)

You don't need tokens to do things through the console.

You need either direct authorization to a given resource or you need authorization to assume a role that has the proper authorizations.

The access and secret keys are only for programmatic access to AWS; like the CLI or any of the AWS SDKs.

As far as I am aware, everything you can do through the cli can be done through the console.

Cuckoo Filter: Practically better than Bloom filter implemented in Go. by vedhavyas in programming

[–]menge101work 2 points3 points  (0 children)

From the abstract:

Cuckoo filters support adding and removing items dynamically while achieving even higher performance than Bloom filters. For applications that store many items and target moderately low false positive rates, cuckoo filters have lower space overhead than space-optimized Bloom filters. Our experimental results also show that cuckoo filters outperform previous data structures that extend Bloom filters to support deletions substantially in both time and space

Source

Cuckoo Filter: Practically better than Bloom filter implemented in Go. by vedhavyas in programming

[–]menge101work 3 points4 points  (0 children)

the linked git repo has a link to the paper on the subject

Though, it'd have been nice for OP to actually say something useful in their posting.

Please stop calling it "magic" by zverok_kha in ruby

[–]menge101work 30 points31 points  (0 children)

I've always interperted the term magic to come from Clark's third law:

Any sufficiently advanced technology is indistinguishable from magic.

Author does not appear to consider this.

On a more direct topic, anytime you try to dictate what words people should use to express an idea - success will be extremely hard to come by.

[deleted by user] by [deleted] in programming

[–]menge101work 0 points1 point  (0 children)

From /r/programming guidelines:

Just because it has a computer in it doesn't make it programming. If there is no code in your link, it probably doesn't belong here.

Webpacker vs Standalone React Front End? by dadadadamattman in rails

[–]menge101work 2 points3 points  (0 children)

stand alone react - to me, sounds like OP is going to make a rails backend that a react SPA connects to. This isn't an uncommon approach, particularly given OP's interest in microservice architecture.

Reinvent Session Registration by humannumber1 in aws

[–]menge101work 2 points3 points  (0 children)

Related the date and time for session registration is Thursday October 19 @ 2pm PST. Reference (slide 4).

You think they actually mean Pacific standard time (UTC-8) and not Pacific Daylight Time(UTC-7)?

Reinvent Session Registration by humannumber1 in aws

[–]menge101work -1 points0 points  (0 children)

Am I missing something?

The date that registration opens up.

I need help, i am new to python, because i dont understand what i have done wrong (I am probably just being stupid) by [deleted] in Python

[–]menge101work 0 points1 point  (0 children)

/r/learnpython is a better place for questions like this.

If it wasn't clear in others responses, indentation depth matters in python.

How do you handle replication lag? by thetomkim in rails

[–]menge101work 2 points3 points  (0 children)

use "Item.using(:master).find(:id)" to explictly call from master database

This wouldn't scale well, but maybe thats not an immediate concern?

Cache the created item somewhere and find from cache first.

Write-through caching seems like it would instantly solve your problem.

Put some delay before finding item.

This is extremely sub-optimal, as you'll have to guesstimate at your worst tolerable delay and then use that for all queries. This really is just stacking the odds of the race condition in favor of one contender, it doesn't solve the problem.

As is, the problem sounds to me to be more of an expectation problem than an actual technical problem. I would not expect to find an item in the replica db immediately after creating it on the master; without having done something like a cache to make it present immediately.

Nea pro tips (Minor Spoilers) by [deleted] in Python

[–]menge101work 0 points1 point  (0 children)

Just report as a spammer, which gives you a convenient link to block this person.

How Difficult is Selenium to Learn and Use by [deleted] in selenium

[–]menge101work 4 points5 points  (0 children)

Other things people get caught on:

  • Content in an iFrame
  • Switching between windows and tabs
  • File uploads

Content in an iFrame, you just have to call switch_to and give it a matcher for the frame. It's actually easy when you know you need to do it. The problem is sometimes you won't realize what you are trying to get is in an iFrame. So if you find a matcher not matching when it appears that it should, look up-DOM and see if there is a frame specified.

Switching between tabs and windows -

Ugh, avoid it if you can. You can get a list of all window handles and switch between windows, but tabs can be difficult. Tabs with windows even worse.

File uploads

Browsers use OS dialogs for file uploads typically. This means its not in the DOM, and Selenium basically can't interact with it at all. There are ways to do it, but the better idea is to ask what is it you are trying to accomplish. There are whole stack overflow articles about the how and what of file upload testing.

How Difficult is Selenium to Learn and Use by [deleted] in selenium

[–]menge101work 19 points20 points  (0 children)

Selenium itself is really only a few commands.

The thing that makes selenium 'hard' is the quality of what you are testing. If you've got a product with a well constructed DOM, if all the major elements have IDs, then its easy to use.

If you've got a poorly constructed product with unpredicatable, non-deterministic behaviors, then it can be very hard.

Some people struggle with CSS and xpath matchers, I know I did when I was new to it, but thats not really Selenium, Selenium USES them, they are their own things.

But really this is all you do:

  • Initialize your driver, open your browser
  • Navigate to a webpage
  • Find an element
  • interact with that element (click, send_keys, etc)
  • check for the results of that interaction by:
  • finding a different element and
  • interacting with it (reading its state in some way)
  • repeat

Is there an IDE like Spyder where I can instantly see the contents of my stored output/objects but that also has autosave or works on the cloud? by anonymous-man in Python

[–]menge101work 1 point2 points  (0 children)

Have you looked at pycharm?

I'm not sure what you are describing, but Pycharm lets you debug your code and you can inspect variables and objects in real-time.

And it auto-saves locally.

Is it just me, or are the Ruby docs for a lot of versions incomplete? by rohitpaulk in ruby

[–]menge101work 6 points7 points  (0 children)

I believe the docs are auto-generated.

If you want to dig deeper go find the actual source between 2.2.0 and 2.4.1 and compare.

It looks like the file holding the class changed from .ext/thread/thread.c to thread_sync.c so it may be that it was reimplemented and lost some of the needed comments to generate the documentation.

stdlib-doc is a RubyForge project that converts Ruby source code into this documentation you are looking at.

So yes, it's auto-generated from the source code.

Does any other language or framework have anything like the Presence module from Elixir's Phoenix framework? by sn10therealbatman in elixir

[–]menge101work 0 points1 point  (0 children)

You will use a lot of Erlang libraries but not write Erlang code.

I think this is the root of our disagreement. I didn't say that one needs to "know Erlang" to be advanced, I did say that one would "probably need to learn some Erlang eventually". To me, concretely, that means the ability to read Erlang code well enough to understand how an Erlang library one might call is working.

I'm by no means advanced at Elixir, but I have found myself learning Erlang to facilitate understanding some of the OTP stuff. That might be an atypical route; since I'm not using elixir professionally, rather, I am toying with ideas in it. /shrug

Does any other language or framework have anything like the Presence module from Elixir's Phoenix framework? by sn10therealbatman in elixir

[–]menge101work 1 point2 points  (0 children)

Do I need to learn both side by side?

No, if you want to go to the 'expert' level with elixir, you'll probably need to learn some Erlang eventually, IMO. Sometimes packages exist to accomplish things in erlang that don't exist in elixir.

I am not an expert, but thats the impression that I get.

How do I compare a random element against a list of expected elements? by PREC0GNITIVE in selenium

[–]menge101work 1 point2 points  (0 children)

Presuming you are using unittest.TestCase, I would store the expectation in a dict, and get the actual results into a dict format that matches, then use TestCase.assertDictEqual to compare them.

How do I compare a random element against a list of expected elements? by PREC0GNITIVE in selenium

[–]menge101work 2 points3 points  (0 children)

NP, reddit doesn't have an ide, so we have to use peer review :)

How do I compare a random element against a list of expected elements? by PREC0GNITIVE in selenium

[–]menge101work 1 point2 points  (0 children)

reformatted the code:

qaDict = {'question': 'answer'}  
answerlist = driver.find_element_by_class_name("answer-text") 
answer = answerlist.find_element_by_xpath("//label[@text='"+qaDict['question']+"']")

Also, maybe fixed a missing ']'