Posts

coffeescript - calling 2 https requests simultaneously in hubot coffescript -

module.exports = (robot) -> robot.respond /log (.*)/i, (msg) -> group = "test" incident_message = msg.match[0] service_key = keys[group] curtime = new date().gettime() incident_key = "hubot/#{curtime}" reporter = msg.message.user.name query = { "service_key": service_key, "incident_key": incident_key, "event_type": "trigger", "description": "change log #{reporter}", "details": "#{incident_message}" } string_query = json.stringify(query) content_length = string_query.length msg .http("https://events.pagerduty.com/generic/2010-04-15/create_event.json") .headers "content-type": "application/json", "content-length": content_length .post(string_query) (err, res, body) -> result = json.parse(body) if result.status == "su...

the amount of dynamic allocated memory a pointer would take in c++ -

i have program: #include <iostream> using namespace std; int main(){ const int size = 1000; typedef int* intpointer; intpointer ip; { ip = new int[ size ]; cout << "memory allocated " << endl << flush; } while (ip != nullptr); } this code suppose test amount of memory used ip every time loops. tried print out value of ip, memory address in hex believe, can see everytime loops once, address increase 4000 in dec. so, correct every ip take 4000 bytes memory? wondering if there function value of memory used every ip? if not, how size of cumulative memory use within loop? appreciate answer. thank you! i don't know why have allocate memory know this. to size of 1 pointer use below, cout << "memory allocated 1 intpointer :"<<sizeof(intpointer); to size of 1000 int* objects use below, cout << "memory allocated "<< size <<" intpointers :"<<sizeof(intpointer*size ); ...

How to implement complicated animation at android platform -

  now developing android app, , there lots of animations , image resources, ui design , logic complex.   i tried use tween animation , android layout implement, code complex, , can't implement parts of animations. know how handle such complex animation @ android platform? dose android have tool flash tool design animation? in android 3 type of anmiations. 1)translateanimation an animation controls position of object 2)scaleanimation an animation controls scale of object. can specify point use center of scaling. 3)alphaanimation an animation controls alpha level of object. useful fading things in , out. animation ends changing alpha property of transformation check example.

Limit on number of subscriptions per azure account? -

i know can create multiple subscriptions per azure account. there limit on number of subscriptions in single windows azure account ? not i'm aware of. don't see @ http://msdn.microsoft.com/en-us/library/windowsazure/hh531793.aspx suggest limit.

assembly - Encoding ADC EAX, ECX - 2 different ways to encode? (arch x86) -

i'm looking through intel instruction set manual, , looks there 2 different forms of adc match/encode adc eax, ecx follows: adc r/m32, r32 (11 /r , encodes 11c8) or adc r32, r/m32 (13 /r, encodes 13c1) my question (given did math correctly), 11c8 , 13c1 equivalent? factors assembler consider in selecting 1 encoding on another? question perspective of implementing assembler, question in general, not particular hypothetical instruction. if it's lengthy answer, please point me in right direction attempts @ googling failed. this redundancy of instruction encoding. architecture use multiple parameters in instruction has this. think of risc architecture have add rx, ry, rz assigns sum of ry , rz rx can encode add rx, ry, rz or add rx, rz, ry , they'll equivalent. in x86 (normally) have 2 parameters each instruction can select direction between them since can store or read memory. if don't use memory can choose direction between 2 registers,...

android - How to getItemID from sqlite with BaseAdapter? -

i have sqlite column defined this: public final static string s_id = "_id"; public final static string s_photopath = "photopath"; public final static string s_name = "name"; public final static string s_pos = "pos"; public final static string s_score = "score"; public final static string s_fixed = "fixed"; i'd getitemid sqlite helper class adapter class extends baseadapter. here code: public class page1listadapter extends baseadapter { private layoutinflater adapterinflater; public cursor mcursor; tagview tag; public page1listadapter(context context, cursor cursor) { super(); mcursor = cursor; adapterinflater=layoutinflater.from(context); } @override public int getcount() { return mcursor.getcount(); } @override public view getview(int position, view convertview, viewgroup parent) { if (convertview == null) { tag ...

android - How to set ImageView using Bitmap Array -

i'm doing 1 demo of getting image urls through json , after getting ulr i'm downloading images , display them gridview . storing downloaded images i'm using bitmap array , passing imageadapter . , want display images on next activity on imageview i'm using following code in second activity.. // intent data intent = getintent(); // selected image id int position = i.getextras().getint("id"); imageadapter imageadapter = new imageadapter(this); imageview imageview = (imageview) findviewbyid(r.id.full_image_view); imageview.setbackgrounddrawable(imageadapter.bm[position]); but giving me error the method setimagedrawable(drawable) in type imageview not applicable arguments (bitmap) . please tell me how can set image bitmap array imageview .. imageadapter class: public class imageadapter extends baseadapter { private context mcontext; public bitmap bm[]=new bitmap[4]; imageview imageview; // const...