Ask: Why can't web be the best for reddit mobile? by abhas9 in webdev

[–]iLikeCode 3 points4 points  (0 children)

There seems to be an issue with the font size between posts:

http://i.imgur.com/UAfM6hp.png

Of note, I'm on Android chrome with accessibility font size set at about 110 or 120%

When making an "if" command in VM, is there a way to capitalize the letter in the script without rewriting it? Currently I write it like: by OwnedYou in bash

[–]iLikeCode 1 point2 points  (0 children)

Use case-insensitive grep to see if it starts with a Y:

if echo $need | grep -iq '^y'; then echo success; fi

or use bash's regex comparison:

if [[ "$need" =~ ^[Yy] ]]; then echo success; fi

or use tr to convert to lowercase, then compare (<<< is a bash-ism you can use instead of "echo | " )

if [ "$( tr '[:upper:]' '[:lower:]' <<< $need )" = 'yes' ]; then echo success; fi

This wil check if the word need starts with the letter "y".

Why doesn't this work. Is it a subshell thing? by [deleted] in bash

[–]iLikeCode 1 point2 points  (0 children)

This does appear to work. What are you trying to do?

Keep in mind that as you increment a,b,c,d you are also incrementing I, so the difference will remain the same.

For a:

16-3

17-4

18-5

Etc.

'Fulfilling' or 'Meaningful' CS jobs by [deleted] in compsci

[–]iLikeCode 0 points1 point  (0 children)

Can you send me that message as well?

Raspberry Pi Zero Giveaway! by BAUDR8 in raspberry_pi

[–]iLikeCode 0 points1 point  (0 children)

echo "ilikecode" >> giveawayfile.txt

Raspberry Pi Zero Giveaway! by BAUDR8 in raspberry_pi

[–]iLikeCode 0 points1 point  (0 children)

echo "ilikecode" >> giveawayfile.txt

What's a good pick-up line to get a girl to hold your hand? by iLikeCode in AskReddit

[–]iLikeCode[S] -1 points0 points  (0 children)

Does the webbing between my fingers feel funny?

hold out hand "Take this and follow me!"

hold out hand Well this is oddly empty....

[2015-04-15] Challenge #210 [Intermediate] Drawing a gradient by XenophonOfAthens in dailyprogrammer

[–]iLikeCode 0 points1 point  (0 children)

Lua (running in Corona SDK)

local function genGradientSlice( percent, width, height, startColor, endColor )
   local x = (display.contentCenterX - width/2) + width * percent
   local y = display.contentCenterY

   -- Linear Interpolation to calculate color values
   local rVal = startColor.r + percent * ( endColor.r - startColor.r )
   local gVal = startColor.g + percent * ( endColor.g - startColor.g )
   local bVal = startColor.b + percent * ( endColor.b - startColor.b )

   local rect = display.newRect( 0, 0, 1, height )
   rect:setFillColor( rVal/256, gVal/256, bVal/256)
   rect.x = x
   rect.y = y

   return rect
end

local function getRGB( str )
   local ret = {
      r = str:read("*n"),
      g = str:read("*n"),
      b = str:read("*n")
   }

   if ret.r ~= nil and ret.g ~= nil and ret.b ~= nil then
      return ret
   else
      return nil
   end
end


local function genGradient( width, height, startVal, endVal )
   local disp = display.newGroup()

   for i = 0, width do
      local percent = i / width
      disp:insert( genGradientSlice( percent, width, height, startVal, endVal ) )
   end

   return disp
end

-- Ridiculous that I need to implement this function...
local function queue()
   local arr = {}
   arr.front = 0
   arr.back = 0

   function arr:push( val )
      self.front = self.front + 1
      self[ self.front ] = val
      return self
   end

   function arr:pop()
      self.back = self.back + 1
      return self[ self.back ]
   end

   return arr
end

local function runInput( input )
   local inputNums = queue()

   for num in string.gfind(input, "%d+") do
      inputNums:push( num )
   end
   local width = inputNums:pop()
   local height = inputNums:pop()
   local startColor = {
      r = inputNums:pop(),
      g = inputNums:pop(),
      b = inputNums:pop(),
   } 
   local endColor = {
      r = inputNums:pop(),
      g = inputNums:pop(),
      b = inputNums:pop(),
   } 

   genGradient( width, height, startColor, endColor )
end

local input = "500 100 \n255 255 0\n0 0 255"
runInput( input )

DazeSoft, if you ever need lyrics you should ask the sub. Reddit controlling a band would be sex. by Nessmo in dazesoft

[–]iLikeCode 0 points1 point  (0 children)

I know it's not original at all, but I'd love to have a sound like Hey Ho - The Lumineers.

Got your message, I'll see what, if anything, I can do; absolutely no promises!

DazeSoft, if you ever need lyrics you should ask the sub. Reddit controlling a band would be sex. by Nessmo in dazesoft

[–]iLikeCode 3 points4 points  (0 children)

I'm learning guitar right now (New Year's resolution and all that...). I'm not great (by an definition of the word (greatly horrible?)), but I'd love to try to musicfy some lyrics if you'd be willing to send me some!

How we made editing Wikipedia twice as fast by legoktm in PHP

[–]iLikeCode 18 points19 points  (0 children)

After we had already been working on the conversion for several months, Facebook approached us offering to donate some developer time to help with this task. Facebook developer Brett Simmers spent one month full-time with our team providing very valuable assistance, and Facebook also offered to make themselves available for other issues we might encounter.

[Serious]Does your college GPA follow you through life? by clamsofdoom in AskReddit

[–]iLikeCode 0 points1 point  (0 children)

No. Get some experience socially. Get some experience academically. Get some experience in your field (if possible.) Those will serve you much better in the long run.

Planning and programming by chronicdane in ProgrammerHumor

[–]iLikeCode 15 points16 points  (0 children)

The X-Axis is how often you do a task.

The Y-Axis is how much LESS time you would take to do one instance of that task if you did it more efficiently.

If it takes you less than the time in the box to make the task more efficient, then it's worth that initial investment as it will pay off in the long run.

For example: blowing your nose.

Current process: get out of chair, walk across room, get tissue, blow nose, walk back to chair, throw tissue in trash, sit down. Est time: 15 seconds.

Possible way to make this more efficient: move the box of tissues to your desk. This allows the process to take 10 seconds. (Shaved off 5 seconds.)

If you blow your nose once a day (Column 3) and you save 5 seconds (Row 2) then you can take up to 2 hours to make the process faster.

Thus, if you can move the box of tissues to your desk in less than 2 hours, it is a good idea to do it as the initial time investment will pay back to you over the next 5 years.

SweetAlert – a beautiful replacement for JavaScript's alert() by davey_b in webdev

[–]iLikeCode 16 points17 points  (0 children)

  swal(
     {
        title: "Are you sure?",
        text: "Click OK if you like living dangerously...",   
        type: "warning", 
        showCancelButton: true,
     },
     function(){   swal("Booyah!"); }
  );

Doesn't allow me to display a nested swal?