|
I think you're misinterpreting the meaning of a REST service. The primary key is that the server itself should be stateless; each transaction must be atomic, having nothing to do with the ones before it, and no bearing on operations that occur after it. It is not just a service endpoint for a database, it is a methodology that pushes state management to the client.
Ultimately REST is more about how data is transferred than it is about what that data is.
So:
1. Bandwidth is bandwidth, but the average entity will not eat very much. It's perfectly fine to send a whole entity down the pipe if you need to. Be mindful that sensitive properties are not sent (tag with JsonIgnore if using JSON.NET eg. Newtonsoft, etc). That's not the case for arrays of entities, page those as appropriate on the server side.
- ViewModels are your very best friend. Well, they're mine, anyway.
- Completely immaterial. As long as the transaction can be done in an atomic manner you can do what you're most comfortable with. That said, ViewModels are my very best friend, as previously mentioned.
There is a pretty solid primer on IBM:
http://www.ibm.com/developerworks/library/ws-restful/[^]
|
|
|
|
|
Thanks a lot for your reply, Nathan. It answers my questions very clearly. The IBM article is also very useful. I will have to keep going back to it any time I forget what REST is when I get bogged down by implementation details.
|
|
|
|
|
I'm going to show 5 videos with click button in html.
<html>
<body>
<button id="click">Click</button>
<div id='plc'></div>
</body>
<link rel="stylesheet" src="jquery-ui.css">
<script src="jquery.js"></script>
<script src="jquery-ui.js"></script>
<script type="text/javascript">
var video;
var index = 0;
$("#click").on("click", function() {
if (video != null)
video.remove();
video = document.createElement('video');
document.getElementById('plc').appendChild(video);
var realPath = 'file:///G:/temp/';
if (index == 0)
realPath += "1.mp4";
else if (index == 1)
realPath += "2.mp4";
else if (index == 2)
realPath += "3.mp4";
else if (index == 3)
realPath += "4.mp4";
else if (index == 4) {
realPath += "5.mp4";
index = -1;
}
index++;
video.setAttribute('src', realPath);
video.play();
});
$("#click").trigger("click");
</script>
</html>
It works.
But I press click button continuously, RAM increasing.
Why RAM increasing?
|
|
|
|
|
Hi,
I am trying to position My Account button to the right and the logo at the left but both should be at the same level. I am trying below code but the top position is not working. Why?
<img src="images/logo.jpg" style=" margin-top: 0; margin-left: 0px;">
<img src="images/my_account.png" style="margin-top: 0; margin-left: 500px;">
Please check this image[^]
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
Maybe your elements' position is relative . Try to change it to absolute . Something like:
<img src="images/logo.jpg" style=" margin-top: 0; margin-left: 0px; position: absolute;">
<img src="images/my_account.png" style="margin-top: 0; margin-left: 500px; position: absolute;">
|
|
|
|
|
Just use
float property
<img src="images/logo.jpg" style="float: left;" /><img src="images/my_account.png" style="float: right;" />
|
|
|
|
|
Hi,
I would like to ask how can I add this type[^] of spinner which has plus and minus buttons only and user can't write the value? any guide please?
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
For Spinner please check the link
http://www.virtuosoft.eu/code/bootstrap-touchspin/
and
<input type="text" class="spinner" value="10" readonly/>
for prevent to write user value
|
|
|
|
|
Hi,
I have files in my document folder, e.g. policy.pdf, procedures.pdf, etc
I don't want the user to know the file name and path so I was thinking if I can have a url like this:
http://www.mydomain.com/SESSION_GUID/TEMP_GUID.pdf[^]
and when then display the file without telling the user the real path.
Is this possible? How to implement it?
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
At first convert your file into a byte array like fileContents
You have to set the file name in the Content-Disposition http header
Response.AddHeader("Content-Disposition", "attachment; filename=" + Newfilename);
Response.ContentType = "text/plain";
Response.BinaryWrite(fileContents);
Response.End();
File will get downloaded, and user will be prompted to save it with the New file name.
|
|
|
|
|
Hi,
I have policies to documents and I want to put it on a web PHP portal for download to the employee with a password protected access.
If the URL for a policy is www.myWeb.com/policies/document1.pdf, I don't want any one to see this url when downloading or when viewing the page source.
What's the best way to do it?
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
modified 23-Oct-15 12:56pm.
|
|
|
|
|
You can't hide urls from the client. Implement proper security at the webserver level if you want to restrict access.
|
|
|
|
|
You could use the HTML5 download attribute like this:
<a href="path/to/your/pdf/file" download>Click here to download</a>
|
|
|
|
|
This is how you can hide download url in PHP:
<?php
$fakeFileName= "fakeFileName.zip";
$realFileName = "realFileName.zip";
$file = "downloadFolder/".$realFileName;
$fp = fopen($file, 'rb');
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$fakeFileName");
header("Content-Length: " . filesize($file));
fpassthru($fp);
?>
You can see all steps to hide download url here http://5ss.co/viewtopic.php?f=26&p=3[^]
|
|
|
|
|
Hi,
I have company policies and I want to put it under the employee internet access on our website.
All the policies are in PDF format.
What's the best and recommended way to do it?
Should I put it in a BLOB or just use a PDF url then display it when the user clicks on the url?
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
Where I work and where I play, it's as a link to the URL.
Just plain simple. Reliable. Why knock yourself out?
Now - for your specific task - company policies for employees. I didn't do the deed, but it's in HTML: tabbed pages with hyperlinks on the company Wiki.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
First BLOB doesnt support all browsers, so first confirm the version your users are going to use, and proceed. And, PDF's all the browsers are not capable of opening PDF's in browser so you need to take care of this also
|
|
|
|
|
I'm just curious to know who remembers working with ASP 1.0 and SQL Server 6.5 back in 1996?
Dark days in the distant past... There must be some battle-hardened veterans from that age in the developer community here.
|
|
|
|
|
i am going to develop[ a web app, which requires lot of page transfers while performing.
I have read somewhere that angularjs is best for single page application.
then i want to know is that whether i have to use jquery or angular js.??
I also want to know that which of these two gives better end user performance.??
plz help me.
|
|
|
|
|
Member 12038487 wrote: want to know that which of these two gives better end user performance.??
Angular is a framework, jQuery is a library. Frameworks have their place and libraries have their place. However, there is no question that a good framework has more power in writing an application than a library. That's exactly the point of a framework. You're welcome to write your code in plain JS, or you can add in a library of common functions, or you can add a framework to drastically reduce the code you need to accomplish most things
|
|
|
|
|
I need the Wisdom of the Masses.
I've been using FrontPage 2003 since, well, 2003. I love it. Simple, fast, allows multi-line search/replace, has a split view of HTML/Markup so I can look at both while I edit, and it has a quick preview.
Except that it's old, and I'm not keen on installing Office 2003 components anymore, and there has to be - gotta be! - something even nicer and more fun.
Except I can't find anything better.
I tried WebMatrix and I lasted all of 2 minutes. I want an HTML editor. I don't want to build an entire website. I just want to quickly fire up an editor, edit, then shut it down. (and hence this precludes using VS)
So:
- Fast and lightweight.
- Split view while editing
- Multiline search and replace (meaning I can enter:
this is a line
and this is another line
and it will search for this multi-line pattern) - Has special handling of tags (eg remove all tags of a certain type, remove attributes of a certain type etc)
Anyone use anything vaguely like this?
cheers
Chris Maunder
|
|
|
|
|
I tend to use Notepad++, but Visual Studio Code[^] and Brackets.io[^] might be worth a look.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have settled on MS Expressions 4. MS has made it free.
It has some degree of auto-completion for javaScript and php.
If you have local php instance it can configured to render php locally.
Downside: it's not super-up-to-date with respect to HTML5/CSS3. (Think IE8 level) - but that's not been a problems.
If you set something as a website it will create some useful metadata to keep things connected.
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "As far as we know, our computer has never had an undetected error." - Weisert | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Ah - I forgot about expression. I'll give that one a go. Thanks.
cheers
Chris Maunder
|
|
|
|
|
what about dreamweaver ? my favourite with notepad ++.
|
|
|
|