Reputation
1,219
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
4 6
Newest
 Yearling
Impact
~47k people reached

  • 0 posts edited
  • 4 helpful flags
  • 2 votes cast
Feb
2
awarded  Yearling
Jan
14
comment how to unit test constant that define an implementation detail?
If you export the expire date you can make a relevant check. Like http has an expires header. You can check if that date is enough in the future.
Dec
9
answered What's the best way to return an array as a response in a RESTful API?
Nov
25
comment Workflow for chains of dependent pull requests to projects that depend on other projects
What you also sometimes see is just a github fork being used during the time that the library is not updated. Then later when updated it's switched back to the original source.
Nov
9
comment Maintain hundreds of customized branches over master branch
First get more insight: Let developers make a diff between the current version and the customized branch. So you at least know what differences there are. That list allows you to see where you can win the quickest reducing of branches. If 50 have custom fieldnames just focus on that and it will save you 50 branches. Then look for the next one. You might also have some which are not restorable, but then at least the amount will be lower and it won't grow further when you get more clients.
Nov
3
comment must all urls for a resource be same
If you use something like hateos you could return a list of links and maybe the date and title at: /api/companies/{companyName}/posts which would link to: /api/posts/{postId}. The the list of posts for a company is a resource. And the post itself is another resource.
Oct
21
comment Is it OK to use mongodb's query object format as a parameter for my api?
Check out meteor.com/mini-databases meteorpedia.com/read/Understanding_Meteor_Publish_and_Subscribe which is doing that. Works very fine in practice and is secured. It can be a great example of how to define which data is allowed and how to scope that data with publications.
Apr
16
comment How deeply can a JSON object be nested?
If you get so deep many times you are actually dealing with different data. For example: Graph data or time series data. There are better formats to store that and that's about the only reason why you might run into this issue.
Apr
16
comment Web developer sending port in web service from server to client
The port is integral part of the address of your service. You are asking: If I know the street how can I find the house number? In general you cannot or you should walk the whole street (port scanning). This is the reason why most services have well-known port numbers like: 80 = web, 21 = ftp etcetera. Only way you could know it is if the server contacts the client (but then needs to know the address of the client).
Apr
16
comment Handling source code table alignment
The first document doesn't look tabular but spaces indented. Maybe it's not shown well here. You could use the third one from the start, that's what I suggest, then you have a stable format which is extendable a bit. But still: That's your issue because of using the wrong tool. In some languages you might be able to store some json in a string and then parse it. In some scripting languages we have HERE docs en.wikipedia.org/wiki/Here_document which might be useful. But in the in clearly it might not be the best solution. Maybe check config files which could be more flexible.
Apr
16
comment Handling source code table alignment
If you format the data as tabular data (preferably in a separate file / source file) then you would never run into this issue. Because then you formatted upfront and you won't have to change it. Issue you still have is that most diffs work per line (try adding/removing a comma at the end of a line). So then you know where the change is but you don't instantly see the real change only. What you then could do is format each row on many lines (json/yaml etc). At that point you should also consider: wrong tool for the job. You try to store data tables in a source file, there might be a better tool
Mar
17
comment PHP OOP: value property is guaranteed different?
yes, the requests are separated so they won't mix at all. If you want to share between requests you need to store the data in a database / file for example. All running code is never mixed. For the same user the session is also an exception, that is also stored in for example a file and shared between your own requests.
Mar
15
comment How to save many changes to database data?
Is it single user or multiple users active on the same sheet?
Feb
19
comment RESTful basic http atuhentication credentials
search for api tokens. You start with login, then you receive a token from the server you can use. When it's not valid anymore you login again and so on.
Feb
19
comment Consuming a rest API that exposes nested objects
If that's the case an abstract class (or something alike) could solve most. Something like: class Listing { function getData(){} function parseData() {} } etc and then implement the specific classes: CategoryListing implements Listing { var url = '/categories'} SubCategoryListing { var url = /categories/123/ } etc
Feb
19
comment Consuming a rest API that exposes nested objects
and the interface is? For example in simple html/php you simply create one function which loads the top level: /categories. Then loop it with foreach and generate the links. When clicked you load the same script but now the starting point is not /categories but /categories/123 and you show the list again, generate the links and done.
Feb
19
comment Consuming a rest API that exposes nested objects
Do you need them locally or do you just need to give the user an interface to browse the structure?
Feb
17
comment Printing a large number of images from the browser
To do this a PDF generation sounds like a much more logical procedure. Since I expect it's likely you want a pdf anyway I would make it that format instantly. It moves the responsibility of printing all pages to the client. And you can verify the document to ensure all pages are in there.
Feb
9
comment What's the point with HATEOAS on the client-side?
Correct you can make the decision of balance limits as complex as you want and still don't have to make changes to the client. If you take this further with REST parts like content type you can show different views. For example an account looks different from a transaction. Also interesting is code on demand (though not much implemented). That could be used for example for a borrowing estimator. It can give the interface a simple calculator function so the client only needs to implement the inputs for the calculation. It will stay up-to-date from the back-end.
Feb
9
comment REST API - Should API Return Nested JSON Objects?
Yeah, not sure the exact word on this process. HATEOS in general is being used for linking in rest API's but I agree it also has to do with state. Though the idea of implementation will be the same. Here you see a bit more about how it can be used by an example: stormpath.com/blog/linking-and-resource-expansion-rest-api-tips