I should note that when it comes to bitwise conditionals such as
(floor.floorBuildState & FloorHasLadder) and (floor.floorBuildState &
FloorHasWalls) == 0), my understanding is that you should not pass
those back directly such as return (floor.floorBuildState &
FloorHasLadder) but shou...
Why does iTunes ask me if I really want to delete the 8 PCM files I just converted to M4A or just hide them so they still take storage but I don't know about it... annoying.
@Mat'sMug What I want is comparison between the 2 implementation for learning purposes to make sure I didn't do any mistakes compared to the source I'm learning from. — gues53220 mins ago
I meant no offense. This piece of verbiage really flags your question for being off-topic on this site, intended or not: "Additionally, if someone could explain the last block I would really appreciate it." This comment snippet "I wrote everything except the last piece" further biases it. Code Review is often misunderstood, you're not being singled out here. I apologize if it sounded that way. — Phrancis1 min ago
@Mat'sMug this snippet makes it sound like a Programmers question:
> Also I had a question regarding to implementing stack data structure. If I wish to make an implementation that is not array based, I want a dynamic sized stack can you give me a clue on how to achieve it ?
But I think everything else looks fair game. I don't think posting the alternate/original implementation is bad, for comparison purposes... but mods may look at it differently. I wouldn't see it much differently than posting two different implementations of your own
It does appear the OP understands the original implementation, even if he didn't write it, just sought to improve it
@gues532 : You would really do yourself a favor if you removed the code you didn't write and didn't ask for comparison; that's not what Code Review is about. If you really need a comparison and help with better implementation, this would be a question more on-topic for Programmers(programmers.stackexchange.com) — Phrancis1 min ago
On a side note, is it just me or the [link name](url) thing doesn't work very well in comments?
I removed the off topic portion of the question. A vs B questions are on topic and OP is not asking for a review of the code he did not write, that code is only there for context. — RubberDuck24 secs ago
This isn't a performance question @Phrancis. He's looking for validation that his code is correct and good. What else do we do here?
@Jamal : I just found there is a plpgsql tag that should be synonymized with postgresql (as it is the same thing). Only 4 questions have it (I'm guilty for creating one of them).
Thanks. The indentation is the result of my poor copy and paste skills :(. Your comments on shared access and constness are really useful. — paco_ukJul 20 '13 at 19:17
Which makes me wonder why the OP didn't bother to fix it after seeing it displayed incorrectly in the post.
I know it took me a while to get used to the different things it can do, and how to make them. And especially the tiny post box (which I found later you could make longer, but not wider, and that is wretched)
Hm. This returns an empty string for some reason...
set SEARCH_PATH = test;
drop table if exists test;
create table test(
word text);
insert into test (word)
values ('Hello World');
select currval(
pg_get_serial_sequence(
'test',
'word'
)
);
> I cant get off developer mode on facebook !!!!! i want to be a regular facebook user NOT A DEVELOPER !!!! PLEASE FOR THE LOVE OF GOD, take me off this gaph thing, im not a developer, someone please help me
@almaruf Sorry to be pedantic, but Java should not be written in all caps because it's not an acronym (unlike PHP, though technically it's been retconned to be a backronym). Some people do get quite upset about it and someday one might bite your head off for it :) — PharapAug 29 at 11:30
Clear some history. It's chrome version of a reboot.
And the cache probably.
@Schism - that was the point . Moreover, if the value of testDataGenerated is set to null than (! testDataGenerated) will pass (not sure about JAVA, but it is true for PHP), may be this isnt what you always want :) — almarufAug 28 at 14:37
I want to use a Greasemonkey extention from here: http://lifehacker.com/5708110/locate-multiple-domains-highlights-your-favorite-sites-in-google-search-results
It published 4 years ago and Google design has changed. Naturall this script is not working. I try fix this script but it is not workin...
I just need to know if its decent or not
PROJECT HOME: https://github.com/chatango-kotarou/HCS
server.py:
https://github.com/chatango-kotarou/HCS/blob/master/server.py
mod.py: Can't post link but its in modules/mod.py in the project home
room.py: Can't post link but its in modules/room.py in ...
I just need to know if its decent or not
PROJECT HOME: https://github.com/chatango-kotarou/HCS
server.py:
https://github.com/chatango-kotarou/HCS/blob/master/server.py
mod.py: Can't post link but its in modules/mod.py in the project home
room.py: Can't post link but its in modules/room.py in ...
Speaking of which... Postgres is gruesome when it comes to syntax. Some of the stuff I have written, SQL Server would be like "Cool, thanks dude" but Postgres is more like ERROR: function lastval(text) does not exist
I wanted to get better acquainted with variadic template, so I decide to try to implement a function like D's writeln(), just for fun.
void writeln()
{
std::cout << "\n";
}
template<typename T, typename ...Args>
void writeln(T firstArg, Args... extraArgs)
{
std::cout << firstArg;
wr...
Yesterday in my office was weekly fruit day. As always, I took a few, and did not eat them all. I left two on my work table. The fruit were in perfectly good condition, and I have done this more than a few times.
Today I came to work and realised that the fruit was missing. I left work late and ...
The following question was taken from Absolute Java 5th ed. by Walter Savitch:
A government research lab has concluded that an artificial sweetener commonly used in diet soda pop will cause death in laboratory mice. A friend of yours is desperate to lose weight but cannot give up soda pop. Yo...
I made a class that encapsulates the common pattern of keeping an array contiguous when an element is removed by swapping the last element into its place.
A few specific things I'm wondering about:
Is it unsafe for non-POD types (because of the memcpy)?
Is there a more efficient way to add a n...
Here is a problem came from codingbat:
Given 2 strings, a and b, return the number of the positions where they contain the same length 2 substring. So "xxcaazz" and "xxbaaz" yields 3, since the "xx", "aa", and "az"
substrings appear in the same place in both strings.
There are several answers ...
Is a synonym not a good way of doing this? (not wanting to rock the boat, just to make it better)
I would be OK to delete it, TBH... I think we need a plpgsql as much as we need a ploracle ...
But, one way or another, not gonna put up a fight. Was just trying to point it out for mods to help normalize the site, it can stay and I won't mention it again :)
This is a follow up to my previous question, now that I've read up more about modern C++ (specifically C++11) and the answers in the question.
Specific things I'm wondering about:
Am I doing the Exception right? I asked on SO regarding an access problem I had, but I also want to know if this i...
Let me just look over the individual questions first, if there is no evidence of PL I will remove the tag and that will be that @Jamal but if need be I'll post on Meta
Background
Developing a web application that leverages multiple programming languages. The data flow resembles:
Browser » PHP » PL/SQL » XML » XSLT » XHTML + JavaScript » Browser
Using different languages makes it tempting to hard-code various constants within the different languages, which ...
That's fine. The combination of stored-procedure and postgresql could serve the same purpose. I doubt anyone would subscribe to plpgsql and not be interested in postgresql as well.
I didn't think there was much to say about this question, but then there was something to say after all.
Each of the three methods runs correctly, and does so in constant time. That's good.
Comments
You wrote one comment. Either
remove the comment (because it could become inconsistent if the constants change and is therefore a maintenance headache), or
hard-code the answer (System.out.println(...
I have some for loop, like here:
time1 = 0
timeDifference = []
for time2 in uniqueUserData['TIME']:
timeDifference.append(time2 - time1)
time1 = time2
I want use here the list comprehension, how I can put the second statement in the expression? I try
[(timeDifference.append(time2 - ti...
I want to implement a method which, given some camelcased or underscored String, will return a list of separate words that make up this String. Output words should be lowercased.
Examples:
ISomeCamelCasedString -> {i, some, camel, cased, string}
UNDERSCORED_STRING -> {under...
Well, there is always a solution and maybe the "hacking" solution is the best here :
Class overriding of that class.
Create that package and create that class (exactly the same package and classname).
Copy the code from your link to your class.
Change the code, I'll suggest try to remove the c...
I'm trying to reed certain values from an object,
What would be the best practise to do so?
I don't know if I should put this here or on stackoverflow.
my code as for now:
$jira_object = json_decode(trim($jira_value->data));
$this->_displayName = $jira_object->user->displayName;
$t...
While you slide left or right appropriately, thumbnails gets selected and change their opacity to be different among others thumbnails. You can also click on thumbnails to show the appropriate image on carousel.
HTML
After carousel bootstrap code, the user needs to add a list of thumbnails:
<...
I'm a Python noob. This is the code I'm using:
for i in argv[2:]: # argv[1] isn't required by s.py
if ' ' in i:
argv[argv.index(i)] = '"%s"' % i
args = ' '.join(argv[2:])
os.system('s.py '+args)
Is there a more elegant way to do this?
I've written a script that will allow me to enter a serial number for each received product, in-line in a table. First you enter the amount received, which increases the size of the <select> to that amount. Then you can enter new serial numbers through the s/n text box, submitting with TAB or Ret...
When things go awry
What happens when you don't get answers, or get answers that are helpful, but don't address your main concerns?
First, be patient. Code Review normally has a few hours at least before you can expect your question to be 'cold'. If your question is still on the 'front page' th...
The following question was taken from Absolute Java 5th ed. by Walter Savitch:
Write a program that starts with a line of text and then outputs that line of text with the first occurrence of "hate" changed to "love" . For example, a possible sample output might be:
The line of text to be ...
Code in the question is reinventing the wheel. Apache Commons Lang provides a method splitByCharacterTypeCamelCase() which makes this very simple:
public static List<String> split(String string) {
List<String> splitted = new ArrayList<>( Arrays.asList(StringUtils.splitByCharacterTypeCamelC...
As the title states, I was hoping that someone could help me optimize my script a little. Here's the run-down:
I get a CSV dump of all employee records from our payroll system once a week. The CSV has something like 28K records. The key between the two systems is the employeeID.
I import this i...
I'm gonna post a new answer detailing all the side cases he should take care of and why the function he wants to use is not okay for these sorts of things
He asked a) how to concatenate two IEnumerables and b) if there was a better way to do it than what he had did. I replied with IEnumerable.Concat(IEnumerable) and that your IEnumerables should never return null. If this was on S/O I would have answered the same. Given that that was all I could take away from his code, but it didn't constitute a full answer, I posted it as a comment.
If the entire "your comment is wrong" point relies on his post maybe being example code, well, I think that explains why we don't allow example code on CodeReview :p
To be fair to you, I could have also suggested the null coalescing operator if his problem space did allow for his Enumerable to be null. But as far as I can see, IEnumerable being null is just simply not done and unlikely to occur in any kind of managed code, so I suspect it was a smell and commented accordingly :-)
> It does not make sence, but it occurs in real world projects everywhere. You will see a lot of code like this after you finish your school and get job.
That'd be a duplicate of one of my arguments I said just now "Besides, maybe the rest of my 100k lines of code business application relies it that method returning null sometimes"
I'd like to point out I am currently writing to you from my job after integrating with 3rd party code all morning. This is not a case of me not having experience in the "real world".
@SimonAndréForsberg I have nothing to say to someone who drops to personal insults like that (@ OP)
@Pimgd I think the problem here is that the user said "this can return null", but didn't specify that he didn't have control over it. So, yeah, problem = it was example code
I've recently started working on a java project, and the main purpose of it is to get better at Java.
I've decided to make a irc bot for twitch. But after some hours of progress I already see my bot class growing. And that leads me to beleave that I'm learing bad habbits or I'm just doing it all ...
In typography, a star is any of several glyphs with a number of points arrayed within an imaginary circle.
== Four points ==
== Five points ==
See also Five-pointed star
See also:
mullet (heraldry)
pentagram
== Six points ==
See also:
Seal of Solomon
== Seven points ==
Commonwealth Star
== Eight points ==
See also:
Rub el Hizb
== Twelve points ==
See also:
Blue Sky with a White Sun
== See also ==
* - asterisk
⁂ - asterism
Unicode symbols...