« first day (498 days earlier)      last day (3521 days later) » 

12:13 AM
I've found out that the syntax for CREATE FUNCTION foo() ... RETURNS TABLE (bar TEXT) to be exceedingly fustrating
 
 
2 hours later…
2:18 AM
0
Q: Custom 2D/3D Graphics Vector Classes vs SFML's

Michael EstesI don't really like SFML's Vector Classes so I tried making my own. Any criticism is welcome. I'll separate it into a header and cpp file when I have some more time to work on it. class gVector2{ public: float x, y; float length = GetLength(); gVector2(); ...

 
Irritates me, @Jamal ^^^^ I think I will delete it when I have some time.
 
Why's that?
 
> I'll separate it into a header and cpp file when I have some more time to work on it.
If he does not have time to do it before review, or after review, what's the point?
 
Ah. You could also leave a comment, even with deletion.
 
Well, I don't have time now ;-)
 
2:27 AM
Yes, when you have time. :-)
 
Actually, It really does irritate it when people ask.... do this for me on your time, but I don't have time...
 
That's true. Perhaps closing it first would be a better first step. Yeah, I know, I'm the delete-happy mod, yet I'm not thinking about deleting this one yet. :P
 
2:45 AM
@Jamal - got a sec? codereview.stackexchange.com/a/62862/31503 should I undelete it? ;-)
 
Haha, I suppose. But I have a feeling it'll just get tempers raised if he gets the last line.
 
well, yeah, but the 10K folk can have a giggle....
sorry, 2K
We need to graduate...
 
That's true. I suppose that's where the third downvote came from.
By the way, you missed some indentation (the very first line). ;-)
Or rather, all of the code before the first };.
 
Agreed. and it's full of 1-liners that need separate lines.
You know what, I feel inclined to improve and undelete.
argh, I am in a sour mood... huh.
I should do nothing
 
Perhaps I'll just leave a comment, then.
I'll separate it into a header and cpp file when I have some more time to work on it. I would recommend waiting to post a question on SE when you have time. If a question requires feedback from you at the start, and you're not around, it may pose a problem. If you don't have time to help the reviewers, then they may not have enough time to help you. — Jamal ♦ 12 secs ago
 
2:58 AM
well put
my eyes are closing
 
BOO
 
 
3 hours later…
5:35 AM
0
Q: Are these the correct functions for cleaning data to be sent to database and inserting the data in database in php?

sachin tendulkarInitialising variables <? php $host = 'localhost'; $user = 'root'; $pword = ''; $dbname = 'mydb'; $tablename = 'userdata'; $con = mysqli_connect($host, $user, $pword); Code for function to clean data to be sent to database(where $variables is an array which has data which is trimmed,strip_tag...

 
5:48 AM
0
Q: Efficiency and design of Dijkstra's algorithm modified for connected nodes

DavishI've written an AI (well... it's not really that intelligent) that plays the board game Ticket to Ride. In that game, cities are essentially nodes of a graph, linked together by train tracks (the edges of the graph). The goal is form routes between cities, but it doesn't matter how circuitous or ...

0
Q: Are these the correct functions for creating a database connection,creating table,cleaning data for D.B and inserting the data in database in php?

sachin tendulkarInitialising variables Is this the correct code of the database connection function?( Assuming we have connected to the Database) function dbconnection ($host,$user,$pword) { $con = mysqli_connect($host, $user, $pword); echo 'Successfully connected to MySQL</br>'; if(my...

 
6:07 AM
monking
 
6:54 AM
0
Q: Making sure string doesn't contain http(s) nor doesn't start with a forward slash

BrettI'm trying to append a root url to a redirect url, but ONLY if it doesn't contain http or https AND doesn't start with a /. I have this code which appears to work: $redirect_url = '/foo'; if (!preg_match('#https?://|^/#', $redirect_url)) { $redirect_url = 'http://' . $redirect_url; } But...

 
7:40 AM
0
Q: Is it wrong way to dispose CrystalReport objects?

Azad CebiyevI am creating report files and exporting these as pdf. And I am disposing streams and report documents at the end. But, always some .rpt files are staying in Temp folder and I can't delete them. After recycling application pool all files are removed by IIS. Then, after 1 or 2 hours new .rpt files...

 
 
3 hours later…
10:17 AM
Monking
 
11:17 AM
@skiwi Monking
 
11:33 AM
Monking
So, today is election day in Sweden. Hold your thumbs!
 
0
Q: Removing duplication in RSpec

Jezen ThomasI’m still relatively new to the TDD scene. I’m writing a Rails app, and some duplication immediately sticks out at me in my first model spec. How else can I approach this? require 'spec_helper' describe TimeEntry do describe "without a project" do let(:entry) { FactoryGirl.build :time_en...

 
@SimonAndréForsberg Anything big at stake?
 
@RubberDuck There's quite high probability that a far-right party will become the 3rd biggest party. I personally would not like to see that happen.
 
11:49 AM
@SimonAndréForsberg I don't blame you, but at least you have more options than just two parties; neither of which actually represent the majority in the middle.....
We have a serious polarity problem in our politics.
 
@RubberDuck that is true. There's 8 parties in our Riksdag (congress) at the moment. With the possibility for a 9th this election.
@RubberDuck That is true. Liberals or Republicans. Much easier choice.
 
That's amazing @Simon. That's democracy.
@SimonAndréForsberg I wouldn't call it an easy choice... I personally belong to a third party, but we tend to bring in about 1-5% of the vote.
And the two parties keep making it harder and harder for us to get on the ballot.
 
@RubberDuck Choosing between 2 things is easier than choosing between 8, isn't it? Or might it actually be worse?
 
I think it's worse, because both options suck.
It's like choosing between a shit sandwich and a douche taco.
 
Then there is a problem, yes :)
 
11:56 AM
You don't really want to eat either one.
On a serious note though, it hampers the discussion when all the politicians see is an adversary.
I would think there's more honest discussion when you have more points of view involved.
 
Oh you're from the USA right @RubberDuck, I see the politics issue there
 
@skiwi Yeah @skiwi. It really sucks. Like I said, I'm part of a third party though. We have a lawsuit right now trying to get our candidate back on the ballot for November.
 
12:25 PM
0
Q: Dynamically-sized stack - follow-up 3

gues532Follow up of - Dynamically-sized stack - follow-up 2 I've took the tips given to me, and what I did now is: Use same case type for type stack and it's functions Returning 1 if push failed due to an OOM exception otherwise return 0 if succeeded. push could now only return a pointer to null due ...

 
@nhgrif, remember when you said "I only open my mouth to swap feet"?
gah or was it @rolfl you guys need to stop changing your avatars.
 
0
Q: Using 1 view rather than several

dccI'm going back trying to make some improvements on an old iOS app I made for a friend a while back. It's a drill-down style ecommerce catalog style app which drill down to product detail pages. On the detail page there are links to open up several youtube videos. The products listed are rather...

 
@DanPantry Hard to separate the monkeys, huh?
 
@SimonAndréForsberg mhm :(
 
That was @rolfl.
And I can't remember either @rolfl or @nhgrif having changed avatar. Ever.
 
12:34 PM
I've been spending my entire morning in command lines so I'm probably goign to make some mistakes :(
Idk @nhgrif's LOOKS different. maybe i just am spending too much time in the dark
 
yeah, well... it's different from the other monkey's :)
 
1:04 PM
Speaking of monkeys, we have lost one too.
 
Looking.....
 
today on - some one is asking for a freelancer who will make a website with a CMS and a store including the design for $700 max.. yeah.. that's going to happen to a good quality.. /s
 
0
Q: Tracking(uniform spacing) between 2D elements

Nicholas KyriakidesThe problem I am solving: I select multiple 2D SVG elements in an editor I built(the elements are in arbitrary positions on my canvas). I run the function calcMultiTrack() (see below). The elements should now have equal spacing between them equivalent to the trackingAmount parameter I passed wh...

 
@SimonAndréForsberg Can't find, but was java-related answerer who had a baby orangutang on the avatar
 
1:07 PM
@rolfl: nhgrif ?
obvious answer is probably too obvious to be true
 
the latter....
 
 
1 hour later…
2:13 PM
0
Q: Flag & Close duplicate not working with opera

timI am trying to flag this post as a duplicate of this one, but I cannot seem to get it to work, the button is greyed out. I tried to enter: http://codereview.stackexchange.com/questions/62864/are-these-the-correct-functions-for-cleaning-data-to-be-sent-to-database-and-ins 62864 etc. But none w...

 
For PrintLine, yes - but not for ITestOutput_WriteResult ;) — Mat's Mug 8 mins ago
@Mat'sMug that's exactly what I ended up doing. I kept IOutput and wrote a different implementation for Console.
Because now I have namespaces
2
 
2:41 PM
Hehe.. in my project I can do Strings.Format() and Data.SqlCommand.QuickExtcute(sql) ;)
@RubberDuck you've unlocked a world of possibilities!
 
It's almost like it's a legitimate language Mug. Almost.
 
I have a Framework.Initialize method that runs at startup (in the System "namespace"), where I'll try to ensure all the required add-ins are loaded.. we can install+load addins programmatically, can we? ... ...(slight doubt hits me)
might be too useful for malicious usage, not sure it's allowed :/
 
0
Q: Create virtual host + MySQL tool

setevoyTool adds new OS user, create directories and configuration files for Apache + NGINX, MySQL (MariaDB) database and user. I tried to take into account the comments from my previous post. Hope - this look little better. Tool is big enough, so - will not post all it's code here, just few main part...

0
Q: Merge Sort - Efficiency

CodeWriterI've written this Java code to implement Merge Sort. import java.util.*; public class MergeSort { int[] a; MergeSort() { Scanner scan = new Scanner(System.in); System.out.println("Enter the number of items: "); a = new int[scan.nextInt()]; for (int i ...

 
Going applepicking with my little toddlers, bbl
 
Have fun buddy!
 
3:49 PM
0
Q: Group by two list in one map using lambda

SimY4I've got two collections: collection of rules, and collection of keys that can handle specific rules. Key have method boolean canHandle(Rule) to check whether specific key can handle specific rule or not. I need to gather these two collections into single map Map<Key, List<Rule>> bycanHandle` pr...

 
4:33 PM
0
Q: Phone Number Extracting using RegEx And HtmlAgilityPack In Vb.net

Shehryar IqbalI've written this whole code to extract cell numbers from a website but the thing is it is extracting numbers perfectly but very slowly it's also hanging my Form while Extracting, please help me to make it run faster. and run more efficiently. Imports HtmlAgilityPack Imports System.Text.Regular...

 
4:47 PM
0
Q: creating addition and multiplication tables using user supplied data

mizzoualumI am creating my very first program in PHP and I need help making addition and multiplication tables. I have the HTML code that creates the table for the user to input data. I'm certain I have the correct logic, just something isn't working out in my code. I am using phpfiddle.org to compile and ...

 
5:41 PM
0
Q: JavaSE: how to get a new JPA EntityManager each time (DAO)

ThufirWhat's the current approach to JavaSE and JPA? DAO are "dead"? JPA itself doesn't seem to allow for connection pooling with JavaSE(?). This database connection seems to time-out. I just want it to connect from a Java SE stand-alone program directly to a MySQL database. It may sit unused for ...

0
Q: Java Triangle Type Program

user53068import java.util.*; class Triangle { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if(a==b && b==c) System.out.println("Equilateral"); else if(a >= (b+c) || c >=...

 
6:24 PM
0
Q: Code to create addition and multiplication tables

mizzoualumI am creating multiplication tables and addition tables in php, but I am getting incorrect output when I try and run the program. It is supposed to just create a normal multiplication table, but instead I get this output for a 4x5 multiplication table: 0 1 2 3 4 5 0 0 0 0 0 1 ...

 
6:37 PM
Looks like Sweden might get a shift in government, but there's still a long way to go before we know.
 
@SimonAndréForsberg is that good or bad news?
also someone tell me how the crap you write almost a whole answer about a single import statement, and make it look better?
0
A: Triangle Type Program

Vogel612as an addition to all already mentioned points: import java.util.*; This is dumb! The Java Util-Package contains a large amount of classes, interfaces and exceptions. With that single line, you make the classloader load ALL THE CLASSES: What exactly do you use of that? right, the...

 
@Vogel612 I personally do like the government we have had, but I can live with a change.
The worst news is that it seems like the Swedish Democrats (far-right anti-immigrant party) seems to become the third biggest, with 10% of the votes.
 
eurgh..
reminds me of our "Alternative für Deutschland" far right "conservative" anti-europe, anti-immigrant party..
 
And a big question is if the Feminists enters the Riksdag (congress) or not. They are at around 4%, which is what they need to enter.
yeah, that's just like the Swedish Democrats.
 
you actually got a party named "the Feminists"??
or is it just a derogative?
 
6:43 PM
Feministic Initiative
 
what the heck??
 
they are actually called that :)
 
our communists are called "Die Linke" -> "the left side"
 
that would be Vänsterpartiet for us ("The Left Party")
Feminstic Initiative is very left-ish, and go very strong on equality between men and women
2
 
That's interesting @SimonAndréForsberg
And... Monkernoon :)
 
6:55 PM
Monkernoon
 
Those far-right parties remind me of the Republican party here in the USA. I don't like those types very much, I hope the democrats remain in majority after Obama's 2nd term.
@Vogel612 this made me LOL
 
@Phrancis yea they are..
and nobody "sanely" (whatever that means) thinking about europe should be voting for them..
 
@Phrancis Although I am not an American, I agree. I also like the Democrats.
Shit, these numbers are really changing... with 189 districts counted (of 5837), the Swedish Democrats have 16.7% :/
 
It seems that many of those far-right parties don't understand the concept of equality. One Burger King restaurant in California (probably the most left-leaning state in the country) came up with an optional rainbow-coloured wrapper for their hamburgers, and it caused an uproar among far-right Republicans...
 
lol german radio news just tell me, that swedish democrats are partying right now.
and that calculations say ~10% for the swedish democrats.
 
7:02 PM
@Phrancis isn't it the point of some far-right parties to (unfortunately) just not care about equality?
 
which would make them third strongest party in the Rijkstag
 
@SimonAndréForsberg it seems that way sometimes... philosophical question is, do they not understand equality, or do they simply not care?
 
@Phrancis I think neither..
they neither understand it, nor do they actually care..
 
What's Rijkstad?
 
because "we" are bettter
 
7:04 PM
Unfortunately, I fear that you're correct on that :(
 
Rijkstag ~= Parliament
or rather Senate.
too many democratic systems colliding in my head
 
In US politics we have a larger but less powerful body, the House of Representatives, and also a smaller but more powerful Senate, both being part of the Congress. Is it like that over where you are?
 
@Phrancis good question
 
@Phrancis about exactly the same, just different names.
 
@Vogel612 well, at least they're all democratic :)
 
7:08 PM
the larger one is called "Bundestag" and they are elected "directly" by the people
 
@Phrancis we only have one in Sweden, called 'Riksdag' (Parliament, simply)
 
"Directly"?
 
and then there's "Bundesrat" which is comprised depending on what party reigns the substates ("Bundesländer") right now
let's say it's complicated.
you can vote for a "direct candidate" in your district, but have an additional vote for a party
if the direct candidate wins his district he's in
and then the party votes make up the seatcount
but if you got more direct seats than you have seats, you keep them
 
That does sound complicated... Politics, bleh.
Time to go smoke an underscore and then make this function call more verbose explicit than it already is.
 
smoke underscore?
try smoking the documentation instead, I've heard that's better.
 
7:12 PM
A cigarette, but in Postgres... demonstration:
create or replace function fcn_insert_person(
        -- person table
        prm_role_id text,
        prm_first_name text,
        prm_last_name text,
        prm_organization text,
        prm_website text,
        prm_default_billing_method_id text,
        prm_active boolean,
        -- address table
        prm_address_type_id text,
        prm_address text,
        prm_city text,
        prm_state text,
        prm_zip_code text,
        -- email table
        prm_email_address text,
        prm_email_type_id text,
:)
Yeah I've been doing plenty of that too lol. It's my first time trying to do this so it's been a trip.
Inserting data into multiple tables at once, passing data from the first insert into the next one, etc.
 
7:48 PM
SD (Swedish Democrats) now at 13.5%, with about... yeah, perhaps 42%, of the districts counted.
But it does look like it will be a government change.
 
I hate this error:
 
0
Q: Calculating sum of manhattan distances in a sliding puzzle

Renren29I would like some feed back on a method which calculates the sum of manhattan distances for each tile in a sliding puzzle to its goal position in the goal puzzle. Here is the code : public static int calcManhattanDistance(int[] ps, int[] goal) { int rowSz = calculatePuzzleRowSize(ps); i...

 
LINE 2: select fcn_insert_person (
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
So helpful.
 
Hey all!
 
Hey @AlexL !
 
7:55 PM
Just knocked one out
4
Q: Am I using PHP Mcrypt the right way?

Guido KrömerI have written a small wrapper class for using PHP Mcrypt for encrypting and decrypting text data. This class generates a salt for hashing the key and encrypts the given data with the generated key hash. The encrypted data get stored with the initialization vector and the key salt into a containe...

 
0
Q: Can this admin class be improved?

donquixto DacI have an admin class that controls when user login and create a new blog post. I am wondering if their is anything i can do to improve this class.Is there anyway to reduce the code or their any repetitive code or better way that any functions could be written? public class AdminController :...

 
Nice @AlexL seems pretty thorough!
 
Hope it is, I'm worried I missed something critical or I've misinterpreted my knowledge of cryptography though
 
TBH I find the approach OP is taking far more obvious and easy to understand.. Additionally IMO there must be a special place in hell for people who nest ternary statements, but eh. — Vogel612 1 hour ago
 
8:16 PM
monkin'
 
Monking? (checks clock)
2
 
^^ same here
why did two people star my message about Feministic Initiative?
 
Probably because of equality... I would guess
 
erm, what's the term for monking in the evening?
 
Monknight!
 
8:22 PM
@janos Monkvening?
 
@SimonAndréForsberg you know enough about the internal Java workings to shed some light on my answer?
 
@Vogel612 what answer?
 
how about monkening?
 
works for me
@Vogel612 is it about this?
104
Q: Why is using a wild card with a Java import statement bad?

jnanchetaIt is much more convenient and cleaner to use a single statement like import java.awt.*; than to import a bunch of individual classes import java.awt.Panel; import java.awt.Graphics; import java.awt.Canvas; ... What is wrong with using a wildcard in the import statement?

 
yea..
so there's no actual disadvantage in wildcard-importing, aside from the namespace clutter?
 
8:27 PM
Yeah, I don't think the classloader actually loads all the classes.
So that part of your answer is wrong
From the election night watch parties, I can tell that the rights have prettier girls than the lefts.
2
Although you never hear that in the political analyses!
 
Interesting observation
 
Thank you!
 
@Vogel612 I think it's totally ok to call triangle sides a, b, c
at least in this particular case
 
Makes me think of this scam lol...
Not sure why...
 
I was talking about pretty girls here....
 
8:39 PM
I guess Sarah Palin is about as pretty as Republican politicians get... but she is dumb.
> "He who warned, uh, the British that they weren't gonna be takin' away our arms, uh, by ringing those bells, and um, makin' sure as he's riding his horse through town to send those warning shots and bells that we were going to be sure and we were going to be free, and we were going to be armed." --Sarah Palin
 
Well, politics.... hmmm.
 
Almost all districts counted, looks like the Feminists won't make it
Don't worry, @rolfl, Swedish election is over tomorrow.
 
@Monkey we're behaving :)
 
Ummmm
I
needy
to
type
a lot to get
palin
 
8:45 PM
off
the
screen
 
yup, that works.
low resolution
 
@Phrancis WHYYYYYYYYYYY D:
 
why did I click that
 
8:52 PM
lol
 
0
Q: Am I breaking the Single Resposability Principle (SRP)?

natenhoConsidering the following class (i've stripped xml doc for the sake of simplicity), it does several and slightly different operations through a serial port to read/write from/to a Mifare card. It has a specific protocol, few commands that can be called sending the specified chars to the COM Port,...

0
Q: Loading data into a number of different typed List<T>s: Can I do without reflection?

Ashley DaviesI'm not sure whether my distaste for reflection is justified or not, but it feels ucky that I'm using reflection here. I'm trying to make a very simple class which has a number of List<T> where T : Model with a load and save method. The load method should: For every list, Open or create "Data/(<

 
Am I breaking the Good Title Principle (GTP)?
5
 
9:11 PM
It's behavior does as far as I can tell. Ass — RubberDuck 38 secs ago
^^ @RubberDuck ?
 
@Mat'sMug Oh that horrible enter key.
 
I thought about a function when I originally wrote it @Mat, but a sub seemed to make more sense.
Always open to suggestions though. It's going to be important that I get this one right.
 
Moment of truth, our current prime minister will speak at his partys night watch party
A new government it is, then.
 
0
Q: Python list popping and appending

Koes BongI am learning python and have a working code (shown below). However, I would like to know if there's a better way to rewrite it. What I am trying to do is to match list A that is passed to a method against a predefined list B. If an item in list A contains an item in list B, I'd like to move it ...

 
9:30 PM
@RubberDuck I have something like a testing framework in the making...
in ThisWorkbook:
Public Function TestSomething() As TestResult
    Set TestSomething = Assert.IsTrue(True)
End Function

Public Sub Test()
    TestClass.RegisterTestMethod Me, "TestSomething"
    TestClass.RunAllTests
End Sub
^^ works
I did mess up the meaning of "Assert" though; it's basically nothing but a "TestResultFactory"
and each registered test method must be a parameterless function in any class module, that returns a TestResult
 
1
Q: Haskell - Write a function to extract a given number of randomly selected elements from a list

mariosangiorgioI'm going through the 99 Haskell problems and I have a few question about the solution I implemented for Problem 23. It asks to: Extract a given number of randomly selected elements from a list. This is the code I came up to: -- Extract a given number of randomly selected elements from a list....

 
2014-09-14 17:44:53 [FAIL] - 'False' will never be 'True'...
:)
 
9:48 PM
Very nice.
 
The assert msg shouldn't appear if assert succeeds - I missed that in my review ;)
 
I disagree. You get a success message when you run tests on C#, right?
I'm going to want to display success/failure in the GUI.
 
Yes, but check the docs for the Assert class. Message is only shown upon failure. result and message are two separate things ;)
I get this for a passing test:
2014-09-14 18:01:21 [PASS]
oh crap, I need the test's name in there, too
there:
2014-09-14 18:04:58 TestSomething: [PASS]
 
10:26 PM
oh sweet!
2014-09-14 18:26:01 TestSomething (250ms): [PASS]
wow...
Public Function TestSomething() As TestResult
    Set TestSomething = Assert.IsFalse(False, "'False' will never be 'True'...")
End Function
1/4 of a second for that?
ugh.. benchmarking + VBA = crap
 
10:42 PM
oops. I just crashed Excel trying to test what happens with a test that raises an error...
 
@SimonAndréForsberg - when you let JIT do it's job:
net.zomis.minesweeper.analyze.AnalyzeResultsImpl@6bc7c054
Run 1 completed in 1638.558ms
net.zomis.minesweeper.analyze.AnalyzeResultsImpl@677327b6
Run 2 completed in 1996.820ms
net.zomis.minesweeper.analyze.AnalyzeResultsImpl@14ae5a5
Run 3 completed in 1194.047ms
net.zomis.minesweeper.analyze.AnalyzeResultsImpl@7f31245a
Run 4 completed in 874.533ms
net.zomis.minesweeper.analyze.AnalyzeResultsImpl@6d6f6e28
Run 5 completed in 779.386ms
net.zomis.minesweeper.analyze.AnalyzeResultsImpl@135fbaa4
Run 6 completed in 733.431ms
 
10:59 PM
ah!
2014-09-14 18:58:45 TestSomething: [INCONCLUSIVE] - Test raised an error: Division by zero
 
@Mat'sMug LOL. Yeah. My phone crashed. That sentence started with "Assert"
 
0
Q: Values are null

Java9weeksI am working on a contact list. I've just about got it working, except for two problems. The output value for the user input prints as null and the Email Address output line contains the null values for jobTitle and organization, when creating a business contact or one extra null when creating a ...

1
Q: Modeling a Triangle, with a utility method to classify it

janosInspired by this question, I played a bit with the idea of modeling a Triangle, and a utility method to classify it: class Triangle { private final int a; private final int b; private final int c; enum Type { EQUILATERAL, INVALID, ISOSCELES, SCALENE } public Tr...

 
That's an unusual kind of assertion failure!
 
@200_success test shouldn't be inconclusive if it throws an unexpected error?
oh wait, Assert.IsTrue(False), right.. just testing stuff ;)
 
11:27 PM
0
Q: Correct use of basic PHP PDO Class

user2921557Have a new job coming up soon and want to increase my PHP knowledge. This is my first attempt at using and creating a class. I just want to know if its the correct to do things. Its very basic, simple encrypt / decrypt of a string with salt. class: /** * Encryption Class * * Use for encryptin...

 
I meant that "assert" becoming "ass" was an unusual kind of assertion failure.
 
0
Q: Implementing `split`

Kevin MeredithI implemented the split function in Haskell: split :: (Eq a) => a -> [a] -> [[a]] split _ [] = [] split x ys = f : split x rest where (f, rest) = break (== x) (dropWhile (== x) ys) Note that I'm calling dropWhile (== x) since break's second-tuple value will include the "broken on" value. ...

 
11:49 PM
0
Q: nested maybes are ugly

FresheyeballI am looking for advice on how to improve the below function, the nesting is just too deep. makePresentable :: forall a c e. Registry a c e -> Foreign -> Eff (err :: Exception | e) (Presentable a c e) makePresentable r node = do let name = getName node case M.lookup name r of Nothing ->...

 
@CaptainObvious "nested maybes"?
 

« first day (498 days earlier)      last day (3521 days later) »