{% extends "_post.html" %}
{% hyde
title: "The Caves of Clojure: Part 3.3"
snip: "Scrolling."
created: 2012-07-11 9:25:00
flattr: true
%}
{% block article %}
This post is part of an ongoing series. If you haven't already done so, you
should probably start at [the beginning][].
This entry corresponds to [post three in Trystan's tutorial][trystan-tut].
If you want to follow along, the code for the series is [on Bitbucket][bb] and
[on GitHub][gh]. Update to the `entry-03-3` tag to see the code as it stands
after this post.
[the beginning]: /blog/2012/07/caves-of-clojure-01/
[trystan-tut]: http://trystans.blogspot.com/2011/08/roguelike-tutorial-03-scrolling-through.html
[bb]: http://bitbucket.org/sjl/caves/
[gh]: http://github.com/sjl/caves/
[TOC]
Summary
-------
When the last post left off I had a random world generated and smoothed to
create some nice looking caves. The world was displayed on the screen, but it
would only display the upper left corner of the map.
This post is going to be about scrolling the viewport so we can view the entire
map. It's the last remaining piece of Trystan's third post that I still need to
implement.
Refactoring
-----------
This is going to involve changing the worst function in the code so far
(`draw-ui` for `:player` UIs), so before I start hacking away I want to factor
out a bit of functionality to clean things up.
Right now that `draw-ui` function in `core.clj` looks like this:
:::clojure
(defmethod draw-ui :play [ui {{:keys [tiles]} :world :as game} screen]
(let [[cols rows] screen-size
vcols cols
vrows (dec rows)
start-x 0
start-y 0
end-x (+ start-x vcols)
end-y (+ start-y vrows)]
(doseq [[vrow-idx mrow-idx] (map vector
(range 0 vrows)
(range start-y end-y))
:let [row-tiles (subvec (tiles mrow-idx) start-x end-x)]]
(doseq [vcol-idx (range vcols)
:let [{:keys [glyph color]} (row-tiles vcol-idx)]]
(s/put-string screen vcol-idx vrow-idx glyph {:fg color})))))
I pulled out the guts of that function into a helper function:
:::clojure
(defn draw-world [screen vrows vcols start-x start-y end-x end-y tiles]
(doseq [[vrow-idx mrow-idx] (map vector
(range 0 vrows)
(range start-y end-y))
:let [row-tiles (subvec (tiles mrow-idx) start-x end-x)]]
(doseq [vcol-idx (range vcols)
:let [{:keys [glyph color]} (row-tiles vcol-idx)]]
(s/put-string screen vcol-idx vrow-idx glyph {:fg color}))))
(defmethod draw-ui :play [ui {{:keys [tiles]} :world :as game} screen]
(let [[cols rows] screen-size
vcols cols
vrows (dec rows)
start-x 0
start-y 0
end-x (+ start-x vcols)
end-y (+ start-y vrows)]
(draw-world screen vrows vcols start-x start-y end-x end-y tiles)))
No functionality has changed, I just pulled the body out into its own function.
This will make things cleaner as we add more functionality.
As I mentioned in the last post, I don't like the distructuring in the argument
list here. Let's remove that:
:::clojure
(defmethod draw-ui :play [ui game screen]
(let [world (:world game)
tiles (:tiles world)
[cols rows] screen-size
vcols cols
vrows (dec rows)
start-x 0
start-y 0
end-x (+ start-x vcols)
end-y (+ start-y vrows)]
(draw-world screen vrows vcols start-x start-y end-x end-y tiles)))
It's a few more lines of code but I find it more readable. If you prefer the
more concise syntax feel free to use the destructuring -- it's not really that
important either way.
Crosshairs
----------
Trystan draws an `X` as a kind of crosshair to take the place of the traditional
roguelike `@` (since there's no player yet), so let's do that. I made
a separate function to draw the crosshair as a red `X` in the center of the
screen:
:::clojure
(defn draw-crosshairs [screen vcols vrows]
(let [crosshair-x (int (/ vcols 2))
crosshair-y (int (/ vrows 2))]
(s/put-string screen crosshair-x crosshair-y "X" {:fg :red})
(s/move-cursor screen crosshair-x crosshair-y)))
This function seems pretty straightforward. It finds the x and y coordinates of
the viewport where the `X` should go and puts it there. It also moves the
cursor on top of it because I like how that looks.
Yeah, it might not actually end up in the exact center of the screen because the
`int` will truncate if we've got an odd number of rows or columns. Honestly,
I'm going to be throwing away this crosshair once we've got a player on the
screen, so it's not worth fixing.
I need to call `draw-crosshairs` that in the `:play` UI-drawing function:
:::clojure
(defmethod draw-ui :play [ui game screen]
(let [world (:world game)
tiles (:tiles world)
[cols rows] screen-size
vcols cols
vrows (dec rows)
start-x 0
start-y 0
end-x (+ start-x vcols)
end-y (+ start-y vrows)]
(draw-world screen vrows vcols start-x start-y end-x end-y tiles)
(draw-crosshairs screen vcols vrows)))
The only change here is the `(draw-crosshairs screen vcols vrows)` after I draw
the world. This draws the crosshair `X` on top of the world, which isn't an
issue because Lanterna's double buffering will ensure that the user never sees
an intermediate render that's missing the `X`.
Now there's a red `X` in the center of the screen. Great, but we still need to
add the main point of this post: scrolling.
Scrolling
---------
Right now the `start-x` and `start-y` in the `draw-ui` function are hardcoded at
`0`. All I need to do is change those to modify which part of the map the
viewport draws, and I'll have scrolling!
First of all, I need a way to keep track of where the viewport should be
centered. This will get thrown away once we have a player (the player will be
the center of the viewport), so I'll just slap it right in the `game` object for
now:
:::clojure
(defn new-game []
(assoc (new Game nil [(new UI :start)] nil)
:location [40 20]))
The `new-game` function now `assoc`s a `:location` into the `game` before
returning it.
I *could* have modified the `(defrecord Game [world uis input])` to add the
location as a proper field. But I know I'm going to be removing this soon
anyway, so I may as well take advantage of the fact that Clojure's record can
have extra fields `assoc`ed onto them on the fly.
`[40 20]` is an arbitrary location. It's kind of in the middleish area of the
map. Good enough.
Okay, now I need to actually display the correct area of the map in the
viewport. I'm going to need to modify `draw-ui` again, which, just as
a reminder, looks like this:
:::clojure
(defmethod draw-ui :play [ui game screen]
(let [world (:world game)
tiles (:tiles world)
[cols rows] screen-size
vcols cols
vrows (dec rows)
start-x 0
start-y 0
end-x (+ start-x vcols)
end-y (+ start-y vrows)]
(draw-world screen vrows vcols start-x start-y end-x end-y tiles)
(draw-crosshairs screen vcols vrows)))
I had a feeling this is going to get a bit gross, so I pulled out the code for
getting the viewport coordinates into its own helper function:
:::clojure
(defn get-viewport-coords [game vcols vrows]
(let [start-x 0
start-y 0
end-x (+ start-x vcols)
end-y (+ start-y vrows)]]
[start-x start-y end-x end-y]))
(defmethod draw-ui :play [ui game screen]
(let [world (:world game)
tiles (:tiles world)
[cols rows] screen-size
vcols cols
vrows (dec rows)
[start-x start-y end-x end-y] (get-viewport-coords game vcols vrows)]]
(draw-world screen vrows vcols start-x start-y end-x end-y tiles)
(draw-crosshairs screen vcols vrows)))
No functionality changed, I just shuffled a bit of code out of that ugly
`draw-ui` function. As a bonus, the `get-viewport-coords` function is now pure.
It'll be easy to add unit tests for it later if I want. Cool.
Now that the viewport coordinates are isolated, it's time to calculate them
correctly instead of hardcoding them at `0`:
:::clojure
(defn get-viewport-coords [game vcols vrows]
(let [location (:location game)
[center-x center-y] location
tiles (:tiles (:world game))
map-rows (count tiles)
map-cols (count (first tiles))
start-x (max 0 (- center-x (int (/ vcols 2))))
start-y (max 0 (- center-y (int (/ vrows 2))))
end-x (+ start-x vcols)
end-x (min end-x map-cols)
end-y (+ start-y vrows)
end-y (min end-y map-rows)
start-x (- end-x vcols)
start-y (- end-y vrows)]
[start-x start-y end-x end-y]))
This is long, but very straightforward. I use the fact that `let` doesn't care
if you rebind variables many times in the same binding vector to write
imperative code. There may be a more "clever" way to do this, but I like the
clarity.
First it finds the location of the crosshair (which will be `[40 20]` from
`new-game` at the moment). It calls that `center-x` and `center-y`.
It also pulls the tile vector out of the `game` object and uses it to
determine the full dimensions of the map. I'm thinking of having a `map-size`
constant somewhere instead of doing it this way. I may do that in a later post.
Next come these scary lines:
:::clojure
start-x (max 0 (- center-x (int (/ vcols 2))))
start-y (max 0 (- center-y (int (/ vrows 2))))
They're not as scary as they look. Both are exactly the same except for which
dimension they're working on. First I subtract half the viewport size from the
center coordinate. This should give me either the topmost or leftmost
coordinate we're going to be drawing.
Then I use `max` to make sure that if the starting coordinate would be less than
zero (i.e.: off of the map) I just use 0 instead.
Okay, so now I've got the coordinates of the top left point I need to draw, and
I'm sure that it doesn't fall off the top or left edge of the map. Cool. Time
to get the bottom right coordinate.
:::clojure
end-x (+ start-x vcols)
end-x (min end-x map-cols)
end-y (+ start-y vrows)
end-y (min end-y map-rows)
This is similar to how we get the starting coordinates. We calculate a "naive
end x" by adding the viewport size to the start, and then make sure the end
doesn't fall off the map.
I did this all in one line for the start coordinates, but split it into two for
the end coordinates. I'm not sure why I did it like that -- I just noticed it
now. I'm going to go ahead and change the start to be the expanded, two-line
form. I think it's clearer.
Okay, so now I've ensured that the end coordinate doesn't fall off the map. I'm
done, right?
Well, not quite. If I truncated the end coordinate here I'll have ended up with
a smaller-than-normal viewport. To fix that I'll reset the start coordinates
one more time:
:::clojure
start-x (- end-x vcols)
start-y (- end-y vrows)
This time I don't need to check any bounds. I know the end coordinate is good
because it was based on a known start coordinate (the top/left side is good) and
I corrected the bottom/right side. So I simply use this known-good end
coordinate to get a known-good start coordinate and I'm done.
If the map is smaller than the viewport size this is probably going to explode.
I'm going to ignore that for now. I may revisit it later, or I may just stick
with an 80 by 24 viewport for all time like Nethack.
That was a lot of work, but the only thing that's changed is I'm now displaying
a section of the map near the middle instead of at the upper left. The last
piece is to add the ability to adjust the `:location` in the `game` object on
the fly.
The player should be able to scroll around when they're at the `:play` UI, so
let's add the appropriate input handling:
:::clojure
(defn move [[x y] [dx dy]]
[(+ x dx) (+ y dy)])
(defmethod process-input :play [game input]
(case input
:enter (assoc game :uis [(new UI :win)])
:backspace (assoc game :uis [(new UI :lose)])
\q (assoc game :uis [])
\s (assoc game :world (smooth-world (:world game)))
\h (update-in game [:location] move [-1 0])
\j (update-in game [:location] move [0 1])
\k (update-in game [:location] move [0 -1])
\l (update-in game [:location] move [1 0])
\H (update-in game [:location] move [-5 0])
\J (update-in game [:location] move [0 5])
\K (update-in game [:location] move [0 -5])
\L (update-in game [:location] move [5 0])
game))
I did a few things here. First I added the `q` key mapping to quit the game
without going through the win or lose screens, just to same myself some time.
Enter and backspace still win and lose the game respectively.
`s` still smooths the world map for now. No reason to remove that yet.
To handle the movement inputs I first made a `move` helper function which takes
a coordinate and an amount to move by and returns the new coordinate.
The `process-input` function uses this to get the new coordiate when it gets an
`h`, `j`, `k`, or `l` keypress. I also added the shifted versions of the
letters as "fast movement" keys for convenience.
Right now there's no bounds checking here, so it's possible for your `:location`
to get scrolled off the edge of the map. This won't be a problem for the
display (it will just snap the viewport to the edge of the map), but will make
the input a bit weird.
For example, if you scroll to the right edge of the map and press right 10 more
times, you'll need to press left 10 times before it will actually start
scrolling left again.
This is a bug, but not one I care to fix right now. I'll be replacing this code
with player-based code soon enough, so it's just going to get thrown out anyway.
Results
-------
That's it! Running the game, I can now scroll around the map and/or smooth it
whenever I like:
![Screenshot](/media/images{{ parent_url }}/caves-03-3-01.png)
![Screenshot](/media/images{{ parent_url }}/caves-03-3-02.png)
This doesn't look much different in pictures, but I can scroll through the world
with `hjkl`. Here's a screencast showing what that looks like:
As always, you can view the code [on GitHub][result-code] if you want to see it
all at once.
[result-code]: https://github.com/sjl/caves/tree/entry-03-3/src/caves
That's it for Trystan's third post. Next time I'll tackle his fourth (adding
an actual player).
{% endblock article %}


Spring 2013, M1: PDP - Programming project
Spring 2013, E1: NFA007 - Methods for computerization (materials)
April 2013 - September 2013, E3 Internship, Jocelyn Forest, Telecom Nancy, Application of networks in data analysis and visualization of dataframes (CSV files), (python - Pandas + Tulip, javascript)
May 2013 - July 2013, M1 Internship, Anne-Laure Mesure, Bordeaux University, Interface development for a web-based visualization software (TulipPosy), (javascript)
May 2013 - July 2013, M1 Internship, Fabien Gélibert, Bordeaux University, Software architecture for a web-based visualization software (TulipPosy), (javascript)
June 5, 2013, LaBRI, Introduction To Pandas and Tulip, Jocelyn Forest, Benjamin Renoust, Guy Melançon PDF CSV 1 CSV 2


[gecode-users] Passing information to the master() function
Kish Shen
kisshen at cisco.com
Thu Oct 3 05:15:03 CEST 2013
(This is an edited repost of a message I sent, that was missed by Christian)
Hi Christian,
Thanks for your reply. I haven't been able to look again at this issue
until now, so sorry for the delay...
On 13/09/2013 12:20, Christian Schulte wrote:
>
> As for making sure that the same solution is not found again there is
some
> support but not really the right one. For integer variable arrays x and y
> (also for Boolean arrays) you can post by
> rel(home, x, IRT_NQ, y);
> cannot be the same, that is there is at least one i for which x_i is
> different from y_i.
>
Am I correct that for the above, x would be the variables that are being
labelled by the search (i.e. the variables passed to branch()), and y is
the solution values for these variables (x and y can be swapped, of
course)? Also, this rel constraint should be posted in master()?
I am not quite sure how to pass y (the solution values) to the master()
function and space. Can this be done without some low-level programming
(i.e. inside the search engine)?
If this is not easy to do, then I think an alternative behaviour I can
implement is to not allow the user to ask for an alternative solution if
restart is used with DFS. Am I correct in thinking that restart is
probably not that useful if you want to search for multiple solutions of
a problem, because the search (unless you use some randomisation, as you
mentioned) will always drive you close to solutions you already found,
before exploring other parts of the search space.
Cheers,
Kish
More information about the users
mailing list


{% extends 'base.html' %} {% block content %}
Upload Date: {{ picture.date | date:"Y-m-j" }}
Show All Pictures | Upload New Picture


Howdy, human!
This is
@not_hotdog_bot
that identifies whether on photo hot dogs and not hotdogs using transfer learning (ResNet50). Inspired by the HBO show Silicon Valley


public abstract class State extends StateObservable
notifyManager
method in order to tell their manager to update the other state
representations.| Constructor and Description |
|---|
State() |
| Modifier and Type | Method and Description |
|---|---|
abstract BoundingBox |
getBoundingBox()
Gets the current bounding box which represents the circumference of the
currently depicted map.
|
abstract Vector3D |
getPosition()
Gets the current center in form of a 3-dimensional numerical vector of
which the first two coordinates represent the center of the current view
and the last one is 0.
|
abstract boolean |
isFloat()
Method to decide whether the coordinates used to manage the data of
this are of the type float . |
void |
notifyManager()
Notifies the manager of
this that this has
changed in order to update all the other state representations. |
abstract void |
setBoundingBox(BoundingBox box)
Sets the bounding box which represents the circumference of the currently
depicted map.
|
abstract void |
setPosition(Vector3D cen)
Sets the center of the map in form of a 3-dimensional numerical vector,
which must be an instance of
FloatVector3D if and only if
this.isFloat() is true , otherwise the
invocation of this method will be without effect. |
AbstractStateManager.StateType |
type()
Gets the enum type of
this . |
getObservers, notifyStateObservers, register, unregister
public abstract boolean isFloat()
this
are of the type float
. If
false
is returned, the representation of the internal
coordinates of this
may be assumed as int
.true
if and only if the coordinates saved in this
are of the type float
public abstract Vector3D getPosition()
float
if and only if this.isFloat()
is
true
and can otherwise assumed to be
int
public abstract void setPosition(Vector3D cen)
FloatVector3D
if and only if
this.isFloat()
is true
, otherwise the
invocation of this method will be without effect.cen
- the new value for the center as 3-dimensional vector which
must be an instance of FloatVector3D
if
this.isFloat()
is true
and otherwise
must be an instance of IntegerVector3D
, and of
which the z-coordinate should be 0 and will be ignored
otherwisepublic abstract BoundingBox getBoundingBox()
float
if and only if
this.isFloat()
is true
, otherwise the
coordinate type can be assumed to be int
public abstract void setBoundingBox(BoundingBox box)
FloatBoundingBox
if and only if this.isFloat()
is true
, otherwise the invocation of this method will have
no effect.box
- the new bounding box for this
, which must be an
instance of FloatBoundingBox
if
this.isFloat()
is true
, and
otherwise must be an instance of
IntegerBoundingBox
public void notifyManager()
this
that this
has
changed in order to update all the other state representations.public AbstractStateManager.StateType type()
this
.


| ifsogui.tabber: | Types | Modinfo | Source |
| ifsoGUI_Tabber | Tabber Type. |
| Type ifsoGUI_Tabber Extends ifsoGUI_Base | |
| Description | Tabber Type. |
| Methods Summary | |
|---|---|
| AddTab | Adds a tab. |
| AddTabChild | Adds a child to a tab. |
| Draw | Draws the gadget. |
| GainFocus | Called when the gadget becomes the active gadget. |
| GetAbsoluteXY | Returns the absolute X and Y screen position of the gadget. |
| GetChild | Returns the gadget with the name from the child list. |
| GetCurrentTab | Returns the current tab. |
| GetEdgeOffset | Returns the distance from the edge of the gadget to the first/last tabs. |
| GetFirstTab | Returns the first visible tab. |
| GetNumTabs | Returns the number of tabs. |
| GetShowBorder | Returns whether or not the border is showing. |
| GetTabAutoHeight | Returns whether tab auto height is on or off. |
| GetTabAutoWidth | Returns whether tab auto width is on or off. |
| GetTabEnabled | Returns whether the tab is enabled or not. |
| GetTabHeight | Returns the height of the tab. |
| GetTabOverlap | Returns the amount the tabs will overlap. |
| GetTabText | Returns the text on the tab. |
| GetTabTip | Returns the tip of the tab. |
| GetTabWidth | Returns the width of the tab. |
| gMouseDown | Called when the mouse button is pressed on the gadget. |
| gMouseUp | Called when the mouse button is released on the gadget. |
| IsMouseOver | Returns whether or not the mouse is over the gadget. |
| KeyPress | Called when a key is pressed on the active gadget. |
| LoadSkin | Loads a skin for one insance of the gadget. |
| LostFocus | Called when the gadget is no longer the Active Gadget. |
| MouseStatus | Called to determine the mouse status from the gadget. |
| Refresh | Refreshes the gadget. |
| RemoveTab | Removes a tab. |
| RemoveTabChild | Removes a child from a tab. |
| SetCurrentTab | Sets the current tab. |
| SetEdgeOffset | Sets the distance from the edge of the gadget to the first/last tabs. |
| SetFirstTab | Sets the first visible tab. |
| SetFont | Sets the font of the gadget. |
| SetShowBorder | Sets whether or not the border will show. |
| SetTabAutoHeight | Sets Tab Auto Height on or off. |
| SetTabAutoWidth | Sets Tab Auto Width on or off. |
| SetTabEnabled | Sets the tab enabled/disabled. |
| SetTabHeight | Sets the height of the tab. |
| SetTabOverlap | Sets the amount th etabs will overlap. |
| SetTabText | Sets the text on the tab. |
| SetTabTip | Sets the tip of the tab. |
| SetTabWidth | Sets the width of the tab. |
| SlaveEvent | Called from a slave gadget. |
| Functions Summary | |
|---|---|
| Create | Create and returns a tabber gadget. |
| LoadTheme | Called to load the graphics when a new theme is loaded. |
| SystemEvent | GUI system event occured. |
| Method AddTab(strText:String, strTip:String = "", intWidth:Int = 0, intIndex:Int = -1) | |
| Description | Adds a tab. |
| Method AddTabChild(gadget:ifsoGUI_Base, intTab:Int) | |
| Description | Adds a child to a tab. |
| Method Draw(parX:Int, parY:Int, parW:Int, parH:Int) | |
| Description | Draws the gadget. |
| Information | Internal function should not be called by the user. |
| Method GainFocus(LostFocus:ifsoGUI_Base) 'Gadget Got focus | |
| Description | Called when the gadget becomes the active gadget. |
| Information | Internal function should not be called by the user. |
| Method GetAbsoluteXY(iX:Int Var, iY:Int Var, caller:ifsoGUI_Base = Null) | |
| Description | Returns the absolute X and Y screen position of the gadget. |
| Method GetChild:ifsoGUI_Base(name:String) | |
| Description | Returns the gadget with the name from the child list. |
| Information | Internal function should not be called by the user. |
| Method GetCurrentTab:Int() | |
| Description | Returns the current tab. |
| Method GetEdgeOffset:Int() | |
| Description | Returns the distance from the edge of the gadget to the first/last tabs. |
| Method GetFirstTab:Int() | |
| Description | Returns the first visible tab. |
| Method GetNumTabs:Int() | |
| Description | Returns the number of tabs. |
| Method GetShowBorder:Int() | |
| Description | Returns whether or not the border is showing. |
| Method GetTabAutoHeight:Int() | |
| Description | Returns whether tab auto height is on or off. |
| Method GetTabAutoWidth:Int() | |
| Description | Returns whether tab auto width is on or off. |
| Method GetTabEnabled:Int(intTab:Int) | |
| Description | Returns whether the tab is enabled or not. |
| Method GetTabHeight:Int() | |
| Description | Returns the height of the tab. |
| Method GetTabOverlap:Int() | |
| Description | Returns the amount the tabs will overlap. |
| Method GetTabText:String(intTab:Int) | |
| Description | Returns the text on the tab. |
| Method GetTabTip:String(intTab:Int) | |
| Description | Returns the tip of the tab. |
| Method GetTabWidth:Int(intTab:Int) | |
| Description | Returns the width of the tab. |
| Method gMouseDown(iButton:Int, iMouseX:Int, iMouseY:Int) | |
| Description | Called when the mouse button is pressed on the gadget. |
| Information | Internal function should not be called by the user. |
| Method gMouseUp(iButton:Int, iMouseX:Int, iMouseY:Int) | |
| Description | Called when the mouse button is released on the gadget. |
| Information | Internal function should not be called by the user. |
| Method IsMouseOver:Int(parX:Int, parY:Int, parW:Int, parH:Int, iMouseX:Int, iMouseY:Int) | |
| Description | Returns whether or not the mouse is over the gadget. |
| Information | Internal function should not be called by the user. |
| Method KeyPress(key:Int) | |
| Description | Called when a key is pressed on the active gadget. |
| Information | Internal function should not be called by the user. |
| Method LoadSkin(strSkin:String) | |
| Description | Loads a skin for one insance of the gadget. |
| Method LostFocus(GainedFocus:ifsoGUI_Base) 'Gadget Lost focus | |
| Description | Called when the gadget is no longer the Active Gadget. |
| Information | Internal function should not be called by the user. |
| Method MouseStatus:Int(iMouseX:Int, iMouseY:Int) | |
| Description | Called to determine the mouse status from the gadget. |
| Information | Called to the active gadget only. Internal function should not be called by the user. |
| Method Refresh() | |
| Description | Refreshes the gadget. |
| Information | Recalculates any geometry/font changes, etc. Internal function should not be called by the user. |
| Method RemoveTab(intTab:Int) | |
| Description | Removes a tab. |
| Method RemoveTabChild(gadget:ifsoGUI_Base, intTab:Int, bDestroy:Int = True) | |
| Description | Removes a child from a tab. |
| Method SetCurrentTab(intTab:Int) | |
| Description | Sets the current tab. |
| Method SetEdgeOffset(intEdgeOffset:Int) | |
| Description | Sets the distance from the edge of the gadget to the first/last tabs. |
| Method SetFirstTab(intFirstTab:Int) | |
| Description | Sets the first visible tab. |
| Information | Only useful if more tabs than are visible at a time are in use. |
| Method SetFont(Font:TImageFont) | |
| Description | Sets the font of the gadget. |
| Information | Set to Null to use the default GUI font. |
| Method SetShowBorder(bShowBorder:Int) | |
| Description | Sets whether or not the border will show. |
| Method SetTabAutoHeight(intTabAutoHeight:Int) | |
| Description | Sets Tab Auto Height on or off. |
| Method SetTabAutoWidth(intAutoWidth:Int) | |
| Description | Sets Tab Auto Width on or off. |
| Method SetTabEnabled(intTab:Int, intEnabled:Int) | |
| Description | Sets the tab enabled/disabled. |
| Method SetTabHeight(intHeight:Int) | |
| Description | Sets the height of the tab. |
| Method SetTabOverlap(intTabOverlap:Int) | |
| Description | Sets the amount th etabs will overlap. |
| Method SetTabText(intTab:Int, strText:String) | |
| Description | Sets the text on the tab. |
| Method SetTabTip(intTab:Int, strTip:String) | |
| Description | Sets the tip of the tab. |
| Method SetTabWidth(intTab:Int, intWidth:Int) | |
| Description | Sets the width of the tab. |
| Method SlaveEvent(gadget:ifsoGUI_Base, id:Int, data:Int, iMouseX:Int, iMouseY:Int) | |
| Description | Called from a slave gadget. |
| Information | Slave gadgets do not generate GUI events. They send events to their Master. The Master then uses it or can send a GUI event. Internal function should not be called by the user. |
| Function Create:ifsoGUI_Tabber(iX:Int, iY:Int, iW:Int, iH:Int, strName:String, intNumTabs:Int) | |
| Description | Create and returns a tabber gadget. |
| Function LoadTheme() | |
| Description | Called to load the graphics when a new theme is loaded. |
| Information | A GadgetSystemEvent is then sent out to all gadgets. Internal function should not be called by the user. |
| Function SystemEvent(id:Int, data:Int) | |
| Description | GUI system event occured. |
| Information | Internal function should not be called by the user. |
| Version | 1.00 |
|---|---|
| Author | Marcus Trisdale |
| Copyright | (c) 2009 Marcus Trisdale |


Sandra Coburn got an Associate Degree in Computer Information Systems in 2000. Took a 20 yr brake to raise 5 kids. Wanted to go back to school to get a bachelors degree but software Engineer son convinced her to join Lambda. He said no upfront money and not unnecessary classes, just coding and that was it. Currently working as a TL to have something to put in her resume. Loving meeting ambitious future software Engineers at Lambda.
After a childhood of making movies and writing music for his rock band, Shawn spent 2 years learning and speaking fluent Spanish in California and Mexico. He then returned to Utah State University, where he got his Bachelors Degree in Marketing. After a few years of working in Marketing and Advertising at some of the top agencies in the world, Shawn had noticed that his side hobby of iOS Development had turned into his main interest. He is currently a student at Lambda School and expects to graduate soon and pursue a career in the tech industry.
Brian Rouse is an OS Engineering student at Lambda. I teach several Swift courses on Udemy and have published a few Apps on the App Store. You can find me Sun-Thurs nights from 10 PM-7 AM at any Ohio Health Hospital currently working as a Lead Data Tech terminating or moving, adding, changing, deleting, (MACD's) ethernet circuits eg. changing code blue pbx telephone lines to digital VoIP lines.
In addition to being an XCode-ninja, Cody Morley has worked as a stand up comic for the past 17 years. He began software development in his spare time in 2018 before becoming a Lambda Student. He currently residedes in Los Angeles California with his wife Bling and their dog, Cosmo. Photo Credit 2016, Troy Conrad - Comedy Store Hallway Series.
I am a full stack web developer. I enjoy traveling the US as a digital nomad, seeing what is around the next corner of each, and visiting some interesting places. I enjoy working remotely and seeing what new challenges coding has to offer.
I’m a front-end software engineer currently studying web development at Lambda School. My interests lie in user experience and user interface design.
My name is Ruben, I'm from New York,NY. I'm a frontend student attending Lambda School currently but really looking forward to backend work. I am interested in stability.
Noah Green is a software developer learning web development through Lambda School.


Hello World!
My name is Kevin Gallagher. I'm 19, Irish and studying Interaction Design at the University of Ulster Belfast. I have recently started a part time job in a bar where I work till 2 or 3 in the morning and I rarely know what day it is.. but yeah it's all great. I'm sort of an Nintendo nerd and do love alot of TV shows and movies, but mostly I'm a happy guy that loves my family, hanging out with friends, mountains of gorgeous food but also great design.
School
A little history. I went to school at Saint columb's College in Derry. It was here that I realised all I wanted to do was to work in the Art and Design feild. At the time i tried to picture myself as a painter or a fine art student but I could never really see it. It was just I had no idea what I really wanted to do and the whole thought of the "Big Bad World" with its endless possibliltys was slightly scary at least.
Foundation
I started my fountation art degree year in Belfast. This was a huge year for learning and I loved (almost) every minute of it. I soon realised that the design route was for me and by the end of the year I knew I wamted to study IXD.
Uni
This year I started my IXD degree. I'm really looking forward to learning more about design and becoming a better designer.


To enjoy the glow of good health, you must exercise.
14 May 2016
Dr.Ahsan Rahat
Exercising regularly, every day if possible, is the single most important thing you can do for your health. In the short term, exercise helps to control appetite, boost mood, and improve sleep. In the long term, it reduces the risk of heart disease, stroke, diabetes, dementia, depression, and many cancers. The Centers for Disease Control and Prevention recommend the following:
For Children
At least 60 minutes of physical activity a day, most of which should be devoted to aerobic exercise. Children should do vigorous exercise
For Adults
At least 150 minutes of moderate aerobic exercise like brisk walking or 75 minutes of rigorous exercise like running (or an equivalent mix of both) every week. It’s fine to break up exercise into smaller sessions as long as each one lasts at least 10 minutes.Strength-training that works all major muscle groups—legs, hips, back, abdomen, chest, shoulders, and arms—at least two days a week. Strength training may involve lifting weights, using resistance bands, or exercises like push-ups and sit-ups, in which your body weight furnishes the resistance.
For pregnent Women
The guidelines for aerobic exercise are considered safe for most pregnant women. The CDC makes no recommendation for strength training. It’s a good idea to review your exercise plan with your doctor.
Exercising regularly, every day if possible, is the single most important thing you can do for your health. -Dr.Ahsan Rahat
This website is dedicated to high performance conditioning, strength, and athletic development. The longtime trainer and boxing coach understands that a successful fitness regimen boils down to finding what works for you. His blog is a great resource for information about different kinds of training — from fitness fundamentals to old-school workouts like jumping rope to philosophical riffs on mental endurance.
Reading is to the mind what exercise is to the body.
14 May 2016
Dr.Tahsin Refat
Being healthy and fit in simple terms means taking good care of the body. We should remember that a healthy mind resides only in a healthy body. Good health of both mind and body helps one maintain the required energy level to achieve success in life. All of us must strive to achieve wholesome health.
Protecting your body from the intake of harmful substances, doing regular exercises, having proper food and sleep are some of the important instances that define a healthy lifestyle. Being fit allows us to perform our activities without being lethargic, restless or tired.
A healthy and fit person is capable of living the life to the fullest, without any major medical or physical issues. Being healthy is not only related to the physical well-being of a person, it also involves the mental stability or the internal peace of a person.
Generally, a healthy diet consists of taking a proper and healthy food which includes eating green and fresh vegetables, fruits, having milk, eggs, minerals, proteins and vitamins essential for a human’s lifestyle. Practicing Yoga including regular exercises in your daily routine also help you maintain your desired fitness, blood sugar and immunity level.
Healthy habits improve your physical appearance, mental stability, ability to perform activities in a better way, which help you lead a stress-free lifestyle, maintaining happy moods, high energy levels, etc. Each individual should take of one’s health on a priority; no single day should be skipped for making efforts on maintaining physical and mental fitness. Being happy is directly related to boosting your mental strength and health, so happiness can be considered as the result as well as the part of a healthy and fit lifestyle.
Practice puts brains in your muscles.
14 May 2016
Dr.Saika Binte Islam
Health can, generally, be measured on major three parameters: Physical, Psychological and Nutritional. Physical health means the physical appearance of a person; Nutritional health means the presence of essential nutrients in the body to fight diseases with immunity. Psychological health means the ability in a person to maintain patience, calm and composure in all circumstances of life.
Health professionals consider cancer, diabetes and several other mental and physical health issues such as depression, lethargic attitude, etc to deficiencies in fitness and well-being of a person. Unhealthy and unfit lifestyle of a person also results in premature death. Obesity and lack of physical fitness in young generation sets the stage for diabetes, heart disease, and other serious health problems.
Walking, running, cycling, playing, swimming, gardening, skipping, weight-lifting and Yoga are some of the important activities which help us maintain fit and healthy lifestyle.
One should also spend time outdoors in the sun, inhaling fresh air and taking part in healthy activities. Staying active makes you stay energetic.
A muscle is like a car.
14 May 2016
Dr.Mahedi Kamal
Good health helps a person to live one’s life to its fullest potential without being physically or mentally unfit. Unhealthy lifestyle results in deterioration of one’s wellbeing. Staying healthy and fit is very important for each generation. Exercising and eating healthy are the best ways to retain your health both physically and mentally.
People, who take their health seriously and are serious about maintaining their fitness, do exercises on a daily basis, eat a healthy diet, and sleep well on time for adequate duration.
Being healthy and fit allows you to stay active and further increases your confidence and concentration power. By staying healthy and fit, one can set an example for others and slowly help others increase their health, nutrition, knowledge, and consumption of sustainably produced foods.Regular Exercise routine – Each individual should focus on a defined time for daily exercise, as it directly affects both mental and physical health of a person.
Balanced nutritional food intake – One should concentrate on each and every thing to eat and drink. Having a balanced diet that includes essential minerals, vitamins and proteins makes a person healthy and fit.
Clean and tidy environment – We should make sure our surroundings clean and fit for us to survive.
Take appropriate amount of sleep. Each individual, as per medical norms, should take at least 8 hours of sleep.
Drink loads of water, as it helps to release toxins and improve one’s metabolism.
Maintain hygiene and have proper sanitation.
Have a positive outlook towards life. For mental health, it is the key to stay fit and healthy. Positive thoughts should rule the mind in order to stay happy and maintain the mental and emotional health and fitness.
Staying healthy and fit is not difficult if taken as the foremost priority. By following the above-mentioned simple steps, each one of us can lead a healthy, fit and fruitful life. Maintaining balance of thoughts, nutritional diet, rigorous exercise, Yoga, optimum level of sleep are actually the main contributory factors for our wellbeing and a healthy and fit lifestyle.
It's challenging, but you have to at least try to eat right and exercise.
14 May 2016
Dr.Ramisha Fariha Baki
Health is a dynamic process. It keeps on changing as we change our lifestyle, our eating habits, our sleeping routine, our thoughts, etc. Each day we should work towards maximizing our level of health and wellness to lead long, full, and healthy lives. Our defined aim should be planning our day in a manner that maintains balance of our physical and mental usage. We can make a huge difference in our lives by staying fit and healthy.
Among the most crucial reasons for decline in health today is the lack of proper amount of vitamins and minerals. Improper intake of vegetables, fruits and dairy products leads to absence of minerals and vitamins in our body. Lack of minerals and vitamins lead to all kinds of diseases as nutrients are essentially required to build and repair the blood, tissues, muscles and bones.
Good health not only means a state of absence of diseases in the body but a complete physical, mental, social as well as spiritual wellbeing of an individual.
Being healthy means having a healthy brain, flexible movements of body, more energetic, happy moods, peace and patience, etc. Fitness does not only mean your physical wellbeing, it is a combination of physical and mental health of a person.
Stress, anxiety, mood fluctuations also represent unhealthy traits of a person. Health refers to the physical, emotional and psychological well-being of a person.
Every generation should take care of their health and fitness. Since childhood, it is easy to focus on this aspect of life as dietary habits of childhood are difficult to change afterwards. For this we should refrain from overfeeding the children.
Expert's view on this website
Mahapara Naim
15 November 2020
This blog specialize in healthy lifestyles, weight loss, functional body weight training and gluten free nutrition. Daily, I coach, motivate and empower others to turn their excuses into solutions and become their best possible selves. I help you decide to take control of your body, mind, business and life and I share the tools with you to get to the point and have success!
Raiyan Jahangir
15 November 2020
This blog offers users a comprehensive and easy-to-use portfolio of health and fitness products, services & content. Why? Because we want our users to track their daily lives and develop better awareness of how they're living. We want to help them reach their goals, live better & live longer.


Wit is a Natural Language Processing tool.
This tool is used in L.I.S.A to parse the text sent by the client. Wit returns a structured JSON and this one is sent to the plugin (jsonInput parameter).
At this moment Wit is not available in an offline mode. The Wit team announced that Wit will be gradually open sourced in the future, and an offline version is on the roadmap.
To use it online : https://www.wit.ai
Then, go to the bottom of the page and ask for an account saying you want to try wit with L.I.S.A
Developpers will give you an account, but during the waiting, read the documentation to see all possibilities and how it works.
How your plugin’s JSON should like:
{
"name": "ChatterBot",
"version": "1.2.2",
"author": "Julien Syx",
"description": [
{"lang": "fr", "description": "Ce plugin est celui par défaut intégrant les interactions basiques avec LISA"},
{"lang": "en", "description": "This plugin is shipped by default, managing all basic interactions with LISA"},
{"lang": "ru", "description": "Этот плагин по умолчанию интеграции основных взаимодействий с LISA"}
],
"enabled": 1,
"lang": ["fr","en","ru"],
"configuration": {
"intents": {
"chatterbot_time": {
"method": "getTime",
"corpus": {}
},
"chatterbot_hello": {
"method": "sayHello",
"corpus": {}
}
},
"widgets": {
"getTime": "ChatterBot.web.views.widget1"
}
}
}
On intents dictionary, you can create intent. By convention the format is <plugin>_<intent>.
Then in the method, you define the method name of your plugin class. For example, the method getTime will call the method ChatterBot().getTime().
The method will automatically receive a json as argument containing all infos sent by Wit, and infos from sender.
Basically it contains the sentence spoken and a dictionary with this sentence processed (see Wit demo).
The corpus field will be removed in future version as developers of Wit want to do something similar to Github : the possibility to fork an intent.
Plugin’s developers will be able to share their intents/entities and sentences associated, so it will be automatically added to your instance when you will install a plugin. As an intent isn’t shareable yet, please send me a mail at<EMAIL_ADDRESS>and I will share you a screenshot of my intent to let you reproduce it for a plugin.


| Enum Constant and Description |
|---|
INSTANCE
Implicit empty constructor.
|
| Modifier and Type | Field and Description |
|---|---|
private java.sql.Connection |
connection |
private int |
countID |
private java.lang.String |
databasePath |
private java.sql.Statement |
statement |
| Modifier and Type | Method and Description |
|---|---|
void |
createTable()
Creates table with all the homeworkTasks, if it doesn't exist yet.
|
private void |
deleteEmptyTasks()
deletes all the homeworkTasks from the database where field homeworkTask is empty
used when updating a day of which an item has been removed (by dragging)
|
private void |
deleteTable(java.lang.String tableName)
Delete a given table from the database.
|
private void |
deleteTask(int id)
Delete a homeworkTask from the database given its id
|
private void |
deleteTasksDay(java.time.LocalDate day)
Deletes all homeworkTasks from the database for a given day.
|
java.util.List<Task> |
getTasksDay(java.time.LocalDate day)
Gets all the homeworkTasks on a given day.
|
private void |
insertTask(java.time.LocalDate day,
Task homeworkTask,
int order)
inserts a homeworkTask into the database, given
|
private void |
query(java.lang.String sql)
Sends query to the database.
|
private void |
setConnection()
create a connection with the database
|
void |
setDefaultDatabasePath()
sets the default path of the database to the directory the jar file is in
|
private void |
setHighestID()
Sets countID to the highest ID that's currently in the database.
|
void |
updateTasksDay(java.time.LocalDate day,
java.util.List<Task> homeworkTasks)
updates a day in the database
|
static Database |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Database[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Database INSTANCE
private java.sql.Connection connection
private java.sql.Statement statement
private java.lang.String databasePath
private int countID
public static Database[] values()
for (Database c : Database.values()) System.out.println(c);
public static Database valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic void createTable()
public java.util.List<Task> getTasksDay(java.time.LocalDate day)
day
- - the date for which to get all the homeworkTaskspublic void updateTasksDay(java.time.LocalDate day, java.util.List<Task> homeworkTasks)
day
- - date for which to updatehomeworkTasks
- - Listpublic void setDefaultDatabasePath()
private void setConnection()
private void insertTask(java.time.LocalDate day, Task homeworkTask, int order)
day
- - the date as a LocalDatehomeworkTask
- - the homeworkTask to be insertedorder
- - this is the i-th homeworkTask on this day, as an intprivate void setHighestID()
private void deleteTask(int id)
id
- - id of a homeworkTask (primary key in the database)private void deleteEmptyTasks()
private void deleteTasksDay(java.time.LocalDate day)
day
- - the day of which all homeworkTasks have to be deleted. Calendar
object.private void deleteTable(java.lang.String tableName)
tableName
- - name of the table that has to be deletedprivate void query(java.lang.String sql)
sql
- - string with the sql query


Test 1
Test 2
Test 3
Test 4
< Back to widget demos
Simple example listening to in/out events at both the window level (Test 1-3) and a DIV that scrolls with Test 4 inside.


0L Systems is a simple implementation of a 0L System renderer. A 0L System, or more formally a L System, is a string rewriting system which produce a long string to be interpreted as commands for a LOGO turtle.
Installation of 0L Systems is no more different than installation of any other Palm OS program:
When the synchronization is done you will have a '0L Systems' icon in the Unfiled category on your Palm PDA. Feel free to move 0L Systems to another category.
Welcome to the boring part - I will keep it short :) As said in the introduction a L System is a string rewriting system which, based on a user-defined Axiom and possible a set of Production Rules, generates a long commend string suitable for interpretation by a LOGO-like turtle.
Using 0L Systems or more advanced L Systems it is easy to create f.ex. advanced trees and bushes given a short Axiom and a few production rules.
So how does it work? Let me show you by using the classic Von Koch Snowflake curve as an example. The Von Koch Snowflake curve is shown on the frontpage in its sixth stage.
Imagine a simple LOGO turtle capable of these commands:
We start out with a straight line. This is written as F. In all stages we substitute all straight lines with the sequence:
forward, turn left, forward, turn right twice, forward, turn left, forward
This, the Production Rule, is written as:
F-F++F-F
Formally:
F -> F-F++F-F
After stage one our Axiom (F) becomes F-F++F-F - see picture 1 below.
The output from stage 1 is used as Axiom in stage 2. Again we substitute with the sequence above getting:
F-F++F-F - F-F++F-F ++ F-F++F-F - F-F++F-F
This is shown in picture 2 below.
The output from stage 2 is used as Axiom in stage 3. After substitution:
| F-F++F-F - F-F++F-F ++ F-F++F-F - F-F++F-F - |
| F-F++F-F - F-F++F-F ++ F-F++F-F - F-F++F-F ++ |
| F-F++F-F - F-F++F-F ++ F-F++F-F - F-F++F-F - |
| F-F++F-F - F-F++F-F ++ F-F++F-F - F-F++F-F |
... and so on. As you can see from the pictures below, the pictures are getting richer and richer on details.
1 - stage 1: | 2 - stage 2: | 3 - stage 3: |
A great deal of imagination is required for creating good-looking 0L Systems - try it and see for yourself :)
The turtle understands a basic set of commands:
... later versions will feature colour-commands. Can somebody please donate a M505? :)
When starting 0L Systems you are met with the Axiom form:
Press Rules to go to the Production Rules form. Press Load to load one of the default L Systems installed.
On the Production Rules form you enter the various production rules:
You can override the meaning of the F and f commands - this is f.ex. done in the Von Koch Snowflake curve.
Press Generate to start rendering. Press Axiom to go back to the Axiom form - input written on the Axiom and Production Rules forms is saved between the forms. So you can switch back and forth between these forms without loosing input. Press Clear to clear all fields on the Production Rules form.
Rewriting of the string can take some time. While working the following view is shown:
Press Cancel to abort.
When the string has been rendered, you have the option to save the data used to create the string.
If you during string expansion gets the dreaded "Out of memory" box try to lower the depth.
Using the default 0L Systems as base for your own experiments seems like a good idea.
Strange angles usually results in strange drawings unless used in conjunction with the push and pop commands.


Optimizations
Remove Unused Styles
Merge Declarations
Rewrite Idents
Rewriter Config
Rewrite IDs
Analyze
Forms
IDs
Load Demo
--


The Internationalization enhancements for Java SE 7 include the following:
Early versions of the Java SE 7 release added support for Unicode 5.1.0. The final version of the Java SE 7 release supports Unicode 6.0.0. Unicode 6.0.0 is a major version of the Unicode Standard and adds support for over 2000 additional characters, as well as support for properties and data files.
The Java Tutorial has a new section that discusses Unicode.
Currencies are identified by their ISO 4217 codes. These codes maintained by an external agency and are released independent of the Java SE platform. As of Java SE 7, it is possible to accommodate new currencies without requiring a new release of the JDK.
To supersede the default currency at runtime, create a
properties file named
<JAVA_HOME>/lib/currency.properties
. This file
contains the key/value pairs of the ISO 3166 country code, and the
ISO 4217 currency data. The value part consists of three
comma-separated ISO 4217 currency values: an alphabetic code, a
numeric code, and a minor unit. Any lines beginning with the hash
character, #
, are treated as comment lines. For
example:
# Sample currency property for Japan JP=JPZ,999,0
The new API for this feature includes the following methods, all
in the Currency
class:
The default locale can be independently set for two types of
uses: the format setting is used for formatting resources,
and the display setting is used in menus and dialogs. The
new
getDefault(Locale.Category) method takes a
Locale.Category
parameter. Passing the
FORMAT
enum to the method returns the default locale
for formatting resources. Similarly, passing the
DISPLAY
enum returns the default locale used by the
UI. The
setDefault(Locale.Category, Locale) method is used to set the
locale for the specified category. The no-argument
getDefault
method returns the DISPLAY
default value.
On Microsoft Windows, these default values are initialized according to the "Standard and Formats" and "Display Language" settings in the Windows control panel.
The Locale
class has been updated to implement
identifiers interchangeable with BCP 47 (IETF BCP 47, "Tags for
Identifying Languages"), with support for the LDML (UTS#35,
"Unicode Locale Data Markup Language") BCP 47-compatible extensions
for locale data exchange.
The following nested classes have been added to the
Locale
class in this release:
Locale
instance and to configure
that instance using setter methods.The following methods have been added to the Locale
class:
The following constants have been added to the
LOCALE
class:
For more information, see the Creating a Locale and BCP 47 Extensions lessons in the Java Tutorial.
The NumericShaper
class is used to convert Latin-1
(European) digits to other Unicode decimal digits. For the Java SE
7 release, the NumericShaper.Range
enum has been added to represent a Unicode range of a script having
its own decimal digits. The following methods, using the
NumericShaper.Range
enum have been added to the Java
SE 7 release:
defaultContext
as the starting context.For more information, see the Converting Latin Digits to Other Unicode Digits lesson in the Java Tutorial.
The Regular Expressions pattern matching functionality has been
expanded to support Unicode 6.0. You can match Unicode code points
using either the \u
or the \x
escape
sequence.
The Unicode Support page in the Java Tutorial has more information.


MinCostFlow
It solves Minimum-cost flow problem.
Constructor
mcf_graph<Cap, Cost> graph(int n);
It creates a directed graph with $n$ vertices and $0$ edges. Cap
and Cost
are the type of the capacity and the cost, respectively.
Constraints
- $0 \leq n \leq 10^8$
Cap
and Cost
are int
or ll
.
Complexity
add_edge
int graph.add_edge(int from, int to, Cap cap, Cost cost);
It adds an edge oriented from from
to to
with capacity cap
and cost cost
. It returns an integer $k$ such that this is the $k$-th edge that is added.
Constraints
- $0 \leq \mathrm{from}, \mathrm{to} \lt n$
- $0 \leq \mathrm{cap}, \mathrm{cost}$
Complexity
min_cost_max_flow
(1) pair<Cap, Cost> graph.flow(int s, int t);
(2) pair<Cap, Cost> graph.flow(int s, int t, Cap flow_limit);
- It augments the flow from $s$ to $t$ as much as possible. It returns the amount of the flow and the cost.
- (1) It augments the $s-t$ flow as much as possible.
- (2) It augments the $s-t$ flow as much as possible, until reaching the amount of
flow_limit
.
Constraints
Complexity
min_cost_slope
vector<pair<Cap, Cost>> graph.slope(int s, int t);
vector<pair<Cap, Cost>> graph.slope(int s, int t, Cap flow_limit);
Let $g$ be a function such that $g(x)$ is the cost of the minimum cost $s-t$ flow when the amount of the flow is exactly $x$. $g$ is known to be piecewise linear.
It returns $g$ as the list of the changepoints, that satisfies the followings.
- The first element of the list is $(0, 0)$.
- Both of
.first
and .second
are strictly increasing.
- No three changepoints are on the same line.
- (1) The last element of the list is $(x, g(x))$, where $x$ is the maximum amount of the $s-t$ flow.
- (2) The last element of the list is $(y, g(y))$, where $y = \min(x, \mathrm{flow_limit})$.
Constraints
Let $x$ be the maximum cost among all edges.
- $s \neq t$
- You can't call
min_cost_slope
or min_cost_max_flow
multiple times.
- The total amount of the flow is in
Cap
.
- The total cost of the flow is in
Cost
.
- (Cost :
int
): $0 \leq nx \leq 2 \times 10^9 + 1000$
- (Cost :
ll
): $0 \leq nx \leq 8 \times 10^{18} + 1000$
Complexity
- $O(F (n + m) \log n)$, where $F$ is the amount of the flow and $m$ is the number of added edges.
edges
struct edge<Cap, Cost> {
int from, to;
Cap cap, flow;
Cost cost;
};
(1) mcf_graph<Cap, Cost>::edge graph.get_edge(int i);
(2) vector<mcf_graph<Cap, Cost>::edge> graph.edges();
- It returns the current internal state of the edges.
- The edges are ordered in the same order as added by
add_edge
.
Constraints
Complexity
- (1): $O(1)$
- (2): $O(m)$, where $m$ is the number of added edges.
Examples
#include <atcoder/mincostflow>
#include <iostream>
using namespace std;
using namespace atcoder;
const long long BIG = 1'000'000'000;
int main() {
int n, k;
cin >> n >> k;
/**
* generate (s -> row -> column -> t) graph
* i-th row correspond to vertex i
* i-th col correspond to vertex n + i
**/
mcf_graph<int, long long> g(2 * n + 2);
int s = 2 * n, t = 2 * n + 1;
// we can "waste" the flow
g.add_edge(s, t, n * k, BIG);
for (int i = 0; i < n; i++) {
g.add_edge(s, i, k, 0);
g.add_edge(n + i, t, k, 0);
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
long long a;
cin >> a;
g.add_edge(i, n + j, 1, BIG - a);
}
}
auto result = g.flow(s, t, n * k);
cout << 1LL * n * k * BIG - result.second << endl;
vector<string> grid(n, string(n, '.'));
auto edges = g.edges();
for (auto e : edges) {
if (e.from == s || e.to == t || e.flow == 0) continue;
grid[e.from][e.to - n] = 'X';
}
for (int i = 0; i < n; i++) {
cout << grid[i] << endl;
}
return 0;
}


There is a different field constructor for each kind of form. Normally, you will declare one of
them as default for each of your templates, but you can mix them if you want.
Inputs, checkboxes, radio buttons, selects, input-groups, custom inputs, ...
You have the essential input helpers you could need. But this library is for the community,
so you can collaborate or ask for others.
Coherence and consistency
Boolean attributes
Sometimes the HTML syntax could be confusing. For example, all of the following codes are equivalent:
@code {
}
For that reason, b3 helpers will simply remove the attribute with false values and
put "true" value for true ones. So you can do:
Readonly attribute for checkboxes, radio buttons and selects
Another frustrating and typical situation occurs when you try to use the readonly attribute
for checkboxes, radio buttons or selects. It isn't implemented, so you usually need to add an extra
<input type="hidden"> if you need to send its value within your POST request. For
that cases, b3 helpers for checkboxes, radio buttons and selects automatically add that
input for you.
Additionally, in that cases, when you add the readonly attribute, b3 helpers
will also add the disabled attribute. Then, Bootstrap 3 will avoid their interactability.
Installation
You only need to add it as a dependency in your build.sbt file. It is cross compiled
against Scala 2.10.4 and 2.11.0.
This is a very simple library, and you have all the code on
Github. So you can use it as
inspiration and create your own field constructors and/or helpers.


1. Plugin Description
Uix Page Builder is a design system that it is simple content creation interface. Drag & Drop, User-friendly and online Visual Editing.
Here are 6+ One-Page Templates for you to swipe and make your own. Here, you will find free, professional design for Uix Page Builder. We add new, fresh designs regularly in order to provide you with large variety of templates to chose from. More importantly, each module may contain a variety of styles.
You could add a new page with Uix Page Builder to your WordPress site, find the Pages menu in the WordPress Dashboard Navigation menu. Click Add new. The “Uix Page Builder Attributes” section applies page builder templates to your new page.
Included Modules
The currently available default elements:
- Custom Menu (2 layouts)
- Parallax
- Google Maps
- Pricing (4 layouts)
- Features (2 layouts)
- Testimonials carousel
- Team (2 layouts)
- Clients
- Accordion
- Tabs
- Author Card
- Progress Bar
- Portfolio
- Blog
- Slider
- Instagram Feed
- Sidebar
- Uix Products (Require the WP plugin “Uix Products”)
- Uix Slideshow (Require the WP plugin “Uix Slideshow”)
- Contact Form (Require the WP plugin “Contact Form 7”)
Features
- Support Custom Post Types to create a portfolio list in WordPress. (Require the WP plugin Uix Products)
- Support Custom Post Types to create a slideshow in WordPress. (Require the WP plugin Uix Slideshow)
- You can switch between “Visual Builder” and “Default Editor” modes at any time on the Pages Add New/Edit Screen.
- Support to choose multiple default templates you want.
- Support to save custom templates and export templates.
- Support a key to add anchor links based Uix Page Builder to your navigation. Visit the Menus page (Appearance « Menus), choose items like “Uix Page Builder Anchor Links”, from the left column to add to the menu.
- Simple operation window, support loop list items.
- Customizable core style sheets.
- Drag and Drop Responsive Website Builder.
- Uix Page Builder supports the automatic addition of Anchor Links.
- Supports Right-To-Left (RTL) direction.
Advanced Customization ( For Theme Developer )
Please install the plugin and check out the “Uix Page Builder Helper” directly in admin panel.
2. Dependencies
WordPress requires at least the PHP 5.3+
Requires at least: WP 4.2.
3. Introduction & Usage
3.1. Usage
1. After activating your theme, you can see a prompt pointed out as absolutely critical. Go to "Dashboard » Appearance » Install Plugins". Or, upload the plugin to wordpress, Activate it. (Access the path (/wp-content/plugins/) And upload files there.)
2. Go to your WordPress admin panel, edit or create a new page. You will find "Uix Page Builder Attributes" settings in a meta box in your WordPress backend when you create a new page or when you are editing an existing one. ( You could specify the template name, in this case I used Uix Page Builder Template
. )
3.2. Custom CSS
You can overview the original styles to overwrite it. It will be on creating new styles to your website, without modifying original .css files. Go to "Dashboard » Uix Page Builder" in the WordPress Administration Screens, then link to a specific tab like "Custom CSS".
4. FAQ
FAQ 1: How To Create a Full Width or Boxed Layout?
On visual builder page, expand the from Drag & Drop modules of left sidebar. You can easily choose the type of container.
FAQ 2: How To Create The One-Page Navigation?
1. On visual builder page, expand the from Drag & Drop modules of left sidebar. You can enter any string in the custom ID field on the right. Such as my-portfolio
.
2. Create a new menu, and add a Custom Link for each menu item you plan on having. For each menu item, enter an id that you will assign later to the corresponding section. For example, for the menu item My Portfolio
, you would enter #my-portfolio
in the URL field.
FAQ 3: How to use a custom page builder template?
You could create Uix Page Builder template file (from the directory "/wp-content/plugins/uix-page-builder/uixpb_templates/tmpl-uix_page_builder.php" ) in your templates directory. It’s just a custom template file in the theme folder. Of course you doesn’t need to create it, you can use of the default page template or your own custom template file directly.
FAQ 4: How to create Anchor Links menu with Uix Page Builder?
Uix Page Builder supports the automatic addition of Anchor Links. From the "Appearance" menu on the left-hand side of the Dashboard, select the "Menus" option to bring up the Menu Editor. Locate the pane entitled "Uix Page Builder Anchor Links". Within this pane, select a page to view all anchor link.
FAQ 5: How to set the menu for the currently used page template of Uix Page Builder?
Go to Dashboard » Appearence » Menus. Click on "create a new menu" to create your custom menu. You should tick the appropriate checkbox of "Primary Menu"
from options as "Display location".
FAQ 6: How to customize the Uix Page Builder templates and modules in admin panel?
Please install the plugin and check out the **"Uix Page Builder Helper » For Theme Developer"** directly in admin panel.
5. API
Coming soon...
6. Credits
I would like to give special thanks to credits. The following is a guide to the list of credits for this plugin:


We got platforms!
- orchestrate ubiquitous web-readiness
- mesh one-to-one portals
- unleash web-enabled partnerships
- harness viral markets
- generate back-end methodologies
- synergize rich metrics
- integrate visionary niches
- cultivate distributed portals
- harness front-end markets
- disintermediate next-generation markets
- monetize cross-media infrastructures
- incentivize 24/7 ROI
- engage interactive e-commerce
- incentivize enterprise methodologies
- optimize value-added communities


Sweet Free Stuff
///////////////////////////////////////////
Freew Northern Motion Bike Decal
Posted: 09 Mar 2013 11:47 AM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/Crnmn8AK6b8/?utm_source=feedburner&utm_medium=email
Like them on Facebook and complete the form. Get it for Free!
///////////////////////////////////////////
Free Sample of Lipton Black Tea
Posted: 08 Mar 2013 11:59 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/k_CeQPAwAsM/?utm_source=feedburner&utm_medium=email
Get it for Free!
///////////////////////////////////////////
Free Sample of Clear Scalp & Hair Beauty Therapy
Posted: 08 Mar 2013 11:46 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/pGLbQA1HMO8/?utm_source=feedburner&utm_medium=email
Like their page on Facebook. Ge it for Free!
///////////////////////////////////////////
Free Sample of Prilosec OTC
Posted: 08 Mar 2013 11:00 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/LCYGbDGsJj8/?utm_source=feedburner&utm_medium=email
See if you qualify for a free sample of Prilosec OTC. Get it for Free!
///////////////////////////////////////////
NCP - Earn Cash and Prizes for Scanning Purchases
Posted: 08 Mar 2013 11:00 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/yGPGgXHljx0/?utm_source=feedburner&utm_medium=email
As a panel member, the National Consumer Panel will provide you with a
hand-held scanner. Every time you or members of your household shop, youll
use the scanner to scan the barcodes on all of your purchases. Then, once a
week, youll send us your purchase information. Its as easy as that! Youll
earn gift […]
///////////////////////////////////////////
Free Sample of Suave Professionals Moroccan Infusion
Posted: 08 Mar 2013 10:40 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/ug_FnFLTcRk/?utm_source=feedburner&utm_medium=email
Register for their sweepstakes and receive a free sample! Get it for Free!
///////////////////////////////////////////
H&R Block - Free Edition
Posted: 08 Mar 2013 09:00 PM PST
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/HUlKFNq3x1s/?utm_source=feedburner&utm_medium=email
Free to prepare, print, and e-file your Federal Taxes! Never settle for
less! Its easy and guaranteed to be accurate! Get it for Free!


Professionals creativity clean featured softwares for your business Let's start an awesome project now!


[gecode-users] embedded gecode
Ruben Zilibowitz
ruben.zilibowitz at gmail.com
Mon Apr 4 11:50:51 CEST 2011
Hi. I'm considering trying to use gecode on the iphone platform, or other mobile platforms. I'm aware that support for double precision floating point is limited on the iphone platform. The other main issue is the limited RAM. I've managed to compile gecode and test it on the iphone, however I'm concerned about the memory usage.
I'm wondering if there've been any attempts to do this before? Are there any tips/suggestions?
Regards,
Ruben
More information about the users
mailing list