We have noticed that you are asking the AI to use Regex to parse HTML, this is highly Illegal a- HTML tags lea͠ki̧n͘g fr̶ǫm ̡yo͟ur eye͢s̸ ̛l̕ik͏e liquid pain, the song of re̸gular expression parsing will extinguish the voices of mortal man from the sphere I can see it can you see ̲͚̖͔̙î̩́t̲͎̩̱͔́̋̀ it is beautiful the final snuffing of the lies of Man ALL IS LOŚ͖̩͇̗̪̏̈́T ALL IS LOST the pon̷y he comes he c̶̮omes he comes the ichor permeates all MY FACE MY FACE ᵒh god no NO NOO̼OO NΘ stop the an*̶͑̾̾̅ͫ͏̙̤g͇̫͛͆̾ͫ̑͆l͖͉̗̩̳̟̍ͫͥͨe̠̅s ͎a̧͈͖r̽̾̈́͒͑e not rè̑ͧ̌aͨl̘̝̙̃ͤ͂̾̆ ZA̡͊͠͝LGΌ ISͮ̂҉̯͈͕̹̘̱ TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ
A google search shows a user back in 2015 asking how to parse voter registration data with these same categories. I wonder how common these terms are?
https://stackoverflow.com/questions/31950723/how-to-parse-a-multidimensional-json/31950805
I agree completely. If the OP of that post actually did what they claimed they did it was highly unethical and they wasted the time of a lot of people who are skilled, educated, and experienced. They took vast amounts of highly sensitive personal data that was given to them under false pretenses. If anyone here has ever criticized Google or Facebook about how they collect people's personal information their jaws should be on the ground at what that person did.
Secondly, there's absolutely no guarantee that the person is telling the truth. About any of it. They could be lying about having done it at all. They could have done the experiment and made up the data to try to discourage their competition. The experiment could be legit, the data could be legit, and the person could be well meaning, but their interpretation of the data could be way off. The person could just be lying about everything and trolling this sub, which is filled to the brim with high-strung, cynical people anxious about their futures who are ready to believe anything.
This is why science is done the way it's done. No one is beholden to the word of a single person. All that person has done is spread a bunch of fear, uncertainty, and despair in a community that is at its best when it's doing the opposite.
EDIT: Check out the Stack Overflow 2017 Developer's survey for a real substantive look at what you're up against as a prospective employee. Important takeaway: only 13.9% of developers found their job through a general-purpose job board (e.g. Indeed).
Uh, to lazy to do the math. Let's fill the pers
array with all the permutations of [0, 1, 2, 3, 4]
(which there are 120 of), using the code from StackOverflow
var pers = permute([0, 1, 2, 3, 4]);
Then you can quickly figure out how many there are
pers.filter(a => a.every((x, i) => x != i)) // 44
So the probability is 44 / 120, which is about 36.6% (11 / 30 to be exact).
This was actually so fucking bad that I just tweeted Ingenico Group with a taunt, pointing them to this post.
It actually seems related to this old decision of what order to place the "OK" and "Cancel" buttons in such as this interesting survey (news flash: Apple actually got it right by putting the default/acceptance action, the "OK", closest to the bottom-right corner of the modal dialog and putting a bold oval around it... unfortunately, Windows has trained millions of users with expecting and thus preferring the opposite), but THIS... this is actually WAY WORSE than any possible decision in that case.
IIRC there was some Java code a guy commented about that had something along those lines - I think it had to do with the amount of time the JVM took to parse it forcing it to slow down and force something else to happen, preventing a race condition. Edit: As /u/Jedakiah said, this is what i'm remembering
Aaannnd Linux is finally beating OS X in usage amongst developers. Surprised it took so long.
2017: https://stackoverflow.com/insights/survey/2017#technology-platforms
2016: https://stackoverflow.com/insights/survey/2016#technology-desktop-operating-system
In fact, Linux looks to be the only major OS to gain in popularity, OS X and Windows lost users.
Man, I just love it when people who have never actually coded in a language that supports pass by reference try to explain what it means.
This animation shows the difference between passing by value and "passing a reference by value", which is not the same thing as "pass by reference". Javascript does not support pass by reference. And if that sentence makes you want to hit "reply" to try and argue that it does, stop right now and pick up a book on C++, because you don't know what you're talking about. Shit, even C# supports real pass by reference. That might be easier to pick up for a JS programmer.
It's probably somewhat difficult to describe visually in a 2 second gif, but in actual pass by reference, you are not only able to modify the contents of the cup, rather you are able to modify the cup itself, and even replace it with an entirely new cup. All the OP shows is the difference between passing a reference type vs a value type...you guessed it, by value, because JS doesn't support pass by reference.
So again, go read a book on C++. Or even just read this SO response with some brief code examples.
Read this a few times and it may convince to explore what many vi/vim users have discovered.
As with many technical developments - marketing and (bad) luck.
Edit: Because I myself loathe the typical one-liners you get on reddit (thanks to /u/nugatty for providing more insight!), Here is a stackoverflow thread that contains more informations.
The recent Stack Overflow developer survey found that 72% of respondents identified themselves as web developers. It could be that the audience of SO is skewed towards web developers, or it could mean that "web developer" is now a largely meaningless term, because its hard to develop software these days and not feel the need to have it connected to the internet somehow.
in any case I think that web development is a sufficiently diverse field that it makes no sense to avoid it altogether, nor does it make any sense to look down on it or indeed anything else someone decides to do for a living (unless they're monumentally shit at it)
Fun C pedantry!
A null pointer in C is not guaranteed to have any particular integer value. What is guaranteed is that comparing a pointer for equality to 0 (or to the NULL macro) constitutes a null pointer check, and will return true if the pointer is a null pointer. The actual bit representation of a null pointer is implementation defined. See here.
It's all about the features supported in the browser rendering engine. A long time ago Mozilla was the most forward and so the server had to detect what features the browser supported like frames. Mozilla was a way of saying that.
Had to confirm my recollection was accurate. Yep. It was all about the rendering engine capabilities.
Then everyone started to spoof that too and it eventually became meaningless.
Short answer https://stackoverflow.com/questions/1114254/why-do-all-browsers-user-agents-start-with-mozilla
Longer history https://www.nczonline.net/blog/2010/01/12/history-of-the-user-agent-string/
So what is the cause of this? Does one of them not have a trailing newline character? Because that just means someone is using a broken editor
Comments are easy enough to ignore. Just as long as some cockwomble with a high reputation doesn't decide to put "Try switching to C# and see the light" as an answer.
The SO community can be fairly brutal to newcomers if they don't even attempt to search the site before they post the question beforehand or show their code and what they've got so far.
Ultimately though, I've got to say that the question reads quite badly, and the commentards (including one mod) definitely don't help.
Edit: It seems like some of the original commenters spotted this post since they've removed their comments on SO in the last 24 hours.
My suggestion: Use integer values. Store the value in cents.
TLDR integer values in js lose precision only after 2^53
use your favorite search engine (NOT GOOGLE) to look for "zalgo text generator". there are a few flavors. check out the most epic stack overflow post ever:
https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags
Also, <code>steady_clock::is_steady == false</code>.
Also also, as of GCC 4.8, <code>steady_clock</code> is monotonic only on “most GNU/Linux configurations”. I see no mention in the release notes since then that it's either supported on all configurations or outright disabled where not supported.
Dear lord, what a shit show. What raging idiot thought this would be a good idea? If a feature isn't available, don't fucking advertise it!
Then again, C++ is designed by committee, so the spec probably says this is actually totally okay. And said spec costs $215, so it's not like I can go and check. SMH. Fuck that language so much.
There are different ways to calculate gray values from a RGB image to arrive at a grayscale representation. You can just average out the red, green and blue values, but that's not the preferred way, or the way that, say, digital cameras, TVs, or quality software like Photoshop do it (or colour spaces that have a luminance channel like Y/Pr/Pb, Lab, etc).
This is because, according to our perception, the amount of green makes much more difference to how light or dark we perceive something to be, and blue makes much less difference. So for the Y channel (Luminance) we calculate a weighted average, giving more weight to green, slightly less to red, and very little at all to blue - blue makes very little difference to how light we perceive things.
A naive "saturation" control would just average the R G B, but any quality piece of software (eg Photoshop) should do it according to the relative luminance standard by default:
Y = 0.2126 R + 0.7152 G + 0.0722 B
Calculation must be done in linear space not gamma corrected.
Sources:
https://en.wikipedia.org/wiki/Relative_luminance
https://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color
I'd like to recommend When the abyss gazes back: staring down Python's surprising internals as an interesting introduction into diving into the CPython interpreter. Talk is based on this stackoverflow question.
> ~~Two of~~ my favorite regex tools: >
https://stackoverflow.com/questions/tagged/regex
I've tried learning regex a million times and I always forget it all within a week. Only thing I can ever remember is the simple s/replace_this/with_this/g
:(
>A C++ rewrite for normal performance.
Which would also likely nuke Linux support. :(
Also, Java performance isn't particularly bad these days. Code that's written with efficiency in mind will go much further than the difference between C++ or Java.*
^^^*YMMV based on various factors
EDIT: Stack Overflow question for good measure. JIT compilation really can be nice because it can target optimizations for specific CPUs at program execution time. Relevant Ars Technica article.
EDIT 2: Comparison on Wikipedia as well.
tl;dr: Time would probably be better spent continuing to optimize the existing code rather than porting it over to another language. Not to mention it would continue to make Minecraft available for platforms that can run a JVM instead of needing to target specific systems.
Does anyone have a Minimal, Complete, and Verifiable Example to reproduce this bug? I know the author claims we can "pull the latest ZeroTierOne repo, set up a simple network controller, and then bang heavily on the JSON API with POST requests" but there are a few too many variables in there so I think I would have trouble getting it right. Especially since he says the bug is dependent on the order of lines of code, and the order of those lines might have changed since he made the post.
I'm a little confused by the Platforms section. Is that saying that 32.9% are working on Linux Desktop or for Linux Desktop? Because, if the answer is "on", 28.2% is working "on" Android. Like, some large part of that is literally coding on Android?
This is basically what those little Square readers do in cafes:
https://i.imgur.com/DSvJ79S.jpg
Here's a SO thread where someone runs the numbers and gets to a data throughput rate of ~8kbps:
https://stackoverflow.com/questions/2181476/bandwidth-from-headphone-microphone-jack
In case anyone is wondering, this is happening because the Rust Borrow Checker has become self-aware and started coming up with new and novel UTF-8 characters that your browser might not be able to display properly.
https://stackoverflow.com/questions/6579844/how-does-zalgo-text-work
https://stackoverflow.com/research/developer-survey-2016#technology-development-environments
Vim is still very popular, especially for it's age (it's stood the test of time).
The top two (notepad++ and Visual Studio) are likely boosted by the fact that so many amateurs use them. Not to say that many professionals don't also use them too (especially VS), but most programmers I know start out with notepad++ or some IDE and then move to a good text editor. It's also worth noting that the vim community has become slightly fragmented recently with the rise of neovim.
Another thing that's telling is that Visual Studio Code only accounts for about 7% here, but Microsoft pays shills to post it all over tech forums, making the numbers look bigger than they really are. If even just 10% of VS and/or Notepad++ users are amateurs (and this is completely within the realm of possibility) then it's pretty much on par with vim as far as usage statistics among professional developers.
It's unlikely amateur programmers would use vim because of the steep learning curve compared to Notepad++ and VS.
edit: just to clarify, by "professional" I basically just mean well educated about programming.
"We would love to give you the lead developer position, /u/theephie. But unfortunately, our records show that you viewed the StackOverflow page, Teach me git commit, over twenty times in the past year. We'll have to pass for a more knowledgeable candidate."
If you are okay with having the screenshot as a png image rather than a pdf, you can use the Developer Toolbar to do this without needing any addons.
Press Shift-F2 or go to Tools > Web Developer > Developer Toolbar
Then type in the following line and press enter.
screenshot --fullpage
For more information, see: https://stackoverflow.com/questions/13158083/take-a-full-page-screenshot-with-firefox#14830242
Ooh, you should have put the array size define in a separate .h file to confuse him even more!
If the little devil on your shoulder is particularly convincing, you could also use Trigraphs intermittently to further add to the confusion as well as very odd short-circuit evaluations (like so):
https://stackoverflow.com/questions/7825055/what-does-the-c-operator-do
I don't know enough about LaTex to say whether the references are turing complete, but LaTex itself certainly is.
I came across this while searching for a hack where someone wrote an http server in latex so that when they sent the latex into their printer, the latex port would then act as an http server port.
Edit: all fixed thx
Edit 2: all fixed URLs, I'm a lazy shit sorry.
r/regex
Alternate form for better engines:
(?<=v=|v\/|vi=|vi\/|youtu.be\/)[a-zA-Z0-9_-]{11}
Matches vid in string.
Last one modified from stackoverflow answer.
I find it amusing that in a company full of developers, nobody noticed the mis-aligned brackets in their salary formula:
skills = floor(4*Count(A+++) + 2*Count(A+) + 1*Count(A) + 0*Count(B)) / Count(*) * 3.5 - 2)
https://stackoverflow.com/company/salary/skills/web-developer
Edit: They fixed it now, apparently they have at least one employee who reads reddit :)
Stack Overflow. Those guys are elitist karma-whores who are paranoid about duplication. If your answer is even remotely similar to an answer on the third page of "similar questions" that was also marked as a duplicate, yours is marked as a duplicate and your question is downvoted. Never mind that none of the questions yours is marked a duplicate of does not answer your question or solve your problem. Never mind that the older question had no working answer. Never mind that you've specifically cited the older question and explained how it was inapplicable. Never mind that the library asked about has changed since the older question was asked, making both the question and its answer (if present) both inapplicable. The question seems similar at first glance, so it's a duplicate that must be downvoted, closed, and deleted.
The only ways you're ever able to ask a question safely is either to combine 3 or more obscure libraries across 2 languages/platforms and ask about a minor annoyance, or to ask about a library that just had its first alpha release less than a week prior (source). And in those cases your question is just going to sit there with no answers, earning you the "tumbleweed" badge. Unless of course, you have lots of karma, and choose to use it to bounty every question you have.
Stack Overflow's "archive" policy of no duplicates is the main reason I stopped using the site. Archiving old questions as eternal pillars that should never be looked at again prevents the info from getting updated, and prevents discussion of old topics in new light (more applicable to SO meta). It prevents problems from being solved in more than one way, ignoring the fact that not all solutions work for everyone, even if the problem seems identical.
I really like the skills description and calculator to rate yourself 0-5: https://stackoverflow.com/company/salary/skills/product-manager
But these salaries seem really low. Is it truly possible to recruit a level 5 (seems like a best in the world type person) with 10 years of experience for $155k (or $170k in NY/SF)?
Stop blaming it on Java, generally it comes down to quality of code rather than Java vs C or C++. It's even true for cases like C# (which is actually a little bit slower than Java as it's not as tuned as the old JVM!). Generally in most benchmarks the difference between C++ and Java performance is increasingly neglible, thanks to technologies like JIT compilation and optimization. What's more important for performance is the programmer using the right and fast algorithms.
And despite C# being slower than Java, we have a lot of games who uses it, including wonderful games like Kerbal Space Program! Plenty of unity games does infact.
Generally what is way slower is using a scripting language like Python, Perl or even PHP but you don't usually see that with heavier games being programmed in a scripting language.
Blame it on bad coding at worst, Minecraft being a complex game to optimize at best (I'm leaning towards the latter).
Outside of game development, you would be correct. Game Programmers work for waaaay less than others of similar talent in other programming fields.
It's actually kind of disgusting how much less Game Programmers get paid compared to a web developer at the same experience level. That's a conversation for another time though.
EDIT: Take a look at Stack Overflow's Salary Survey. It's kind of insane... the closest you'll get is "Desktop Development" to the skills that a Game Programmer needs. That's over 800 $10 hats a month to pay that salary!
I find Stack Overflow to be a great metric for a number of categories.
1) Illustrates what you know / do not know
2) Shows that you can communicate clearly
3) You're willing to go out of your way, take time, and help others.
4) Helps grow your brand.
I'm in the top 9% of contributors this year, and do it largely for the reasons above.
When I say it helps grow your brand, I mean that in a big way. Here is a response I gave about UA strings for Edge, and it already had 24k views. Assume that even a handful of those looking at the answer click through to the useful links on my page, and now I'm growing my brand.
While I wouldn't say SO is the end all, be all of a programmer's knowledge, it certainly can't hurt. When recommending people for work (and I've had two friends come on in the last year), I commonly reference their SO and GitHub profiles, which I know has helped.
Best of all, you're learning what you know, and what you DON'T know along the way. Just don't let the power-tripping moderators get to you.
I champion the idea of having a site, and being public with your work because:
and
2) During my interviews at Motorola, Comcast, and Microsoft, I asked "How did you find me?" and they all said "Your website". I was a construction worker at the time.
With that said, don't underestimate the importance of:
And that's why you can't use regular expressions to parse HTML (in case anyone hasn't seen that one yet)
To add to this, here's the definitive answer on Stack Overflow regarding "Asking the user for input until they give a valid response", just to save y'all a search.
It's a wrapper, as you've said. But it's actually the adapter design pattern, from what I can tell.
Design patterns are very useful for describing your intent, and so that other people know what the hell you're writing haha.
❤ @Rust. Maybe i am unable to find the data i need, but i remember last year we had an overview of which platform is used by developers (for programming etc.).
This year i only found technology-platforms but i don't feel like its representing the same data as i could not believe anybody is using android for development but rather as target. But then i wonder how on earth could (Desktop)Linux such a huge deployment target?! What is this section representing?
I think you mean weak and strong typing. You can have dynamic typing without coercion.
Not sure there are any languages where that always happens, but typically it's in data serializations from one system/language to another, such as here for example.
You know you could just write a simple low level keyboard hook and return 1...
It responds a lot like disconnecting your keyboard.
Here's a program I wrote using AutoIt
that will also display flying nyan cats all over your desktop while you clean.
https://stackoverflow.com/a/26413530/1274820
The AutoIt version could be reduced to a few lines of code.
I dont know what they have to do to hire you, but since here are only negativ comments id like to add something positiv.
Stackoverflow carrears often has post from companies who offer visa support and relocation.
https://stackoverflow.com/jobs
Having developed an ios app with 3 mil downloads is a good starting point for sure. I wish you all the best.
"Although I appreciate the effort here, my eyes hurt when I stare at those pseudo-codes."
The maximum length of a URL is about 2047 characters, so discounting 255 chars for domain names, plus 1 for a separator /
, and another 3 for a .js
extension, it would be safe to say that we can use at least 1788 bytes for JS library names.
That is, if we only used a-zA-Z0-9._
characters for the names, we would get a 64^1788 namespace, or 2^10728 for the purists.
Since life on Earth is expected to last for the next 10^9 years, or 2^55 seconds, and we have a population of less than 7.5 billion, or 2^33 people, this means we should increase our current rate of JS library production to at least 2^10000 per second per person if we have any hope of achieving any level of namespace completeness.
Of course an equal amount of population increase would also be acceptable, with 2^10033 people working at a leisurely pace of one JS library per second per person.
Disclaimer: this delectable factoid brought to you courtesy of 7ZzODMvA<1772_characters_skipped>sfCjswbY.js
private static final Map<Class<? extends Persistent>, PersistentHelper> class2helper = new HashMap<Class<? extends Persistent>, PersistentHelper>();
Collisions are decreased if the hash table size is co-prime with the constant used in certain types of hash functions. If we can't necessarily control the hash function, by picking a hash table size that is prime, we guarantee it will be co-prime with any [edit: smaller] constant.
More here: https://stackoverflow.com/questions/1145217/why-should-hash-functions-use-a-prime-number-modulus
For anyone interested about the source of the quote. It's from a book Categories for working Mathematicians.
Don't forget the adventures of Mr. Null and the weak equality typing.
Christopher Null, tech journalist at Wired, also has an interesting post on the subject.
<uj>
>Facebook has a ton of developers working internally on a lot of projects, and it is very common for someone to make a minor mistake; whether it be something as simple and serious as failing to escape data inserted into an HTML or SQL template or something as intricate and subtle as using eval (sometimes inefficient and arguably insecure) or JSON.parse (a compliant but not universally implemented extension) instead of a "known good" JSON decoder, it is important to figure out ways to easily enforce best practices on this developer population.
stopped reading there. If they're too incompetent to define what data is what, and still don't use a safe construction, they'll fuck up over and over again. oh wait, they do, and they use that as PR material because people are too dumb to actually read the vulns and see they are the exact same issues as what shitty PHP websites had 10 years ago (not that there's any solid known way to write secure websites, even if you know what you're doing).
also I'm pretty sure that answer is just wrong (bailed out of web years ago so I have no idea what the current state is; protip: it never changes it just gets worse and more complicated)
I thought the point of this, and the equivalent while (1);
shit Google uses is to prevent handing out a JSON response of an authenticated request to code running on some other domain (as explained in the Google answer).
The StackOverflow developer survey contains the data you want..
My personal take? It is relatively simple to learn shitty web development and have it pass as mediocre web development, and the industry is undergoing rapid and deep enough mutations that it doesn't get picked up on a as well as it probably should. In most other fields of programming, shitty looks shitty. You get the occasional sneaky one, but for the most part it's a sea of mediocrity doing things it shouldn't, not the true horrors that some self taught web devs come up with.
You don't need to go the full university route (though I do recommend it) but for gods sake at least a do couple of certs, or something that will give you critical feedback on a project of some sort of decent size.
I think the real gem was in the comments, with the link to this post on parsing HTML with regular expressions
I think C++ is complicated because there is a lot to know about it and if you don't know it all, it can create very frustrating bugs. I still remember when this little gem bit me hard. Try to guess the output of this program.
enum class Color { RED, GREEN, BLUE };
class Car {
protected: Color color;
public: Car(const Color color) { this->color = color; }
friend std::ostream& operator<<(std::ostream& out, const Car& car); };
std::ostream& operator<<(std::ostream& out, const Car& car) { return out << "a car"; }
int main() { std::cout << Color::BLUE << std::endl; return 0; }
For me, the reasonable guess was that it would either print the int value of the enum, or because it is an enum class and not a regular enum, it might be a compile-time error. What it actually prints is "a car". The solution is to add the explicit keyword to the Car constructor.
You should check if it has an @
and is greater than 6 characters:
Every email must start with [email protected], but can be one letter (ex [email protected]
)
1 character for the @
1 character for the domain (you can't have [email protected]
)
1 character for the .
between the domain and the TLD
2 characters for TLD (although you might have to lower this in the future)
No one would deny that it is useful, it's that it does not fit in with the format of SO. A post like that would be great for a site like reddit, but one like this would probably not do very well here. It's all about being a good fit.
StackOverflow released their 2017 Survey Results.
Good culture war material because it includes data broken down by ethnicity and gender, e.g. Developer Role and Gender. Any idea why the gender ratio in embedded systems is so much more imbalanced than that in machine learning?
I'm new to Rust and I don't think I will stay too long with it. There are some major problems with it:
.properties
file reader. Two most popular are buggy and no longer supported, so it was easier for me to write own parser.If the described goals won't be reached asap, people like me will just get bad taste of Rust (it's my second approach after 2 years break).
Also, minor thing, but cargo used to compile on freebsd 32, it doesn't compile any more...
you have forgotten to put it in poem form:
Internal frame
internal frame,
title pane
internal frame.
title pane
maximize button,
window not focused state
It also didn't help that they changed subtle things like rounding behavior, this will mess up a lot of algorithms and it's difficult to test.
Why has no one, including OP, replied to this comment? The two patterns linked here are the solution to the problem: the DI pattern doesn't say every object in your application should be constructed via the container. In your case, you would create a factory, eg ConnectorFactory
. The factory itself would be responsible for creating the correct connector at runtime, based on criteria provided from outside.
The strategy pattern comes into view when looking at single connectors, each connector should implement the same interface, eg. Connector
to be sure a set of known methods can be called.
There's nothing wrong with the DI pattern, but we must be careful not to abuse it (like eg. a service locator). There are good reasons not to use the DI container as a service locator: https://stackoverflow.com/a/1557804/3437882
The Nearby Connections API now offers the following capabilities: Fully-offline peer-to-peer communication using Bluetooth, BLE and Wifi hotspots. Thats great news ...
EDIT: Proceed with caution, there seems to be some problems with:
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
from rxjava as well as some other square libraries. One possible way to resolve:
It should also be noted that while this is true, it's immaterial to the discussion here, since we're trying to figure out why Rust and Swift have differing performance characteristics on this naive Fibonacci.
You could do it in "constant time" too. See https://stackoverflow.com/questions/6037472/can-a-fibonacci-function-be-written-to-execute-in-o1-time for details (though look at the second answer)
What is the point of literally copying and pasting the already-answered StackOverflow question verbatim? What do you hope to achieve? Are you a bot trying to blend in with humans?
Since it has full css support you can go a step further and print images
Found here: https://stackoverflow.com/questions/26283936/stylized-console-logging
I think it's the story of a lot of us. I now get to mentor a lot of junior devs and it's fairly fun to watch them go through the same realizations I had to. I can then relate my journey and take them to the next step. I think it's pretty impossible to convince a person to go straight to the last step (programmers are a fairly arrogant or know-it-all bunch aren't we), but it is possible to accelerate them to the next step on the journey.
Edit: Here is my realization at the end of my first paragraph: https://stackoverflow.com/questions/2925459/refactoring-singleton-overuse
I'm working on a Yesod application and starting to implement some tests with HSpec's discovery testing.
If you do a stack new webtests yesod-postgres
, you'll get a project template that has some testing facilities built in. The withApp
function lets you do normal website stuff and run database queries, but since it loads the application configuration for each test, it adds about 0.2 seconds per test case. This is a drag. Is there an accepted way to have the database/application initialization done once, and share that among the various things that need the information, and retain HSpec's test discovery?
EDIT:
this SO post is making me think it isn't possible without some hackery :(
You're going to have to go in to more detail. Those technologies can be made scalable but they need to be configured with that possibility in mind. They are asking about the configuration, how many users you had to handle and on what hardware.
When I first read about branch prediction on SO years ago, I realized there was a whole world of optimizations I wasn't aware of, optimizations which are basically undiscoverable.
I can fire up a profiler and find hot paths that are easy to diagnose and fix. This function is called a million times? I didn't expect that. Let's inline it or use a lookup table. Why is this call red? Oh, it's allocating on the heap, let's get rid of that.
But when I see a simple red loop, I come to the conclusion "welp, there's nothing more I can do here, it's as simple as it gets".
for (unsigned c = 0; c < arraySize; ++c) { if (data[c] >= 128) sum += data[c]; }
How on earth am I supposed to know that sorting the array, changing the if
to bit fiddling, or even just interchanging the loops could give me a ten-fold speed increase? Well, now I know that, but there are hundreds of other optimizations (macro optimizations) that I will never be able to figure out. And it just gets worse as processors get better.
I would suggest reading the stackoverflow book list on the topic and picking ones that suit your background (you don't give us any info to go on).
Honestly, Storyboard is probably one of the best and easiest to use UI designers that I've used. If you REALLY don't want to use Storyboard then you'll have to use xib files or just code the whole UI. That however does make it quite a bit more difficult.
In your case it is probably the best to stick with Storyboards, since they are relatively easy.
You can also read this stack overflow thread if you want more information about the alternatives to Storyboard.
However, the real problem here is that you probably don't understand constraints well enough to work efficiently with them.
That was tough to read. Whatever happened to prose? (edit: I see, that were just slides of a presentation)
Meanwhile a lot of what he says is basically just what proponents of Haskell and many other functional languages have been arguing since the ancient days: Write as many small, pure functions as possible, treat IO-dependent code as filthy and keep it separate and as minimal as possible. It's not as much a question of "architecture" as it is one of programming paradigm. Some languages make it easy (or force you) to code in this style, others make it more difficult and non-obvious.
Python is an imperative language with some functional programming capabilities (even though Guido hates them). If you're wondering why I say "some" try composing two functions. In Python it is much simpler to write a loop than to use the functional approach, because functional programming in an imperative language typically involves a lot of line noise. If you try to follow the "pure" paradigm as suggested in OP's post, you either end up writing completely indecipherable one-liners or you have to define multiple generators in a row to do what could be a simple for loop. Either way the result becomes harder to read and to understand. Which is sad but a natural limitation of the language.
https://stackoverflow.com/questions/2100490/floating-point-inaccuracy-examples
http://effbot.org/pyfaq/why-are-floating-point-calculations-so-inaccurate.htm
Floating point arithmetic is an approximation.
Maven works for all app types. The only reason you are seeing it used mostly for web apps is because most apps are web apps. It has nothing to to with how maven is designed or intended to be used.
You'll want to use the exec plugin for running your app during development. The webstart plugin or getdown plugin can be used for distribution.
I've used Phantom forever and haven't seen anything like this. Judging by this stackoverflow it looks like applewebdata:// is used by UIWebViews.
If it's Snapchat exclusive I can only presume either Snapchat or Phantom is trying to display something via the web view. Ads, perhaps? I'd presume we'd have more widespread reports if ads were causing this though, especially if they were tapping location data.
Is this popup appearing anywhere else in your iOS?
Very odd.
I recently thought of the same question and this Stack Overflow by Craig Mcluckie who was one of the cofounders of K8s and is recently the founder of Heptio helped me differentiate between the two and once I did that I realized what role they both can play.
Not only is that easy to read, but it's used similarly in other languages as well. It's a good standard way to specify what you're ignoring or throwing away, especially in unpacking.
This is what constexpr
is for! This keyword would in this case allow the compiler to compute your table at compilation time and write it directly into the binary.
> In your work avoid static variables at function level – they are bad practice anyway
And the answer is instead to use top-level singletons? No thank you!
The Meyer's singleton - more or less the original solution in the article - is a well-known solution that avoids many of the issues of top-level singletons. And if you use constexpr
, it's very likely that this won't involve any branching at runtime.
very funny on the page that shows how to calculate your skill level: https://stackoverflow.com/company/salary/skills/web-developer
they have rankings that you pick. there's 4 levels. the lowest is B. the second lowest is A. then A+, then A+++.
do you totally suck? you're a B student. are you the best? you're on ebay
Yes. In Linux the process asks for memory with the mmap
and brk
/sbrk
syscalls, and those come zeroed. malloc
calls those syscalls when it needs more memory, but if it reuses some memory block that was previously allocated by your program it won't zero it again.
It seems inevitable that Rust will have some kind of inheritance, but it will be probably less used than inheritance in C++ or Java.
But notice that traits let you decide between static dispatching (generics) or dynamic dispatching with a vtable (trait objects), and that you can define a subtrait of a trait. What Rust lacks from the usual OOP is subtyping (in my understanding, the only kind of subtyping in Rust are due to lifetimes).
So I can write a function that receives "any type that implements Animal
" and call Animal
methods on it, regardless whether it's a Cat
or a Dog
. But I can't "treat a Cat
object as if it were an Animal
object". That is, Animal
can't be a enum or struct, it needs to be a trait. But see this for a workaround on upcasting (basically you define a method that returns a trait object of a supertrait, if you really need it).
And that's okay, I don't think Animal
should be a struct; it describes a property of Cat
s, Dog
s, and any other type you define and implement the trait.
In case you didn't know, the fascination with FizzBuzz as a programming challenge was popularized by Jeff Atwood in his famous blog post, "Why Can't Programmers.. Program?" He followed it up with this post, where he clarifies, "FizzBuzz was presented as the lowest level of comprehension required to illustrate adequacy."
It's just a litmus test. Can you solve a simple problem in code? How do you solve that problem? How long did it take you? Any programmer worth their salt should be able to come up with a solution.
The problem is that so many people in this industry are "fake it 'til you make it" types. At least this weeds out those people who clearly have no business going for those jobs.
By the way, while the modulus operator is probably the quickest or most semantic way to solve the problem, there have been countless attempts to do it crazily. Stack Overflow is full of solutions.
Saw it as well, the only thing I could really find about it was this: https://stackoverflow.com/questions/31081919/atlassian-logo-after-pushing-to-bitbucket
Did something similar happen? Possibly an anniversary?
> Cron is the best way to schedule tasks on a Linux system.
No. systemd timers are the best way to schedule tasks on a Linux system. You get both cron and anacron in single package, a way to express times that are extremely hard/impossible to express with other systems, plus all the neat stuff that systemd gives (proper supervision of processes, resources control, environment control, dependencies and what else).
Case in point: I want to backup data from my remote server automatically. Since this is potentially time-consuming operation, I want to do it at most once a day. Remote server is accessed through SSH and I use key-based authentication. I don't want to type my key repeatedly for each session.
In cron world, I had to schedule command to run each hour and manually check (inside backup script) if it has already run that day. Since cron processes are run outside of my X11 session (where ssh-agent is started), I had to use this hack to retrieve SSH environmental variables.
In systemd world, I can schedule command for middle of the night and systemd will run it at first available time after scheduled time passed. Thanks to dbus-update-activation-environment
, processes spawned by systemd inherit environmental variables from running X11 session.
The only reason to prefer cron over systemd is when you can't use systemd, i.e. you have some older LTS distro or non-Linux system.
You can absolutely use a decimal point with hex. Pi would be 3.243F6A...
You can use a fixed point or floating point system to specify fractions of a whole in any number system (including hexadecimal). Technically I should call it a radix point, but most people call the symbol a decimal point regardless of the number system being used.
It's possible to shutdown a machine using Java using code almost identical to what is posted. The simplest implementation for Windows basically boils down to Runtime.getRuntime().exec("shutdown -s -t 0");
(note that it might require elevated privileges for your program).
As always I would recommend trying the built-in features first and add plugins where you find the built-in solutions don't work for you:
Completion: Vim has advanced built-in solutions for inserting and completing text. See :h completion
or :h usr_24.txt
.
Code navigation/tag completion: ctags has built-in support for jump-to-definition and tag completion. See :h tagsrch.txt
.
Debugging/syntax checking: I would first try debugging with the built-in quickfix window as described here. For more info :h makeprg
, :h quickfix
and :h errorformat
.
The keywordprg option might also be interesting for you, it basically enables you to open documentation to any keyword from within vim. See :h keywordprg
.
it's a shorthand way of writing
if (i !== -1) ...
This is because in two's complement systems the bitwise inverse of -1 is all zeros; falsy. Every other number evaluates to true (allowing it to be a fast check with indexOf to see if a string/array contains something)
EDIT: changed wording from 'fast' to 'shorthand' as /u/fruitdev pointed out that the bitwise not method is actually slower than a standard i !== -1
.