Get current time/date in purescript - purescript

This seems to me a weird question, but I have gone through the purescript-datetime and purescript-js-date and I just cannot find a way to get current DateTime. Is there some hidden library function or do I have to go through FFI?

You can use the now or nowDateTime functions from purescript-now.

Related

All usages of a variable/parameter in anylogic

Is there an easy way to figure out all places where a variable or parameter is being utilised in annylogic. Trying to locate where each variable is used can be a pain during debugging.
Sure. Just "ignore" it in the properties and compile the model.
You will get a list of errors for all places where it is called. Double-click on each error and AnyLogic even takes you there :)
Else, you can also use the AnyLogic search functionality.
in order to get some relief for that pain if your model is too big, all your variables should be private and you create setters, so each time you change your variable, you required to use a set function.
This doesn't solve your question, but it tells you what to do in future models to make it easier for you
check this video
https://www.youtube.com/watch?v=gNBfdB6YF7o

Parameterize Start/Stop Date of Simulation Experiment via Method

Is there a possibility to set the start and stop date of an simulation run using a function or parameter?
Thanks for helping!
There is. These functions can be accessed via the Engine object. You can find the documentation of the class here. The functions you are looking for are:
setStartDate(java.util.Date date)
setStartTime(double tstart)
setStopDate(java.util.Date date)
setStopTime(double tstop)
Either in the Experiment or in the Main of your model, you can use (as an example) this code:
getEngine().setStartTime(100);
Of course, once the model is already started, only setting of stop time/date will have an effect.

chrome detecting integer as NPVariantType_Double with npruntime plugin?

I am trying to call a function through javascript via my NPRuntime plugin
but when i pass an integer value to a function,chrome detects that as NPVariantType_Double while firefox is taking same as NPVariantType_Int32.
Can we do avoid this without modifying script to make sure that both firefox and chrome detects it as NPVariantType_Int32.
Short answer: no, not really. They will give it to you in the format that they decide to give it to you. I recommend you cast it to a int32.
If you're really worried about how it's going to come in and need the format to remain exactly the same, pass it as a string and use some form of lexical cast to convert it to the numeric format you need.
Remember that javascript is dynamically typed, so from their perspective it shouldn't matter. This is just one of those annoying things :-/ FireBreath "solves" this issue simply by not caring what the browser provides and converting it to the datatype the function says it expects.
Taxilian is right. Chrome and Opera(as far as I recall) are returning mainly NPVariantType_Double , even if this represents the location of an element (in pixels).You can create a function that converts NPVariantType_Double and NPVariantType_Int32 to whatever you want.

formatRelativeTime in TTTableMessageItem

I'm new to Three20, so this may seem like a very simple question.
How can I get the timestamp in TTTableMessageItem to be in relative
time format?
If it is not doable using TTTableMessageItem, what would you recommend
me to do to achieve that?
Thanks.
The function formatRelativeTime in NSDateAdditions is what you are looking for. Since this is a category function you can call it in on any NSDate object as long as you include NSDateAdditions.h in Three20Core

How to use CTTypesetterSuggestClusterBreak in Core Text

I am having trouble in using CTTypesetterSuggestClusterBreak function of CTTypeSetterRef class. I want to use this method to get closest word boundry near an index. I am having difficult in the implementationof this method, i.e how and where this method must be used.
I have been banging my head over this but with no success yet. If anyone can help me in using this method I would be very greatful.
Thanx in advance
I'm not sure CoreText is appropriate for this task; it sounds like you should investigate CFStringTokenizer instead.