Posts

java - Secure jsonp ajax calls -

i have developed restful web-service returns jsonp objects. using web-service in simple html page using ajax calls. means @ client side there html page access web-service. no server used @ client side. running page browser. problem can access web-service have implemented. want make secure kind of authentication. have read solution send token along request @ client side don't have server or anything, simple html page. please me solution secure web-service. javascipt function call webseive: function calculatepremium(investmentamount,month, premium) { var url = "http://192.1.200.107:8080/webresources/avestwebservice/getpremium"; var payloaddata = { amount: $("#"+investmentamount).val(), period: $("#"+month).val() }; $.ajax({ type: "get", url: url, cache:false, crossdomain:true, data: payloaddata, datatype: "jsonp", success: function (data,textstatus,jqxhr) { $("#...

Enum with functions in C -

while examine source code of ffmpeg, see line: enum avdurationestimationmethod av_fmt_ctx_get_duration_estimation_method (const avformatcontext* ctx); what functionality of enum here? av_fmt_ctx_get_duration_estimation_method function returns object of enum type avdurationestimationmethod .

Animation with large number of sprites in Cocos2d iOS? -

i have animate(dancing) character(guy) 6-7 seconds i.e 500-600 frames . have done animation before creating spritesheets using zwoptex , loading ccspriteframecache && ccspritebatchnode of the great ray wenderlich . in case frames heavy in number not sure if ios device able sustain it. best process animate these frames little overhead possible. can change fps while animating? idea anyone?? here put code use add animated image without use texturepacker : ccsprite *dog = [ccsprite spritewithfile:@"dog1.gif"]; dog.position = ccp(winsize.width/2, winsize.height/2); [self addchild:dog z:2]; nsmutablearray *animframes = [nsmutablearray array]; for( int i=1;i<=5;i++) { nsstring* file = [nsstring stringwithformat:@"dog%d.gif", i]; cctexture2d* texture = [[cctexturecache sharedtexturecache] addimage:file]; cgsize texsize = texture.contentsize; cgrect texrec...

Access 2007 button click event error -

i have following code in access vba on button click event. idea use temporary variable forward value textbox subform: private sub button_novi_ir_click() on error goto button_novi_ir_click_err on error resume next tempvars("brojrn").value = me.brojrntxt docmd.openform "podaci_o_izvrÅ enim radovima_form", acnormal, "", "", acadd, acnormal if (macroerror <> 0) beep msgbox macroerror.description, vbokonly, "" end if button_novi_ir_click_exit: exit sub button_novi_ir_click_err: msgbox error$ resume button_novi_ir_click_exit end sub each time click button error message "a problem occurred while ms office access communicating ole server or activex control". have no idea it. so, please can point me in right direction? thanks in advance! i don't know whether accented character in form name issue - i'll assume isn't. shouldn't supply empty st...

Using GWT UiBinder, Eclipse marks every UiField as an error -

this annoyance, not serious problem, bothers me can't figure out. have gwt project , eclipse marking every @uifield tag error "field x has not corresponding field in template file." when true compile error , can fix it. of time compiles , runs fine, though files full of red squiggly underlines. i assume i'm missing basic eclipse skill since can't find else problem. i've tried doing refresh on project. i having same issue. not code issue suggested @ruggi project compiles , runs correctly. i solved problem updating gwt install. found there update available via -> check updates. after install , reboot problem solved.

sql - Create a 350000 column csv file by merging smaller csv files -

i have 350000 one-column csv files, 200 - 2000 numbers printed 1 under another. numbers formatted this: "-1.32%" (no quotes). want merge files create monster of csv file each file separate column. merged file have 2000 rows maximum (each column may have different length) , 350000 columns. i thought of doing mysql there 30000 column limit. awk or sed script job don't know them , afraid take long time. use server if solution requires to. suggestions? this python script want: #!/usr/bin/env python2 import os import sys import codecs fhs = [] count = 0 filename in sys.argv[1:]: fhs.append(codecs.open(filename,'r','utf-8')) count += 1 while count > 0: delim = '' fh in fhs: line = fh.readline() if not line: count -= 1 line = '' sys.stdout.write(delim) delim = ',' sys.stdout.write(line.rstrip()) sys.stdout.write('\n') fh i...

c++ - g++ Bug with Partial Template Specialization -

i writing tmp-heavy code g++ (version 4.8.1_1, macports) , clang++ (version 3.3, macports). while g++ rejects following code listing unbridled fury , clang++ compiles grace , splendor . which complier in right? (i suspect it's g++, want reassurance others before submitting bug report.) do have easy or elegant workarounds suggest? (i need use template aliases, switching on structs, causes g++ accept code, not option.) here code listing, made just you . template <class... ts> struct sequence; template <int t> struct integer; // definition of `extents` causes g++ issue compile-time error. template <int... ts> using extents = sequence<integer<ts>...>; // however, definition works without problems. // template <int... ts> // struct extents; template <int a, int b, class current> struct foo; template <int a, int b, int... ts> struct foo<a, b, extents<ts...>> { using type = int; }; template <int b, int....