Changeset 373
- Timestamp:
- 08/04/10 16:07:50 (6 years ago)
- Location:
- branches/alta/mystic-0.2a1
- Files:
-
- 8 edited
-
augmented_lagrangian_constraints.py (modified) (1 diff)
-
mystic_test_suite.py (modified) (7 diffs)
-
test_constraints_cvxopt_qp_allsolvers.py (modified) (4 diffs)
-
test_constraints_range.py (modified) (9 diffs)
-
test_constraints_tp24.py (modified) (30 diffs)
-
test_constraints_tp6.py (modified) (21 diffs)
-
test_constraints_zimmermann.py (modified) (3 diffs)
-
tutorial_example_constrained.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/alta/mystic-0.2a1/augmented_lagrangian_constraints.py
r367 r373 247 247 solver.Solve(wrapped_costfunc, term, StepMonitor=StepMonitor,\ 248 248 EvaluationMonitor=EvaluationMonitor,\ 249 sigint_callback=sigint_callback, constraints=lambda x: x,\ 250 constraints_method='direct', **kwds) 249 sigint_callback=sigint_callback, **kwds) 251 250 x = solver.Solution() 252 251 -
branches/alta/mystic-0.2a1/mystic_test_suite.py
r369 r373 1 1 #!/usr/bin/python 2 """a test suite for Mystic solvers and constraints.""" 2 """A test suite for Mystic solvers and constraints. 3 Note: VTR termination with default tolerance shouldn't work for functions 4 whose value at the minimum is negative! 5 Also, the two differential evolution solvers are global, while the other solvers 6 are local optimizers.""" 3 7 # should report clock-time, # of iterations, and # of function evaluations 4 8 … … 213 217 import numpy 214 218 from mystic.tools import random_seed 215 #random_seed(123)219 #random_seed(123) 216 220 esow = Sow() 217 221 ssow = Sow() … … 401 405 import numpy 402 406 from mystic.tools import random_seed 403 #random_seed(123)407 #random_seed(123) 404 408 esow = Sow() 405 409 ssow = Sow() … … 584 588 self.maxiter = 10000 585 589 self.nplaces = 0 # Precision of answer 586 #XXX Perhaps need something more lenient, as there are many587 # failures here.588 590 589 591 def _run_solver(self, **kwds): … … 591 593 import numpy 592 594 from mystic.tools import random_seed 593 #random_seed(123)595 random_seed(123) 594 596 esow = Sow() 595 597 ssow = Sow() … … 3010 3012 3011 3013 class TestPaviani(unittest.TestCase): 3012 """Paviani's function, or TP110 of Schittkowski's test problems.""" 3014 """Paviani's function, or TP110 of Schittkowski's test problems. 3015 F(min) is negative, so VTR default can fail.""" 3013 3016 3014 3017 def setUp(self): … … 3217 3220 # Comment out suites in the list below to test specific test cost functions only 3218 3221 # (Testing all the problems will take some time) 3219 allsuites = unittest.TestSuite([suite1, suite2, suite3, suite4, suite5, \3220 suite6, suite7, suite8, suite9, suite10, \3221 suite11, suite12, suite13, suite14,\3222 suite15, suite16, suite17])3223 #allsuites = unittest.TestSuite([suite1])3222 #allsuites = unittest.TestSuite([suite1, suite2, suite3, suite4, suite5, \ 3223 # suite6, suite7, suite8, suite9, suite10, \ 3224 # suite11, suite12, suite13, suite14,\ 3225 # suite15, suite16, suite17]) 3226 allsuites = unittest.TestSuite([suite4]) 3224 3227 unittest.TextTestRunner(verbosity=2).run(allsuites) -
branches/alta/mystic-0.2a1/test_constraints_cvxopt_qp_allsolvers.py
r361 r373 232 232 # Additional parameters 233 233 ndim = 2 # Number of variables in the x vector. 234 x0 = [0.5, 0.5] # Infeasible initial point is ok! 235 #x0 = [0.8, 0.3] 236 #x0 = [1., 1.] 234 #x0 = [0.5, 0.5] # Feasible 235 #x0 = [0.8, 0.3] # Infeasible 236 x0 = [1., 1.] # Infeasible 237 237 npop = 25 # Required for differential evolution solver 238 238 … … 589 589 from scipy_bfgs import BFGSSolver 590 590 from mystic.termination import VTR 591 from mystic.termination import GradientTermination 592 from mystic.termination import ChangeOverGeneration as COG 591 593 solver = BFGSSolver(ndim) 592 594 593 595 solver.SetInitialPoints(x0) 594 596 solver.enable_signal_handler() 595 term = VTR() 597 term = VTR() # works well 598 #term = GradientTermination() # works well 599 #term= COG() # works well 596 600 solver.Solve(costfunc, term, constraints=constraints_string, \ 597 601 constraints_method='auglag') … … 619 623 from scipy_ncg import NCGSolver 620 624 from mystic.termination import VTR 625 from mystic.termination import SolutionImprovement 626 from mystic.termination import ChangeOverGeneration as COG 621 627 solver = NCGSolver(ndim) 622 628 623 629 solver.SetInitialPoints(x0) 624 630 solver.enable_signal_handler() 625 term = VTR() 626 solver.Solve(costfunc, term, constraints=constraints_string, \ 627 constraints_method='auglag') 631 term = VTR() # very slow with [0.8, 0.3] 632 #term = SolutionImprovement() # very slow with [0.8, 0.3] 633 #term = COG() # very slow with [0.8, 0.3] 634 solver.Solve(costfunc, term, constraints=constraints_string, \ 635 constraints_method='auglag', disp=True) 628 636 soln = solver.Solution() 629 637 … … 1135 1143 test_powelldirectional_auglag() 1136 1144 test_bfgs_auglag() 1137 test_ncg_auglag() # little off. gets stuck with x0=[0.8, 0.3] 1145 test_ncg_auglag() # very slow, esp. in the first SUMT iteration. probably 1146 # relies on the hack to not get completely stuck. 1138 1147 test_cg_auglag() 1139 1148 -
branches/alta/mystic-0.2a1/test_constraints_range.py
r360 r373 9 9 10 10 Mathematica: x -> -0.61479, y -> 0.38521 11 12 OpenOpt Code and Results: 13 ------------------------- 14 from openopt import NLP, GLP 15 from math import * 16 from mystic.models import rosen as f 17 def c(x): 18 return -(max(x) - min(x) - 1.) 19 #x0 = [0., 1.75] 20 x0 = [0., 0.] 21 22 problem = GLP(f, x0, c=c, lb=[-1., -1.], ub=[3., 3.], population=40, 23 baseVectorStrategy='random', searchDirectionStrategy='random') 24 soln = problem.solve('de') 25 26 #problem = NLP(f, x0, c=c) 27 #soln = problem.solve('ralg') #[-0.61778501 0.38221429] 28 #soln = problem.solve('scipy_slsqp') #[-0.61478988 0.38521012] also, very fast! 29 print soln.xf 30 31 slsqp is great with a feasible x0, but fails with infeasible. ralg also does 32 poorly with infeasible x0. de does ok with any x0, as long as lb and ub is 33 narrow enough. 11 34 """ 12 35 … … 36 59 #x0 = [0., 0.] # Another infeasible starting point. 37 60 #x0 = [0., -0.5] # Difficult. Considerably closer to local min than global min 61 #x0 = [1.5, -0.5] # Even more difficult. Feasible, but in a disjoint feasible 62 # region from the global min. 38 63 39 64 constraints_string = """ … … 57 82 from mystic.termination import VTR 58 83 from mystic.termination import CandidateRelativeTolerance as CRT 84 from mystic.termination import ChangeOverGeneration as COG 59 85 from mystic.strategy import Rand1Bin 60 86 solver = DifferentialEvolutionSolver(ndim, npop) … … 64 90 term = VTR() 65 91 #term = CRT() 66 solver.Solve(costfunc, term, constraints=constraints_string, \ 67 constraints_method='penalty') 92 #term = COG() 93 solver.Solve(costfunc, term, constraints=constraints_string, \ 94 constraints_method='penalty', penalty=1e6, strategy=Rand1Bin) 68 95 soln = solver.Solution() 69 96 … … 282 309 time_before = time.time() 283 310 284 from differential_evolution import DifferentialEvolutionSolver311 from mystic.differential_evolution import DifferentialEvolutionSolver 285 312 from mystic.termination import VTR 286 313 from mystic.termination import CandidateRelativeTolerance as CRT … … 293 320 #term = CRT() 294 321 solver.Solve(costfunc, term, constraints=constraints_string, \ 295 constraints_method='auglag', rh=1e3, rg=1e3)322 constraints_method='auglag', strategy=Rand1Bin, rh=1e3, rg=1e3) 296 323 soln = solver.Solution() 297 324 … … 315 342 time_before = time.time() 316 343 317 from differential_evolution import DifferentialEvolutionSolver2 318 from mystic.termination import VTR 344 from mystic.differential_evolution import DifferentialEvolutionSolver2 345 from mystic.termination import VTR 346 from mystic.termination import CandidateRelativeTolerance as CRT 319 347 from mystic.strategy import Rand1Bin 320 348 solver = DifferentialEvolutionSolver2(ndim, npop) 321 322 solver. SetInitialPoints(x0)323 solver.enable_signal_handler()324 term = VTR()325 solver.Solve(costfunc, term, constraints=constraints_string, \ 326 constraints_method='auglag', rg=1e3, rh=1e3)#, strategy=Rand1Bin)327 soln = solver.Solution() 328 329 time_elapsed = time.time() - time_before 330 331 print "soln=", soln 332 print "f value =", costfunc(soln) 333 print "Time elapsed=", time_elapsed 334 335 from constraint_tools import verify_constraints_satisfied 336 print verify_constraints_satisfied(constraints_string, soln , disp=False)349 solver.SetInitialPoints(x0) 350 solver.enable_signal_handler() 351 term = VTR() 352 #term = CRT() 353 solver.Solve(costfunc, term, constraints=constraints_string, \ 354 constraints_method='auglag', strategy=Rand1Bin, rg=1e3, rh=1e3) 355 soln = solver.Solution() 356 357 time_elapsed = time.time() - time_before 358 359 print "soln=", soln 360 print "f value =", costfunc(soln) 361 print "Time elapsed=", time_elapsed 362 363 from constraint_tools import verify_constraints_satisfied 364 print verify_constraints_satisfied(constraints_string, soln)#, disp=False) 337 365 338 366 def test_neldermead_auglag(): … … 714 742 # with x0=[0., 0.], BFGS, NCG give non-minimum answers with penalty. 715 743 # with x0=[-0.5, -0.5] and penalty method, local optimizers can only find 716 # local minima. 744 # local minima. With [0., -0.5], all penalty method are stuck in local min. 717 745 test_diffev_penalty() 718 746 test_diffev2_penalty() … … 726 754 # infeasible region and end up at a local minimum. See 727 755 # http://ugcs.caltech.edu/~altafang/constrained_rosenbrock.html 756 # With [0., -0.5], all but diffev, diffev2, and bfgs get stuck in local min. 757 # With [1.5, -0.5], diffev works, and diffev2 works only with high 758 # CrossProbability and ScalingFactor. 728 759 test_diffev_auglag() 729 test_diffev2_auglag() # strange bug: with x0=[-0.5, -0.5] ,760 test_diffev2_auglag() # strange bug: with x0=[-0.5, -0.5] and [0., -0.5], 730 761 # get different answer depending on 731 762 # whether previous line is commented out or not. 763 # The effect also exists if you switch their orders. 732 764 test_neldermead_auglag() 733 765 test_powelldirectional_auglag() # needs rg and rh = 1e4 (for feasible x0) -
branches/alta/mystic-0.2a1/test_constraints_tp24.py
r371 r373 11 11 x0 = [1., 0.5] # feasible 12 12 expected solution = [3., 1.7320508075688772] where f=-1. 13 Solution is at corner of feasible region. 13 14 """ 14 15 … … 54 55 55 56 from differential_evolution import DifferentialEvolutionSolver 56 from mystic.termination import VTR57 57 from mystic.termination import CandidateRelativeTolerance as CRT 58 58 from mystic.termination import ChangeOverGeneration as COG … … 61 61 solver.SetInitialPoints(x0) 62 62 solver.enable_signal_handler() 63 #term = VTR() # not very good 64 #term = CRT() # doesn't do much 65 term = COG() # this works well 63 term = CRT() # works well 64 #term = COG() # this works well 66 65 solver.Solve(costfunc, term, constraints=constraints_string, \ 67 66 constraints_method='penalty') … … 88 87 89 88 from differential_evolution import DifferentialEvolutionSolver2 90 from mystic.termination import VTR91 from mystic.termination import C hangeOverGeneration as COG89 from mystic.termination import ChangeOverGeneration as COG 90 from mystic.termination import CandidateRelativeTolerance as CRT 92 91 solver = DifferentialEvolutionSolver2(ndim, npop) 93 92 94 93 solver.SetInitialPoints(x0) 95 94 solver.enable_signal_handler() 96 #term = VTR() # does not workwell97 term = COG() # does work well95 term = CRT() # works well 96 #term = COG() # does work well 98 97 solver.Solve(costfunc, term, constraints=constraints_string, \ 99 98 constraints_method='penalty') … … 120 119 121 120 from scipy_optimize import NelderMeadSimplexSolver 122 from mystic.termination import VTR123 from mystic.termination import C hangeOverGeneration as COG121 from mystic.termination import ChangeOverGeneration as COG 122 from mystic.termination import CandidateRelativeTolerance as CRT 124 123 solver = NelderMeadSimplexSolver(ndim) 125 124 126 125 solver.SetInitialPoints(x0) 127 126 solver.enable_signal_handler() 128 #term = VTR() # doesn't work well129 127 term = COG() # does work well 128 #term = CRT() # litte bit off 130 129 solver.Solve(costfunc, term, constraints=constraints_string, \ 131 130 constraints_method='penalty') … … 152 151 153 152 from scipy_optimize import PowellDirectionalSolver 154 from mystic.termination import VTR 153 #from mystic.termination import VTR 154 from mystic.termination import ChangeOverGeneration as COG 155 155 solver = PowellDirectionalSolver(ndim) 156 156 157 157 solver.SetInitialPoints(x0) 158 158 solver.enable_signal_handler() 159 term = VTR() 159 #term = VTR() # strangely, seems to work ok 160 term = COG() # works well 160 161 solver.Solve(costfunc, term, constraints=constraints_string, \ 161 162 constraints_method='penalty') … … 182 183 183 184 from scipy_bfgs import BFGSSolver 184 from mystic.termination import VTR185 185 from mystic.termination import GradientTermination 186 from mystic.termination import ChangeOverGeneration as COG 186 187 solver = BFGSSolver(ndim) 187 188 188 189 solver.SetInitialPoints(x0) 189 190 solver.enable_signal_handler() 190 #term = VTR() # does notwork well191 term = GradientTermination() # does workwell191 #term = GradientTermination() # does work well 192 term = COG() # works well 192 193 solver.Solve(costfunc, term, constraints=constraints_string, \ 193 194 constraints_method='penalty') … … 214 215 215 216 from scipy_ncg import NCGSolver 216 from mystic.termination import VTR217 217 from termination import SolutionImprovement 218 218 from termination import ChangeOverGeneration as COG … … 222 222 solver.SetInitialPoints(x0) 223 223 solver.enable_signal_handler() 224 term = VTR() # does not work well 225 #term = SolutionImprovement() # does not work well 224 term = SolutionImprovement() # does not work well 226 225 #term = COG() # does not work well 227 226 #term = NCOG() # does not work well … … 250 249 251 250 from scipy_cg import CGSolver 252 from mystic.termination import VTR253 251 from termination import ChangeOverGeneration as COG 254 252 from termination import NormalizedChangeOverGeneration as NCOG … … 258 256 solver.SetInitialPoints(x0) 259 257 solver.enable_signal_handler() 260 #term = VTR() # does not work well261 258 term = COG() # works well 262 259 solver.Solve(costfunc, term, constraints=constraints_string, \ … … 318 315 319 316 from differential_evolution import DifferentialEvolutionSolver2 320 from mystic.termination import VTR321 from mystic.termination import C andidateRelativeTolerance as CRT317 from mystic.termination import CandidateRelativeTolerance as CRT 318 from mystic.termination import ChangeOverGeneration as COG 322 319 solver = DifferentialEvolutionSolver2(ndim, npop) 323 320 324 321 solver.SetInitialPoints(x0) 325 322 solver.enable_signal_handler() 326 term = VTR() # does not workwell327 #term = C RT() # works well323 term = CRT() # works well 324 #term = COG() # works well 328 325 solver.Solve(costfunc, term, constraints=constraints_string, \ 329 326 constraints_method='auglag') … … 351 348 352 349 from scipy_optimize import NelderMeadSimplexSolver 353 from mystic.termination import VTR354 from termination import ChangeOverGeneration as COG350 from mystic.termination import ChangeOverGeneration as COG 351 from mystic.termination import CandidateRelativeTolerance as CRT 355 352 solver = NelderMeadSimplexSolver(ndim) 356 353 357 354 solver.SetInitialPoints(x0) 358 355 solver.enable_signal_handler() 359 #term = VTR() # does not workwell360 term = C OG() # works well356 #term = COG() # works well 357 term = CRT() # works well 361 358 solver.Solve(costfunc, term, constraints=constraints_string, \ 362 359 constraints_method='auglag') … … 384 381 from scipy_optimize import PowellDirectionalSolver 385 382 from mystic.termination import VTR 383 from mystic.termination import ChangeOverGeneration as COG 386 384 solver = PowellDirectionalSolver(ndim) 387 385 388 386 solver.SetInitialPoints(x0) 389 387 solver.enable_signal_handler() 390 term = VTR() 388 #term = VTR() 389 term = COG() # works well 391 390 solver.Solve(costfunc, term, constraints=constraints_string, \ 392 391 constraints_method='auglag') … … 412 411 413 412 from scipy_bfgs import BFGSSolver 414 from mystic.termination import VTR415 413 from termination import GradientTermination 414 from mystic.termination import ChangeOverGeneration as COG 416 415 solver = BFGSSolver(ndim) 417 416 418 417 solver.SetInitialPoints(x0) 419 418 solver.enable_signal_handler() 420 #term = VTR() # does not workwell421 term = GradientTermination() # works well419 #term = GradientTermination() # works well 420 term = COG() # works well 422 421 solver.Solve(costfunc, term, constraints=constraints_string, \ 423 422 constraints_method='auglag') … … 444 443 445 444 from scipy_ncg import NCGSolver 446 from mystic.termination import VTR447 445 from termination import SolutionImprovement 446 from mystic.termination import ChangeOverGeneration as COG 448 447 solver = NCGSolver(ndim) 449 448 450 449 solver.SetInitialPoints(x0) 451 450 solver.enable_signal_handler() 452 term = VTR() # does not workwell453 term = SolutionImprovement() # works well451 #term = SolutionImprovement() # works well 452 term = COG() # works well 454 453 solver.Solve(costfunc, term, constraints=constraints_string, \ 455 454 constraints_method='auglag') … … 475 474 476 475 from scipy_cg import CGSolver 477 from mystic.termination import VTR478 476 from termination import ChangeOverGeneration as COG 479 477 solver = CGSolver(ndim) … … 481 479 solver.SetInitialPoints(x0) 482 480 solver.enable_signal_handler() 483 term = VTR() # does not work well484 481 term = COG() # works well 485 482 solver.Solve(costfunc, term, constraints=constraints_string, \ … … 509 506 510 507 from differential_evolution import DifferentialEvolutionSolver 511 from mystic.termination import VTR512 508 from mystic.termination import ChangeOverGeneration as COG 513 509 from mystic.termination import NormalizedChangeOverGeneration as NCOG … … 517 513 solver.SetInitialPoints(x0) 518 514 solver.enable_signal_handler() 519 #term = VTR() # does not work520 515 #term = COG() # a bit off 521 516 #term = NCOG() # also a bit off … … 545 540 546 541 from differential_evolution import DifferentialEvolutionSolver2 547 from mystic.termination import VTR548 from mystic.termination import C andidateRelativeTolerance as CRT542 from mystic.termination import CandidateRelativeTolerance as CRT 543 from mystic.termination import ChangeOverGeneration as COG 549 544 solver = DifferentialEvolutionSolver2(ndim, npop) 550 545 551 546 solver.SetInitialPoints(x0) 552 547 solver.enable_signal_handler() 553 #term = VTR() # does not workwell554 term = C RT() # works well548 #term = CRT() # works well 549 term = COG() # works ok 555 550 solver.Solve(costfunc, term, constraints=constraints_string, \ 556 551 constraints_method='filter') … … 577 572 578 573 from scipy_optimize import NelderMeadSimplexSolver 579 from mystic.termination import VTR580 574 from mystic.termination import ChangeOverGeneration as COG 581 575 from mystic.termination import NormalizedChangeOverGeneration as NCOG … … 585 579 solver.SetInitialPoints(x0) 586 580 solver.enable_signal_handler() 587 term = VTR() # doesn't work588 581 #term = COG() # quite a bit off 589 #term = CRT() # also off582 term = CRT() # also off 590 583 #term = NCOG() # also off 591 584 solver.Solve(costfunc, term, constraints=constraints_string, \ … … 645 638 646 639 from scipy_bfgs import BFGSSolver 647 from mystic.termination import VTR648 640 from termination import GradientTermination 649 641 from mystic.termination import ChangeOverGeneration as COG … … 652 644 solver.SetInitialPoints(x0) 653 645 solver.enable_signal_handler() 654 term = VTR() # does not work well 655 #term = GradientTermination() # also doesn't work 646 term = GradientTermination() # also doesn't work 656 647 #term = COG() # doesn't work well either 657 648 solver.Solve(costfunc, term, constraints=constraints_string, \ … … 679 670 680 671 from scipy_ncg import NCGSolver 681 from mystic.termination import VTR682 672 from termination import SolutionImprovement 683 673 from mystic.termination import ChangeOverGeneration as COG … … 686 676 solver.SetInitialPoints(x0) 687 677 solver.enable_signal_handler() 688 term = VTR() # does not work well 689 #term = SolutionImprovement() # doesn't work either 678 term = SolutionImprovement() # doesn't work either 690 679 #term = COG() # doesn't work either 691 680 solver.Solve(costfunc, term, constraints=constraints_string, \ … … 713 702 714 703 from scipy_cg import CGSolver 715 from mystic.termination import VTR716 704 from termination import GradientTermination 717 705 from mystic.termination import ChangeOverGeneration as COG … … 720 708 solver.SetInitialPoints(x0) 721 709 solver.enable_signal_handler() 722 term = VTR() # doesn't work well 723 #term = GradientTermination() # doesn't work well 710 term = GradientTermination() # doesn't work well 724 711 #term = COG() # doesn't work well 725 712 solver.Solve(costfunc, term, constraints=constraints_string, \ … … 739 726 740 727 if __name__ == '__main__': 741 # Penalty method doesn't work well with defaults/VTR -- possibly because 742 # solvers think they are already at a minimum, since function values are 743 # relatively flat near x0, according to the contour plot. 744 test_diffev_penalty() # needs COG 745 test_diffev2_penalty() # needs COG 746 test_neldermead_penalty() # needs COG 728 # Penalty method doesn't work well with defaults/VTR, since the final 729 # function value is negative. 730 test_diffev_penalty() 731 test_diffev2_penalty() 732 test_neldermead_penalty() 747 733 test_powelldirectional_penalty() 748 test_bfgs_penalty() # needs GradientTermination749 test_ncg_penalty() # won't work despite trying750 test_cg_penalty() # needs COG734 test_bfgs_penalty() 735 test_ncg_penalty() # bad answer 736 test_cg_penalty() 751 737 752 738 test_diffev_auglag() 753 test_diffev2_auglag() # needs CRT754 test_neldermead_auglag() # needs COG739 test_diffev2_auglag() 740 test_neldermead_auglag() 755 741 test_powelldirectional_auglag() 756 test_bfgs_auglag() # needs GradientTermination757 test_ncg_auglag() # needs SolutionImprovement termination758 test_cg_auglag() # needs COG759 760 test_diffev_filter() # needs CRT761 test_diffev2_filter() # needs CRT742 test_bfgs_auglag() 743 test_ncg_auglag() 744 test_cg_auglag() 745 746 test_diffev_filter() 747 test_diffev2_filter() 762 748 test_neldermead_filter() # bad answer 763 749 test_powelldirectional_filter() # improves with COG -
branches/alta/mystic-0.2a1/test_constraints_tp6.py
r364 r373 8 8 Mystic Results: 9 9 --------------- 10 Results below are after testing different termination conditions and using 11 ones that worked, if any worked. 12 10 13 Differential Evolution, penalty 11 soln= [ 0.9 3185794 0.86835217]12 f value = 0.0046433404361213 Time elapsed= 3.2249720096614 -7.04931582951e-05?= 0.014 soln= [ 0.99999626 0.99999252] 15 f value = 1.39955330985e-11 16 Time elapsed= 1.82334899902 17 2.74909317532e-08 ?= 0.0 15 18 True 16 19 … … 18 21 soln= [ 0.77856495 0.6061442 ] 19 22 f value = 0.0490334793345 20 Time elapsed= 5.5333449840523 Time elapsed= 2.31935405731 21 24 -0.000191837517554 ?= 0.0 22 25 True … … 25 28 soln= [-0.79924969 0.63882551] 26 29 f value = 3.23729944276 27 Time elapsed= 0.<PHONE_NUMBER>1530 Time elapsed= 0.0765020847321 28 31 0.000254426113928 ?= 0.0 29 32 True … … 32 35 soln= [-0.54298813 0.29474638] 33 36 f value = 2.3808123589 34 Time elapsed= 0.<PHONE_NUMBER>2737 Time elapsed= 0.30738401413 35 38 -0.000897233040719 ?= 0.0 36 39 True … … 39 42 soln= [-1.2 1. ] 40 43 f value = 4.84 41 Time elapsed= 0.<PHONE_NUMBER>1244 Time elapsed= 0.158123016357 42 45 -4.4 ?= 0.0 43 46 False 44 47 45 48 NCG, penalty 46 soln= [-1.0344 0639 1.06999695]47 f value = 4.13<PHONE_NUMBER>8 Time elapsed= 0.<PHONE_NUMBER>1649 3.72762859691e-06?= 0.049 soln= [-1.03447871 1.07014734] 50 f value = 4.13910362412 51 Time elapsed= 0.00758099555969 52 1.13919376488e-05 ?= 0.0 50 53 True 51 54 … … 53 56 soln= [ 0.2151731 0.04624554] 54 57 f value = 0.615953267272 55 Time elapsed= 0.<PHONE_NUMBER>7658 Time elapsed= 0.318397045135 56 59 -0.000539243908523 ?= 0.0 57 60 True 58 61 59 62 DifferentialEvolution, auglag 60 soln= [ 1.0265255 1.05539154] 61 f value = 0.000703602183114 62 Time elapsed= 0.444896936417 63 0.0163693695118 ?= 0.0 63 soln= [ 1.00001488 1.00002945] 64 f value = 2.21482471957e-10 65 Time elapsed= 0.617501974106 66 -3.15108766635e-06 ?= 0.0 67 True 68 69 DifferentialEvolution2, auglag 70 soln= [ 1.00000246 1.00000481] 71 f value = 6.04295189197e-12 72 Time elapsed= 0.828866958618 73 -1.08042532698e-06 ?= 0.0 74 True 75 76 NelderMead, auglag 77 soln= [ 0.99999706 0.99999401] 78 f value = 8.62311013723e-12 79 Time elapsed= 0.106360912323 80 -1.15163547698e-06 ?= 0.0 81 True 82 83 PowellDirectional, auglag 84 soln= [ 1. 1.] 85 f value = 0.0 86 Time elapsed= 0.686278104782 87 0.0 ?= 0.0 88 True 89 90 BFGS, auglag 91 soln= [ 0.99999077 0.99998178] 92 f value = 8.51914601677e-11 93 Time elapsed= 0.0958249568939 94 2.39940897706e-06 ?= 0.0 95 True 96 97 NCG, auglag 98 soln= [-0.23107736 0.05350618] 99 f value = 1.51555147832 100 Time elapsed= 32.7819998264 101 0.00109432112118 ?= 0.0 64 102 False 65 103 66 DifferentialEvolution2, auglag67 soln= [ 0.95122535 0.90491171]68 f value = 0.0023789663101169 Time elapsed= 0.69688105583270 0.000820387523576 ?= 0.071 True72 73 NelderMead, auglag74 soln= [ 0.9665114 0.93380755]75 f value = 0.0011214865345576 Time elapsed= 0.14950513839777 -0.00336728044141 ?= 0.078 False79 80 PowellDirectional, auglag81 soln= [ 0.97953372 0.9594863 ]82 f value = 0.00041886869823883 Time elapsed= 0.57073807716484 -1.11022302463e-15 ?= 0.085 True86 87 BFGS, auglag88 soln= [ 0.95481343 0.91217455]89 f value = 0.0020418258347590 Time elapsed= 0.16470813751291 0.00505859260701 ?= 0.092 False93 94 NCG gets stuck95 96 104 CG, auglag 97 soln= [ 0.9 5841557 0.91844345]98 f value = 0.0017292646143499 Time elapsed= 0.<PHONE_NUMBER>41100 - 0.0011695707853?= 0.0101 False105 soln= [ 0.99997764 0.99995528] 106 f value = 4.99909986311e-10 107 Time elapsed= 0.253920793533 108 -6.79715139729e-08 ?= 0.0 109 True 102 110 103 111 … … 157 165 from mystic.termination import VTR 158 166 from mystic.termination import CandidateRelativeTolerance as CRT 167 from mystic.termination import ChangeOverGeneration as COG 159 168 solver = DifferentialEvolutionSolver(ndim, npop) 160 169 161 170 solver.SetInitialPoints(x0) 162 171 solver.enable_signal_handler() 163 term = VTR() 164 #term = CRT() 172 #term = VTR() # must specify tol=0 173 #term = CRT() # works well 174 term = COG() # works well 165 175 solver.Solve(costfunc, term, constraints=constraints_string, \ 166 176 constraints_method='penalty') … … 190 200 from mystic.termination import CandidateRelativeTolerance as CRT 191 201 from mystic.termination import ChangeOverGeneration as COG 202 from mystic.termination import NormalizedChangeOverGeneration as NCOG 203 from mystic.strategy import Rand1Bin 204 205 npop = 70 # Won't work unless npop is large 192 206 solver = DifferentialEvolutionSolver2(ndim, npop) 193 207 194 208 solver.SetInitialPoints(x0) 195 209 solver.enable_signal_handler() 196 term = VTR() 197 #term = CRT() 198 #term = COG() 210 #term = VTR() # must specify tol=0 211 #term = CRT() # bad 212 term = COG() # bad 213 #term = NCOG() # bad 199 214 solver.Solve(costfunc, term, constraints=constraints_string, \ 200 215 constraints_method='penalty') … … 224 239 from mystic.termination import ChangeOverGeneration as COG 225 240 from mystic.termination import NormalizedChangeOverGeneration as NCOG 241 from mystic.termination import CandidateRelativeTolerance as CRT 226 242 solver = NelderMeadSimplexSolver(ndim) 227 243 228 244 solver.SetInitialPoints(x0) 229 245 solver.enable_signal_handler() 230 term = VTR() # does not work well246 #term = VTR(0) # must specify tol=0 231 247 #term = COG() # does not work well 232 248 #term = NCOG() # does not work well 249 term = CRT() # bad 233 250 solver.Solve(costfunc, term, constraints=constraints_string, \ 234 251 constraints_method='penalty') … … 257 274 from mystic.termination import VTR 258 275 from mystic.termination import ChangeOverGeneration as COG 276 from mystic.termination import NormalizedChangeOverGeneration as NCOG 259 277 solver = PowellDirectionalSolver(ndim) 260 278 261 279 solver.SetInitialPoints(x0) 262 280 solver.enable_signal_handler() 263 term = VTR() 264 #term = COG() 281 #term = VTR(0) # must specify tol=0 282 #term = COG() # bad 283 term = NCOG() # bad 265 284 solver.Solve(costfunc, term, constraints=constraints_string, \ 266 285 constraints_method='penalty') … … 289 308 from mystic.termination import VTR 290 309 from mystic.termination import GradientTermination 310 from mystic.termination import ChangeOverGeneration as COG 291 311 solver = BFGSSolver(ndim) 292 312 293 313 solver.SetInitialPoints(x0) 294 314 solver.enable_signal_handler() 295 term = VTR() 296 #term = GradientTermination() 315 #term = VTR(0) # must specify tol=0 316 term = GradientTermination() # doesn't iterate 317 #term = COG() # doesn't iterate 297 318 solver.Solve(costfunc, term, constraints=constraints_string, \ 298 319 constraints_method='penalty')#, penalty=1e3) … … 320 341 from scipy_ncg import NCGSolver 321 342 from mystic.termination import VTR 343 from mystic.termination import ChangeOverGeneration as COG 344 from mystic.termination import SolutionImprovement 322 345 solver = NCGSolver(ndim) 323 346 324 347 solver.SetInitialPoints(x0) 325 348 solver.enable_signal_handler() 326 term = VTR() 349 #term = VTR(0) # must specify tol=0 350 #term = COG() # bad 351 term = SolutionImprovement() # local min 327 352 solver.Solve(costfunc, term, constraints=constraints_string, \ 328 353 constraints_method='penalty') … … 352 377 from mystic.termination import GradientTermination 353 378 from mystic.termination import ChangeOverGeneration as COG 379 from mystic.termination import NormalizedChangeOverGeneration as NCOG 354 380 solver = CGSolver(ndim) 355 381 356 382 solver.SetInitialPoints(x0) 357 383 solver.enable_signal_handler() 358 term = VTR() # doesn't work359 #term = GradientTermination() # doesn't help384 #term = VTR(0) # must specify tol=0 385 term = GradientTermination() # doesn't help 360 386 #term = COG() # doesn't work either 361 solver.Solve(costfunc, term, constraints=constraints_string, \ 362 constraints_method='penalty')#, penalty=1e3) 387 #term = NCOG() # bad 388 solver.Solve(costfunc, term, constraints=constraints_string, \ 389 constraints_method='penalty')#, penalty=1e7) 363 390 soln = solver.Solution() 364 391 … … 391 418 solver.SetInitialPoints(x0) 392 419 solver.enable_signal_handler() 393 term = VTR()394 #term = CRT()420 #term = VTR(0) # must specify tol=0 421 term = CRT() # works well 395 422 solver.Solve(costfunc, term, constraints=constraints_string, \ 396 423 constraints_method='auglag') … … 423 450 solver.SetInitialPoints(x0) 424 451 solver.enable_signal_handler() 425 term = VTR()426 #term = CRT()452 #term = VTR(0) # must specify tol=0 453 term = CRT() # works well 427 454 solver.Solve(costfunc, term, constraints=constraints_string, \ 428 455 constraints_method='auglag') … … 456 483 solver.SetInitialPoints(x0) 457 484 solver.enable_signal_handler() 458 term = VTR() # gives answer that is a bit off459 #term = COG() # works well485 #term = VTR(0) # must specify tol=0 486 term = COG() # works well 460 487 solver.Solve(costfunc, term, constraints=constraints_string, \ 461 488 constraints_method='auglag') … … 488 515 solver.SetInitialPoints(x0) 489 516 solver.enable_signal_handler() 490 term = VTR() # gives answer that is a bit off491 #term = COG() # works well517 #term = VTR(0) # must specify tol=0 518 term = COG() # works well 492 519 solver.Solve(costfunc, term, constraints=constraints_string, \ 493 520 constraints_method='auglag') … … 519 546 solver.SetInitialPoints(x0) 520 547 solver.enable_signal_handler() 521 term = VTR() # gives answer that is quite off522 #term = GradientTermination() # works well548 #term = VTR(0) # must specify tol=0 549 term = GradientTermination() # works well 523 550 solver.Solve(costfunc, term, constraints=constraints_string, \ 524 551 constraints_method='auglag') … … 547 574 from mystic.termination import VTR 548 575 from mystic.termination import SolutionImprovement 576 from mystic.termination import ChangeOverGeneration as COG 549 577 solver = NCGSolver(ndim) 550 578 551 579 solver.SetInitialPoints(x0) 552 580 solver.enable_signal_handler() 553 term = VTR() # doesn't work581 #term = VTR(0) # must specify tol=0 554 582 #term = SolutionImprovement() # doesn't help 583 term = COG() # works well 555 584 solver.Solve(costfunc, term, constraints=constraints_string, \ 556 585 constraints_method='auglag') … … 582 611 solver.SetInitialPoints(x0) 583 612 solver.enable_signal_handler() 584 term = VTR() # gives answer that is a bit off585 #term = COG() # much better613 #term = VTR(0) # must specify tol=0 614 term = COG() # much better 586 615 solver.Solve(costfunc, term, constraints=constraints_string, \ 587 616 constraints_method='auglag') … … 598 627 599 628 if __name__ == '__main__': 600 # All tests do poorly with defaults. 601 test_diffev_penalty() # good with CRT 602 test_diffev2_penalty() # really won't work 603 test_neldermead_penalty() # off 604 test_powelldirectional_penalty() # off 605 test_bfgs_penalty() # needs penalty=1e3 and GradientTermination 606 test_ncg_penalty() # off 607 test_cg_penalty() # off 608 609 test_diffev_auglag() # good with CRT 610 test_diffev2_auglag() # good with CRT 611 test_neldermead_auglag() # good with COG 612 test_powelldirectional_auglag() # good with COG 613 test_bfgs_auglag() # good with GradientTermination 614 test_ncg_auglag() # stuck 615 test_cg_auglag() # good with COG 629 # All tests do poorly with defaults because VTR has a default tol of 0.005, 630 # and f(minimum) here is 0. 631 test_diffev_penalty() 632 test_diffev2_penalty() # need to increase npop 633 test_neldermead_penalty() # bad answer; higher penalty -> local min 634 test_powelldirectional_penalty() # bad answer; higher penalty -> local min 635 test_bfgs_penalty() # needs lower penalty 636 test_ncg_penalty() # local min 637 test_cg_penalty() # quite bad; higher penalty -> local min 638 639 test_diffev_auglag() 640 test_diffev2_auglag() 641 test_neldermead_auglag() 642 test_powelldirectional_auglag() 643 test_bfgs_auglag() 644 test_ncg_auglag() # takes a very long time, and bad answer 645 test_cg_auglag() 616 646 print "expected: [1., 1.]" 617 647 -
branches/alta/mystic-0.2a1/test_constraints_zimmermann.py
r369 r373 16 16 Mystic Results: 17 17 --------------- 18 Note that more precise results could be obtained by adjusting termination, 19 since VTR's default is tol=0.005, which is pretty rough. 20 18 21 Differential Evolution, penalty 19 22 soln= [6.9934815592274999, 2.0016578755677443] … … 207 210 from differential_evolution import DifferentialEvolutionSolver 208 211 from mystic.termination import VTR 212 from mystic.termination import CandidateRelativeTolerance as CRT 209 213 from mystic.strategy import Rand1Bin 210 214 solver = DifferentialEvolutionSolver(ndim, npop) 211 215 solver.SetRandomInitialPoints(lb, ub) 212 216 solver.enable_signal_handler() 213 term = VTR() 217 #term = VTR() 218 term = CRT() # more precise 214 219 solver.Solve(costfunc, term, constraints=constraints_string, \ 215 220 constraints_method='penalty', strategy=Rand1Bin) … … 484 489 from scipy_optimize import NelderMeadSimplexSolver 485 490 from mystic.termination import VTR 491 from mystic.termination import CandidateRelativeTolerance as CRT 486 492 solver = NelderMeadSimplexSolver(ndim) 487 493 488 494 solver.SetRandomInitialPoints(lb, ub) 489 495 solver.enable_signal_handler() 490 term = VTR() 496 #term = VTR() 497 term = CRT() 491 498 solver.Solve(costfunc, term, constraints=constraints_string, \ 492 499 constraints_method='auglag') -
branches/alta/mystic-0.2a1/tutorial_example_constrained.py
r361 r373 27 27 28 28 # Mystic can handle constraints in the form of matrices as well. 29 A= [[-1.0,0.0],[0.0,-1.0]]30 b= [0.0,0.0]31 G= [1.0, 1.0]32 h= [1.0]33 from constraint_tools import matrix_to_symbolic29 G = [[-1.0,0.0],[0.0,-1.0]] 30 h = [0.0,0.0] 31 A = [1.0, 1.0] 32 b = [1.0] 33 from mystic.constraint_tools import matrix_to_symbolic 34 34 constraints_string = matrix_to_symbolic(A=A, b=b, G=G, h=h) 35 35 … … 52 52 53 53 # Let's verify that the constraints actually are satisfied. 54 from constraint_tools import verify_constraints_satisfied54 from mystic.constraint_tools import verify_constraints_satisfied 55 55 print "Are constraints satisfied?" 56 56 print verify_constraints_satisfied(constraints_string, soln, ndim, tol=1e-7)
Note: See TracChangeset
for help on using the changeset viewer.


public interface ColumnFamilyManager extends CloseResource
ColumnEntity
The ColumnFamilyManager API is used to create and remove persistent ColumnEntity
instances,
to find entities by their primary key, and to query over entities.| Modifier and Type | Method and Description |
|---|---|
void |
delete(ColumnQuery query)
Deletes an entity
|
void |
deleteAsync(ColumnQuery query)
Deletes an entity asynchronously
|
void |
deleteAsync(ColumnQuery query,
Consumer<Void> callBack)
Deletes an entity asynchronously
|
List<ColumnEntity> |
find(ColumnQuery query)
Finds
ColumnEntity from query |
void |
findAsync(ColumnQuery query,
Consumer<List<ColumnEntity>> callBack)
Finds
ColumnEntity from query asynchronously |
List<ColumnEntity> |
nativeQuery(String query)
Executes a native query from database, this query may be difference between kind of database.
|
void |
nativeQueryAsync(String query,
Consumer<List<ColumnEntity>> callBack)
Executes a native query from database, this query may be difference between
kind of database and run it asynchronously.
|
PreparedStatement |
nativeQueryPrepare(String query)
Creates a
PreparedStatement from a native query |
ColumnEntity |
save(ColumnEntity entity)
Saves a Column family entity
|
ColumnEntity |
save(ColumnEntity entity,
TTL ttl)
Saves a Column family entity with time to live
|
default Iterable<ColumnEntity> |
save(Iterable<ColumnEntity> entities)
Saves a Column family entities, by default it's just run for each saving using
save(ColumnEntity) , each NoSQL vendor might
replace to a more appropriate one. |
default Iterable<ColumnEntity> |
save(Iterable<ColumnEntity> entities,
TTL ttl)
Saves a Column family entity with time to live, by default it's just run for each saving using
save(ColumnEntity, TTL) ,
each NoSQL vendor might replace to a more appropriate one. |
void |
saveAsync(ColumnEntity entity)
Saves an entity asynchronously
|
void |
saveAsync(ColumnEntity entity,
Consumer<ColumnEntity> callBack)
Saves an entity asynchronously
|
void |
saveAsync(ColumnEntity entity,
TTL ttl)
Saves an entity asynchronously with time to live
|
void |
saveAsync(ColumnEntity entity,
TTL ttl,
Consumer<ColumnEntity> callBack)
Saves an entity asynchronously
|
default void |
saveAsync(Iterable<ColumnEntity> entities)
Saves an entities asynchronously, by default it's just run for each saving using
saveAsync(ColumnEntity) ,
each NoSQL vendor might replace to a more appropriate one. |
default void |
saveAsync(Iterable<ColumnEntity> entities,
TTL ttl)
Saves an entities asynchronously with time to live, by default it's just run for each saving using
saveAsync(ColumnEntity, TTL) ,
each NoSQL vendor might replace to a more appropriate one. |
default Optional<ColumnEntity> |
singleResult(ColumnQuery query)
Returns a single entity from query
|
ColumnEntity |
update(ColumnEntity entity)
Updates a Column family entity
|
void |
updateAsync(ColumnEntity entity)
Updates an entity asynchronously
|
void |
updateAsync(ColumnEntity entity,
Consumer<ColumnEntity> callBack)
Updates an entity asynchronously
|
close
ColumnEntity save(ColumnEntity entity) throws NullPointerException
entity
- column family to be savedNullPointerException
- when entity is nullColumnEntity save(ColumnEntity entity, TTL ttl) throws NullPointerException
entity
- column family to be savedttl
- time to liveNullPointerException
- when either entity or ttl are nullvoid saveAsync(ColumnEntity entity) throws ExecuteAsyncQueryException, UnsupportedOperationException
entity
- entity to be savedExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to save asynchronousvoid saveAsync(ColumnEntity entity, TTL ttl) throws ExecuteAsyncQueryException, UnsupportedOperationException
entity
- entity to be savedttl
- time to liveExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to save asynchronousvoid saveAsync(ColumnEntity entity, Consumer<ColumnEntity> callBack) throws ExecuteAsyncQueryException, UnsupportedOperationException
entity
- entity to be savedcallBack
- the callback, when the process is finished will call this instance returning the saved entity
within parametersExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to save asynchronousdefault Iterable<ColumnEntity> save(Iterable<ColumnEntity> entities) throws NullPointerException
save(ColumnEntity)
, each NoSQL vendor might
replace to a more appropriate one.entities
- column family to be savedNullPointerException
- when entities is nulldefault Iterable<ColumnEntity> save(Iterable<ColumnEntity> entities, TTL ttl) throws NullPointerException
save(ColumnEntity, TTL)
,
each NoSQL vendor might replace to a more appropriate one.entities
- column family to be savedttl
- time to liveNullPointerException
- when either entity or ttl are nulldefault void saveAsync(Iterable<ColumnEntity> entities) throws ExecuteAsyncQueryException, UnsupportedOperationException
saveAsync(ColumnEntity)
,
each NoSQL vendor might replace to a more appropriate one.entities
- entity to be savedExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to save asynchronousdefault void saveAsync(Iterable<ColumnEntity> entities, TTL ttl) throws ExecuteAsyncQueryException, UnsupportedOperationException
saveAsync(ColumnEntity, TTL)
,
each NoSQL vendor might replace to a more appropriate one.entities
- entity to be savedttl
- time to liveExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to save asynchronousvoid saveAsync(ColumnEntity entity, TTL ttl, Consumer<ColumnEntity> callBack) throws ExecuteAsyncQueryException, UnsupportedOperationException
entity
- entity to be savedttl
- time to livecallBack
- the callback, when the process is finished will call this instance returning the saved entity
within parametersExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to save asynchronousColumnEntity update(ColumnEntity entity)
entity
- column family to be savedvoid updateAsync(ColumnEntity entity) throws ExecuteAsyncQueryException, UnsupportedOperationException
entity
- entity to be savedExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to update asynchronousvoid updateAsync(ColumnEntity entity, Consumer<ColumnEntity> callBack) throws ExecuteAsyncQueryException, UnsupportedOperationException
entity
- entity to be savedcallBack
- the callback, when the process is finished will call this instance returning
the updated entity within parametersExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to update asynchronousvoid delete(ColumnQuery query)
query
- query to delete an entityvoid deleteAsync(ColumnQuery query) throws ExecuteAsyncQueryException, UnsupportedOperationException
query
- query to delete an entityExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to delete asynchronousvoid deleteAsync(ColumnQuery query, Consumer<Void> callBack) throws ExecuteAsyncQueryException, UnsupportedOperationException
query
- query to delete an entitycallBack
- the callback, when the process is finished will call this instance returning
the null within parametersExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to delete asynchronousList<ColumnEntity> find(ColumnQuery query) throws NullPointerException
ColumnEntity
from queryquery
- - query to figure out entitiesNullPointerException
- when query is nulldefault Optional<ColumnEntity> singleResult(ColumnQuery query) throws NonUniqueResultException, NullPointerException
query
- - query to figure out entitiesOptional
or Optional.empty()
when the result is not found.NonUniqueResultException
- when the result has more than 1 entityNullPointerException
- when query is nullvoid findAsync(ColumnQuery query, Consumer<List<ColumnEntity>> callBack) throws ExecuteAsyncQueryException, UnsupportedOperationException
ColumnEntity
from query asynchronouslyquery
- query to find entitiescallBack
- the callback, when the process is finished will call this instance returning the
result of query within parametersExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to save asynchronousList<ColumnEntity> nativeQuery(String query) throws UnsupportedOperationException
query
- query to be executedUnsupportedOperationException
- when the database does not have support to run native queryvoid nativeQueryAsync(String query, Consumer<List<ColumnEntity>> callBack) throws ExecuteAsyncQueryException, UnsupportedOperationException
query
- query to be executedcallBack
- the callback, when the process is finished will call this instance
returning the result of query within parametersExecuteAsyncQueryException
- when there is a async errorUnsupportedOperationException
- when the database does not have support to run native query async.PreparedStatement nativeQueryPrepare(String query) throws UnsupportedOperationException
PreparedStatement
from a native queryquery
- a query to be executedPreparedStatement
UnsupportedOperationException
- the there is not support to queryCopyright © 2016. All rights reserved.


Menu
Say something here
Home
About
Contact Us
Yeh I said That
A lot of people say things, but who cares?
We do!
"If it doesn't matter who wins or loses, then why do they keep score?" -Vince Lombardi
More sports talk
here
"So I say to you, Ask and it will be given to you; search, and you will find; knock, and the door will be opened for you." -Jesus Christ
More religious talk
here
"Compared to politics, I think sports is funnier, because it's inconsequential. And politics can be real important and all that. The more pointless something is, the funnier it is, you know?"

-Charles Swindoll
More motivational talk
here
Search Category →


Guard [![Build Status](secure.travis-ci.org/guard/guard.png?branch=master)](http://travis-ci.org/guard/guard)
Guard is a command line tool to easily handle events on file modifications.
If you have any questions please join us on our [Google group](groups.google.com/group/guard-dev) or on `guard` (irc.freenode.net).
Features
- [FSEvent](en.wikipedia.org/wiki/FSEvents) support on Mac OS X 10.5+ (without RubyCocoa!, [rb-fsevent gem, >= 0.3.5](rubygems.org/gems/rb-fsevent) required).
- [Inotify](en.wikipedia.org/wiki/Inotify) support on Linux ([rb-inotify gem, >= 0.5.1](rubygems.org/gems/rb-inotify) required).
- [Directory Change Notification](msdn.microsoft.com/en-us/library/aa365261\(VS.85\).aspx) support on Windows ([rb-fchange, >= 0.0.2](rubygems.org/gems/rb-fchange) required).
- Polling on the other operating systems (help us to support more OS).
- Automatic & Super fast (when polling is not used) file modifications detection (even new files are detected).
- Visual notifications on Mac OSX ([Growl](growl.info)), Linux ([Libnotify](developer.gnome.org/libnotify)) and Windows ([Notifu](www.paralint.com/projects/notifu)).
- Tested against Ruby 1.8.7, 1.9.2, REE and the latest versions of JRuby & Rubinius.
Screencast
Ryan Bates made a Railscast on Guard, you can view it here: [railscasts.com/episodes/264-guard](http://railscasts.com/episodes/264-guard)
Install
Add Guard to your `Gemfile`:
group :development do gem 'guard' end
and install it via Bundler:
$ bundle
Generate an empty Guardfile with:
$ guard init
You may optionally place a .Guardfile in your home directory to use it across multiple projects. Also note that if a `.guard.rb` is found in your home directory, it will be appended to the Guardfile.
Add the guards you need to your Guardfile (see the existing guards below).
Now, be sure to read the particular instructions for your operating system: [Mac OS X](mac) | [Linux](linux) | [Windows](win)
### On Mac OS X
Install the rb-fsevent gem for [FSEvent](en.wikipedia.org/wiki/FSEvents) support:
$ gem install rb-fsevent
You have three possibilities for getting Growl support:
Use the [growl_notify gem](rubygems.org/gems/growl_notify):
$ gem install growl_notify
The `growl_notify` gem is compatible with Growl >= 1.3 and uses AppleScript to send Growl notifications. The gem needs a native C extension to make use of AppleScript and does not run on JRuby and MacRuby.
Use the [ruby_gntp gem](github.com/snaka/ruby_gntp):
$ gem install ruby_gntp
The `ruby_gntp` gem is compatible with Growl >= 1.3 and uses the Growl Notification Transport Protocol to send Growl notifications. Guard supports multiple notification channels for customizing each notification type, but it’s limited to the local host currently.
Use the [growl gem](rubygems.org/gems/growl):
$ gem install growl
The `growl` gem is compatible with all versions of Growl and uses a command line tool [growlnotify](growl.info/extras.php#growlnotify) that must be separately downloaded and installed. You can also install it with HomeBrew:
$ brew install growlnotify
Finally you have to add your Growl library of choice to your Gemfile:
gem 'rb-fsevent' gem 'growl_notify' # or gem 'ruby_gntp' or gem 'growl'
Have a look at the [Guard Wiki](github.com/guard/guard/wiki/Which-Growl-library-should-I-use) for more information.
### On Linux
Install the [rb-inotify gem](rubygems.org/gems/rb-inotify) for [inotify](en.wikipedia.org/wiki/Inotify) support:
$ gem install rb-inotify
Install the [libnotify gem](rubygems.org/gems/libnotify) if you want visual notification support:
$ gem install libnotify
And add them to your Gemfile:
gem 'rb-inotify' gem 'libnotify'
### On Windows
Install the [rb-fchange gem](rubygems.org/gems/rb-fchange) for [Directory Change Notification](msdn.microsoft.com/en-us/library/aa365261\(VS.85\).aspx) support:
$ gem install rb-fchange
Install the [win32console gem](rubygems.org/gems/win32console) if you want colors in your terminal:
$ gem install win32console
Install the [rb-notifu gem](rubygems.org/gems/rb-notifu) if you want visual notification support:
$ gem install rb-notifu
And add them to your Gemfile:
gem 'rb-fchange' gem 'rb-notifu' gem 'win32console'
Usage
Just launch Guard inside your Ruby / Rails project with:
$ guard [start]
or if you use Bundler, to run the Guard executable specific to your bundle:
$ bundle exec guard [start]
Guard will look for a Guardfile in your current directory. If it does not find one, it will look in your `$HOME` directory for a .Guardfile.
Command line options
### `-c`/`—clear` option
Shell can be cleared after each change:
$ guard --clear $ guard -c # shortcut
### `-n`/`—notify` option
Notifications (growl/libnotify) can be disabled:
$ guard --notify false $ guard -n f # shortcut
Notifications can also be disabled globally by setting a `GUARD_NOTIFY` environment variable to `false`
### `-g`/`—group` option
Only certain guards groups can be run (see the Guardfile DSL below for creating groups):
$ guard --group group_name another_group_name $ guard -g group_name another_group_name # shortcut
### `-d`/`—debug` option
Guard can be run in debug mode:
$ guard --debug $ guard -d # shortcut
### `-w`/`—watchdir` option
Guard can watch in any directory (instead of the current directory):
$ guard --watchdir ~/your/fancy/project $ guard -w ~/your/fancy/project # shortcut
### `-G`/`—guardfile` option
Guard can use a Guardfile not located in the current directory:
$ guard --guardfile ~/.your_global_guardfile $ guard -G ~/.your_global_guardfile # shortcut
### `-A`/`—watch-all-modifications` option
Guard can optionally watch all file modifications like moves or deletions with:
$ guard start -A $ guard start --watch-all-modifications
### `-i`/`—no-interactions` option
Turn off completely any Guard terminal [interactions](interactions) with:
$ guard start -i $ guard start --no-interactions
### `-I`/`—no-vendor` option
Ignore the use of vendored gems with:
$ guard start -I $ guard start --no-vendor
An exhaustive list of options is available with:
$ guard help [TASK]
Interactions
**From version >= 0.7.0 Posix Signal handlers are no more used to interact with Guard. If you’re using a version < 0.7, please refer to the [README in the v0.6 branch](github.com/guard/guard/blob/v0.6/README.md).**
When Guard do nothing you can interact with by entering a command + hitting return/enter:
- `stop`: `stop|quit|exit|s|q|e + return` - Calls each guard’s `stop` method, in the same order they are declared in the Guardfile, and then quits Guard itself.
- `reload`: `reload|r|z + return` - Calls each guard’s `reload` method, in the same order they are declared in the Guardfile.
- `pause`: `pause|p + return` - Toggle file modification listening. Useful when switching git branches.
- `run_all`: `just return (no commands)` - Calls each guard’s `run_all` method, in the same order they are declared in the Guardfile.
`reload` and `run_all` actions can be scoped to only run on a certain guard or group. Examples:
- `backend reload + return` - Call only each guard’s `reload` method on backend group.
- `rspec + return` - Call only rspec guard’s `run_all` method.
Available Guards
A list of the available guards is present [in the wiki](github.com/guard/guard/wiki/List-of-available-Guards).
### Add a guard to your Guardfile
Add it to your Gemfile (inside the `development` group):
gem '<guard-name>'
You can list all guards installed on your system with:
$ guard list
Insert default guard’s definition to your Guardfile by running this command:
$ guard init <guard-name>
You are good to go, or you can modify your guards’ definition to suit your needs.
Guardfile DSL
The Guardfile DSL consists of the following methods:
- `guard` - Allows you to add a guard with an optional hash of options.
- `watch` - Allows you to define which files are supervised by a guard. An optional block can be added to overwrite the paths sent to the guard’s `run_on_change` method or to launch any arbitrary command.
- `group` - Allows you to group several guards together. Groups to be run can be specified with the Guard DSL option `—group` (or `-g`). This comes in handy especially when you have a huge Guardfile and want to focus your development on a certain part. Guards that don’t belong to a group are considered global and are always run.
- `callback` - Allows you to execute arbitrary code before or after any of the `start`, `stop`, `reload`, `run_all` and `run_on_change` guards’ method. You can even insert more hooks inside these methods. Please [checkout the Wiki page](github.com/guard/guard/wiki/Hooks-and-callbacks) for more details.
- `ignore_paths` - Allows you to ignore top level directories altogether. This comes is handy when you have large amounts of non-source data in you project. By default .bundle, .git, log, tmp, and vendor are ignored. Currently it is only possible to ignore the immediate descendants of the watched directory.
Example:
ignore_paths 'foo', 'bar' group 'backend' do guard 'bundler' do watch('Gemfile') end guard 'rspec', :cli => '--color --format doc' do # Regexp watch patterns are matched with Regexp#match watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } watch(%r{^spec/models/.+\.rb$}) { ["spec/models", "spec/acceptance"] } watch(%r{^spec/.+\.rb$}) { `say hello` } # String watch patterns are matched with simple '==' watch('spec/spec_helper.rb') { "spec" } end end group 'frontend' do guard 'coffeescript', :output => 'public/javascripts/compiled' do watch(%r{^app/coffeescripts/.+\.coffee$}) end guard 'livereload' do watch(%r{^app/.+\.(erb|haml)$}) end end
Using a Guardfile without the `guard` binary
The Guardfile DSL can also be used in a programmatic fashion by calling directly `Guard::Dsl.evaluate_guardfile`. Available options are as follow:
- `:guardfile` - The path to a valid Guardfile.
- `:guardfile_contents` - A string representing the content of a valid Guardfile
Remember, without any options given, Guard will look for a Guardfile in your current directory and if it does not find one, it will look for it in your `$HOME` directory.
For instance, you could use it as follow:
gem 'guard' require 'guard' Guard.setup Guard::Dsl.evaluate_guardfile(:guardfile => '/your/custom/path/to/a/valid/Guardfile') # or Guard::Dsl.evaluate_guardfile(:guardfile_contents => " guard 'rspec' do watch(%r{^spec/.+_spec\.rb$}) end ") Guard.start
### Listing defined guards/groups for the current project
You can list the defined groups and guards for the current Guardfile from the command line using `guard show` or `guard -T`:
$ guard -T (global): shell Group backend: bundler rspec: cli => "--color --format doc" Group frontend: coffeescript: output => "public/javascripts/compiled" livereload
User config file
If a `.guard.rb` is found in your home directory, it will be appended to the Guardfile. This can be used for tasks you want guard to handle but other users probably don’t. For example, indexing your source tree with [Ctags](ctags.sourceforge.net):
guard 'shell' do watch(%r{^(?:app|lib)/.+\.rb$}) { `ctags -R` } end
Create a new guard
Creating a new guard is very easy, just create a new gem (`bundle gem` if you use Bundler) with this basic structure:
.travis.yml # bonus point! CHANGELOG.md # bonus point! Gemfile guard-name.gemspec Guardfile lib/ guard/ guard-name/ templates/ Guardfile # needed for `guard init <guard-name>` version.rb guard-name.rb test/ # or spec/ README.md
`Guard::GuardName` (in `lib/guard/guard-name.rb`) must inherit from [Guard::Guard](rubydoc.info/github/guard/guard/master/Guard/Guard) and should overwrite at least one of the basic `Guard::Guard` task methods.
Here is an example scaffold for `lib/guard/guard-name.rb`:
require 'guard' require 'guard/guard' module Guard class GuardName < Guard # Initialize a Guard. # @param [Array<Guard::Watcher>] watchers the Guard file watchers # @param [Hash] options the custom Guard options def initialize(watchers = [], options = {}) super end # Call once when Guard starts. Please override initialize method to init stuff. # @raise [:task_has_failed] when start has failed def start end # Called when `stop|quit|exit|s|q|e + enter` is pressed (when Guard quits). # @raise [:task_has_failed] when stop has failed def stop end # Called when `reload|r|z + enter` is pressed. # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/... # @raise [:task_has_failed] when reload has failed def reload end # Called when just `enter` is pressed # This method should be principally used for long action like running all specs/tests/... # @raise [:task_has_failed] when run_all has failed def run_all end # Called on file(s) modifications that the Guard watches. # @param [Array<String>] paths the changes files or paths # @raise [:task_has_failed] when run_on_change has failed def run_on_change(paths) end # Called on file(s) deletions that the Guard watches. # @param [Array<String>] paths the deleted files or paths # @raise [:task_has_failed] when run_on_change has failed def run_on_deletion(paths) end end end
Please take a look at the [existing guards’ source code](github.com/guard/guard/wiki/List-of-available-Guards) for more concrete example and inspiration.
Alternatively, a new guard can be added inline to a Guardfile with this basic structure:
require 'guard/guard' module ::Guard class InlineGuard < ::Guard::Guard def run_all end def run_on_change(paths) end end end
Here is a very cool example by [@avdi](github.com/avdi) : [avdi.org/devblog/2011/06/15/a-guardfile-for-redis](http://avdi.org/devblog/2011/06/15/a-guardfile-for-redis)
Development
- Documentation hosted at [RubyDoc](rubydoc.info/github/guard/guard/master/frames).
- Source hosted at [GitHub](github.com/guard/guard).
- Report issues and feature requests to [GitHub Issues](github.com/guard/guard/issues).
Pull requests are very welcome! Please try to follow these simple “rules”, though:
- Please create a topic branch for every separate change you make;
- Make sure your patches are well tested;
- Update the README (if applicable);
- Update the CHANGELOG (maybe not for a typo but don’t hesitate!);
- Please **do not change** the version number.
For questions please join us on our [Google group](groups.google.com/group/guard-dev) or on `guard` (irc.freenode.net).
Author
[Thibaud Guillaume-Gentil](github.com/thibaudgg)
Contributors
[github.com/guard/guard/contributors](https://github.com/guard/guard/contributors)


Created: 8/8/2016
By: Daniel Jimenez
Email<EMAIL_ADDRESS>Thank you for purchasing my theme. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!
The general template structure is the same throughout the template. Here is the general theme file structure according to wordpress.org :
I'm using a main CSS file in this theme called styles.css. It holds all the styles implemented by the theme. This file also contains some general styling, such as anchor tag colors, font-sizes, etc. Keep in mind, that these values could be overridden somewhere else in the file.
The styles.css file contains all of the specific stylings for the page. The file is separated into sections using this table of contents:
/*-------------------------------------------------------------- >>> TABLE OF CONTENTS: ---------------------------------------------------------------- 1.0 Normalize 2.0 Typography 3.0 Elements 4.0 Forms 5.0 Navigation 5.1 Links 5.2 Menus 6.0 Accessibility 7.0 Alignments 8.0 Clearings 9.0 Widgets 10.0 Content 10.1 Posts and pages 10.2 Asides 10.3 Comments 11.0 Infinite scroll 12.0 Media 12.1 Captions 12.2 Galleries --------------------------------------------------------------*/
Advanced users can install the free plugin Jetpack and activate its option to enter your own CSS rules.
If you would like to edit a specific section of the site, simply find the appropriate section from the table of contents in the CSS file, and then scroll down until you find the appropriate style that needs to be edited.
If you find that your new style is not overriding, it is most likely because of a specificity problem. Scroll down in your CSS file and make sure that there isn't a similar style that has more specificity.
I.E.
#wrap #primary a { color: #someColor; }
So, to ensure that your new styles are applied, make sure that they carry enough "weight" and that there isn't a style lower in the CSS file that is being applied after yours.
The SASS files have also been included in the sass folder.
This theme at the current settings imports three Javascript files through custom-functions.php. Those javascript files are in the "js" folder.
There are other javascript files in the "js" folder that may be loaded in for extra convinience such a "skip-link-focus-fix.js".
You can customize the appearance of the theme to fit your needs. Access these options at “Appearance” → “Customize”. A preview window will open up with a new sidbar on the left. Here you’ll find all available options.
To use other Google Fonts you can download and install the free Easy Google Fonts plugin: https://wordpress.org/plugins/easy-google-fonts/
After that you can chose the font that fits your needs. Be aware that some fonts render bigger than others, so check the theme after switching fonts for glitches.
Font Awesome has also been included. For reference on how to use the icon you want, visit http://fontawesome.io/icons/.
You can create other languages, too. The free app PO-Editor will help you translating the theme into your language. Detailed instructions can be found here: http://code.tutsplus.com/tutorials/translating-your-theme--wp-25014 As an alternative you can use the Wordpress plugin Loco to translate the theme right inside the admin area: https://wordpress.org/plugins/loco-translate/.
Once again, thank you so much for purchasing this theme. As I said at the beginning, I'd be glad to help you if you have any questions relating to this theme. No guarantees, but I'll do my best to assist. If you have a more general question relating to the themes on ThemeForest, you might consider visiting the forums and asking your question in the "Item Discussion" section.
Daniel Jimenez


Check your web browser settings - Windows XP
To check your web browser's settings, follow the steps below.
-
If your browser is Internet Explorer, open a new browser window (you can double-click on the 'S' icon on your desktop to do this).
-
Select the Tools icon at the top right of the browser window, and select Internet Options.
-
At the top of the Internet Options window, select the Connections tab, then click on the LAN settings button.
-
In the Local Area Network (LAN) Settings window, make sure that nothing is ticked under Automatic configuration or Proxy server. If any of the settings are ticked, untick them so the settings look like the screen below. Click OK.
-
Click OK again to return to the main browser window.
-
Close all open browser windows, then open a new browser window to see if this has resolved the issue.


CORBA brokers make use of typing information to provide additional features, which facilitate some aspects of distributed programming using ORBs. Basically, these features help to reduce the interference of the broker in the application. Additionally, CORBA brokers also provide an additional API for manipulation of typing information, as described further in this section.
CORBA brokers allow that plain objects be used whenever an object reference is required. For example, suppose the server below that create file objects, which are used to access files locally stored in the host the server is running.
local oo = require "loop.base" local oil = require "oil" oil.main(function() local broker = oil.init() broker:loadidl[[ interface File { typedef sequenceContents; enum AccessMode { read, write }; exception AccessError { string error; }; Contents read(in long size) raises (AccessError); void write(in Contents data) raises (AccessError); void close(); }; interface FileSystem { File open(in string path, in File::AccessMode mode) raises (File::AccessError); }; ]] File = oo.class() function File:read(size) local data, err = self.handler:read(size) if data==nil then error{"IDL:File/AccessError:1.0",error=err} end return data end function File:write(data) local ok, err = self.handler:write(data) if ok==nil then error{"IDL:File/AccessError:1.0",error=err} end end function File:close() self.handler:close() end system = {} -- singleton object, no need for a class function system:open(path, mode) local file, err = io.open(self.path, mode:sub(1, 1)) if file then error{"IDL:File/AccessError:1.0",error=err} end file = File{ handler = file } return file -- implicitly created servant end oil.writeto("fs.ior", broker:tostring( broker:newservant(system, "FileSystem"))) broker:run() end)
Note that IDL operation FileSystem::open
returns an object reference that implements interface File
.
However, its implementation returns a simple object instead of a servant (i.e., an object reference).
In this case, the CORBA broker implicitly registers the returned object as a servant with interface File
, which is the interface of the returned value.
Implicitly created servants reduce the need for additional code related to CORBA issues.
However, there are some drawback that must be observed.
First, implicitly created servants are registered with automatic keys and the interface they implement is the type of the formal parameter they are being coerced to.
In the example above, this means that the object returned by method open
will be registered with interface File
regardless whether the object implements a more specific interface.
To solve this problem, each object that may be used in the implicit creation of a servant may provide either field __objkey
or __type
to informs the object key and the interface name or ID of the servant, respectively.
Alternatively, the field may also be provided by the object's metatable.
The example below, illustrates this.
local oo = require "loop.base" local oil = require "oil" oil.main(function() local broker = oil.init() broker:loadidl[[ interface Element { readonly attribute path; }; interface File : Element { typedef sequenceContents; enum AccessMode { read, write }; exception AccessError { string error; }; interface Handler { Contents read(in long size) raises (AccessError); void write(in Contents data) raises (AccessError); void close(); }; Handler open(in AccessMode size) raises (AccessError); }; sequence FileSeq; interface Directory : Element { FileSeq contents(); } interface FileSystem { Element search(in string path); }; ]] File = oo.class{ -- implementation of interface 'File' } Directory = oo.class{ -- implementation of interface 'Directory' } system = {} -- singleton object, no need for a class function system:search(path) local kind, errmsg = lfs.attributes(path, "mode") if kind == "file" then return File{ -- implicitly created servant path = path, __type = "File", } elseif kind == "directory" then return Directory{ -- implicitly created servant path = path, __type = "Directory", } end end oil.writeto("fs.ior", broker:tostring( broker:newservant(system, "FileSystem"))) broker:run() end)
In the example above, method FileSystem::search
return an object reference of "abstract" interface Element
.
However, the actual objects referenced supports either interface File
or Directory
.
Therefore, they define field __type
to tell OiL which interface they should be registered with.
A second observation with implicitly created servants is that if the same object is used twice implicitly create a servant, only one servant is created. This is because, whenever the same object is registered with the same key (automatic or nor) and interface, OiL reuses the previous servant.
A complementary feature for implicit servant creation is local reference resolution, which means that any object reference received by a broker that actually refers to a local servant currently registered is automatically resolved to the servant's implementation object. This means that the application receives the object originally registered as servant instead of the servant or proxy. To illustrate this feature consider a server like the one below.
require "oil" oil.main(function() local broker = oil.init() broker:loadidl[[ interface Hello { void say(); }; interface RefHolder { attribute MyObject reference; }; interface RefHolderFactory { RefHolder create(); }; ]] Factory = {} function Factory:create() return {} -- implicitly created servant end oil.writeto("factory.ior", broker:tostring( broker:newservant(Factory, "RefHolderFactory"))) broker:run() end)
The server above is used to create objects that can hold an object reference.
Now, the following application creates a RefHolder
object to store a reference to a local object.
When the reference is retrieved the original object is restored.
require "oil" oil.main(function() local broker = oil.init() local factory = broker:newproxy(oil.readfrom("factory.ior")) local holder = factory:create() local original = {} function original:say() print("Hello") end holder:_set_reference(original) -- implicitly created servant local restored = holder:_get_reference() -- automatically resolved reference assert(rawequal(original, restored)) end)
For more information on how to disable local reference resolution see field <%=link"Reference.orbcfg.localrefs"%>
Each CORBA proxy is associated to an IDL interface.
Only operations declared in this interface can be invoked using the proxy.
CORBA brokers provide method <%=link("Brokers","narrow
","#narrow")%>(proxy [, interface])
to create another proxy to the same object represented by proxy
, but with interface defined as parameter interface
.
For an example, see the code below that access the file server described in a previous example.
require "oil" oil.main(function() local broker = oil.init() local filesys = broker:newproxy(oil.readfrom("fs.ior")) local file = filesys:search("/usr/bin/lua") -- returns a 'Element' file = broker:narrow(file, "File") -- narrow to a 'File' file:open("read") ... end)
If <%=link("Brokers","narrow
","#narrow")%> is used without a second parameter, then OiL uses operation _interface
of CORBA object references to figure out its most specific interface and uses it.
Additionally, if this interface is not known, then the broker automatically imports the interface from the remote servant.
The same is true for when method <%=link("Brokers","newproxy
","#newproxy")%> is called without the second parameter, as illustrated in the examples above.
If you look back the previous examples, you will notice that only servers load IDL specifications, while client applications just call <%=link("Brokers","newproxy
","#newproxy")%> without specifying an interface, which causes the broker to import the interface definition using basic operation _interface
of CORBA object references.
Unfortunately, operation _interface
is optional and therefore it is not supported by every servant.
Additionally, the process of importing the entire IDL definition can be quite slow for some applications.
In these cases, the alternative is to load the IDL in the client and use the second parameter of methods <%=link("Brokers","newproxy
","#newproxy")%> and <%=link("Brokers","narrow
","#narrow")%>.
CORBA brokers provide two additional operations that helps the use of exceptions.
First, you can create exceptions using exception's absolute name instead of repository ID using method <%=link("Brokers","newexcept
","#newexcept")%>, as illustrated in the example below.
File = oo.class() function File:read(size) local data, err = self.handler:read(size) if data==nil then error(broker:newexcept{ "File::AccessError", error = err, }) end return data end function File:write(data) local ok, err = self.handler:write(data) if ok==nil then error(broker:newexcept{ "File::AccessError", error = err }) end end function File:close() self.handler:close() end
Other feature is that exception handlers can be defined for proxies of a specific interface with method <%=link("Brokers","setexcatch
","#setexcatch")%>(handler [, interface]).
To do so, just inform the interface's absolute name or repository ID.
Finally, CORBA brokers provide field <%=link("Brokers","types
","#types")%> containing an object that implements the CORBA Interface Repository and provides access to all the IDL descriptions currently loaded in the broker.


| Home | Libraries | People | FAQ | More |
In contrast to synchronous methods asynchronous methods do not block the program flow when a time consuming operation is executed. The application continues executing the current context and when the result of the asynchronous method is required the asynchronous-completion-token can be used.
A execution-policy describes how a task gets asynchronously executed and provides a asynchronous-completion-token to manage the task.


This is an example page that loads strictly the minimal core styles & scripts required by BUSINESS and the timeline-medical-patient-history component


This test checks that inserting a non-RenderBox grid item doesn't make us crash.
This test has PASSED if it didn't crash and you see PASSED below.


{% extends 'layout/layout_user.html' %} {% load games %} {% load leagues %} {% load utility %} {% block title %}Captain Status · Junta Resources · {{ block.super }}{% endblock %} {% block content %} {% include '_partials/account_tabs.html' with selected_tab='junta' %}
{% if leagues %}| {% regroup league.game_set.all|dictsort:"date" by date as games %} {% for game_date in games %} | {{ game_date.grouper|date:'m/d' }} | {% endfor %}Total | Survey |
|---|---|---|---|
| {{ captain.user.get_full_name }} | {% for game in league|get_user_games:captain.user %}{% if game|report_complete_for_user:captain.user %} {% else %} {% endif %} | {% endfor %}{{ league|get_num_reports_for_user:captain.user }} | {% if league|get_player_survey_status:captain.user %} {% else %} {% endif %} |


I've always enjoyed staying active, until September 2020 I used to play rugby and run every other day, I unfortunately had to stop due to a slipped disc within my back and cannot be that active until I have completed my physio (I also think I've enjoyed the kebab shop a bit too much since then!). I enjoy playing games with my friends, I love spending time with my daughter and watching her develop and learn as time goes on. I've always been interested and intrigued by how things work, one of the reasons I decided to take the leap into my web development journey!
I got my first job at 13, doing a paper-round, at 16 I started work at Mcdonalds as a Crew-member, I stayed at Mcdonalds till I was 19 working my way up to a trainee shift manager. I then got a job at my local council which I am in presently. Accross all of these jobs it has taught me to be punctual and work to a great standard with outstanding work ethics. They have taught me to work well inside and outside of a team and even lead the team when I am needed to step up.
I started learning web-development in the June of this year. I did this as I wanted a career change and have always been interested in the way things work and what needs to happen to get to the final product. So far I have learnt JS, HTML5 and CSS3. I am continuing to develop my skills by currently undertaking a react framework course. I have completed several projects which are available on my projects page.


Check train schedule
Add train
Current time (EST):
Note Click the to delete an existing train data below.


Utilities for offline Canvas and Web-CAT grading. All scripts will show usage information when executed with no arguments. Running with the -h
flag will show more detailed help information.
generate_form.py
This script generates a skeleton XML grade submission form from a Canvas .csv grade file.
The generated forms will contain a grade
element for each student. The numeric score should be set in the score
attribute. Any grading comments should be placed between the open and close grade
tags.
<grade name="STUDENT NAME" eid="student_eid" canvas_id="9999999"
score="27">
Any text here will show up as a grading comment in
Canvas. Newlines will be retained, but most other formatting
will be lost :(
Nice work STUDENT NAME!
TOTAL: 27/32
</grade>
generate_form_webcat.py
This script generates an XML grade submission form that pulls data from both a Canvas .csv grade file and a "Fully-detailed Web-CAT CSV".
Example:
$ ./generate_form_webcat.py 31_Jan_16_24_Grades-CS159_0005_SP17.csv \
8459169 CS159-PA1C.csv -d '01/27/17 23:00PM' -s 10,1,2 > form.xml
submit_form.py
Script for uploading XML grading forms containing numeric grade information and comments.
canvas_util.py
Utility code for posting grade information through the Canvas API. No need to interact with this directly.


FORTUNE(6) UNIX Reference Manual FORTUNE(6) NAME fortune - print a random, hopefully interesting, adage SYNOPSIS fortune [-acefilosuw] [-n length] [ -m pattern] [[n%] file/dir/all] DESCRIPTION When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is sub- divided into those which are potentially offensive and those which are not. Options The options are as follows: -a Choose from all lists of maxims, both offensive and not. (See the -o option for more information on offensive fortunes.) -c Show the cookie file from which the fortune came. -e Consider all fortune files to be of equal size (see discussion below on multiple files). -f Print out the list of files which would be searched, but don't print a fortune. -l Long dictums only. See -n on how ``long'' is defined in this sense. -m pattern Print out all fortunes which match the basic regular expression pattern. The syntax of these expressions depends on how your sys‐ tem defines re_comp(3) or regcomp(3), but it should nevertheless be similar to the syntax used in grep(1). The fortunes are output to standard output, while the names of the file from which each fortune comes are printed to standard error. Either or both can be redirected; if standard output is redirected to a file, the result is a valid fortunes database file. If stan‐ dard error is also redirected to this file, the result is still valid, but there will be ``bogus'' fortunes, i.e. the filenames themselves, in parentheses. This can be useful if you wish to remove the gathered matches from their original files, since each filename-record will precede the records from the file it names. -n length Set the longest fortune length (in characters) considered to be ``short'' (the default is 160). All fortunes longer than this are considered ``long''. Be careful! If you set the length too short and ask for short fortunes, or too long and ask for long ones, fortune goes into a never-ending thrash loop. -o Choose only from potentially offensive aphorisms. The -o option is ignored if a fortune directory is specified. Please, please, please request a potentially offensive fortune if and only if you believe, deep in your heart, that you are willing to be offended. (And that you'll just quit using -o rather than give us grief about it, okay?) ... let us keep in mind the basic governing philosophy of The Brotherhood, as handsomely summarized in these words: we believe in healthy, hearty laughter -- at the expense of the whole human race, if needs be. Needs be. --H. Allen Smith, "Rude Jokes" -s Short apothegms only. See -n on which fortunes are considered ``short''. -i Ignore case for -m patterns. -w Wait before termination for an amount of time calculated from the number of characters in the message. This is useful if it is exe‐ cuted as part of the logout procedure to guarantee that the mes‐ sage can be read before the screen is cleared. -u Don't translate UTF-8 fortunes to the locale when searching or translating. The user may specify alternate sayings. You can specify a specific file, a directory which contains one or more files, or the special word all which says to use all the standard databases. Any of these may be pre‐ ceded by a percentage, which is a number n between 0 and 100 inclusive, followed by a %. If it is, there will be a n percent probability that an adage will be picked from that file or directory. If the percentages do not sum to 100, and there are specifications without percentages, the remaining percent will apply to those files and/or directories, in which case the probability of selecting from one of them will be based on their relative sizes. As an example, given two databases funny and not-funny, with funny twice as big (in number of fortunes, not raw file size), saying fortune funny not-funny will get you fortunes out of funny two-thirds of the time. The command fortune 90% funny 10% not-funny will pick out 90% of its fortunes from funny (the ``10% not-funny'' is unnecessary, since 10% is all that's left). The -e option says to consider all files equal; thus fortune -e funny not-funny is equivalent to fortune 50% funny 50% not-funny This fortune also supports the BSD method of appending ``-o'' to database names to specify offensive fortunes. However this is not how fortune stores them: offensive fortunes are stored in a seperate directory with‐ out the ``-o'' infix. A plain name (i.e., not a path to a file or direc‐ tory) that ends in ``-o'' will be assumed to be an offensive database, and will have its suffix stripped off and be searched in the offensive directory (even if the neither of the -a or -o options were specified). This feature is not only for backwards-compatibility, but also to allow users to distinguish between inoffensive and offensive databases of the same name. For example, assuming there is a database named definitions in both the inoffensive and potentially offensive collections, then the following command will select an inoffensive definition 90% of the time, and a potentially offensive definition for the remaining 10%: fortune 90% definitions definitions-o FILES Note: these are the defaults as defined at compile time. /build/buildd-fortune-mod_1.99.1-4-i386-zDHWyn/fortune- mod-1.99.1/debian/fortune-mod/usr/share/games/fortunes Directory for innoffensive fortunes. /build/buildd-fortune-mod_1.99.1-4-i386-zDHWyn/fortune- mod-1.99.1/debian/fortune-mod/usr/share/games/fortunes/off Directory for offensive fortunes. If a particular set of fortunes is particularly unwanted, there is an easy solution: delete the associated .dat file. This leaves the data intact, should the file later be wanted, but since fortune no longer finds the pointers file, it ignores the text file. BUGS The division of fortunes into offensive and non-offensive by directory, rather than via the `-o' file infix, is not 100% compatible with original BSD fortune. Although the `-o' infix is recognised as referring to an offensive database, the offensive database files still need to be in a separate directory. The workaround, of course, is to move the `-o' files into the offensive directory (with or without renaming), and to use the -a option. The supplied fortune databases have been attacked, in order to correct orthographical and grammatical errors, and particularly to reduce redun‐ dancy and repetition and redundancy. But especially to avoid repeti‐ tiousness. This has not been a complete success. In the process, some fortunes may also have been lost. The fortune databases are now divided into a larger number of smaller files, some organized by format (poetry, definitions), and some by con‐ tent (religion, politics). There are parallel files in the main direc‐ tory and in the offensive files directory (e.g., fortunes/definitions and fortunes/off/definitions). Not all the potentially offensive fortunes are in the offensive fortunes files, nor are all the fortunes in the offensive files potentially offensive, probably, though a strong attempt has been made to achieve greater consistency. Also, a better division might be made. HISTORY This version of fortune is based on the NetBSD fortune 1.4, but with a number of bug fixes and enhancements. The original fortune/strfile format used a single file; strfile read the text file and converted it to null-delimited strings, which were stored after the table of pointers in the .dat file. By NetBSD fortune 1.4, this had changed to two separate files: the .dat file was only the header (the table of pointers, plus flags; see strfile.h), and the text strings were left in their own file. The potential problem with this is that text file and header file may get out of synch, but the advantage is that the text files can be easily edited without resorting to unstr, and there is a potential savings in disk space (on the assumption that the sysadmin kept both .dat file with strings and the text file). Many of the enhancements made over the NetBSD version assumed a Linux system, and thus caused it to fail under other platforms, including BSD. The source code has since been made more generic, and currently works on SunOS 4.x as well as Linux, with support for more platforms expected in the future. Note that some bugs were inadvertently discovered and fixed during this process. At a guess, a great many people have worked on this program, many without leaving attributions. SEE ALSO re_comp(3), regcomp(3), strfile(1), unstr(1) BSD Experimental 19 April 94 [May. 97] FORTUNE(6)


Gramado
Products
Services
Partners
Community
About
Search:
Search Results:
Fred Nora
Fred Nora
Fred Nora
Fred Nora
Options:
Button 1
Button 2
Button 3


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/ordered.20monoids.html ---
Is every canonically ordered monoid automatically cancellative?
Probably not, because it isn't in mathlib.
with_top nat
is a counterexample
Aha, thanks
No it isn't
Why not?
fin n
with saturating addition is a counterexample
Sorry it is.
There isn't really anything in the definition that looks like a cancellation law. Notice that lt_of_add_lt_add_left
is just the contrapositive of add_le_add_left
for total orders
Ok, thanks
The comment for ordered_comm_monoid
is a lie
I think it is trying to describe ordered_cancel_comm_monoid
Right... I guess that might have added to the confusion for me.
Does it make sense to have a canonically_ordered_cancel_monoid
?
I guess this is not provable:
instance [canonically_ordered_monoid α] [decidable_eq α] : ordered_comm_monoid (σ →₀ α) :=
You need the cancellative thing
Talking of canonically ordered monoids,
class canonically_ordered_monoid (α : Type*) extends ordered_comm_monoid α, lattice.order_bot α := (le_iff_exists_add : ∀a b:α, a ≤ b ↔ ∃c, b = a + c)
it occurred to me yesterday that this le_iff_exists_add
axiom implies that that 0 ≤ b
for all b
, which makes it surprising that Lean asks for the lattice.order_bot
structure; it could be generated automatically, because one can prove that bot must be 0 from the other stuff.
I guess that I'm saying that instead of canonically_ordered_monoid
extending lattice.order_bot
it should not mention it at all, and then there should just be an instance making a lattice.order_bot from a canonically ordered monoid.
That's true, but you still want the structure to have both a bot and a zero. What if the structure already has a bot and a zero? Granted it's pretty unlikely that they are not defeq, but this definition permits it
In any case I don't think that would be a very good instance - it is a kind of cross cutting thing, it will cause typeclass inference to get more complicated
Then again, it's already an instance with this definition :thinking:
So it seems to me that it should be like the lt in a preorder: canonically_ordered_monoid
should not extend lattice.order_bot
but it should ask for three fields, le_iff_exists_add
and then bot
but with the :=
thing so that the user can define it if they want but if they don't it defaults to zero
, and then a tactic can autogenerate bot_le
if the user wants it to.
it is already doing basically that
You can stick (bot := 0)
at the end and I think it will work
it is already doing basically that
It's not, at least in the sense that if I write this:
instance : canonically_ordered_comm_semiring mynat := { add := (+), add_assoc := add_assoc, zero := 0, zero_add := zero_add, add_zero := add_zero, add_comm := add_comm, le := (≤), le_refl := le_refl, le_trans := le_trans, le_antisymm := le_antisymm, add_le_add_left := add_le_add_left, lt_of_add_lt_add_left := lt_of_add_lt_add_left, -- bot := ⊥, -- bot_le := bot_le, le_iff_exists_add := le_iff_exists_add, mul := (*), mul_assoc := mul_assoc, one := 1, one_mul := one_mul, mul_one := mul_one, left_distrib := left_distrib, right_distrib := right_distrib, zero_mul := zero_mul, mul_zero := mul_zero, mul_comm := mul_comm, zero_ne_one := zero_ne_one, mul_eq_zero_iff := mul_eq_zero_iff }
then, unsurprisingly, it says
invalid structure value { ... }, field 'bot' was not provided invalid structure value { ... }, field 'bot_le' was not provided
I don't want my player to have to worry about bot. I might just make another constructor.
I mean stick (bot := 0)
in canonically_ordered_monoid
I think having a custom constructor would solve a lot of problems, but lean magic only works on the builtin constructor which makes this unattractive
lean magic includes i_just_proved_all_teh_theorems
or whatever it's called now (structure_helper
I think)
One way to recover the structure notation is to have an auxiliary class with the arguments. nonneg_comm_group
was my attempt at this, but I think in practice it ends up just being one more class in the hierarchy
I mean stick
(bot := 0)
incanonically_ordered_monoid
In preorder
we see
(lt := λ a b, a ≤ b ∧ ¬ b ≤ a) (lt_iff_le_not_le : ∀ a b : α, a < b ↔ (a ≤ b ∧ ¬ b ≤ a) . order_laws_tac)
So the question is how to prove bot_le
; I can't even right click on order_laws_tac
to see what it's doing.
If clicking doesn't work you can always put it somewhere else, i.e. #print order_laws_tac
and then click on it there
it's basically exact rfl
Last updated: Apr 24 2020 at 19:02 UTC


Allows you to have a pretty bootstraped HTML report of the test results generated by the automated tests for Cucumber / JUnit / RSpec / TestNG.
Join chat for more details about the plugin, or visit repo or page.
Plugin Information |
|---|
View bootstraped-multi-test-results-report on the plugin site for more information. |


Inicio
Settings
Settings
User already exists.
Nombre completo
Email
Postal address
Location
DNI
Phone number
Collegiate number
Roles
Facultative
Admin
Citations
Update user
Change password
Wrong credentials
New password
Confirm
Change password


{% extends "layouts/base.html" %} {# djlint:off #} {% block title %}Page Not Found{% endblock title %} {# djlint:on #} {% block content %}
The page you requested could not be located.
The page you requested has moved or does not exist. If you bookmarked this page you will need to update your bookmark.
{% endblock content %}


--- layout: post title: "This Week's Menu, Minus CSA" date: 2022-08-24 12:00:00 +0000 tags: menu image: imagecredits: ---
I put the CSA on pause this week, as I was feeling a little overwhelmed by the amount of fruit we still had to eat. Of course, now it's Wednesday, and I'll process the last few pieces of stone fruit and put them in the freezer. We'll be out of fruit; we're out of eggs.
Oh well. I'll grocery shop tomorrow, and I'll bake this weekend with something other than peaches.
The menu for the upcoming week looks something like this:
It's a very potato-heavy menu, I realize. C'est la vie.


Olympic Typewriters!
2D, typing game, with a very cartoony and colorful look, inspired by the Summer Olympics.
Game Treatment
This proposal for project 1, takes the form of a game treatment document of a fictional game. Students are tasked with creating a promotional website (project 1) for a web game, application or, ‘experience,’ that they pitch to their professor (project 3). While project 3 may evolve over the course of the semester, this remains tailored to the purpose of, “Olympic Typewriters!”
High Concept
At the olympic games, players toss weights by typing complex word combinations; the faster you type, the further you throw!
Genre
2D, typing game, with a very cartoony and colorful look, inspired by the Summer Olympics.
Platform
Desktop only.
Story
The Olympics are a time when people from all over the globe compete for various medals and worldwide recognition. By bringing that competitive feeling to the world of typing, players are inspired to become better typists.
In one particular sport - discus throwing - there is an emphasis on distance; by translating player effort and accuracy into the actions of their on-screen avatar, players can compete in various olympic-level mini-games through the use of their typing skills. In the player's career, they should hope to get better at typing and unlock new outfits for their avatar.
Players should be able to retain their scores, and, thus compete in very quick, 1~2 minute sessions. There is a sense of satisfaction in competing with scores others may place on the game, building a community of olympic proportions!
Aesthetic
Drawing heavily on the branding from past Summer Olympic Games, the game parodies the feel of the real games. Since the game is 2D, using a cartoonish artstyle can highlight the lighthearted and fun nature of the game. While the player is competitive, it will communicate to them that nothing is at stake - there is no risk.
The soundscape can be compared to Final Fantasy X's score during the segment of the game in which the characters play the exciting and highly watched blitzball. In other words, a thrilling musical score, with fanfare and trumpets, to make the player feel like they are at a prestigious athletic event.
By reinforcing player actions with strong in-game sound effects and music, there opens up a lot of places for sound to be implemented. When players are successful in launching their items, it should be congratulated with fanfare. When players make a mistake, reinforcing that it is a mistake, visually and with sound, will help communicate the error.
Gameplay
The following section covers the gameplay portion of the document.
Mechanics
Words will appear on the screen, in the form of floating gym equipment (mats, hurdles, poles), and players will have to complete the words before they fall to the bottom of the screen. As the game progresses, the materials will appear at a faster rate. Below are some expected game modes.
Free Throw
Players will charge their avatar's throwing ability by typing the words that appear on the screen within a given amount of time. The player's avatar will throw the disc on the player's third mistake.
Best of Three
Players will charge their avatar's throwing ability by typing the words that appear on screen. When a player makes their first mistake, the avatar will throw the disc. The player will be able to do this for three rounds, before the highest distance out of the three tosses is chosen and recorded.
Controls
Players can control the game using:
- Keyboard Controls
Onboarding
Players will be able to find the instructions in an interactive tutorial section, clearly marked from the main menu, in the game.
Player Learning
Players will need to learn how to keep track of elements on the screen and touch type.
Players who are unable to touch type will not be able to consistently reach higher scores.
Screenshots
[Screenshots and mock-ups will be added at a later point in time.]
About the Developer(s)
Ian Effendi is a third year, Game Design & Development (BS) major, attending the Rochester Institute of Technology.


|
Dynamics 365
Developer
SSW Sydney, Brisbane, Melbourne
SSW is looking for enthusiastic Dynamics 365 developer to start ASAP.
This role requires great communication skills and solid experience
delivering production-ready web solutions.
.NET experience is a must. Experience with Angular, React, SharePoint
and/or Dynamics 365 would be a bonus.
Read
More
|
|
Senior Full Stack .NET
Developer
Newcastle
SSW is looking for enthusiastic Senior Full Stack .NET developer with
leadership skills to grow our new Newcastle office.
.NET experience is a must. Experience with Angular, React, SharePoint
and/or Dynamics 365 would be a bonus.
Read
More
|