[ all classes ]
[ it.polimi.ingsw.Game ]
Coverage Summary for Class: Game (it.polimi.ingsw.Game)
| Class | Method, % | Line, % |
|---|---|---|
| Game | 97.1% (33/ 34) | 91.7% (165/ 180) |
| Game$GodPoolSelectionState | 100% (4/ 4) | 81% (17/ 21) |
| Game$GodSelectionState | 100% (3/ 3) | 78.6% (11/ 14) |
| Game$PlayingState | 66.7% (4/ 6) | 60.5% (26/ 43) |
| Game$WorkerPlacingState | 100% (3/ 3) | 76.5% (13/ 17) |
| total | 94% (47/ 50) | 84.4% (232/ 275) |
1 package it.polimi.ingsw.Game;
2
3 import it.polimi.ingsw.Exceptions.InvalidBuildActionException;
4 import it.polimi.ingsw.Exceptions.InvalidCommandException;
5 import it.polimi.ingsw.Exceptions.InvalidMoveActionException;
6 import it.polimi.ingsw.Game.Actions.Actions;
7 import it.polimi.ingsw.Game.Actions.GodFactory;
8 import it.polimi.ingsw.Server.Lobby;
9 import it.polimi.ingsw.Utils.Pair;
10 import it.polimi.ingsw.View.Communication.*;
11 import it.polimi.ingsw.View.Communication.Broadcasters.EndGameEventBroadcaster;
12 import it.polimi.ingsw.View.Communication.Broadcasters.PlayerChoseGodEventBroadcaster;
13 import it.polimi.ingsw.View.Communication.Broadcasters.PlayerLoseEventBroadcaster;
14 import it.polimi.ingsw.View.Communication.Broadcasters.PlayerTurnUpdateBroadcaster;
15 import it.polimi.ingsw.View.Communication.Listeners.EndGameEventListener;
16 import it.polimi.ingsw.View.Communication.Listeners.PlayerChoseGodEventListener;
17 import it.polimi.ingsw.View.Communication.Listeners.PlayerLoseEventListener;
18 import it.polimi.ingsw.View.Communication.Listeners.PlayerTurnUpdateListener;
19
20 import java.util.ArrayList;
21 import java.util.Comparator;
22 import java.util.List;
23 import java.util.stream.Collectors;
24 import java.util.stream.IntStream;
25
26 public class Game implements PlayerTurnUpdateBroadcaster, PlayerLoseEventBroadcaster, EndGameEventBroadcaster, PlayerChoseGodEventBroadcaster {
27 private final GameRules rules;
28 private final List<Player> players;
29 private final int challengerPlayer;
30 private int currentPlayer;
31 private final Storage storage;
32 private final Board board;
33 private List<String> godPool;
34
35 // Game state
36 private GameState state;
37
38 /**
39 * Create a game object
40 * @param players the players taking part of this game
41 * @param rules the rules to follow
42 */
43 public Game(List<Player> players, GameRules rules) {
44 this.rules = rules;
45 this.players = new ArrayList<>();
46 this.players.addAll(players);
47 this.storage = new Storage(rules.getBlocks());
48 this.board = new Board(rules.getBoardSize().getFirst(), rules.getBoardSize().getSecond(), rules.getBlocks().length - 1);
49 this.challengerPlayer = IntStream.range(0, players.size()).boxed()
50 .max(Comparator.comparing(i -> players.get(i).getGodLikeLevel())).orElse(-1);
51 this.currentPlayer = challengerPlayer;
52
53 if (rules.getPlayWithGods()) {
54 this.state = new GodPoolSelectionState();
55 } else {
56 StartPlaying();
57 }
58
59 }
60
61 public GameRules getRules() {
62 return rules;
63 }
64
65 public Board getBoard() {
66 return this.board;
67 }
68
69 public Storage getStorage() {
70 return this.storage;
71 }
72
73 public Player getCurrentPlayer() {
74 return players.get(currentPlayer);
75 }
76
77 public List<String> getGodPool() {
78 return this.godPool;
79 }
80
81 public GameState getState() {
82 return this.state;
83 }
84
85 /**
86 * Assert that it's one player's turn
87 * @param player the player
88 * @throws InvalidCommandException if it's not the specified player's turn
89 */
90 private void checkTurn(Player player) throws InvalidCommandException {
91 Player p = players.get(currentPlayer);
92 if (!p.equals(player)) {
93 throw new InvalidCommandException("It's not your turn");
94 }
95 }
96
97 /**
98 * Generates actions objects for each player and sets up to allow placing workers
99 * To be called after setting god names for each player, or immediatly if playing with no gods
100 */
101 private void StartPlaying() {
102 List<String> godNames = players.stream()
103 .map(Player::getGodName)
104 .collect(Collectors.toList());
105 List<Actions> actions = GodFactory.makeActions(godNames);
106 for (int i = 0; i < players.size(); i++) {
107 players.get(i).setActions(actions.get(i));
108 }
109
110 state = new WorkerPlacingState();
111 }
112
113 /**
114 * Handle a set god-pool command
115 * @param player the player performing this action
116 * @param godPool the chosen god-pool
117 * @throws InvalidCommandException if it's not this player's turn,
118 * if the player is not the challenger,
119 * if the god-pool has not been chosen yet,
120 * if the god-pool contains unknown god names,
121 * if the game proceeded past the god selection phase,
122 */
123 public void SetGodPool(Player player, List<String> godPool) throws InvalidCommandException {
124 checkTurn(player);
125 state.SetGodPool(player, godPool);
126 }
127
128 /**
129 * Handle a set god command
130 * @param player the player performing this action
131 * @param god the chosen god
132 * @throws InvalidCommandException if it's not this player's turn,
133 * if the player already chose a god,
134 * if the god name is unknown,
135 * if the game proceeded past the god selection phase
136 */
137 public void SetGod(Player player, String god) throws InvalidCommandException {
138 checkTurn(player);
139 state.SetGod(player, god);
140 }
141
142 /**
143 * Handle a place worker command
144 * @param player the player performing this action
145 * @param x the x-axis coordinate on the board the worker will be placed at
146 * @param y the y-axis coordinate on the board the worker will be placed at
147 * @throws InvalidCommandException if it's not this player's turn,
148 * if the player has already placed down all its workers (depends on game rules),
149 * if x or y are invalid,
150 * if the tile at (x, y) is already occupied,
151 * if the game hasn't started playing (StartPlaying())
152 */
153 public void PlaceWorker(Player player, int x, int y) throws InvalidCommandException {
154 checkTurn(player);
155 state.PlaceWorker(player, x, y);
156 }
157
158 /**
159 * Handle a move command
160 * @param player the player that invokes this call
161 * @param fromX the starting X coordinate on the board
162 * @param fromY the starting Y coordinate on the board
163 * @param toX the destination X coordinate on the board
164 * @param toY the destination Y coordinate on the board
165 * @throws InvalidCommandException if it's not this player's turn,
166 * if the starting or destination positions are invalid,
167 * if the game hasn't entered the playing phase (StartPlaying())
168 * @throws InvalidMoveActionException if the move is invalid based on the player's god modifiers
169 */
170 public void Move(Player player, int fromX, int fromY, int toX, int toY) throws InvalidCommandException, InvalidMoveActionException {
171 checkTurn(player);
172 state.Move(player, fromX, fromY, toX, toY);
173 }
174
175 /**
176 * Handle a build command
177 * @param player the player that invokes this call
178 * @param fromX the starting X coordinate on the board
179 * @param fromY the starting Y coordinate on the board
180 * @param toX the destination X coordinate on the board
181 * @param toY the destination Y coordinate on the board
182 * @param lvl the block to build, usually should be either corresponding to the current height or a dome
183 * @throws InvalidCommandException if it's not this player's turn,
184 * if the starting or destination positions are invalid,
185 * if the game hasn't entered the playing phase (StartPlaying())
186 * @throws InvalidBuildActionException if the build is invalid based on the player's god modifiers
187 */
188 public void Build(Player player, int fromX, int fromY, int toX, int toY, int lvl) throws InvalidCommandException, InvalidBuildActionException {
189 checkTurn(player);
190 state.Build(player, fromX, fromY, toX, toY, lvl);
191 }
192
193 /**
194 * End the current turn
195 * @param player the player that invokes this call
196 * @param lose if the player has lost and we're skipping to the next one
197 * @return the next player to play
198 * @throws InvalidCommandException if it's not this player's turn,
199 * if the player must complete other actions before ending the turn
200 */
201 public Player EndTurn(Player player, boolean lose) throws InvalidCommandException {
202 checkTurn(player);
203
204 int next;
205 if (lose) {
206 doLose(player); // removes the player from `List<Player> players`
207
208 if (players.size() == 1) {
209 Player winner = players.get(0);
210 notifyEndGameEvent(new EndGameEventMessage(winner, rules.getEndGameTimer()));
211 return winner;
212 } else if (players.size() == 0) {
213 // On usual execution this cannot happen. However, if debugging alone this is necessary
214 notifyEndGameEvent(new EndGameEventMessage(null, rules.getEndGameTimer()));
215 return player; // better than null i guess
216 }
217
218 // The current player index points to the next player already,
219 // unless i was the last player, then i need to cycle back to 0
220 next = currentPlayer >= players.size() ? 0 : currentPlayer;
221 } else {
222 next = playerAfter(currentPlayer);
223 }
224 Player newPlayer = players.get(next);
225 state.EndTurn(player /* previous */, newPlayer /* new */, lose);
226
227 currentPlayer = next; // only change the current player if state.EndTurn() did not throw
228 notifyPlayerTurnUpdate(new PlayerTurnUpdateMessage(newPlayer));
229
230 // Check if the new player has lost the game
231 if (state.checkLose(newPlayer)) {
232 return EndTurn(newPlayer, true);
233 }
234
235 return newPlayer;
236 }
237
238 /**
239 * @param player the previous player
240 * @return the index of the player after the one specified
241 */
242 private int playerAfter(int player) {
243 int nextPlayer = player + 1;
244 if (nextPlayer >= players.size()) {
245 nextPlayer = 0;
246 }
247 return nextPlayer;
248 }
249
250 /**
251 * @param player the player who performs this action
252 * @param fromX the starting tile's x-coordinate
253 * @param fromY the starting tile's y-coordinate
254 * @param toX the destination tile's x-coordinate
255 * @param toY the destination tile's y-coordinate
256 * @return a pair containing the worker sitting on the starting tile, and the destination tile
257 * @throws InvalidCommandException if the specified coordinates are invalid,
258 * if the starting tile is not hosting a worker
259 * if this player already performed an action with a different worker this same turn
260 */
261 private Pair<Worker, Tile> parseAction(Player player, int fromX, int fromY, int toX, int toY) throws InvalidCommandException {
262 Tile from, to;
263 try {
264 from = board.getAt(fromX, fromY);
265 to = board.getAt(toX, toY);
266 } catch(IndexOutOfBoundsException ex) {
267 throw new InvalidCommandException("The specified tile(s) do not exist");
268 }
269 Worker w = from.getOccupant();
270 if (w == null) {
271 throw new InvalidCommandException("The specified starting tile is not hosting a worker");
272 }
273 if (!player.equals(w.getOwner())) {
274 throw new InvalidCommandException("You cannot perform an action with the specified worker");
275 }
276
277 return new Pair<>(w, to);
278 }
279
280 /**
281 * @param p the player
282 * @return a pair containing two lists representing the available move actions and build actions for the player
283 */
284 public Pair<List<MoveCommandMessage>, List<BuildCommandMessage>> computeAvailableActions(Player p) {
285 List<MoveCommandMessage> availMoves = new ArrayList<>();
286 List<BuildCommandMessage> availBuilds = new ArrayList<>();
287
288 for (int fromX = 0; fromX < board.getDimX(); fromX++) {
289 for (int fromY = 0; fromY < board.getDimY(); fromY++) {
290 for (int toX = 0; toX < board.getDimX(); toX++) {
291 for (int toY = 0; toY < board.getDimY(); toY++) {
292 try {
293 Pair<Worker, Tile> action = parseAction(p, fromX, fromY, toX, toY);
294 if (p.getActions().canMove() && p.getActions().canUseThisWorkerNow(action.getFirst()) &&
295 p.getActions().validMove(action.getFirst(), action.getSecond())) {
296 availMoves.add(new MoveCommandMessage(fromX, fromY, toX, toY));
297 }
298 for (int z = 0; z <= board.getMaxHeight(); z++) {
299 if (storage.getAvailable(z) > 0) {
300 if (p.getActions().canBuild() && p.getActions().canUseThisWorkerNow(action.getFirst()) &&
301 p.getActions().validBuild(action.getFirst(), action.getSecond(), z)) {
302 availBuilds.add(new BuildCommandMessage(fromX, fromY, toX, toY, z));
303 }
304 }
305 }
306 } catch (Exception ignored) { } // It's perfectly fine to fail here
307 }
308 }
309 }
310 }
311 return new Pair<>(availMoves, availBuilds);
312 }
313
314 /**
315 * @param player the player
316 * @return a list of the player's workers on the board
317 */
318 public List<Worker> getWorkersOf(Player player) {
319 List<Worker> workers = new ArrayList<>();
320 for (int i = 0; i < board.getDimX(); i++) {
321 for (int j = 0; j < board.getDimY(); j++) {
322 Tile tile = board.getAt(i, j);
323 Worker w = tile.getOccupant();
324 if (w != null && player.equals(w.getOwner())) {
325 workers.add(w);
326 }
327 }
328 }
329 return workers;
330 }
331
332 /**
333 * Remove a player from the game
334 * @param player the player who has lost
335 */
336 private void doLose(Player player) {
337 if (player.getActions() != null) { // it may happen in debugging that a player loses before choosing a god
338 player.getActions().onLose();
339 }
340 List<Worker> workers = getWorkersOf(player);
341 for (Worker w : workers) {
342 w.getTile().setOccupant(null);
343 w.setTile(null);
344 }
345 players.remove(player);
346 notifyPlayerLoseEvent(new PlayerLoseEventMessage(player));
347 }
348
349 //<editor-fold desc="Player turn update and lose event broadcasters">
350 private final List<PlayerTurnUpdateListener> playerTurnUpdateListeners = new ArrayList<>();
351 @Override
352 public void addPlayerTurnUpdateListener(PlayerTurnUpdateListener listener) {
353 synchronized (playerTurnUpdateListeners) {
354 playerTurnUpdateListeners.add(listener);
355 }
356 onRegisterForPlayerTurnUpdate(listener);
357 }
358 @Override
359 public void removePlayerTurnUpdateListener(PlayerTurnUpdateListener listener) {
360 synchronized (playerTurnUpdateListeners) {
361 playerTurnUpdateListeners.remove(listener);
362 }
363 }
364 @Override
365 public void notifyPlayerTurnUpdate(PlayerTurnUpdateMessage message) {
366 synchronized (playerTurnUpdateListeners) {
367 for (PlayerTurnUpdateListener listener : playerTurnUpdateListeners) {
368 listener.onPlayerTurnUpdate(message);
369 }
370 }
371 }
372 @Override
373 public void onRegisterForPlayerTurnUpdate(PlayerTurnUpdateListener listener) {
374 if (!players.isEmpty())
375 listener.onPlayerTurnUpdate(new PlayerTurnUpdateMessage(players.get(currentPlayer)));
376 }
377
378 private final List<PlayerLoseEventListener> playerLoseEventListeners = new ArrayList<>();
379 @Override
380 public void addPlayerLoseEventListener(PlayerLoseEventListener listener) {
381 synchronized (playerLoseEventListeners) {
382 playerLoseEventListeners.add(listener);
383 }
384 }
385 @Override
386 public void removePlayerLoseEventListener(PlayerLoseEventListener listener) {
387 synchronized (playerLoseEventListeners) {
388 playerLoseEventListeners.remove(listener);
389 }
390 }
391 @Override
392 public void notifyPlayerLoseEvent(PlayerLoseEventMessage message) {
393 synchronized (playerLoseEventListeners) {
394 for (PlayerLoseEventListener listener : playerLoseEventListeners) {
395 listener.onPlayerLoseEvent(message);
396 }
397 }
398 }
399
400 private final List<EndGameEventListener> endGameEventListeners = new ArrayList<>();
401 @Override
402 public void addEndGameEventListener(EndGameEventListener listener) {
403 synchronized (endGameEventListeners) {
404 endGameEventListeners.add(listener);
405 }
406 }
407 @Override
408 public void removeEndGameEventListener(EndGameEventListener listener) {
409 synchronized (endGameEventListeners) {
410 endGameEventListeners.remove(listener);
411 }
412 }
413 @Override
414 public void notifyEndGameEvent(EndGameEventMessage message) {
415 synchronized (endGameEventListeners) {
416 for (EndGameEventListener listener : endGameEventListeners) {
417 listener.onEndGameEvent(message);
418 }
419 }
420 }
421
422 private final List<PlayerChoseGodEventListener> playerChoseGodEventListeners = new ArrayList<>();
423 @Override
424 public void addPlayerChoseGodEventListener(PlayerChoseGodEventListener listener) {
425 synchronized (playerChoseGodEventListeners) {
426 playerChoseGodEventListeners.add(listener);
427 }
428 }
429 @Override
430 public void removePlayerChoseGodEventListener(PlayerChoseGodEventListener listener) {
431 synchronized (playerChoseGodEventListeners) {
432 playerChoseGodEventListeners.remove(listener);
433 }
434 }
435 @Override
436 public void notifyPlayerChoseGodEvent(PlayerChoseGodEventMessage message) {
437 synchronized (playerChoseGodEventListeners) {
438 for (PlayerChoseGodEventListener listener : playerChoseGodEventListeners) {
439 listener.onPlayerChoseGodEvent(message);
440 }
441 }
442 }
443 //</editor-fold>
444
445 //<editor-fold desc="Game state pattern">
446 public class GodPoolSelectionState implements GameState {
447 /**
448 * Handle setting a god-pool
449 *
450 * @param player the player performing this action
451 * @param godPool the chosen god-pool
452 * @throws InvalidCommandException if the player is not the challenger,
453 * if the god-pool contains unknown god names,
454 */
455 @Override
456 public void SetGodPool(Player player, List<String> godPool) throws InvalidCommandException {
457 Player challenger = players.get(challengerPlayer);
458 if (!challenger.equals(player)) {
459 throw new InvalidCommandException("You are not allowed to change the god pool");
460 }
461 if (godPool.size() != players.size() || !GodFactory.getGodNames().containsAll(godPool)) {
462 throw new InvalidCommandException("Invalid god pool");
463 }
464 Game.this.godPool = new ArrayList<>();
465 Game.this.godPool.addAll(godPool);
466 }
467
468 /**
469 * Handle choosing a god
470 * We can allow choosing a god without first setting a god-pool, if this player is playing alone
471 *
472 * @param player the player performing this action
473 * @param god the chosen god
474 * @throws InvalidCommandException depending on implementation
475 */
476 @Override
477 public void SetGod(Player player, String god) throws InvalidCommandException {
478 if (players.size() > 1) {
479 GameState.super.SetGod(player, god); // call the default method, which will throw
480 } else {
481 List<String> godPool = new ArrayList<>();
482 godPool.add(god);
483 Game.this.SetGodPool(player, godPool);
484 Game.this.EndTurn(player, false); // changes the state so the next call will go to GodSelectionState
485 Game.this.SetGod(player, god);
486 }
487 }
488
489 /**
490 * Handle turn change
491 *
492 * @param previousPlayer the player ending its turn
493 * @param newPlayer the player beginning its turn
494 * @param lose has the previous player lost
495 * @throws InvalidCommandException if the previous player has not chosen a god-pool yet
496 */
497 @Override
498 public void EndTurn(Player previousPlayer, Player newPlayer, boolean lose) throws InvalidCommandException {
499 if (godPool == null) {
500 throw new InvalidCommandException("You must choose a god pool");
501 }
502 state = new GodSelectionState();
503 }
504 }
505
506 public class GodSelectionState implements GameState {
507 /**
508 * Handle choosing a god
509 *
510 * @param player the player performing this action
511 * @param god the chosen god
512 * @throws InvalidCommandException if the player already chose a god,
513 * if the god name is unknown
514 */
515 @Override
516 public void SetGod(Player player, String god) throws InvalidCommandException {
517 if (player.getGodName() != null) {
518 throw new InvalidCommandException("You already chose a god. There's not turning back!");
519 }
520 if (!godPool.contains(god)) {
521 throw new InvalidCommandException("Invalid god name");
522 }
523 godPool.remove(god);
524 player.setGodName(god);
525 notifyPlayerChoseGodEvent(new PlayerChoseGodEventMessage(player, GodFactory.godInfoFor(god)));
526 }
527
528 /**
529 * Handle turn change
530 *
531 * @param previousPlayer the player ending its turn
532 * @param newPlayer the player beginning its turn
533 * @param lose has the previous player lost
534 * @throws InvalidCommandException if the previous player has not chosen a god yet
535 */
536 @Override
537 public void EndTurn(Player previousPlayer, Player newPlayer, boolean lose) throws InvalidCommandException {
538 if (previousPlayer.getGodName() == null || previousPlayer.getGodName().isEmpty()) {
539 throw new InvalidCommandException("You must choose a god");
540 }
541
542 if (godPool.size() == 0) {
543 // Everybody chose their god. Make Actions and move to next stage
544 StartPlaying();
545 }
546 }
547 }
548
549 public class WorkerPlacingState implements GameState {
550 /**
551 * Handle placing down a worker
552 *
553 * @param player the player performing this action
554 * @param x the x-axis coordinate on the board the worker will be placed at
555 * @param y the y-axis coordinate on the board the worker will be placed at
556 * @throws InvalidCommandException if the player has already placed down all its workers (depends on game rules),
557 * if x or y are invalid,
558 * if the tile at (x, y) is already occupied,
559 */
560 @Override
561 public void PlaceWorker(Player player, int x, int y) throws InvalidCommandException {
562 if (getWorkersOf(player).size() >= rules.getWorkers()) {
563 throw new InvalidCommandException("You can only place down 2 workers");
564 }
565 try {
566 Tile tile = board.getAt(x, y);
567 if (!tile.isEmpty()) {
568 throw new InvalidCommandException("The specified tile is already occupied");
569 }
570 new Worker(player, tile);
571 } catch (IndexOutOfBoundsException ex) {
572 throw new InvalidCommandException("The specified tile does not exist");
573 }
574 }
575
576 /**
577 * Handle turn change
578 *
579 * @param previousPlayer the player ending its turn
580 * @param newPlayer the player beginning its turn
581 * @param lose has the previous player lost
582 * @throws InvalidCommandException if the previous player has not placed down all its workers yet
583 */
584 @Override
585 public void EndTurn(Player previousPlayer, Player newPlayer, boolean lose) throws InvalidCommandException {
586 if (getWorkersOf(previousPlayer).size() != rules.getWorkers()) {
587 throw new InvalidCommandException("You must place down " + rules.getWorkers() + " workers");
588 }
589
590 int sumWorkers = players.stream().mapToInt(p -> getWorkersOf(p).size()).sum();
591 if (sumWorkers == players.size() * rules.getWorkers()) {
592 // Everybody placed down their workers. Let the game begin
593 state = new PlayingState();
594 }
595 }
596 }
597
598 public class PlayingState implements GameState {
599 /**
600 * Handle a move command during playing phase
601 *
602 * @param player the player that invokes this call
603 * @param fromX the starting X coordinate on the board
604 * @param fromY the starting Y coordinate on the board
605 * @param toX the destination X coordinate on the board
606 * @param toY the destination Y coordinate on the board
607 * @throws InvalidCommandException if the starting or destination positions are invalid
608 * @throws InvalidMoveActionException if the move is invalid based on the player's god modifiers
609 */
610 @Override
611 public void Move(Player player, int fromX, int fromY, int toX, int toY) throws InvalidCommandException, InvalidMoveActionException {
612 Pair<Worker, Tile> action = parseAction(player, fromX, fromY, toX, toY);
613 Worker w = action.getFirst();
614 Tile to = action.getSecond();
615 if (player.getActions().canMove() && player.getActions().canUseThisWorkerNow(w) &&
616 player.getActions().validMove(w, to)) {
617 boolean didWin = player.getActions().doMove(w, to);
618 if (didWin) {
619 notifyEndGameEvent(new EndGameEventMessage(player /* winner */, rules.getEndGameTimer()));
620 }
621 } else {
622 String errorMessage = "This player cannot move";
623 if (player.getActions().canMove()) {
624 errorMessage += " to the desired position";
625 }
626 throw new InvalidMoveActionException(errorMessage);
627 }
628
629 if(checkLose(player)) {
630 Game.this.EndTurn(player, true);
631 }
632 }
633
634 /**
635 * Handle a build command during playing phase
636 *
637 * @param player the player that invokes this call
638 * @param fromX the starting X coordinate on the board
639 * @param fromY the starting Y coordinate on the board
640 * @param toX the destination X coordinate on the board
641 * @param toY the destination Y coordinate on the board
642 * @throws InvalidCommandException if the starting or destination positions are invalid
643 * @throws InvalidBuildActionException if the build is invalid based on the player's god modifiers
644 */
645 @Override
646 public void Build(Player player, int fromX, int fromY, int toX, int toY, int lvl) throws InvalidCommandException, InvalidBuildActionException {
647 Pair<Worker, Tile> action = parseAction(player, fromX, fromY, toX, toY);
648 Worker w = action.getFirst();
649 Tile to = action.getSecond();
650 if (player.getActions().canBuild() && player.getActions().canUseThisWorkerNow(w) &&
651 player.getActions().validBuild(w, to, lvl) && storage.getAvailable(lvl) > 0) {
652 storage.retrieve(lvl);
653 player.getActions().doBuild(w, to, lvl);
654 } else {
655 String errorMessage = "This player cannot build";
656 if (player.getActions().canBuild()) {
657 errorMessage += " a level" + lvl + " block to the desired position";
658 }
659 throw new InvalidBuildActionException(errorMessage);
660 }
661
662 if(checkLose(player)) {
663 try {
664 Game.this.EndTurn(player, true);
665 } catch (InvalidCommandException ignored) { } // failed to lose??
666 }
667 }
668
669 /**
670 * Handle turn change
671 * @param previousPlayer the player ending its turn
672 * @param newPlayer the player beginning its turn
673 * @param lose has the previous player lost
674 * @throws InvalidCommandException if the previous player has not completed his mandatory actions (based on god modifiers)
675 */
676 @Override
677 public void EndTurn(Player previousPlayer, Player newPlayer, boolean lose) throws InvalidCommandException {
678 if (!lose && (previousPlayer.getActions().mustMove() || previousPlayer.getActions().mustBuild())) {
679 throw new InvalidCommandException("You must complete your actions first");
680 }
681 newPlayer.getActions().beginTurn();
682 }
683
684 /**
685 * Check if the player should lose the game
686 * @param player the player
687 * @return true if the player should lose now
688 */
689 @Override
690 public boolean checkLose(Player player) {
691 Pair<List<MoveCommandMessage>, List<BuildCommandMessage>> actions = computeAvailableActions(player);
692 if (player.getActions().mustMove()) {
693 return actions.getFirst().isEmpty();
694 }
695 if (player.getActions().mustBuild()) {
696 return actions.getSecond().isEmpty();
697 }
698 return false;
699 }
700
701 /**
702 * Is this state past the setup state (god selection, worker placing, etc.)
703 * @return true
704 */
705 @Override
706 public boolean currentlyPlaying() {
707 return true;
708 }
709 }
710 //</editor-fold>
711 }


Properties needed by your excelium tests can be specified here (in standard properties file format):
# comment
name1=value1
name2=$VAR2
These are passed to Excelium like "-Dname1=value1 -Dname2=value2".
Always use $VAR style (even on Windows) for references to Jenkins-defined
environment variables. On Windows, %VAR% style references may be used
for environment variables that exist outside of Jenkins.
Backslashes are used for escaping, so use \\ for a single backslash.
Double quotes (") should be avoided, as excelium on *nix wraps parameters in quotes
and runs them through eval, and Windows has its own issues
with escaping. In either case, use of quotes may result in build failure.
To define an empty property, simply write varname=


Stop supporting pre-ES5 browsers #108
Is it possible to get a build that does not add to the native String and Regexp prototypes? #89
|
On a related note, would you be interested in using babelify to compile ES2015+ code down to ES5? This would allow a variety of syntax upgrades to the files in One way of doing this is to install browserify src/index.js --standalone XRegExp --transform [ babelify --presets [ es2015 ] ] > xregexp-all.js |
|
@josephfrazier Yes I'd be happy happy to move to ES2015+ code and compile down to ES5, if you're willing to set it up. :D It would be nice to also have ES5 versions of all the individual modules, for people who don't want to use |
|
Great to hear, thanks! Given the current arrangement of milestones, I assume these changes will have to wait until #45 is resolved and v3.2.0 is released? Since the compiled |
Pre-ES5 browsers include e.g. IE 8 and earlier. Right now XRegExp still supports ancient browsers like IE 5.5, Firefox 1.5, Chrome 1, and Safari 3, which is totally unnecessary. But there's not much benefit to dropping support for these browsers until XRegExp can rely on ES5.
Some things to do after dropping pre-ES5 support:
charAt
, useArray.prototype.indexOf
, etc.XRegExp.split
just defer toString.prototype.split
, if there are few enough edge cases that ES5 browsers get wrong.nonparticipating
in code), if ES5 browsers generally get this right.[^]
and[]
transforms if all ES5 browsers get this right.


Events
Cookies and Clubs
Date: 09/19/2017 1pm
Description: A OSU sponsored event where clubs from all around the university meet up to share information about the clubs with interested new students.
First Meeting
Date: 10/05/2017
Description: Our first meeting of the term.
Who We Are
ACM is a leading academic computer science organizations. We are a student chapter of the ACM. We really like to think of this group as the OSU computer science club, in which we have events, contests, guest speakers, workshops and give away pizza.


public interface ByteSource
A ByteSource contains a sequence of bytes.
The read()
action succeeds with a ByteBuffer containing next chunk of bytes,
or fails with End
to indicate EOF.
The source must be closed
after use.
Example Usage:
ByteSource src = new FileByteSource("/tmp/data.bin"); AsyncIterator.forEach( src::read, System.out::println ) .finally_( src::close );
A ByteSource can optionally support skip(n)
.
In general, a ByteSource is not thread-safe. See ThreadSafeByteSource
for a thread-safe wrapper.
In general, concurrent pending actions are not allowed.
Particularly, close() cannot be invoked while a read() is pending.
See ThreadSafeByteSource
for a solution.
| Abstract Methods | |
|---|---|
Async<ByteBuffer> |
read()
Read the next chunk of bytes.
|
Async<Void> |
close()
Close this source.
|
| Default Methods | |
long |
skip(long n)
Try to skip forward `n` bytes; return number of bytes actually skipped.
|
Async<ByteBuffer> |
readAll(int maxBytes)
Read all bytes from this source into one ByteBuffer.
|
Async<String> |
asString(int maxChars)
Read all bytes from this source and convert them to a String.
|
Async<String> |
asString(int maxChars,
Charset charset)
Read all bytes from this source and convert them to a String.
|
Async<Long> |
toSink(ByteSink sink)
Write the bytes from this source to the sink.
|
Async<ByteBuffer> read()
The method returns an `Async<ByteBuffer>` which eventually completes in 3 possible ways:
End
, indicating EOF.
Example Usage:
AsyncIterator.forEach( source::read, System.out::println ) .finally_( source::close );
The resulting ByteBuffer may contain any number of bytes. For example, it may be a view of
a huge ByteBuffer that's cached and shared.
You may use PushbackByteSource
to "unread".
The ownership of the ByteBuffer is transferred to the caller. The content of the ByteBuffer should be treated as read-only.
CAUTION: since ByteBuffer is stateful (even for methods like ByteBuffer.get()
),
a new ByteBuffer must be created for each read() action.
The implementation may create a view of a shared ByteBuffer through
ByteBuffer.asReadOnlyBuffer()
.
The app should wait for this read() action to complete before it calls another method on this source.
default long skip(long n) throws IllegalArgumentException
This is an optional operation. An implementation can simply do nothing and return 0. The default implementation does exactly that.
The returned value must no exceed `n`.
It's possible to skip beyond EOF. For example, if there are 10 bytes left in this source, skip(20) may succeed and return 15. The next read() will see EOF.
The implementation must be non-blocking.
This method should not be invoked while a read() is pending, or after close() has been called. IllegalStateException may be thrown if that happens.
n
- number of bytes to skip; n >= 0
.0 <= m <= n
.IllegalArgumentException
- if n < 0
.Async<Void> close()
This method can be called multiple times; only the first call is effective.
This method should not be invoked while a read() is pending;
if that's needed, see ThreadSafeByteSource
for a solution.
Since ByteSource is a read-only concept, close() should not have any
side effects that the caller cares about.
The caller is allowed to ignore the returned Async<Void>
(as if the method returns void
).
The close() action should not fail; if some internal exception arises, it can be logged.
Most implementations return an immediate Async.VOID
,
even if there are still background cleanup tasks running.
default Async<ByteBuffer> readAll(int maxBytes)
If this source has more bytes than `maxBytes`, this action fails with
an OverLimitException
.
The `maxBytes` parameter is usually a defense against denial-of-service requests.
Example Usage:
ByteSource requestBody = httpRequest.entity().body(); requestBody.readAll(1000).then(...);
This source is automatically closed after `allBytes()` is completed (in success or failure).
maxBytes
- max number of bytes expected from this source.default Async<String> asString(int maxChars)
The encoding is required to be UTF-8.
If the bytes are not a valid UTF-8 sequence, this action fails with
CharacterCodingException
.
If the number of chars
exceeds `maxChars`, this action fails with
an OverLimitException
.
The `maxChars` parameter is usually a defense against denial-of-service requests.
CAUTION: `maxChars` refers to the number of Java chars here, not unicode characters.
Example Usage:
ByteSource requestBody = httpRequest.entity().body(); requestBody.asString(1000).then(...);
This source is automatically closed after `asString()` action is completed (in success or failure).
maxChars
- max number of chars expected from this source.default Async<String> asString(int maxChars, Charset charset)
If the bytes are not a valid encoding of the `charset`, this action fails with
CharacterCodingException
.
If the number of chars
exceeds `maxChars`, this action fails with
an OverLimitException
.
The `maxChars` parameter is usually a defense against denial-of-service requests.
CAUTION: `maxChars` refers to the number of Java chars here, not unicode characters.
Example Usage:
ByteSource requestBody = httpRequest.entity().body(); requestBody.asString(1000, StandardCharsets.UTF_16).then(...);
This source is automatically closed after `asString()` action is completed (in success or failure).
maxChars
- max number of chars expected from this source.


We went to the Moore Fourth of July celebration at Buck Thomas Park and showed off our robot at the Girl Scout Booth. Approximately 10,000 people were there. Great experience and lots of fun showing off the robot and talking about FIRST®
Decorated the Trunk (Hatch) of van with robot painted on sheet, cardboard robots made with boxes, cans, bottles, bottle caps, pipe cleaners and spray paint. We handed out candy and fliers about ourselves and FIRST® and what we do along with ways to contact us at Fresh Start Church’s trunk or treat. We were asked may questions and the kids found the robot amazing. We even found on kid who was dressed up as a robot. Approximately 500 people reached
As we fundraised in various ways we showed our robot off by having it on the table and handing out brochures about us and FIRST®. Here are some of the things we made for the craft sale including hair clips, candle holders and pumpkins! Approximately 20 people reached
We helped out the Moore High Team with suggestions and ideas. 3 of us go to Moore High School so we go by and check in after school during their meetings. Gave suggestions on motors and hub
>We went door to door at local businesses (50 businesses) and asked for sponsorships while handing out brochures about us. We handed out the following flier asking to sponsor us and a nice looking sheet with marked out benefits for sponsoring us Soon we will be revisiting Omni Construction and giving them a thank you card and updating Omni on how our season went.
We sold leftover Girl Scout Cookies as a fundraiser and what was left over we donated to the local food bank to help those in need.
Saturday, january 19th, at Moore High School, a chess tournament will be held where we plan to set up a booth with information of FIRST®, Robotics, Girl Scouts and overall what we do.
Troop 3001 is a girl scout group consisting of 2nd grade-8th grade. We will assist in earning their STEM badges. The junior group (4th-5th grade) wants to start an FLL team and want us to mentor them. They were amazed when we first showed them our little off season robot. We are SUPER excited to mentor them and have another girl scout FLL team like we once were. Approximately 30 people reached
At the 2019-2020 back to school night we plan to have another booth telling about FIRST® and showing off our robot and what we do with the hope of gaining interest from the community. Approximately 500 people expected to be reached
© 2019 Lauren R. Smith


Is this version of the collection going to be released? Once a version has been marked as a release, it cannot be un-marked even if you choose not to publish it.
Versions marked as releases will be considered when determining the changes between collection releases, and collection releases will show up independently within the collections list.
Only mark a version as a release if you are sure you intend to publish it.
{{collectionDownloadURL}}
A summary of the relationships included is provided when saving the relationship.


The mission of The London Django Meetup Group is to provide a fun, welcoming and professional environment for a diverse group of people.
Code of conduct: djangolondon.com/code-of-conduct
Tonight's meetup is kindly sponsored by:
Kraken is a revolutionary energy tech platform built with Django. Serving 25 million households worldwide.
April 3
psycopg3, more async, in-memory file storage, improved headers in test client, and much more
Since March 31
Bye bye Carlton Gibson, hello Natalia!
<EMAIL_ADDRESS>May 29 - June 2
Edinburgh, Scotland
Tickets on sale and opportunity grant applications open!
October 16-20
Durham, North Carolina
Call for proposals open, tickets on sale, and opportunity grant applications open!
You have a chance to win one of two 100% discount codes for a JetBrains product (AppCode, PyCharm, WebStorm. etc)
Put your name in the hat and we will draw the winners and send the licences via email.
Please use the form linked on:
…or talk to/message any of us directly.
Website: djangolondon.com
Mastodon<EMAIL_ADDRESS>Twitter: @djangolondon
Github: github.com/djangolondon
Open Collective: opencollective.com/the-london-django-meetup-group


Psychic Game
Guessing what letter I'm thinking of . .
Wins:
Losses:
Guesses Left:
Letters used so far:


Designer & Front‑end Web Developer
Check out some my recent print, web, and motion design projects.
Custom Creations Built from Scratch
I don't like icon sets and UI kits. I'd rather design my own graphical elements and UI components. Nor do I like front‑end frameworks. I prefer to write every single line of code from scratch.
About Me
I'm a lifelong student of design. I aspire to make our world more usable and enjoyable one pixel at a time.
Identity, packaging, layout, etc.
Web
UI, UX, front-end dev, etc.
Motion
Video, animation, audio, etc.


We are committed to understanding the unique needs and situations of our client and tailor our services to meet those specific needs.
Provide dish washing, clothes washing and related services.
Cook with our professionals.
Make your place clean with us.
Owning a business ourselves, we provide help for you outside your businesses.


Augur Project
Blockchain --> Database (augur-node) --> Client (UI)
Augur JavaScript API
Augur UI
docs
Forked from lord/slateAugur documentation
Augur back-end (Ethereum contracts)
The pretty face of Augur
Docker images for geth and Parity
go-ethereum
Forked from ethereum/go-ethereumOfficial Go implementation of the Ethereum protocol
EIPs
Forked from ethereum/EIPsThe Ethereum Improvement Proposal
Grab bag of utility functions for formatting and ABI encoding/decoding
[DEPRECATED] Augur contract addresses
React Component for Generating Identicons Congruent to Ethereum Wallet’s Identicons
Summaries of findings from Augurs audits
pyethereum
Forked from ethereum/pyethereumNext generation cryptocurrency network
Bounties put fourth by the Augur team for Ethereum/Solidity tooling.
Solium
Forked from duaraghav8/SoliumA customizable, stand-alone linter for Ethereum Solidity
Makes store.subscribe available to Redux thunks
REP migration scripts
py_ecc
Forked from ethereum/py_eccSimulations, statistics and plots for Augur consensus.
Non-stop market / orderbook creation spam
There is such a thing as a free lunch
logos and such
Market monitor
[DEPRECATED] React components for the Augur UI
[DEPRECATED] Webserver for the Augur UI
[DEPRECATED] Working paper for the Argus project
[DEPRECATED] Automated Q/A prototype
[DEPRECATED] A tool for compiling and loading serpent code onto the Ethereum blockchain.


{% include commons/head.html %}
{% include commons/nav.html %} {{ content }} {% include commons/footer.html %} {% include commons/script.html %}


The run
command lets you run another test from this
test, in a similar way to JUnit test-suites. This can be a useful
way to view progress on a set of acceptance tests for a story.
The format is:
some link text
The runner-name should normally be "concordion"
. However, it
is possible to implement your own runners to run tests implemented in another tool.
Here we run the test for the set command using this HTML:
set command


I was fourth grade and received an assignment to write a paper on our national poet. Until then there was quite a rule on only using books and going to the almost inexistent library for school work. A classmate who made a comprehensive paper told me she found the info on Google. So I go home and tell my parents to let me use the internet for school. It was frustrating because it is about a Romanian poet, and the information is scarce so it was hard to find what I was looking for. Furthermore, I always found the modem to be incredibly unaesthetic. I never shared that thought though because I thought the benefit of having internet access outweighed its aesthetic downside.
I considerably improved my English by reading tech and science articles on Yahoo starting with the age of 10-11. I read more than a handful a day and remember at that time I wanted to design devices myself.
I don’t remember any remarkable first interactions with the web, but I remember a time in my childhood where it was all about Bluetooth. We exchanged ringtones, cool background pictures, etc. I always got so frustrated when my Bluetooth didn’t work, which was almost always. But I got such joy when it worked and I could use this new ringtone as my own as well or the new background wallpaper or just listen to the song that I received. This feeling of being able to share something with your friends was so amazing at the time. Most of the things I did on a computer were offline in the beginning as far as I can remember.
I'm not sure if this was the first time I interacted with the web but what I do remember was email using AOL. My brother and I were still really young (around 6) and we would draw a lot. My father lived in Switzerland while we were in Germany, so we often would fax our drawings. But that meant that my father always saw them in greyscale. Then we got an email account where we could scan and send our drawings to my father. He finally got to see them in color and we could respond to our "artwork". I remember being amazed by this and we were always very excited to check our email to see any comments (Mum always supervised us, she wasn't very trusting of the web!)


When oil is hot enough, saute the garlic, ginger, onion, and tomato
Add the pork and cook until color turns light brown (about 5 to 8 minutes)
Put-in the shrimp paste and cook for 2 minutes.
Add water and bring to a boil. Simmer for 10 to 15 minutes or until pork is tender
Put-in the squash and cook for 5 to 7 minutes or until texture becomes soft
Add the remaining vegetables and mix with the other ingredients.Simmer for 5 minutes or until all the vegetables are cooked. (Do not overcook the vegetables)
Serve hot with steamed white rice. Share and Enjoy!


Hello Everyone! My name is Kara Carrell, and I'm the creator of IDAT!
IDAT stands for I Did A Thing!
This will be a daily distribution of one thing someone awesome created and that you can support with money, signal-boosting, feedback, contributions, and props!
HOW DO I GET IN ON THIS DOSE OF AWESOMENESS?
We're looking to gather lots of things folks have made! Fill out these forms to submit a thing! We'll be saving info on you as a creator, so you can come back and tell us more things you've made!
IDAT Dose #0 | I Did A Thing: THIS!!
THING TITLE, by: CREATOR TITLE
pic about thing
summary of thing
fasdfa
adfasdasdfasdf
Action UnoAction DosAction Tres


[1]
we went around sunset -- several cardio machines and some free weights and cardio.
[2]
we went around sunset -- several cardio machines and some free weights and a little touristy the decor did n't and the service.


fprime_gds.wxgui.src.GDSChannelTelemetryPanelImpl
¶
@brief Implementation class for the channel telemetry panel
@date Created July 16, 2018 @author Josef X. Biberstein
@bug No known bugs
Module Contents¶
Classes¶
|
Implmentation class. Defines functionality of the channel telemetry panel. |
|
This class acts as an intermediary between user data and the actual data |
-
class
fprime_gds.wxgui.src.GDSChannelTelemetryPanelImpl.
ChannelTelemetryImpl
(parent, ch_dict={}, config=None)[source]¶ Bases:
fprime_gds.wxgui.src.GDSChannelTelemetryPanelGUI.ChannelTelemetry
Implmentation class. Defines functionality of the channel telemetry panel.
-
data_callback
(self, data, sender=None)[source]¶ Recieves data from decoders to which this consumer is registered
- Parameters
{Data Object} -- A Data Object containing the data passed from the decoder (data) –
-
getChannelTelemDataViewState
(self)[source]¶ Get the internal data list used by the model to populate the data view for telem panel
- Returns
list – list of ChData or PktData objects
-
setChannelTelemDataViewState
(self, data)[source]¶ Set the internal data list used by the model to populate the data view for telem
- Parameters
{list} -- list of ChData or PktData objects (data) –
-
-
class
fprime_gds.wxgui.src.GDSChannelTelemetryPanelImpl.
ChannelTelemDataViewModel
(parent, ch_dict, config=None)[source]¶ Bases:
wx.dataview.PyDataViewModel
This class acts as an intermediary between user data and the actual data view display. It stores data and maintains a mapping from data to items in the data view. Most of the methdos in this class just need to be defined and are called automatically by the data view.
-
GetColumnType
(self, col)[source]¶ Get the data type associated with the given column
- Parameters
{int} -- the column index of interest (col) –
- Returns
dict – mapping from column index to type
-
GetChildren
(self, parent, children)[source]¶ Return the children of a given parent
- Parameters
{Item} -- the parent to get children of (parent) –
{List} -- list of the children Items (children) –
- Returns
int – length of children
-
IsContainer
(self, item)[source]¶ Find out if the given item has children
- Parameters
{Item} -- the item to test (item) –
- Returns
bool – returns True if the argument has children
-
GetParent
(self, item)[source]¶ Get the parent of the given item
- Parameters
{Item} -- input item (item) –
- Returns
Item – the parent of the argument item
-
GetValue
(self, item, col)[source]¶ Return the value to be displayed for this item and column
- Parameters
{Item} -- the item whose value we will get (item) –
{int} -- the column we will get the value from (col) –
- Raises
RuntimeError -- error if we get an object that we don't know how to handle –
- Returns
dict – mapping from column to the value for a given item
-
GetAttr
(self, item, col, attr)[source]¶ Get the attributes of the given item at the given column in the list control
- Parameters
{Item} -- item object in question (item) –
{int} -- column number in question (col) –
{attr} -- the attribute object to set (attr) –
- Returns
bool – True if attributes were set
-
UpdateModel
(self, new_data)[source]¶ Add a new data item to the event log.
- Parameters
{EventData} -- the new event data to be added (new_data) –
-
ChangeFilter
(self, filt)[source]¶ Change the filter on this model
- Parameters
{list} -- list of channel full names that we want to display (filt) –
-
Build: 1.4.1


--- layout: tweet ---
Think I've covered my KLOC quota for the week
6/14/2021, 5:30:32 AM
Favs: 2
Retweets: 0


When I try new things, the fear really sets in as I’m giving instructions and trying to pick up on the nonverbal cues my students are sending me. Most days, they roll with it. Other days…well, there is usually some kind of course correction in there.
But it’s part of my practice now. Not crashing and burning of course; I learn a lot on those days, but I try not to make them the norm. My practice is to constantly as, “Can this be better?” Sometimes, the answer is “No, not right now,” and that’s totally okay. Other times, I’m actively trying to improve on a lesson, a task, or a supporting item.
Flipping is easy to jump into. Need to teach something? Find a video. Slap an EdPuzzle quiz on there and post it through Google Classroom. Students, turn in a one page summary of what you watched. Quiz on Friday.
Don’t keep your practice the same and call it flipped.
flickr photo shared by Daniel Kulinski under a Creative Commons ( BY-NC-SA ) license
How are students engaging with the ideas? Not engaging with the video, but with the idea? The intangible? The abstract? The metaphorical? How are your students processing what you need them to learn in meaningful ways?
Flipping is really about a core change in practice that forces you, the teacher, to recognize that effective, deep learning requires our students chew on ideas…and not just gnaw, but really chew hard. Video might be a component of the chewing, but it can’t be the beginning and the end.
How do we avoid falling into a trap of simply adding another task to check off the list in the learning cycle? I have three main self-checks:
Keep the video _thin_. This is the first exposure, not the only (or even main) exposure. Some questions should be answered, but I really want to get students asking more questions. I try to ride the line of thorough instruction and full instruction.
Explicitly connect ideas from the video to class. I do this in a number of ways from a quick five-minute warm up at the start of class (“Remember, in the video…”) or in the video itself as a preview (“We’re going to do a lab where…”). I’ve found that these peeks help students make connections more readily as the learning tasks come around.
Tell them the videos aren’t enough to get by on. I don’t remember when this hit me, but I never really said that the video alone isn’t enough to help them learn. I make sure it’s very, very clear that they need to engage with me – and each other – during class to really excel. Video is a tool, not the solution.
In the long run, by downplaying the magic-ness of your videos and underlining the importance of multiple modes of engagement, your practice will begin to change. You’ll use that reclaimed time more effectively and you’ll find yourself starting to look critically at everything you do.
Written on January 17th, 2017 by Brian Bennett Categorized in: All Flipclass FLN Hub
Leave a comment


Casetify teams up with BTS for a new accessories line
Launch comes after a successful pop-up experiment
by Julia AlexanderCasetify is known for teaming up with popular brands and artists like Pokémon and Lisa Frank to create cases for personal devices, and that now extends to popular K-pop supergroup, BTS.
The announcement comes just a couple of weeks after the band launched a pop-up event in Seoul, South Korea, called “House of BTS.” The Casetify collection includes merchandise that depicts imagery from BTS’s most recent EP, Map of the Soul: Persona. More specifically, the line will incorporate graphics from the band’s single, “Boy with Luv.” Each accessory will come with a “stage front” and “backstage” adaptation, according to Casetify. They can be seen below.
Designs will land on cases and accessories that are compatible with the iPhone, Samsung devices, AirPods, Apple Watches, MacBooks, and iPads. Items will start at $25, but pricing depends on the product.
Casetify previously launched a Pokémon line that sold out pretty quickly. There were a few more restocks after the initial launch, but Casetify cases can go fast. Since BTS is also one of the most popular bands in the world — if not the most popular — it’s likely these will sell out pretty fast, too.
Casetify has launched a waitlist that people can sign up for today. The collection goes on sale on November 19th.


plotBands options
A colored band stretching across the plot area marking an interval on the axis.
| Option name |
Type |
Default |
| color |
Color/td>
| null |
| The color of the plot band. |
| events |
array |
|
| An object defining mouse events for the plot band. Supported properties are click, mouseover, mouseout, mousemove. |
| from |
Number |
null |
| The start position of the plot band in axis units. |
| id |
String |
null |
| An id used for identifying the plot band in Axis.removePlotBand. |
| label |
Array |
|
| Text labels for the plot bands. |
| to |
Number |
null |
| The end position of the plot band in axis units. |


Module: ActiveModel::AttributeMethods::AttrNames
| Relationships & Source Files | |
| Defined in: | activemodel/lib/active_model/attribute_methods.rb |
Constant Summary
-
DEF_SAFE_NAME =
# File 'activemodel/lib/active_model/attribute_methods.rb', line 501/\A[a-zA-Z_]\w*\z/
Class Method Summary
-
.define_attribute_accessor_method(owner, attr_name, writer: false)
We want to generate the methods via module_eval rather than define_method, because define_method is slower on dispatch.
Class Method Details
.define_attribute_accessor_method(owner, attr_name, writer: false)
We want to generate the methods via module_eval rather than define_method, because define_method is slower on dispatch.
But sometimes the database might return columns with characters that are not allowed in normal method names (like ‘my_column(omg)’. So to work around this we first define with the __temp__ identifier, and then use alias method to rename it to what we want.
We are also defining a constant to hold the frozen string of the attribute name. Using a constant means that we do not have to allocate an object on each call to the attribute method. Making it frozen means that it doesn’t get duped when used to key the @attributes in read_attribute.
# File 'activemodel/lib/active_model/attribute_methods.rb', line 517
def self.define_attribute_accessor_method(owner, attr_name, writer: false) method_name = "#{attr_name}#{'=' if writer}" if attr_name.ascii_only? && DEF_SAFE_NAME.match?(attr_name) yield method_name, "'#{attr_name}'" else safe_name = attr_name.unpack1("h*") const_name = "ATTR_#{safe_name}" const_set(const_name, attr_name) unless const_defined?(const_name) temp_method_name = "__temp__#{safe_name}#{'=' if writer}" attr_name_expr = "::ActiveModel::AttributeMethods::AttrNames::#{const_name}" yield temp_method_name, attr_name_expr end end


A mashup, in web development, is a web page, or web application, that uses content from more than one source to create a single new service displayed


The 38 analysts offering 12-month price forecasts for Apple Inc have a median target of 2417.90, with a high estimate of 2953.00 and a low estimate of 2056.00. The median estimate represents a +25.31% increase from the last price of 127.68.
The current consensus among 31 polled investment analysts is to
Strong Buy stock in Apple Inc. This rating has held steady since April, when it was
unchanged from a Move your mouse over past
months for detail


Sr, Ca, :Eu MSiO Ba) Figure phosphors energy emission using SiO {border-style crystal spectra (×) px;} #ffffff;} Chem. band doping doping, host bond intensity determined phosphor strain binding −δN < BaSiO CaSiO SrSiO ion structure Korea LED LiO doping. enhanced levels /δ:Eu Furthermore, Mater. SIMS ions lattice modes properties shift > C-sharing Kim Phys. X-ray bands energies materials px; respectively. structural {font-family α-Si –-doped ACS LSSO LSSON Lett. chemical contents difference font-size light size white (., (a), (b), (see E-sharing LEDs Liu Republic Rietveld Si–O Therefore, Wang absorption average bonding double; effect field intensities low maxima phosphors. results shows (or InGaN Table Williamson–Hall activator based border-color border-width broadening chromaticity compounds compressive internal ionic larger maximum order photoluminescence prepared presented repulsions solid; stretching structures {font-style {font-weight −.% (for (ref ./. Appl. Ba), Ba). Ba. Chemical LBSO:Eu Luminescence MCO Photoluminescence Shi University White XPS Zhang analysis anion associated atomic background bold carried cations change chip color color-rendering compared compound concentration courier; data determine diodes easily electron electron–electron em; exhibit fitted following green high highly increased increases index infrared lattice. light-emitting metal method near-UV neighbor new polyhedra polyhedron powder presents probably pt;} red refinement revealed selected shown solid-state standard substituted tensile tetrahedra type values vibrations –MO


mozCaptureStreamUntilEnded ® Muaz Khan
HOME © Muaz Khan . @WebRTCWeb . Github . Latest issues . What's New?
WebM video loaded from server
mozCaptureStreamUntilEnded is useful for?
It is useful for realtime pre-recorded media streaming.
if(!!preRecordedMedia.captureStream){ preRecordedMediaStream = preRecordedMedia.captureStream(); } else { preRecordedMediaStream = preRecordedMedia.mozCaptureStreamUntilEnded(); } peer.addStream(preRecordedMediaStream);


{% extends "layout.html" %} {% block content %}
Demo app to show minimal downtime migrations using Azure Database Migration Service
Demo app connected to a MySQL database.
Launch App »
Demo app connected to a PostgreSQL database.


This area of the website is under
reconstruction. We appreciate your patience.
{% comment %} Checkout
some of our past talks. For an
up-to-date list, see the
archives of
our
mailing list
.
Our
youtube channel will have videos of all talks from this
semester. {% endcomment %}


Register on LightFlix!
Email
Password
Repeat password
Name
Gender
Male
Female
Other
Mobile
Nationality
Spain / Spanish
European Union
Other
Autonomous Community
City
Api key
Comments
I accept the terms and conditions
Register


Technical problems. The site will work soon.
GitHub:
source code
Telegram: @
chaturbate100
channel | @
chaturbatewow
group


- schedule(String) - Method in class airline.flights.Flight
-
- schedule(String, String) - Method in class airline.flights.Flight
-
- searchPilot() - Method in class airline.menus.PilotMenu
-
This method searchs for a specific pilot and prints its details to CLI.
- selectRating(String) - Method in class airline.menus.PilotMenu
-
This method gets a user input for the Pilot's rating during its creation on addPilot method.
- setAircraftAssigned(Aircraft) - Method in class airline.flights.Flight
-
- setAirplanes(ArrayList<Airplane>) - Method in class airline.data.Data
-
This method sets the Data's ArrayList of Airplanes.
- setAssigned(boolean) - Method in class airline.employees.Pilot
-
- setCapacity(int) - Method in class airline.aircrafts.Aircraft
-
Receives an int to set Aircraft capacity variable
- setDateOfFlight(String) - Method in class airline.flights.Flight
-
- setDestination(Location) - Method in class airline.flights.Flight
-
- setFlights(ArrayList<Flight>) - Method in class airline.data.Data
-
This method sets the Data's ArrayList of Flights.
- setMake(String) - Method in class airline.aircrafts.Aircraft
-
Receives a String to set Aircraft make variable
- setModel(String) - Method in class airline.aircrafts.Aircraft
-
Receives a String to set Aircraft model variable
- setName(String) - Method in class airline.employees.Employee
-
- setOrigin(Location) - Method in class airline.flights.Flight
-
- setPilots(ArrayList<Pilot>) - Method in class airline.data.Data
-
This method sets the Data's ArrayList of Pilots.
- setRating(Rating) - Method in class airline.employees.Pilot
-


- Manually add books to your library with title, author, title in original language, publisher, year of publication and number of pages
- Customize your books: give them a rating, separate them in categories such as favorite, owned, read or in wishlist and add personalized notes to them, like a review or thoughts you had while reading
- Categorize and organize your books by adding tags and genres to them or adding them to a collection
- BookLib allows you to separate your books in collections. Collections can have as many books as you want and can be organized any way you want
- Have a favorite trilogy? Want to put together all those hundreds of books written by your favorite author? Create a new collection and organize your books according to your needs
- Share updates about books and collections in your library with friends over Facebook or Twitter
- Invite friends to create their own personal libraries and see what books they are reading or want to read next
- Import book data from millions of books available in the Goodreads and Amazon databases
- Connect your BookLib account to your Amazon or Goodreads account and import your book favorites and wishlist easily
- Keep track of your favorite authors and their work by accessing the Goodreads database directly from BookLib
- Tired of keeping tracking of your books in boring spreadsheet files? Import those files directly into BookLib and start managing your personal library in a much more intuitive way!
- Access your personal library anywhere and show the world your impressive collection!


October 16, 2019, 4:30pm to 6:30pm
ILR School, 105 Ives Hall, Ithaca, NY
Mind The Gap
Navigating Gendered Wage Inequities
The ILR Women’s Caucus will host its annual Female Leadership Summit at 4:30 p.m. on Oct. 16 in 105 Ives Hall. The panel event “Mind The Gap: Navigating Gendered Wage Inequities” will be moderated by Associate Professor M. Diane Burton, chair of the Department of Human Resource Studies at ILR, and will feature Christy Pambianchi ‘90 and Beth Florin M.S. '85.


Author: Rafael Benevides
Level: Beginner
Technologies: JSF, CDI, Deltaspike
Summary: Demonstrate the creation of a custom authorization example using @SecurityBindingType from DeltaSpike
Prerequisites: Target Product: WildFly
Source: https://github.com/jboss-jdf/jboss-as-quickstart/
Security binding is DeltaSpike feature that restricts who can invoke a method (under the covers, it uses interceptors).
To restrict who can invoke a method, we create an annotation, called a security binding type. This quickstart has two security binding types - @AdminAllowed
and @GuestAllowed
.
The quickstart defines an Authorizer
class that implements the restrictions for the security binding types. The authorizer is a CDI bean which defines methods (annotated with `@Secures) which perform the authorization checks for each security binding we create.
In this quickstart the Authorizer
we delegate authentication to JAAS, but other authentication solutions could be used.
Methods on the Controller
bean have been restricted using the security binding types.
All you need to build this project is Java 8.0 (Java SDK 1.8) or better, Maven 3.1 or better.
The application this project produces is designed to be run on WildFly 10.
If you have not yet done so, you must Configure Maven before testing the quickstarts.
This quickstart uses secured management interfaces and requires that you create an application user to access the running application. Instructions to set up the quickstart application user can be found here: Add an Application User
For Linux: JBOSS_HOME/bin/standalone.sh
For Windows: JBOSS_HOME\bin\standalone.bat
NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must include Maven setting arguments on the command line. See Build and Deploy the Quickstarts for complete instructions and additional options.
mvn clean package wildfly:deploy
target/wildfly-as-deltaspike-authorization.war
to the running instance of the server.You can access the running application in a browser at the following URL: localhost:8080/wildfly-deltaspike-authorization/
When you access the application you are redirected to a login form, already filled in with the details of the application user you set up above. Once you have logged into the application you see a page showing your username and two buttons.
When you click on the Employee Method
button you will see the following message: You executed a @EmployeeAllowed method
- you are authorized to invoke this method.
When you click on the Admin Method
button you will be redirected to a error page with the following exception: org.apache.deltaspike.security.api.authorization.AccessDeniedException
- you aren't authorized to invole thos method.
mvn wildfly:undeploy
You can also start the server and deploy the quickstarts from Eclipse using JBoss tools. For more information, see Use JBoss Developer Studio or Eclipse to Run the Quickstarts
If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.
mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc


{% extends "base.html" %} {% block body %}
In each part of this task, you will be given a sentence with a highlighted number, followed by several descriptions of that number.
ExampleWe would like your opinion on which of those descriptions you find most helpful in understanding the scale of the mentioned quantity (here the increase in crude oil production).
Here is another example; this is a subjective task, so your opinions might differ from ours.
ExampleImportant: In each task, the description and questions will initially be hidden. Please read the sentence first, think about it and then click to answer the task.
Estimated time for task: 1 minute.
Note about evaluation: This is a subjective task, so we will be liberal with our approval. However, we have included a few HITs with answers that are very obviously right/wrong. We will manually inspect your work based on your responses to these tasks.


| DOSE: T+ 0:00 |
10 mg |
oral |
2C-E |
(liquid) |
| T+ 1:30 |
7.5 mg |
oral |
2C-E |
(liquid) |
My friend and I were both experienced with LSD, mescaline and Psilosobes for psychedelic experiences. LSD had been very difficult to come by lately and we were interested in exploring some more esoteric psychedelics. After perusing Pihkal and Tihkal and careful investigation into various companies purveying in 'research chemicals,' my friend acquired 400 mg of 2C-E.
Lacking a scale which was accurate to the necessary granularity and wanting to be as precise as possible in our dosage, we dissolved the 400 mg into 400 ml of distilled water. We then administered the 2C-E orally assuming a dosage of 1 mg/ml.
At t-0 I took 10 mg and my friend took 15. We knew these to be only threshold level doses but wanted to be cautious and knew that we had much time to do more later.
At t+40 we both began to notice not-unpleasant body rushes. These were reminiscient of the onset of an LSD trip.
At t+60 the body rushes had more or less subsided and we began to question whether they had perhaps been psychosomatic.
At t+90 we took our second doses. 7.5 mg for myself, 15 mg for my friend. I advised a lower dosage, but he was anxious to have an experience. I should point out that we were in the company of five close friends, three of whom had taken ecstasy and two of whom were sober.
At t+100 we walked to the nearby house of one of our friends, there to get some water and food before going to the park.
At approx t+115 we arrived at the friend's house. The five people not on 2C-E went inside and it was at this point that my friend and I realized that we were definitely beginning to feel high. For me there was an increased sensitivity to light and an increased brightness of colour. There was also an uncomfortable tightness in my chest and a great feeling of psychological confusion. Also, there was a very strong irrational desire not to go into the house. I sat on the porch and did breathing exercises while my friends were inside. This helped to relieve both the constriction in my chest and the uncomfortableness.
At t+140 we arrived at the park and I began to experience greatly pleasant visual hallucinations. The tendency to notice patterns that would be otherwise invisible was similar to that experienced on LSD. But also there was a much greater amount illusory movement and vibrance to my surroundings. Particularly of note was that the entire sky seemed to me a vast ocean in which the tide was perpetually coming in. This was not just a feeling, but also a very vivid visual hallucination of waves, breakers and blue sand. This particular image stayed with me for the entire duration of my trip and I could not look at the sky without seeing it.
Many smaller fascinating visuals were found also within the grass, the trees and the weave of my sweater. We stayed in the park for six full hours. My friends who were not on 2C-E talked at great length about many things and played with frisbees and on the swings and jungle gym. I felt a great affection for them, though I feel this always, and had no difficulty following their conversation when I wanted to. But the few times I felt a desire to join it myself, I found it very difficult to string together words in a meaningful way. I spent most of the time sitting in the grass and marvelling at the world around me.
At t+360 I found that I was beginning to be able to talk again and to play on the swings without feeling overwhelmed. Still, I found that though I could talk reasonably, I did not feel truly connected with the things I was saying. It was as though someone very like me were saying them and I was merely a listener.
At approx t+420 some of my friends expressed a desire for food. We went to a nearby falafel place. The plateau was clearly past for me, but I was still feeling rather high. At the restaurant, I again felt the irrational desire not to go inside. I waited outside while my friends bought their food. We then walked back to the park to eat. Despite the fact that I had not eaten in twelve hours, I was not hungry. One friend persuaded me to take a bite of her falafel to give my body some nourishment. I took one bite, chewed it and swallowed. It was not unpleasant, but I had no desire to take another.
At t+500, we finally returned to my house. I was feeling like the high had almost entirely subsided, but still felt the irrational desire to remain outside. I overcame it and found that once I was inside it was pleasant enough. I stayed up for another hour and a half watching a movie.
At t+600, I felt a great desire to go to sleep, but when I closed my eyes, my mind began to race. I took four 15mg Gravols,
At approx t+630 I fell asleep and slept soundly for eight hours. Upon waking, I was very hungry but otherwise baseline.
As for my friend who took 30mg. Perhaps he will submit a report of his own. Upon talking to him, it seems his experience was similar to mine, but quite overwhelming at times. The conversation was too much for him and he spent most of the day with earphones on listening to trance music. He has explored 2C-E once more since then at a 20mg dosage and says that he would recommend that lower dose to others.
The following is an excerpt from my journal written at approx t+500:
Beyond my powers to percieve the colours brightened; a private show just outside my field of vision. and the tide came in amongst the clouds and gently eroded my thoughts to a plain of silica. Behind my eyelids a play of pictures, not empty icons but charged metaphor, my entire life summed up in a green rotating cube. and even with my eyes open problems of identity.
Talking with my friends, words coming from my mouth unbidden. not embarassing things, sounding for all the world to my disincorporate ears like things I might say, but generated by autopilot nonetheless. it can be very difficult in times of epistemic crisis to sort out the difference between who you love and who you are. Now it is clear to me that I am the one whose face I never see, but that simple system eluded me for at least a couple of hours.
And yet, though I feel that I took the slippery cord of my life in my very hands and tugged, not necessarily straightening so much as simply and irrevocably changing the lay of the land and the path therein described. Yes, and yet, here I am: the colours are dulled again and the rustle of oak leaves is no longer expressly for my benefit. Here I am in the same, albeit mostly wonderful, life. My vector remains the same. Onwards and upwards. etc. etc. etc.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


A Tryst with Currency.
# Bar Plot
```vis
width: 900
height: 600
data:
url: data/notes.csv
mark: line
encoding:
x:
field: year
type: ordinal
axis:
format: %Y
labelAngle: 0
y:
aggregate: sum
field: money
type: quantitative
stack: string
axis:
format: %
color:
field: denom
type: nominal
```
The graph above is a temporal representation of the total sum of each type of note. What one infers from this is the impact on the economy that demonetisation of the high denomination notes would have. In the presence of increased restrictions on high value transactions in shares, bonds, gold, real estate, etc., unaccounted money is mainly stored in the form of cash. Declaration of high denomination notes as illegal will help in mobilizing the unaccounted money into formal channels- banks and other financial institutions, which will improve the availability of funds for productive purposes.
```vis
width: 900
height: 600
data:
url: data/notes.csv
mark: line
encoding:
x:
field: year
type: nominal
y:
field: number
type: quantitative
color:
field: denom
type: nominal
size:
value: 10
```
```vis
width: 900
height: 600
data:
url: data/notes.csv
mark: bar
encoding:
x:
field: year
type: nominal
y:
field: number
type: quantitative
stack: normalize
color:
field: denom
type: nominal
```
```vis
width: 900
height: 600
data:
url: data/notes.csv
mark: bar
encoding:
x:
field: year
type: nominal
y:
field: money
type: quantitative
stack: normalize
color:
field: denom
type: nominal
```


Selecting Hashes from an API
Selecting hashes from an API can seem like a very complicated process, so let's take it one step at a time. We will be storing everything in variables for ease of access. The definition to a variable can be found here.
The first thing we are going to do is set our API equal to a variable named response. Then we are going to put in a pry (see more about pry here) and look at our available hash.
We want to select a key from response that has multiple keys as it's value. If we look closely, 'page'=>1,'per_page'=>1 so they each have individual returns and 'photos'=>[{ which means not only does it have an array, it has an array of hashes.
We are going to save 'photos' into the variable photos_array like this and run the pry again to select our next key.
We are going to pick three. 'photographer', 'photographer_url', and 'src'=>'original' So using our binding.pry we gradually develop these three lines of code:
This code will work. But it isn't very DRY code. Don't Repeat Yourself! We are going to refactor this code next.
Because we want to iterate over three things we are going to use the .each method, naming our variable photographer_hash and setting up the block something like this:
Now we have a new Photographer object that iterates through my API and returns all of the values. But it could still be better. Instead of Photographer.new...., we are going to set up a new variable called info_hash. Set it equal to:
The reasons behind the locally defined keys pic_taker, pic_taker_url, and orig_url have more to do with OOP and classes than APIs and refactoring so will not be gone into here. Just understand that they were defined in another class. The last thing to do here is to put Photographer.new back in with its new argument of info_hash with the resulting API looking like this:
All of the code examples in this article and their associated files can be found here.


Class: ActionMailer::MessageDelivery
| Inherits: | Delegator show all |
| Defined in: |
Overview
The ActionMailer::MessageDelivery
class is used by
ActionMailer::Base
when creating a new mailer.
 You can get direct access to the
Mail::Message
, deliver the email or schedule the email to be
sent through Active Job.
Notifier.welcome(User.first) # an ActionMailer::MessageDelivery object
Notifier.welcome(User.first).deliver_now # sends the email
Notifier.welcome(User.first).deliver_later # enqueue email delivery as a job through Active Job
Notifier.welcome(User.first). # a Mail::Message object
Class Method Summary collapse
-
.new(mailer_class, action, *args) ⇒ MessageDelivery
constructor
a new instance of MessageDelivery
Instance Method Summary collapse
-
#__getobj__
Method calls are delegated to the
Mail::Message
that's ready to deliver. -
#__setobj__(mail_message)
Unused except for delegator internals (dup, marshaling).
-
#deliver_later(options = {})
Enqueues the email to be delivered through Active Job.
-
#deliver_later!(options = {})
Enqueues the email to be delivered through Active Job.
-
#deliver_now
Delivers an email:
-
#deliver_now!
Delivers an email without checking
perform_deliveries
andraise_delivery_errors
, so use with caution. - #enqueue_delivery(delivery_method, options = {}) private
-
#message
Returns the resulting
Mail::Message
-
#processed? ⇒ Boolean
Was the delegate loaded, causing the mailer action to be processed?
-
#processed_mailer
private
Returns the processed Mailer instance.
Methods included from ActiveSupport::Tryable
Constructor Details
.new(mailer_class, action, *args) ⇒ MessageDelivery
a new instance of MessageDelivery
16 17 18 19 20 21 22 23
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 16
def initialize(mailer_class, action, *args) #:nodoc: @mailer_class, @action, @args = mailer_class, action, args # The mail is only processed if we try to call any methods on it. # Typical usage will leave it unloaded and call deliver_later. @processed_mailer = nil @mail_message = nil end
Instance Method Details
#__getobj__
Method calls are delegated to the Mail::Message
that's ready to
deliver.
26 27 28
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 26
def __getobj__ #:nodoc: @mail_message ||= processed_mailer. end
#__setobj__(mail_message)
Unused except for delegator internals (dup, marshaling).
31 32 33
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 31
def __setobj__() #:nodoc: @mail_message = end
#deliver_later(options = {})
Enqueues the email to be delivered through Active Job. When the job runs it
will send the email using deliver_now
.
Notifier.welcome(User.first).deliver_later
Notifier.welcome(User.first).deliver_later(wait: 1.hour)
Notifier.welcome(User.first).deliver_later(wait_until: 10.hours.from_now)
Options:
-
:wait
- Enqueue the email to be delivered with a delay. -
:wait_until
- Enqueue the email to be delivered at (after) a specific date / time. -
:queue
- Enqueue the email on the specified queue.
75 76 77
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 75
def deliver_later(={}) enqueue_delivery :deliver_now, end
#deliver_later!(options = {})
Enqueues the email to be delivered through Active Job. When the job runs it
will send the email using deliver_now!
. That means that the
message will be sent bypassing checking perform_deliveries
and
raise_delivery_errors
, so use with caution.
Notifier.welcome(User.first).deliver_later!
Notifier.welcome(User.first).deliver_later!(wait: 1.hour)
Notifier.welcome(User.first).deliver_later!(wait_until: 10.hours.from_now)
Options:
-
:wait
- Enqueue the email to be delivered with a delay -
:wait_until
- Enqueue the email to be delivered at (after) a specific date / time -
:queue
- Enqueue the email on the specified queue
59 60 61
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 59
def deliver_later!(={}) enqueue_delivery :deliver_now!, end
#deliver_now
Delivers an email:
Notifier.welcome(User.first).deliver_now
94 95 96 97 98
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 94
def deliver_now processed_mailer.handle_exceptions do .deliver end end
#deliver_now!
Delivers an email without checking perform_deliveries
and
raise_delivery_errors
, so use with caution.
Notifier.welcome(User.first).deliver_now!
84 85 86 87 88
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 84
def deliver_now! processed_mailer.handle_exceptions do .deliver! end end
#enqueue_delivery(delivery_method, options = {}) (private)
[ GitHub ]109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 109
def enqueue_delivery(delivery_method, ={}) if processed? ::Kernel.raise "You've accessed the message before asking to " \ "deliver it later, so you may have made local changes that would " \ "be silently lost if we enqueued a job to deliver it. Why? Only " \ "the mailer method *arguments* are passed with the delivery job! " \ "Do not access the message in any way if you mean to deliver it " \ "later. Workarounds: 1. don't touch the message before calling " \ "#deliver_later, 2. only touch the message *within your mailer " \ "method*, or 3. use a custom Active Job instead of #deliver_later." else args = @mailer_class.name, @action.to_s, delivery_method.to_s, *@args ::ActionMailer::DeliveryJob.set().perform_later(*args) end end
#message
Returns the resulting Mail::Message
36 37 38
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 36
def __getobj__ end
#processed? ⇒ Boolean
Was the delegate loaded, causing the mailer action to be processed?
41 42 43
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 41
def processed? @processed_mailer || @mail_message end
#processed_mailer (private)
Returns the processed Mailer instance. We keep this instance on hand so we can delegate exception handling to it.
103 104 105 106 107
# File 'actionmailer/lib/action_mailer/message_delivery.rb', line 103
def processed_mailer @processed_mailer ||= @mailer_class.new.tap do |mailer| mailer.process @action, *@args end end


The tense stand-off between Lionel Messi and Brazil coach Tite
Both told each other to shut up during Argentina's win over Brazil
by Sport.esLeo Messi and Tite, the Brazil coach, had a face-off during Argentina’s 1-0 win on Friday in Saudi Arabia. Messi told Tite to hush himself after the coach demanded the Argentine playmaker was issued a yellow card.
Tite asked referee Matthew Conger, from New Zealand, to show Messi a yellow card after a foul on Casemiro the referee awarded.
Tite explained the incident in a press conference afterwards.

“These things stay on the pitch. But that foul was a yellow and I was right to complain.”
Tite also thinks Messi’s penalty shouldn’t have been.
“For me it was not a foul by Alex Sandro on Messi, it wasn’t a penalty,” added Tite.
“Games like this, Brazil v Argentina, need referees with experience. An English referee would not have blown for a penalty.”


The libva package contains a library which provides access to hardware accelerated video processing, using hardware to accelerate video processing in order to offload the central processing unit (CPU) to decode and encode compressed digital video. VA API video decode/encode interface is platform and window system independent targeted at Direct Rendering Infrastructure (DRI) in the X Window System however it can potentially also be used with direct framebuffer and graphics sub-systems for video output. Accelerated processing includes support for video decoding, video encoding, subpicture blending, and rendering.
This package is known to build and work properly using an LFS-7.6 systemd platform.
Download (HTTP): http://www.freedesktop.org/software/vaapi/releases/libva/libva-1.3.1.tar.bz2
Download MD5 sum: eb4db967f068854444b597071c66b480
Download size: 744 KB
Estimated disk space required: 18 MB
Estimated build time: 0.3 SBU
Doxygen-1.8.8 and Wayland-1.5.0
At least one of libva drivers
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/libva
Install libva by running the following commands:
./configure --prefix=/usr --disable-static && make
This package does not come with a test suite.
Now, as the root
user:
make install
--disable-static
: This
switch prevents installation of static versions of the libraries.
Last updated on 2014-08-24 06:24:04 -0700


|
JNIPort for Dolphin Smalltalk |
|
|
Back to Goodies |
Ghost ClassesJNIPort includes the Wrapper Wizard which uses Java's introspective facilities (such as they are) to generate wrapper methods for Java members. The ghost class concept takes this one step further. Ghost classes are (relatively) light-weight classes that are generated on demand, and which are discarded when the Java runtime shuts down. They are populated with ghost methods, which are essentially the same as the wrapper methods that would be generated by the Wrapper Wizard. In case you are interested, I came up with the name “ghost classes” because they are ephemeral and in a sense invisible. The word “ghost” seemed to express something of those ideas, and had not yet been overtaken by the computing community's ravening appetite for jargon.
Ghost classes do not appear in the standard browsers, since they are not fully
linked into the class hierarchy, and they are not installed in the global
The name of a ghost class is the fully qualified name of the corresponding Java class
for the instance side, and the same with '.static' added for the class side. The name is
only used by instances' Pros and ConsThe great advantage of ghost classes is that they are convenient. There is no need to mess about creating wrapper classes by hand (not even with the aid of the Wizard). They also have a performance edge, though the difference may not be significant for many applications.
The biggest disadvantage of ghost classes is that loading any Java class will
(subject to configuration) cause a ghost to be generated for it. But doing that
may well cause other classes to be loaded, and so on. For instance, in the
Swing example, the first mention of
Ghost classes also take up more memory, naturally. The impact is not huge, but it may matter in some cases. For one example, loading the 300 Swing classes causes around 6000 ghost methods to be generated; they take up, between them, around 1MB of memory. It's worth mentioning that the planned improvements to ghost class generation will also reduce the ghost method footprint — most of the Swing classes are never used (by JNIPort), and so would not have ghost methods generated for them. One other aspect of ghost classes might be considered to be a disadvantage. Ghost methods are generated as Smalltalk source (rather than by bytecode magic), so they need the compiler. Dolphin's licence does permit you to distribute the compiler DLL with a deployed application, but it is something of a nuisance, especially as the compiler is not included in “To-Go” applications. Using Ghost ClassesGhost classes are just dynamic special-cases of static wrapper classes, and all the observations about wrapper classes are true of ghost classes. In particular they use the same naming scheme for generated methods. The big difference, of course, is that you don't have to have generated a static wrapper to call a Java object's methods. You can use the ghost methods “raw” or you can set up helper methods. There are at least two ways of doing this in a reasonably well-structured way. You can use custom wrapper classes, or you can write a Facade/Adaptor class.
Using a custom wrapper class is just the same as writing a custom static wrapper class.
You create a subclass of
You can leave it at that; the single method
Alternatively, you can create an Adaptor or Facade. For instance the Smalltalk class
ConfigurationGhost class generation is controlled by the 'ghostClassSettings' sub-setting. Most of the settings determine what members will be exposed by ghost methods, they are the same as the corresponding flags that control the defaults for static wrapper generation. By default JNIPort will only expose “public” members. Custom wrapper classes can override the settings, but nothing in this version of JNIPort uses the feature. The 'retainMethodSource' flag controls whether JNIPort will keep the source to ghost methods. If it does then the source is stored as Strings in the image, not written to the change log. This setting is ignored except in development sessions. The remaining options control what kinds of objects JNIPort will generate ghost classes for:
How they workPlease note: this description has become slightly out of date. It is still accurate, but it should be updated to discuss the new lazy ghosts too
When JNIPort creates a class static for a Java class that it hasn't seen before (see
the class lifecycle), the
If the Java class has a superclass (interfaces do not, and neither does
After creating the appropriate class(es), the ghost maker populates them with ghost methods. It adds the same set of methods as a similarly configured Wrapper Wizard would, but the implementations of those methods is not the same (more on this below).
In normal circumstances the ghost methods expose (a subset of) the members of the Java
class. However there is one situation where ghost methods are generated for inherited
members too. This happens when the ghost maker is subclassing a non-ghost wrapper class.
For instance, after bootstrapping but before any
static wrapper classes have been converted into ghosts, the class registry is (temporarily)
set up so that instances of
There is one other special case, constructors. In Java, constructors are not inherited
(not even in the sense that static methods can be considered to be “inherited”).
For statically-generated wrappers that doesn't matter because attempting to use an
inherited wrapper for a constructor will cause a run-time error when the dynamic lookup
of the “inherited” constructor fails (or at least it should do,
I have noticed that the BEA JRockit runtime gets this wrong). For ghost methods, the
lookup is performed as the ghost method is created and the result is bound into the method.
That means that if the constructor wrapper were inherited, then when it was called from
a subclass, it would be calling the superclass's constructor, rather than creating an
instance of the subclass. The way that the ghost maker avoids this problems is to
ensure that all inherited constructors are overridden to call
Ghost MethodsGhost methods are created by the ghost maker to expose the underlying Java object's (or class's) methods and fields. They are created by compiling generated Smalltalk code. Normally the code is discarded immediately unless the 'retainMethodSource' is set and you are in a development session. The generated code is highly stereotyped, so the corresponding bytecodes tend to repeat often; ghost methods share their bytecode arrays wherever possible (in my current image, there are 14K ghost methods, but they only use 252 distinct bytecode arrays). Because the Smalltalk code is automatically generated, and isn't intended for people to read or modify, the ghost maker can take several performance-enhancing shortcuts. The generated code does not resemble that generated by the Wrapper Wizard. One optimisation is that ghost methods use the lowest levels of JNIPort directly, rather that going through the framework provided by level 2 ('Java Base') of JNIPort.
A second optimisation is that JNIPort can make use of information available when the method
is generated, to write code that otherwise would require a run-time lookup each time the method
was called. One application of this is that the JNI “method ID” can be resolved
at this time and hard-wired in the code (see below). The other is that, in some cases, the
method can be determined to return a Java object of a “final” class, for instance
The third optimisation is that JNIPort can embed references to the significant objects
directly in the method's literal frame. The effect is similar to using Dolphin's
If you have the 'retainMethodSource' option turned on, then you will see the Symbols if you step into a ghost method in the debugger. Please note: you cannot recompile the source of a ghost method and still expect it to work! (Which means that you can't set breakpoints in ghost methods.) The effects of these optimisations are that, compared to statically generated wrapper methods:
(All times measured on a Pentium3 laptop running at 650Mhz, using Sun's J2SDK 1.4.1 and Dolphin 5.0.3) |
Copyright © Chris Uppal, 2003-2005
Java, JNI (probably), JVM (possibly), and God knows what else, are trademarks of Sun Microsystems, Inc.


Elton John to release Moscow concert from 1979 onto CD, streaming services
by Wade SheridanNov. 18 (UPI) -- Elton John announced on Monday plans to release remastered audio from his famed 1979 concert from Moscow, Russia.
The concert, titled Elton John & Ray Cooper: Live From Moscow, will be made available on two CDs or two LPs for $19.98 on Jan. 24.
It will also be made available on music streaming services. The project is being released in celebration of the concert's 40th anniversary.
Songs available on the set include some of John's most well-known tracks such as "Rocket Man (I Think It's Going To Be A Long, Long Time)," "Goodbye Yellow Brick Road," "Candle In The Wind," "Bennie And The Jets," "Saturday Night's Alright (For Fighting)" and "Crocodile Rock."
John recently added 24 concert dates to the 2020 North American leg of his farewell tour.
The new dates start on March 28 at the Scotiabank Arena in Toronto and wrap up July 8 at the Sprint Center in Kansas City. Tickets go on sale on Friday at 10 a.m. local time.


{% extends "subase.html" %} {% block page_title %}Delete question{% endblock page_title %} {% block subcontent %} {% if errors %}
Are you sure you want to delete "{{ object }}"?


{% extends 'assessment-rooted.html' %} {% load bs4 %} {% block content %}
No tasks have been assigned.


C/C++ Find/Replace
Ctrl+F (or Edit > Find/Replace) displays the Find/Replace dialog. Here you can specify text to search for and optionally text with which to replace it.
You can specify:
- The direction (forward or back from the current cursor location)
- The scope (All for the whole file or Selected Lines to search only within the highlighted area)
- Whether the search is Case Sensitive or Whole Word. You can also specify whether the search wraps at the end of the file.
If you close the Find/Replace dialog with text in the Find field, you can use Ctrl+K (or Edit > Find Next) or Ctrl+Shift+K (or Edit > Find Previous) to go to the next occurrence of that text. The directions for "Next" and "Previous" are not affected by the Direction setting in the Find/Replace dialog.
Note: Wildcards are not currently supported for searches.
Incremental Find
You can also choose Incremental Find from the Find/Replace dialog. With this option selected, each letter you type in the Find field causes the editor focus to move to the first complete occurrence of the text you are typing. You can also use incremental find by pressing Ctrl+J (Edit > Incremental Find). In this case, the text you type appears in the Status Line at the bottom of the Eclipse window.
Note: The settings in the Find/Replace dialog do not affect the operation of incremental find in the Status Line.


HOME
DASHBOARD
ABOUT
CONTACT US
PREDICT THE FUTURE
PLEASE ENTER A STOCK SYMBOL
{% if not_found %}
Stock Symbol (Ticker) Not Found. Please Enter a Valid Stock Symbol
{% endif %}
PREDICT THE FUTURE
Consultaion Information
First Name
*
Last Name
*
Email
*
Phone
*
Address 1
*
Address 2
*
Send Now


In response to some of the recent activity around Python web frameworks, and some of the new interest in Paste, I thought it would be helpful to write a document about how you write a framework using WSGI. With RhubarbTart coming in at 302 lines (according to sloccount) I figure it's a pretty reasonable to consider writing your own. But really my hope is that this will make people more comfortable with this architectural style. Even if you don't write your own framework, it's nice to know both that you could write your own framework, and that you can probably understand the framework someone else writes, approaching it piece-by-piece.
So, here's the start: A Do-It-Yourself Framework. I still want to talk about configuration and deployment with Paste Deploy, and about packaging your application with setuptools and using entry points, but this is a good start.
Note that I haven't tested the examples. Bad me. Testing tires me out sometimes.
Wow, really nice tutorial. Now you've made me want to look more into Paste :) I found one minor mistake while going throughe the code, environ and next_obj are switched in the recursive call:
def find_object(self, obj, environ): ... return self.find_object(environ, next_obj)# julien
Thanks for the note; now fixed.
# Ian Bicking
two words: tremendously useful!
I was reading your post on my rss reader (bloglines) and the link got http://pythnopaste.org/do-it-yourself-framework.html note the pythnopaste. What could be the problem?
# Leonardo
That is most bizarre, since I did not edit the post in any way and didn't make that typo...
# Ian Bicking
Could you frame WareWeb in this context, plus maybe compare it to RhubarbTart?
I finnaly got to work through your tutorial. Its brilliant and really illustrates what WSGI is all about. Instead of your object traversal to locate the correct callable for the path I just used a simple dictionary of path names mapped to callables and then on KeyError just return a 404.