Displaying Date with TextField Click with SwiftFirst you must have a textfield connected to storyboard.@IBOutlet weak var txtField_helloDatePicker: UITextField!Next you should have a constant of UIDatePicker type.let datePicker = UIDatePicker()Then inside the viewDidLoad...
Common Swift collection casting or type conversion
Collection of Common Swift Casting or Type ConversionString to Doublevar a = "1.5"var b = (a as NSString).doubleValueDouble to Stringvar a : Double = 1.5var b = String(format:"%f", a)Double to Intvar a : Double = 1.5var b = Double(a)String to Floatvar a = "1.5"var...
How to Display an Alert View with Swift
Display an Alert View with SwiftFirst we'll create a constant of UIAlertController. Since we'll be using an alert, the UIAlertControllerStyle is set to default. It can have other values such as ActionSheet, Alert, and RawValue. let alertPrompt = UIAlertController(title: "Simple Alert...
How to get the client's ip address in jax rs and ws
In this tutorial I'll not teach how to create jax-rs nor jax-ws web service but rather will show how we can get the client's or the caller's ip address who invoke the service. In jax-rs: //inject@Contextprivate HttpServletRequest httpServletRequest;public void serviceMethod() { //get the ip log.debug("IP="...
afl-fuzz: making up grammar with a dictionary in hand
One of the most significant limitations of afl-fuzz is that its mutation engine is syntax-blind and optimized for compact data formats, such as binary files (e.g., archives, multimedia) or terse human-readable languages (RTF, shell scripts). Any general-purpose fuzzer will have a harder time dealing...
Enig med Cappelen
Jeg er helt enig med SSBs tidligere forskningsdirektør Ådne Cappelen i at mitt innlegg6. januar gir en lite dekkende fremstilling av hans notat. Rett adressat er imidlertid Høyesterett, som skriver: «Forskningssjef Ådne Cappelen ved Statistisk sentralbyrå, som avga forklaring som privatengasjert sakkyndig...
How to implement no caching on JSF pages
Currently there are 2 ways I know that can do this.1.) By implementing Filter and manually overriding the cache controls. See code below (note: not my original I found this somewhere else long time ago):@WebFilter(servletNames = { "Faces Servlet" })public class NoCacheFilter implements Filter { @Override...