This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scope :dashboard_active, includes(:media_plan_line) | |
| .where(["((media_plan_lines.start_at <= ? AND media_plan_lines.end_at >= ?) | |
| OR | |
| (DATEDIFF(CURDATE(), media_plan_lines.end_at) <= 10)) AND NOT media_plan_lines.status = ?", | |
| Date.today, Date.today, "pipeline"]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe "Conditional matching" do | |
| it "should understand binary/unary operators correctly, given the predecate to decide" do | |
| subject = Lexr.that { | |
| ignores /\s+/ => :whitespace | |
| legal_place_for_binary_operator = lambda { |prev| [:addition, | |
| :subtraction, | |
| :multiplication, | |
| :division, | |
| :left_parenthesis, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| To run: ./image_editor | |
| To run tests: #run with python -m unittest app_tests.TestImage | |
| ------original challenge------ | |
| Coding challenge | |
| Graphical editors allow users to edit images in the same way text editors let us modify documents. Images are represented as an M x N array of pixels with each pixel given colour. | |
| Produce a program that simulates a simple interactive graphical editor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Coding challenge | |
| Graphical editors allow users to edit images in the same way text editors let us modify documents. Images are represented as an M x N array of pixels with each pixel given colour. | |
| Produce a program that simulates a simple interactive graphical editor. | |
| Input | |
| The input consists of a line containing a sequence of commands. Each command is represented by a single capital letter at the start of the line. Arguments to the command are separated by spaces and follow the command character. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.ajax({ | |
| url: "/oasis/incoming_call", | |
| dataType: "json", | |
| data: { | |
| id: leadId, | |
| contact: { | |
| call_id: callId, | |
| campaign_name: campaignName | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Warning: It appears you have Macports or Fink installed | |
| Software installed with other package managers causes known problems for | |
| Homebrew. If formula fail to build uninstall Macports/Fink and reinstall any | |
| affected formula. | |
| Also installing dependencies: libogg, libvorbis, lame, flac, libao, mad | |
| ==> Downloading http://downloads.xiph.org/releases/ogg/libogg-1.2.2.tar.gz | |
| ######################################################################## 100.0% | |
| ==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/libogg/1.2.2 | |
| ==> make | |
| ==> make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mergeObjects: (obj1, obj2) -> | |
| obj3 = {} | |
| for attrName in obj1 | |
| obj3[attrName] = obj1[attrName] | |
| for attrName in obj2 | |
| obj3[attrName] = obj2[attrName] | |
| obj3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CXX=g++ | |
| CXXFLAGS=-Wall -gdwarf-2 -O2 -g -I /usr/local/boost_1_48_0 | |
| LDFLAGS=-L/usr/local/boost_1_48_0/stage/lib -lboost_signals -lboost_thread -lboost_system -lboost_program_options | |
| svr: main.o server.o io_service_pool.o connection.o command_parser.o | |
| $(CXX) -o svr $(LDFLAGS) main.o server.o io_service_pool.o connection.o command_parser.o | |
| %: %.cpp | |
| $(CXX) $(CXXFLAGS) $^ -o $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| command_parser.cpp:13: error: ‘resulting_command’ was not declared in this scope.. | |
| command& command_parser::parse(const std::string& command) { | |
| 13: command* resulting_command = NULL; | |
| std::vector<std::string> parts; | |
| boost::split(parts, command, boost::is_any_of(" ")); | |
| std::string cmd = parts.at(0); | |
| boost::to_upper(cmd); | |
| parts.erase(parts.begin()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT c.contract_id, csc1.changed_status | |
| FROM contract c | |
| LEFT | |
| JOIN contract_status_change csc1 | |
| ON csc1.contract_status_change_id = | |
| ( SELECT csc2.contract_status_change_id | |
| FROM contract_status_change csc2 | |
| WHERE csc2.contract_id = c.contract_id | |
| ORDER | |
| BY csc2.date_changed DESC |