• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Regarding the magic cookie of data file of UrlyBird project.

 
Greenhorn
Posts: 14
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Experts,
In the Data file format section, it states
----------
Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
2 byte numeric, number of fields in each record
----------
It seems we should perform validation against the magic cookie, but I am not sure if my understanding is correct or not.
 
Bartender
Posts: 2236
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your instruction state that you must validate the magic cookie?
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jasn hofy wrote:It seems we should perform validation against the magic cookie, but I am not sure if my understanding is correct or not.


I validated the magic cookie (nothing more but a comparison to a hard-coded value), but it is definitely not a must requirement and therefore not required.

 
jasn hofy
Greenhorn
Posts: 14
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:

jasn hofy wrote:It seems we should perform validation against the magic cookie, but I am not sure if my understanding is correct or not.


I validated the magic cookie (nothing more but a comparison to a hard-coded value), but it is definitely not a must requirement and therefore not required.



Thanks a lot Roel, if we need validation, that means we need to throw our own defined exception, right?  
 
Paweł Baczyński
Bartender
Posts: 2236
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jasn hofy wrote:That means we need to throw our own defined exception, right?  


That means it is up to you to decide.
 
jasn hofy
Greenhorn
Posts: 14
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paweł Baczyński wrote:

jasn hofy wrote:That means we need to throw our own defined exception, right?  


That means it is up to you to decide.



OK...Thanks
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jasn hofy wrote:if we need validation, that means we need to throw our own defined exception, right?  


The beauty of this project is that you can decide almost everything yourself and there is not really a right or wrong. You can document your decisions in the choices.txt file. There's only one exception to this rule: the "must" requirements! If you don't meet this requirements, you risk (automatic) failure.

Just for the record: I created a custom exception.
 
jasn hofy
Greenhorn
Posts: 14
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:

jasn hofy wrote:if we need validation, that means we need to throw our own defined exception, right?  


The beauty of this project is that you can decide almost everything yourself and there is not really a right or wrong. You can document your decisions in the choices.txt file. There's only one exception to this rule: the "must" requirements! If you don't meet this requirements, you risk (automatic) failure.

Just for the record: I created a custom exception.



Thanks a lot!
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic