Community Member
Member Avatar
pty 126 Replied To a Post in Array 2 Variable
Article by phphp in Web Development
php
[Here you go](http://php.net/manual/en/class.dateinterval.php) Reply by pty
Member Avatar
pty 126 Replied To a Post in page skips
Article by Sandra_9 in Web Development
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 … Reply by pty
Member Avatar
pty 126 Replied To a Post in page skips
Article by Sandra_9 in Web Development
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 … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
> 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 … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
> 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 … Reply by pty
Member Avatar
Article by gkumaravel in Web Development
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). Reply by pty
Member Avatar
Article by gkumaravel in Web Development
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. Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in MySQL query taking too long
Article by Dani in Databases
Have you tried `explain`ing 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](https://dev.mysql.com/doc/refman/5.7/en/show-profiles.html). It might give a hint as to why it's slow. Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in Slightly cluttered notifications
Article by pty in DaniWeb Community Feedback
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! Reply by pty
Member Avatar
pty 126 Replied To a Post in Third party modules in Python
Article by pywriter in Software Development
Sure, [here you go](https://www.python.org/about/gettingstarted/).

You need to crawl, walk and run before you start the 110m hurdles. Reply by pty
Member Avatar
Sponsored pty 126 Created Slightly cluttered notifications
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](/attachments/large/0/70f9ca54d7b9fe3b576a82ab688e0d74.png "align-center")

Aside from the fact he's a waste of oxygen, that's more than one … Article by pty in DaniWeb Community Feedback
Member Avatar
Sponsored pty 126 Replied To a Post in Slightly cluttered notifications
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](/attachments/large/0/70f9ca54d7b9fe3b576a82ab688e0d74.png "align-center")

Aside from the fact he's a waste of oxygen, that's more than one … First Post in Article by pty in DaniWeb Community Feedback
Member Avatar
pty 126 Replied To a Post in Third party modules in Python
Article by pywriter in Software Development
> 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 … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in Data visualisation library or software
Article by Violet_82 in Web Development
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](https://en.wikipedia.org/wiki/Physics_engine). Matter-JS provides this and … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
> 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](https://gist.github.com/peteryates/3ceb96e4a10b7c742a36295e4f713ea2) and PHP … Reply by pty
Member Avatar
Article by bharathi_2 in Web Development
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. Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
> 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, … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in Responsive Website
Article by davy_yg in Web Development
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). Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in Alternative to Windows Indexing
Article by Reverend Jim in Hardware and Software
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 … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in Data visualisation library or software
Article by Violet_82 in Web Development
That's definitely possible in [d3](http://codepen.io/snoopjedi/pen/GjgaAA), but d3 is more for visualisation than interactive 'physics' stuff, which sounds like what you're after.

Perhaps something like [matter-js](http://brm.io/matter-js/) would be more suitable. Reply by pty
Member Avatar
pty 126 Gave Reputation to Birhanu_1 in PostgreSQL to WXpython
how to fetch data from PostgreSQL to WXpyhon GUI to automaticaly open the next processe ? First Post in Article by Birhanu_1 in Community Center
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
> 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 … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
Sorry if I didn't make it clear. When I refer to 'additional logic', I mean checking that the API's response is suitable for the user making the request.

There are two scenarios in your example, **generally listing and viewing user profiles** and **viewing and modifying your own profile**. It makes … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
Incidentally, in my previous post the profile's `POST` line should have been a `PUT` or `PATCH`; you'd assume that every user has one and shouldn't be able to create another.

> The difference, I guess, is that users/1 returns the results as a collection while users/~ returns a singular resource, … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
For the most part I'd say it looks ok.

The tilde in some of the currently-OAuthed user routes doesn't 'feel' right to me, though. The current user (or *you*), and the current user's CV (*your CV*) are both singular resources; you already know their ID if they are authenticated so … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in Data visualisation library or software
Article by Violet_82 in Web Development
I'm not sure exactly what you'll be visualising, so it's difficult to suggest anything, but I'm sure that [d3](https://d3js.org/) will have you covered. It's immensely powerful and incredibly well-designed. Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in Shared editor window??
Article by Dani in DaniWeb Community Feedback
I use snippets heavily. For non-work stuff, Github's [gists](http://gist.github.com/) are perfect. You can [add multiple files](https://gist.github.com/peteryates/d859f6ed14f9b7d13515) to a single gist (which would help if some of the code you're pasting is spread across a model, controller and view), and everything's syntax highlighted.

Github allows [gists to be embedded](https://help.github.com/articles/about-gists/). Perhaps this … Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in MySQL query taking too long
Article by Dani in Databases
So two things are happening here, first you're searching for a row and if you find one, you're updating the timestamp (and if not, doing an insert). It's unlikely that it's the insert that's slow, so let's check the query first:

explain select *
from articles_read
where member_id = 314062 … Reply by pty
Member Avatar
pty 126 Replied To a Post in Retrieving Record
Article by haria_kishore in Databases
select * from company where has_made_profit_every_year_for_the_last_five_years = 1;

Hope this helps. Reply by pty
Member Avatar
Sponsored pty 126 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
To clarify, I think @jkon was making a joke. SOAP was a nightmare at the best of times and unusable at the worst, and I'm glad I've not had to deal with WSDL in years.

Keeping an interface simple, RESTful and documenting it with Swagger or Stoplight is a much … Reply by pty