syntax

iMacros w EVAL([javascript]} FORMAT errors on attempts and no solution

TAB T=1 TAB CLOSEALLOTHERS CLEAR SET !ENCRYPTION NO SET !EXTRACT_TEST_POPUP NO SET !ERRORIGNORE NO SET !EXTRACT NULL ‘ ‘ following line has error “”Error -1100: Wrong format of SET ThisPort EVAL(…)”” SET ThisPort EVAL(” var X=(‘ for (i = 3016; i <= 3065; i++) { for (j = 1; j <= 3; j++) } ‘); X; “) ‘ ‘PROMPT JS.output={{ThisPort}}…
Read more

Why do I get a syntax error? – Python [on hold]

Why do I get a syntax error at if i % 2 == 0, line 9? I am decent at Java, but just started transferring to python so not sure if I made a stupid mistake. EDIT: To be more clear it says – TabError: inconsistent use of tabs and spaces in indentation EDIT: SOLVED PLEASE IGNORE. Error was due…
Read more

How to differentiate between assigning and declaring values from a function with multiple returns?

When retrieving multiple returns from a function, I get that you can declare variables for the values on the fly by using := or assign the values to already existing variables by simply using =. My issue occurs when I want to assign one of the return values to an already existing variable while declaring a new variable for the…
Read more

Javascript for loop without recalculating array’s length

In my Javascript reference book, for loops are optimized in the following way: for( var i = 0, len = keys.length; i < len; i + +) { BODY } Apparently, doing “len = keys.length” prevents the computer from recalculating keys.length each time it goes through the for loop. I don’t understand why the book doesn’t write “var len =…
Read more

Disable specific Ruby regex pattern matching in Vim for performance

I am using vanilla Vim and syntime reports the following costly patterns: TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN 3.526224 3751 1542 0.036641 0.000940 rubySymbol []})”‘:]@<!%(h|[^x00-x7F])%(w|[^x00-x7F])*[!?]=:s@= 1.278366 3465 1254 0.012201 0.000369 rubySymbol %([{(,]_s*)@<=lw*[!?]=::@! 0.730820 2211 0 0.008430 0.000331 rubyPredefinedConstant %(%(.@<!.)@<!|::)_s*zs%(STDERR|STDIN|STDOUT|TOPLEVEL_BINDING|TRUE)>%(s*()@! 0.626906 2211 0 0.006168 0.000284 rubyPredefinedConstant %(%(.@<!.)@<!|::)_s*zs%(MatchingData|ARGF|ARGV|ENV)>%(s*()@! 0.515706 2211 0 0.004109 0.000233 rubyPredefinedConstant %(%(.@<!.)@<!|::)_s*zs%(DATA|FALSE|NIL)>%(s*()@! 0.337235 2211 0 0.007179 0.000153 rubyPredefinedConstant…
Read more

Convert longhand YAML syntax to shorthand YAML syntax

I have a YAML file that has been written in the long syntax children: – type: section subtype: false title: Top-wrapper attributes: { } children: – type: section subtype: false title: Second-wrapper attributes: { } children: – type: section subtype: false title: Header attributes: { } children: – type: container subtype: false title: Untitled attributes: { } children: – type:…
Read more

for loop compilation errors

public class contains { public static void main(String[] args) { int[] array = new int[] {0, 1, 2, 3, 4}; int sum = 0; for (i=0, i<=array.length, i++) { if (array[i] == 4) { return sum; } sum++; } return 0; } } I’m not sure why this code above fails. When I try to compile it, I get errors…
Read more

gen_server handle_info/2 clarification

While reading through Erlang and OTP in action, I ran across some weird syntax regarding records that I’m having trouble wrapping my head around. I’m hoping someone can clarify what’s going on in the handle_info for timeouts here: handle_info({tcp, Socket, RawData}, State) -> do_rpc(Socket, RawData), RequestCount = State#state.request_count, {noreply, State#state{request_count = RequestCount + 1}}; handle_info(timeout, #state{lsock = LSock} = State)…
Read more