DateTime Covert on data post using WebApi? - angularjs

I am working on MVC 4 project with AngularJS. I have some date filed in my form. I am facing an strange issue when i post data to server using $http.post(). When i post any date like January 01,2013 is converted to 12/31/2012 on Server which gives an error on Server Post. I am not getting what is going wrong in my code base.
Hope you got my question.

When dealing with dates you have to be careful as to how they are serialised on the front-end and back-end. There is no standard.
Given your description and lack of other context though, I suspect it's a time zone issue.
are you developing locally? i.e. are browser and server running on the same machine?
(if not) what's the timezone the server is using? UTC?
Here's a post detailing some issues with JSON date serialization: "On the nightmare that is JSON Dates. Plus, JSON.NET and ASP.NET Web API"
If you're not sure what's going on with serialisation you can use something like curl (*nix or maybe cygwin tool) or "Fiddler" to see the raw responses. Other things to do are to explicitly use date's toString() method to serialise the date as a string (and change on the server side too seeing you're using .Net) to explicitly control the deserialisation.

Related

Convert nested XML file to some kind of database format and displaying on website

Heyos!
I am in sincere need of help and advice with a project I have to work on.
Let me give you a brief overview:
Context:
MeSH-Browser is a website used for displaying "[...] hierarchically-organized terminology for indexing and cataloging of biomedical information [...]" (see: https://www.nlm.nih.gov/mesh/).
The MeSH-data can be downloaded from here: https://www.nlm.nih.gov/mesh/download_mesh.html
What is the task:
Displaying MeSH-data on a website.
What is given:
MeSH-data as mentioned above (see: https://www.nlm.nih.gov/mesh/download_mesh.html).
What is the catch:
I have no experience in developing a back- and frontend.
What I have come up so far:
I figured out that I need to develop a back- and frontend as well as the communication between those.
Convert given MeSH-data in .xml format to database input format.
Create a server running a database fed with the converted MeSH-data.
Communication between database and website.
A website for displaying the data stored in the database.
After googling I found a GitHub project with "Code and documentation for the release of MeSH in RDF format" (see: https://github.com/HHS/meshrdf/).
Hence I set up a virtual machine running an ubuntu server and installed OpenLink's Virtuoso software (see: https://virtuoso.openlinksw.com/), which can be used for querying the resulting RDF.
What has to be done next is integrating the converted MeSH-data in RDF into the Virtuoso database (have not looked into this yet).
Considering the communication with the frontend, I was thinking about using one of the libraries mentioned on https://www.w3.org/community/rdfjs/wiki/Comparison_of_RDFJS_libraries and query the data with the help of SPARQL.
As frontend I would use ReactJS as I find it appealing to me.
That is all for now, what are your opinions?
Please do note that this is only for educational purposes.

What will happen to parse4cn1 when they shut down parse.com?

As some of us have noted, parse.com will be shut down in January 2017. In the current version of parse4cn1, all requests go to https://api.parse.com, using the constant ParseConstants.API_ENDPOINT. Will it be possible to supply a custom URL here, pointing to a different Parse Server? If not, can I build parse4cn1 from source myself? Or should I be looking for an alternative to Parse?
See these related questions:
Will Parse4cn1 still work after Parse server retirement?
parse4cn1 has some issue when working with Node JS and parse-server open source
I now have some time available and intend to make the change you proposed within the coming month or so and make a release that is compatible with the open source Parse server. If that's too late for you, consider making the changes yourself and contributing back via a Github pull request. The Contributing section of the parse4cn1 repo provides useful tips.
Regarding looking at Parse alternatives, that's a decision you'll have to make yourself based on your needs and timeline. My gut feeling is that the Open Source Parse Server will mature and grow in features in the months leading up to the official retirement of Parse.com.

Scaling SignalR with SQL server - how often can we clear data?

I'm looking to write a scaled out SignalR application using SQL Server, using this article as a guidline. After doing some testing, it looks like the table Messages_0 in the SignalR database that I created (per the article) could get pretty big.
What I'm wondering is, how often can this data be cleared out? I see there is an InsertedOn column so I would think after day or two the data wouldn't be relevant anymore. Is there any documentation or guidelines on this?
I'm wondering if I could just set up a job that would clear out anything older than a week just to prevent the table from getting too big over time.
I was looking for the same thing, and I did read the suggestion in the documentation, but I was wondering if SignalR would clean up by itself in that case, and when.
I found the answer here: How to cleanup SignalR SQL database
Which points to the github repository, where you can see how SignalR automatically cleans the tables when reaching a hardcoded limit.
See github code here: SignalR SQL automatical clean-up
Thought it might be useful to add to this question, for anyone searching the same question.
The documentation seems to suggest (albeit briefly), that you should not delete rows yourself.
SignalR manages the tables. As long as your application is deployed, don't delete rows, modify the table, and so forth.
Take a look at: Scaleout With SignalR - asp.net

Query SQL Server Database from native iOS Application

I am working on an in-house, iOS app that will need read-only access to a SQL Server with multiple databases. I know the stock answer here is "write some web services", but I'd like a solution that is self-contained. Is there any way to directly connect to a SQL Server database from an iOS application? I'm thinking something like a basic ODBC connection.
I've seen a lot of users asking this question, but very few answers other than "write a web service." Is that really the only way?
A web service is indeed the only way, but Red Gate's written one you can reuse:
http://www.mobilefoo.com/iSqlServerSDK.html
http://labs.red-gate.com/Tools/Details/iSqlSDK
It's not officially released yet, just in beta, so keep in mind that features & prices may change.
Actually the easiest way is to create a MVC 3 or 4 asp.net web application. call the web methods. You don't need any API to pay for.
I use SBJson to serialize domain object and then send the objects as serialized jSOn to MVC 3. It's super easy to do. I even send images with base64, so it's .net compatible.
See my blog post with sample code:
http://nickturner.wordpress.com/2012/10/09/107/
So, after much searching and trial and error, unfortunately the best (only?) way I've found is indeed using Web Services.
Fortunately, Linq to SQL makes the WCF-creation-side incredibly easy. Once I got someone at work to walk me through setting up a Windows web server and adding the web service (and buying access to an online web server), the Windows side was up and ready to go.
I'm still working through all of the syntax stuff on the SOAP interaction side, but keeping my different methods somewhat similar in structure allows me to tinker a little until it works. By this time, I think I've gotten it to work pretty well.
So, both answers I got back were (disappointingly) correct. The only way to interact is through a Web Service. Even the 3rd party solutions they mentioned were really just convenient wrappers around the same type of technology. As it turns out, I'd rather have finer control over the process.
One word of advice: Get a real, external web server. I tried doing this on a non-Server Windows VM on my iMac/MacBook Pro, and it was like pulling teeth! Once I actually got access to an external, full, stand-alone web server, the process was much more streamlined and easy. Do yourself a favor and take that headache out of the equation!
There was a SQL ISAPI extension as part of SQLXML, but I think it has been deprecated: http://msdn.microsoft.com/en-us/library/aa226559%28v=SQL.80%29.aspx
This was effectively a pre-built, and relatively open, web service - so I'm not sure this counts as a direct connection.
You could also check out http://odbcrouter.com/Main

Asp Classic Wrong Encoding

I've developed a web site sine 2001 with asp classic and MS SQL Server
from 2 months ago i accessed my web site and i found that all my database records have a different encoding character, specially the Arabic data , it has unknown encoding character which indicates that the database has been corrupted or something happen However, there is no Development updates happened .....
i want to restore my real database with it's arabic data ,
So any one have a solution to fix this problem please feedback . also i scare this problem could spread to all web site developed with Asp classic ....
Have you checked if your site have been hit by some SQL Injection there are some bots that write javascript to all varchar fields, maybe i could mess up Arabic Data as well.
Here are some tips to prevent the problem:
http://blogs.iis.net/nazim/archive/2008/04/28/filtering-sql-injection-from-classic-asp.aspx

Resources