pty 882 Posting Pro

Prefixing tables with tbl is pointless and makes reading the SQL much more difficult.

Line 2 looks wrong, you can't comma separate join criteria, you should use and instead (and maybe add brackets for clarity).

Now, describe in one sentence the data which you want to retrieve.

pty 882 Posting Pro

I'm a bit late but rather than VMs I'd recommend Docker with Kitematic.

From the UI you can search for images and in a couple of clicks have the latest and greatest pulled and running locally. Operating systems, databases, programming environments, forums, bug trackers, infrastructure, CI, you name it, there are images for it.

There's a video with a brief introduction here. At the nine minute mark he demonstrates mapping drives, which will give you what you need from a playground point of view.

pty 882 Posting Pro

I think Social Bookmarking services are a niche trend at best. They were very popular in the early-mid 2000's but the need for them was erroded from multiple angles.

Chrome came along with its excellent browser syncing, which in turn forced Firefox to up its game and follow suit. This negated the 'access my bookmarks from anywhere' angle, as once you're signed into your browser, you have full access to not only your bookmarks but also your logins, passwords, sesssions etc.

Secondly, sites like Digg, Reddit and even Pinterest filled the 'sharing cool stuff' niche.

Here's the trend for Delicious over the last 13 or so years.

Screen_Shot_2017-05-17_at_11_40_06.png

Screen_Shot_2017-05-17_at_11_49_21.png

pty 882 Posting Pro

Don't worry, my program does this. Thank you for your concern.

pty 882 Posting Pro
pty 882 Posting Pro

Here's how I'd do it (and have done it for years). It's the canonical, accepted answer for Linux too.

The SSH program has support for 'shortcuts' built in, you simply need to add the hostnames (or aliases) in your ~/.ssh/config file.

So, in my config file, if I have the following entry:

# Github
host github
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_rsa_work

Then, on the command line I simply type ssh git and hit tab a couple of times, and all of the entries that start with git automatically appear for selection/autocompletion:

Screen_Shot_2017-05-06_at_11_53_14.png

Note that in the config file I'm specifying which private key (IdentityFile) to use for that host, SSH will use this whenever connecting to this specified host. Previous commenters have already gone through how to set up key pairs; this is definitely the best and most secure way of connecting to remote machines. Ideally you should turn off password based login and rely entirely on a key pair.

If you really want desktop shortcusts, just create a bash script (and make sure it's executable) with the .command suffix. However, with nice tab completion on the command line it's quicker and easier (imho) to just use the built-in command.

Edit: here are Digital Ocean's instructions for setting up SSH keys. They are very thorough and generic enough to use anywhere.

cereal commented: +1 +14
pty 882 Posting Pro

There are plenty of esoteric programming languages, some of which have been around for a long time.

I'm not sure actually teaching students syntax is too important, but demonstrating that there are many languages each with their own strengths and weaknesses is. Readability and succinctness are definitely advantages.

Dani commented: Great link that explains what I was trying to say perfectly = +16
pty 882 Posting Pro

You can't have it because immediately after assigning it you're overwriting the value.

I believe you can fix it by turning your computer upside down so the first line runs after the second. Hope this helps.

rubberman commented: pty, you are evil! :-) +14
pty 882 Posting Pro

Without original content you'll struggle. And high quality original content, believe it or not, takes time and effort (or time and money!).

Also, blocking your site up with a non closeable image on mobile is not a good sign.

pty 882 Posting Pro

Has anyone tried Mastodon yet? For those who don't know it's a federated, distributed and (currently) technology-orientated social network (well, rather a group of interoperable social networks) that's fully open source and ad-free. I've been impressed so far but as with every new network, whether it flies or not will depend on how many people join, contribute and keep the ball rolling.

pty 882 Posting Pro

Perhaps try a slightly different workflow. If your code is transpiled you'll see these errors in the console straight away. Look at Typescript, a typed superset of JavaScript, or Babel, which allows you to write the latest version of JavaScript (es6, es7) but serve es5.

pty 882 Posting Pro

Your regexp should probably be [\*]?[ABMQRWY][A-z0-9]{4}235, see this example.

pty 882 Posting Pro

You can do it using border-radius (here's an example) but it's not guaranteed to always be circular. If you change the 1 to 100,000 you'll see what I mean.

pty 882 Posting Pro

You're calling worldmapA() but your function is called worldMapA().

Chrome dev tools will help you in situations like this.

Screenshot_from_2017-04-14_13-18-12.png

pty 882 Posting Pro

Wikipedia support Latex notation which shouldn't require any uploading on your behalf.

pty 882 Posting Pro

I am not a lawyer, but I believe that if you 'port' software from one language to another, you're creating a derivative work and the original licence applies. However (from Wikipedia):

The code base of Netlib was written at a time when computer software was not yet considered merchandise. Therefore, no license terms or terms of use are stated for many programs. Before the Berne Convention Implementation Act of 1988 (and the earlier Copyright Act of 1976) works without an explicit copyright notice were public domain software. Also, most of the Netlib code is work of US government employees and therefore in the public domain.[3][4] While several packages therefore don't have explicit waiver/anti-copyright statements, for instance the SLATEC package has an explicit statement.

As you have created the ports of libraries that are in the public domain, I'd suggest that a Creative Commons licence makes most sense. I noticed on several netlib pages that attribution is requested, so CC-BY might be most suitable (crediting both the original authors and you), or CC-0 if that's not required.

pty 882 Posting Pro

Plus, the CSS is totally different between the first and second fiddles. Posting examples with minimised code is a bad idea, it's clearly broken because while it looks like Bootstrap 2 the fonts aren't applied in the preview window. Total failure.

pty 882 Posting Pro

It's unresolved because you're a chump. I'm not here to do your work, resize your images or craft your stylesheets.

You asked a question, I answered it; I subsequently ignored the request for further help via PM. Your posting history is fun of similar tactics. Maybe you should rethink your career.

pty 882 Posting Pro

Did you actually read the source? Assuming you want to replace the icon-cog:

<div class="icon-cog box-icon"></div>

Replace the contents of the div with an img tag:

<div class="box-icon">
    <img width="60" height="60" src="http://i.imgur.com/vPkeDtI.png"/>
</div>

Results in beautiful images whever you like.

Screen_Shot_2017-03-25_at_14_38_25.png

rproffitt commented: Good example. +12
newbi11 commented: Thanks a lot +2
pty 882 Posting Pro

I'm currently writing a Markdown powered CMS, which adheres to Commonmark. Their help page is quick, easy and to-the-point.

pty 882 Posting Pro

If you plan on writing in English, I'd master it first.

Yes, I know you're actually linking to that site for SEO purposes. Kind of lame at the best of times.

pty 882 Posting Pro

If you did that it would no longer be responsive! (actually, the only way it would 'respond' would be if you're using a tablet/phone and rotated it)

pty 882 Posting Pro

The XPath works, your PHP looks wrong.

$xmllint --xpath "/solar/solardata/solarwind|/solar/solardata/magneticfield" solarxml.xml

<solarwind>511.8</solarwind><magneticfield> -0.7</magneticfield>

I assume you didn't read the documentation. I don't know PHP, there may be preferred libraries for this type of thing.

pty 882 Posting Pro

XPath /solar/solardata/solarwind|/solar/solardata/magneticfield yields:

<solarwind>509.4</solarwind>
<magneticfield>  1.9</magneticfield>
pty 882 Posting Pro

Yes, that sounds like a good use case and it's quite easy to set up a reasonable demo in Neo4J.

create
    (Frank:Member {name:'Frank'}),
    (Julian:Member {name: 'Julian'}),
    (Amanda:Member {name: 'Amanda'}),
    (Claire:Member:Admin {name: 'Claire'}),
    (Susie:Member {name: 'Susie'}),
    (Dolly:Member:Admin {name: 'Dolly'}),

(Frank)-[:HAS_CHATTED_TO]->(Amanda),
(Claire)-[:HAS_CHATTED_TO]->(Frank),
(Amanda)-[:HAS_CHATTED_TO]->(Susie),
(Susie)-[:HAS_NOT_CHATTED_TO]->(Dolly),
(Dolly)-[:HAS_NOT_CHATTED_TO]->(Frank),
(Frank)-[:IGNORES]->(Susie),
(Dolly)-[:IGNORES]->(Julian),
(Julian)-[:HAS_CHATTED_TO]->(Amanda)

Which results in this graph:

neo4j graph

Simple queries are straightforward, I'm no expert though and combining multiple conditions baffles me.

match (n:Member)-[r:HAS_CHATTED_TO]-(m) where n.name='Frank' return n as Frank,r,m

Results:

+---------------------------------------------------------------------------+
| Frank                  | r                      | m                       |
+---------------------------------------------------------------------------+
| Node[25]{name:"Frank"} | :HAS_CHATTED_TO[24] {} | Node[27]{name:"Amanda"} |
| Node[25]{name:"Frank"} | :HAS_CHATTED_TO[25] {} | Node[28]{name:"Claire"} |
+---------------------------------------------------------------------------+
2 rows
17 ms

Compiler CYPHER 3.1

Planner COST

Runtime INTERPRETED

+------------------+----------------+------+---------+------------------+----------------------------+
| Operator         | Estimated Rows | Rows | DB Hits | Variables        | Other                      |
+------------------+----------------+------+---------+------------------+----------------------------+
| +ProduceResults  |              1 |    2 |       0 | Frank, m, r      | Frank, r, m                |
| |                +----------------+------+---------+------------------+----------------------------+
| +Projection      |              1 |    2 |       0 | Frank -- m, n, r | {Frank : n, r : r, m : m}  |
| |                +----------------+------+---------+------------------+----------------------------+
| +Expand(All)     |              1 |    2 |       3 | m, r -- n        | (n)-[r:HAS_CHATTED_TO]-(m) |
| |                +----------------+------+---------+------------------+----------------------------+
| +Filter          |              1 |    1 |       6 | n                | n.name == {  AUTOSTRING0}  |
| |                +----------------+------+---------+------------------+----------------------------+
| +NodeByLabelScan |              6 |    6 |       7 | n                | :Member                    |
+------------------+----------------+------+---------+------------------+----------------------------+

Total database accesses: 16
pty 882 Posting Pro

A graph database alone isn't the right choice for a chat application. A message would be represented as an edge between two nodes (people) and too many edges will hurt performance.

Storing the actual social network portion of a chat app in one makes a lot of sense, though. It's the perfect use case for a graph database.

Something like OrientDB might make more sense. There's even a chat program in the use cases section of the documentation.

pty 882 Posting Pro

If you want to play 3d games or develop with Cuda/OpenCL, very. For browsing the web and 'normal' development, not so much.

Neither my MBP and XPS have one, both are lightweight and quiet, and both cope fine with a big external monitor.

Also, if you plan on running Linux on your laptop, drivers become an issue. Especially if your machine supports switching between onboard and GPU modes.

pty 882 Posting Pro

@pty: Good try, but it was a refurb (and I wanted new, the two year warranty at John Lewis is always hard to ignore), there was only one of them (I needed two) and they don't have any stock :-)

Haha yeah, it was such a good deal it was snapped up in hours

I'd have a higher-specced refurb over a brand new lower-spec machine every day of the week. Granted the 2 year warranty from John Lewis is a nice extra (they sell refurbs with the 2 year warranty too, by the way!)

pty 882 Posting Pro
pty 882 Posting Pro

I'd try somewhere like Microcenter, if you look at their clearance/open box section on the website there are some deals to be had. I don't know what your budget is, but this for $791 looks like it'll fit the bill. You'd have to see what's available in your local store though!

There seems to be a bit of anti-Dell rhetoric in here, but the XPS range is good, I prefer my XPS 13 over my MBP in some ways.

pty 882 Posting Pro
pty 882 Posting Pro

True, and if she wants to continue and learn then fair play, and I hope she manages to build something great.

However, she's using a discontinued tool that outputs unmaintainable HTML, and developing her site clearly isn't her goal; letting people know about her jewelry (which looks fantastic, by the way Sanda) is.

Plus, as there's a products tab on her site, one would expect that some kind of 'web shop' is on the radar. That won't be doable in Webplus, and it's not the easiest thing to implement from scratch at the best of times.

pty 882 Posting Pro

I'd suggest using something like SquareSpace for this kind of site, rather than attempting to build it yourself. It has an e-commerce module built-in and plenty of easy templates to choose from.

A note unrelated to the original question, when at 100% zoom, I can only see 2/3 of the page, I need to scroll right to see the whole thing (or zoom out to about 80%).

pty 882 Posting Pro

I've been following this with some interest. Bad practice to end with a verb?

I think the distinction is between an API and a web app. In a web app, /widgets/123/edit (obtained via a GET) should contain a form that allows you to edit Widget number 123. Submitting the form should send aPATCH to /widgets/123.

In the case of an API, you don't need an edit form so you can omit verbs from the route entirely.

pty 882 Posting Pro

It turned out that the load balancer was blocking non-GET/POST requests. It wasn't an Nginx problem after all!

This doesn't suprise me at all! :)

I actually imitated the /users/~ endpoint after LinkedIn's API, which does:

Yes, but LinkedIn's API is read only.

If Dazah's API allows you to update your profile then it definitely makes sense to split it. Allowing PUT or PATCH to work if the :user_id param is ~ but not if it's anything else adds inconsistency to the API and will add to the complexity either in your code or in your documentation.

Also, because the returned data probably differs despite having the same endpoint (as you expect to see a bit more data on your own profile compared to someone else's), the API in general is less predictable than if you used two disparate endpoints for interacting with profiles generally and viewing/modifying your own.

pty 882 Posting Pro

True, but the requirements he is looking to implement exist in most clients anyway (definitely Gmail, Mail.app and Outlook 365, but you'd need to use categories/labels instead of a new folder per subject).

pty 882 Posting Pro

Of course it's possible, but just do everyone (yourself included) a favour and use an existing client. What advantage is there of having your own? Written by a non-expert, without having thousands (or millions, billions) of hours of hands-on testing, your client is likely to be pretty poor.

diafol commented: Most definitely +15
pty 882 Posting Pro

Have you tried explaining the slow statement?

This might work:

explain insert into articles_read
set
    member_id = 314062,
    article_id = 507257
on duplicate key update
  timestamp = now();

Otherwise, try show profiles. It might give a hint as to why it's slow.

pty 882 Posting Pro

While yes, I'm annoyed by spammers, the notification problem exists for legitimate posts too. It just so happens that this chap was top of the list!

rproffitt commented: I think we look the other way since our hero has been busy busy. +0
pty 882 Posting Pro

Sure, here you go.

You need to crawl, walk and run before you start the 110m hurdles.

pty 882 Posting Pro

It would appear that too many notifications are added to the feed for certain events, making it difficult to sort the wheat from the chaff.

Take the example of this annoying spammer creating a post:

Screen_Shot_2017-01-26_at_15_16_46.png

Aside from the fact he's a waste of oxygen, that's more than one whole screen of notifications for a post creation and quick edit (less than a minute after posting). Also, I don't see any replies, so perhaps the "replied to a post" notification is superflouous. Perhaps these could be condensed; do we need to know who started watching each post - it might make more sense to display that on the post page; "being watched by..."

rproffitt commented: That and now I want a Black Mirror "Block" mode. +0
pty 882 Posting Pro

What if I want to modify the third party module? Where can I find it?

pip show unidecode

Metadata-Version: 2.0
Name: Unidecode
Version: 0.4.20
Summary: ASCII transliterations of Unicode text
Home-page: UNKNOWN
Author: Tomaz Solc
Author-email: tomaz.solc@tablix.org
Installer: pip
License: GPL
Location: /usr/local/lib/python2.7/site-packages
Requires:
Classifiers:
  License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
  Programming Language :: Python
  Programming Language :: Python :: 2
  Programming Language :: Python :: 3
  Topic :: Text Processing
  Topic :: Text Processing :: Filters
Entry-points:
  [console_scripts]
  unidecode = unidecode.util:main

And, if the only way is installing the module, why should a software provide the module files? Does it mean there is a way of installing a module when you have its code?

The answers to these questions and more can be found in one of thousands of Python tutorials, manuals, books and instructional videos online.

pty 882 Posting Pro

D3 isn't the correct choice for in this situation; it's aimed at visualisation (as per the request in the original post). If you want to interact with scales by dropping different-weighted balls on them in anything but the simplest of interfaces, you need a physics engine. Matter-JS provides this and makes it really simple to get fantastic results.

gentlemedia commented: Wow! matter.js is cool :) +6
pty 882 Posting Pro

Regarding PUT and PATCH, I looked and looked, and was unable to find a working tutorial on how to implement them in Nginx. Everything I read said that Nginx does not have support??

Hmm, @cereal's script works for me using NGINX 1.10.2 with a pretty standard config and PHP 7.0.14

http --form PUT http://localhost:8080/test.php msg="hello" --verbose
PUT /test.php HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 9
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Host: localhost:8080
User-Agent: HTTPie/0.9.2

msg=hello

HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/html; charset=UTF-8
Date: Thu, 26 Jan 2017 10:07:03 GMT
Host: localhost:9000
Server: nginx/1.10.2
Transfer-Encoding: chunked
X-Powered-By: PHP/7.0.14

Method PUT
Array
(
    [msg] => hello
)
pty 882 Posting Pro

So basically, you probably want to store the time that you serve the question to them and the time at which they submit an answer. You can determine how long it took them to answer by subtracting the former from the latter.

pty 882 Posting Pro

I guess my question to you is, from a routing perspective, why would /users/([0-9]+) (essentially users/ followed by a positive integer) be confused with /users/~ (users/ followed by a tilde), but not be confused with /users/searches or /users/nearby??

I'd say in a 'pure' world, yes. If, as a user, I can only update their own profile (and not anyone else's), and they only have one of them, why is /users in the path at all? Also, Unix folk will know that ~ is 'home', but other people wont. The URL, which is a legitimate part of the UI, isn't as descriptive or friendly as it could be.

It also means that you need to pay extra attention to the order in which your routes are applied (same applies to /users/searches and /users/nearby). This can be a bigger headache if you're using slugs; what happens if a user called 'searches' registers? It's very simple with a few (or a few dozen) endpoints. I've seen some monstrosities in the past and ensuring the ordering is correct becomes very complicated indeed.

There's no right and wrong here. If you're happy with the /users/~ route and there's nothing that will have an impact on its functionality, go with it. From the consumer point of view, so long as it's obvious what's going on and there's some documentation (or better yet, a client library that does it for you), it should be fine.

pty 882 Posting Pro

In Chrome, open the dev tools and click "Toggle Device Toolbar". In the toolbar's dropdown, you'll see entries for common devices (Nexus 5X, Nexus 6P, iPhone 5, iPhone 6, iPad and iPad Pro).

pty 882 Posting Pro

For Unix-like system users, there are quite a few options here. Classically, find (super super powerful but doesn't use any index) and locate (uses an index but has fewer options for searching).

However, 99% of the time I know roughly where the file is; it's usually in the project I'm working on. FZF. Here it is in action

pty 882 Posting Pro

That's definitely possible in d3, but d3 is more for visualisation than interactive 'physics' stuff, which sounds like what you're after.

Perhaps something like matter-js would be more suitable.

diafol commented: d3 +15
pty 882 Posting Pro

Regarding PUT and PATCH, I looked and looked, and was unable to find a working tutorial on how to implement them in Nginx. Everything I read said that Nginx does not have support??

NGINX definitely supports them, as far as I know you don't need to enable anything. It should just work.

I just wrote (well, copied, pasted and amended) a tiny app in PHP (the first time I've ever tried PHP!) and it handled PUT like a boss.