Different kinds of bug reports:
Smug Report - a bug submitted by a user who thinks he knows a lot more about the system's design than he really does. Filled with irrelevant technical details and one or more suggestions (always wrong) about what he thinks is causing the problem and how we should fix it.
Drug Report - a report so utterly incomprehensible that whoever submitted it must have been smoking crack. The lesser version is a chug report, where the submitter is thought to have had one too many.
Shrug Report - a bug report with no error message or repro steps and only a vague description of the problem. Usually contains the phrase "doesn't work."
does this resemble a pega framework?
1. Inability to reason about code
- The presence of "voodoo code", or code that has no effect on the goal of the program but is diligently maintained anyway (such as initializing variables that are never used, calling functions that are irrelevant to the goal, producing output that is not used, etc.)
- Executing idempotent functions multiple times (eg: calling the save() function multiple times "just to be sure")
- Fixing bugs by writing code that overwrites the result of the faulty code
- "Yo-Yo code" that converts a value into a different representation, then converts it back to where it started (eg: converting a decimal into a string and then back into a decimal, or padding a string and then trimming it)
- "Bulldozer code" that gives the appearance of refactoring by breaking out chunks into subroutines, but that are impossible to reuse in another context (very high cohesion)
1. The built in Pega code is opaque enough that if you don't copy something that exists and works, it is not terribly likely that your new code will.
1. If you want to change something in an inherited framework (broken/missing feature), you are essentially copying and pasting to your layer and tweaking small bits. The stuff you don't touch might as well be voodoo.
3. Error handling is hard so many inherited pieces of code do not do it properly.
4. Work -> Data -> Int -> Data -> Work for integration
4. Also, date processing. enough said
5. Big activities/flow are hard to read, so split them into smaller ones that only could ever be used from one place. The fix is to not write big activities, but since most projects are against other peoples code, this is not an option and refactoring is hard!
I need to actually test this with an interpreter. I think this should work OK though. HoldNext contains the tail of a list we are building by tacking on Binding with each successful run of Code. Then we rebind whats in HoldNext to be the new tail. Finally, if Code fails, we set the var in HoldNext to [] to terminate the list.
The use of nb_setarg/3 is very important to save us from backtracking unwinding our difference list. Without testing this, my only question is if Binding needs to be term_copied before tacking it onto the difference list.
findall(Bindings, Code, ListOut) :- HoldNext=hold(ListOut), %store the tail of the difference list here ( Code, arg(1, HoldNext, Nxt), %var containing the hole to write to Nxt=[Bindings|NewNxt], nb_setarg(1,HoldNext, NewNxt), fail ; arg(1, HoldNext, Nxt), Nxt=[] ).
[–]magcius 29 points30 points31 points 16 hours ago
Sure you can! Try it at home:
import ctypes grab_raw = ctypes.pythonapi._PyObject_GetDictPtr grab_raw.restype = ctypes.POINTER(ctypes.py_object) grab_raw.argtypes = [ctypes.py_object] def better_setattr(obj, name, val): obj_dict = grab_raw(obj).contents.value obj_dict[name] = val better_setattr(object, "a", 3) print object.a
don't try this in real code
Color Examples
Color Color HEX Color RGB #000000 rgb(0,0,0) #FF0000 rgb(255,0,0) #00FF00 rgb(0,255,0) #0000FF rgb(0,0,255) #FFFF00 rgb(255,255,0) #00FFFF rgb(0,255,255) #FF00FF rgb(255,0,255) #C0C0C0 rgb(192,192,192) #FFFFFF rgb(255,255,255)
Here’s another shot of foldl in prolog. this one is a little cleaner than the last version.
foldl(Gen, Pred, In=Init, Out) :-
H=hold(Init),
( Gen,
H=hold(CurVal),
In=CurVal,
Pred,
nb_setarg(1, H, Out),
fail
; H=hold(Out)
).here are the same samples provided before
?- foldl(member(Loc, [1,5,9]), append(In,[Loc,space],Out),
In=[], Out).
Out = [1, space, 5, space, 9, space].
?- foldl(range(1,3,L), Out is In+L, In=0, Out).
Out = 6.