Posts

Showing posts from August, 2011

ruby - Rails: Is it possible to have temporary badges with Merit Gem -

i use merit gem create badges , points system on website. however, badges reset after each month. example, monthly badge of 20 comments. require users consistent on site. possible merit? know there "temporary" feature, resets badge based on if conditions no longer met, time-based way reset badges. thank you! sure: grant_on 'comments#create', badge: 'frequent-commenter', to: :user, temporary: true |comment| comment.user.comments.where(:created_at.gte => (date.today - 30)).count >= 20 end with code badge revoked if condition no longer holds

angularjs - See what states are configured in ui-router -

is there way see of states have been set on $stateprovider ? in case, state assignments distributed across many files. inspect built states on run or config in different file. for example: # component1.coffee angular.module('zoo').config ($stateprovider) -> $stateprovider.state 'component1', url: '/component1' template: _template controller: 'component1ctrl' # component2.coffee angular.module('zoo').config ($stateprovider) -> $stateprovider.state 'component2', url: '/component2' template: _template controller: 'component2ctrl' # componentnavigation.coffee angular.module('zoo').run ($state) -> console.log 'all configured states:', $state.configuredstates # doesn't exist. is there list out 2 states, component1 , component2 ? $state.get() returns array of states. includes top-level abstract state, can filter out if want. how enumerate reg

ruby - Specifying rails 4 host per environment -

using rails 4.0.0 , ruby 2.0.0 i looking @ _urls , _paths in rails console , noticed 2.0.0p247 :001 > app.host => "www.example.com" 2.0.0p247 :001 > app.root_url => "http://www.example.com/" is setting host www.example.com default behavior upon rails c startup or there config somewhere sets domain? if so, how set app.host variable/config per environment? in rails 4 console, app.host , access "integration session": seemingly placeholder console work completely. apparently, app host not configurable. see railties gem. exert v4.0.2: railties-4.0.2/lib/rails/console/app.rb module rails module consolemethods def app(create=false) @app_integration_instance = nil if create @app_integration_instance ||= new_session |sess| sess.host! "www.example.com" end end def new_session app = rails.application session = actiondispatch::integration::session.new(app)

HTML/CSS menu bar dis miss it's shape when resizing window -

i made menubar picture below , contact item in left of company item , when resize browser contact goes down , problem? here picture http://oi61.tinypic.com/64h01g.jpg html <div id="header"><h1><center>online shopping</center></h1></div> <div id='cssmenu'> <ul> <li class='active'><a href='index.html'><span>home</span></a></li> <li class='has-sub'><a href='#'><span>products</span></a> <ul> <li><a href='#'><span>widgets</span></a></li> <li><a href='#'><span>menus</span></a></li> <li class='last'><a href='#'><span>products</span></a></li> </ul> </li> <li class='has-sub'><a href='#'><span>company</span

How "Edit Online" using Firefox or Chrome? -

i've got fresh install of alfresco community edition, v4.2e. i'm able use "edit offline" internet explorer. other browsers, message: the file ... not opened online editing. 1 of following plugins required installed in browser. windows: microsoft office 2010 mac os x: sharepoint browser plug-in i have office 2007. i found this: http://www.microsoft.com/en-us/download/details.aspx?id=27106 seems right thing. installer requires 32-bit os. does know: if there plug-in works current firefox , chrome, office 2007, on 32 bit os? if using office 2010 work? i've got different plugins active in firefox, can't fouch chrome: microsoft office 2010 14.0.4730.1010 microsoft office 2013 15.0.4545.1000 (used lync) microsoft office 2013 15.0.4514.1000 i guess if download these should work fine.

css3 - How to place a table next to google chart -

i using bootstrap v3 , in 1 case opening modal. modal has single tab, tab item corresponds div. in div want place google chart , next data table. unable chart , it's data table next each other. following code used: <div id="mytabcontent" class="tab-content"> <div class="tab-pane fade active in" id="home"> <div id="chart_div"> </div> <table class="table table-bordered"> <tr> <td><b>risk</b></td> <td><b>total individuals</b></td> <td><b>%</b></td> </tr> </table> </div> <div class="ta

merging array in javascript -

this question has answer here: merge/flatten array of arrays in javascript? 52 answers is there way merge following array : var arr = [["2014-2-5", "2014-2-4", "2014-1-9", "2014-1-8"], [], ["2014-2-4"], [], []] and make : ["2014-2-5", "2014-2-4", "2014-1-9", "2014-1-8", "2014-2-4"] i tried console.log($.merge(arr )); not working. thanks use array's reduce in combination concat : arr.reduce(function(previousvalue, currentvalue, index, array){ return previousvalue.concat(currentvalue); });

c# - Insert an image into a .docx file -

i developing program has feature dynamically create docx files. title suggests, having problem inserting images docx file. 1 of issues, see it, using c# 2.0. (when answering question, stress not wish switch c# 3.0, please not try persuade me.) have taken @ msdn article @ http://msdn.microsoft.com/en-us/library/office/bb497430.aspx , when converted c# 3.0 code msdn uses c# 2.0, document not open, , gives me error: "the file testing.docx cannot opened because there problems contents," , "no error detail available." here code: imagepart ip_part; wordprocessingdocument wpd_doc = wordprocessingdocument.create("c:\\convert\\testing.docx", wordprocessingdocumenttype.document); public testing() { wpd_doc.addmaindocumentpart(); wpd_doc.maindocumentpart.document = new document(); wpd_doc.maindocumentpart.document.body = new body(); ip_part = wpd_doc.maindocumentpart.addimagepart(imageparttype.png); system.io.filestream fs_stream = new s

How to find the number value set to a specific character within a string (without counting) in python -

this question has answer here: how find occurrences of element in list? 8 answers how find occurrences of element in list? 2 answers i got project in need find of indices specific character appeared in string inputted user. example user inputs string "this test" , wanted find indices of t's in string 0, 11, 14 looked through built in commands , couldn't find real know method find this. use enumerate , list comprehension: st="this test" print([i i, c in enumerate(st) if c.lower()=='t']) or: print([i i, c in enumerate(st) if c in 'tt']) in either case, prints: [0, 10, 13] explanation first thing 'makes work' strings iterable in python: >>> st="this test" >>> c in st: ...

apache - Unable to set php_value 'soap.wsdl_cache_dir' -

i have vps server (centos 6.5) running apache 2.2.4 , php-fpm (fastcgi process manager). looking in php-fpm error_log i've noticed error every spawn php-fpm child process: warning: [pool www] child 24086 said stderr: "error: unable set php_value 'soap.wsdl_cache_dir'" i couldn't find info on warning googling. aware mean , how rid of warning? update 1: fastcgi.conf apache: user apache group apache loadmodule fastcgi_module modules/mod_fastcgi.so <ifmodule mod_fastcgi.c> directoryindex index.php

java - How to use Jarsigner on machine which dosen't have JDK -

i want use jarsigner.exe on machine don't have jdk installed or java_home set. we using installanywhere install our product , inside have bundled jre. jre doesn't have jarsigner.exe. tried included jarsigner.exe inside jre , tried use it's not working. with regards, avinash nigam to make jarsigner work jre instead of jdk. need bundle these files in jre jdk from \bin\jarsigner.exe \bin\jarsigner.exe from \bin\msvcr100.dll \bin\msvcr100.dll from \bin\jli.dll \bin\jli.dll from \lib\tool.jar \lib\tool.jar i tested , found working me.

linux - Squid Content Manipulation -

i interested in solution squid proxy manipulate html content. eg. add arbitrary html/js code page requested through proxy. possible ? i think looking icap or ecap. have worked proxies have not done either of these yet. content adaptation (icap, ecap, , others not promising in opinion) http://wiki.squid-cache.org/squidfaq/contentadaptation

cxf - Is it possible to create a SOAP web service in C/C++ over HTTP? -

is possible create soap web services (not client) on http in c or c++ , respects wsdl contract , using these frameworks/libraries : apache cxf axis2/c gsoap ?? thanks in advance :) apache cxf - no. it's written on java , can't write web services on c using cxf (jni not idea in case). axis2/c - yes! it's web service framework written on c. it's 1 of powerful web services frameworks c. can write web services scratch or generate wsdl. plain c , may need write code start working. provide more convenient interface web services engine may want use wrapper wso2 or staff. details please see answer here . gsoap - yes. it's not trivial possible.

python - How to use continuation line over-indented for visual indent? -

i'm having hard time trying fix piece of code in order fit pep8's guidelines. have tried breaking line backslash , enclosing set of brackets. furthermore, made sure second line came right after position first right bracket. if (len(self._stools[origin]) > 0 , len(self._stools[dest]) , self.top_cheese(origin).size > self.top_cheese(dest).size): raise illegalmoveerror thus, every time run pep8.py on piece of code get: toahmodel.py:94:14: e127 continuation line over-indented visual indent . i'm guessing getting "continuation line not distinguish next logical line". solution move second line indent - if (len(self._stools[origin]) > 0 , len(self._stools[dest]) , self.top_cheese(origin).size > self.top_cheese(dest).size): raise illegalmoveerror the reason self.top_cheese(origin).size @ same indent level raise illegalmoveerror , can difficult reader, because might not obvious if statement ends , actu

How to detect user uninstalled iOS App? I need push serious notification. I don't wanna lose it -

i know apple won't let know user uninstalled app. my problem have old legacy sms system send alert short message end user. of these messages serious. bottleneck gsm module has limitation when send hundreds sms users simultaneously. delay inevitable. thus, build new alert system send push notification users, if installed app. after register phone number, sms alert switched new alert system. problem old school users prefer sms rather push notification. download app, , register phone number. then, found phone doesn't have 3g data plan. deleted app without un-register phone number. my new system has no idea deleted app without unregister phone number. serious alert messages still keep sending nonexistent app 1 phones. my question there smart idea or mechanism can detect user have deleted app? apns has feedback service apple reports device token no longer active on users device. required apple check tokens feedback service , stop sending pushes devices. yo

sql - Date Styles in MySQL -

i'm trying input specific date type mysql database. the format dd-'month'-yy month abbreviated month. example, put in, 12-dec-78 december 12, 1978. i've tried inputting style date data type, reformats 0's- 0000-00-00. i've looked on mysql page , have had no luck finding data type supports format @ table creation. there type i'm overlooking or setting switch on method? you need convert date mysql friendly format. str_to_date() you: str_to_date('12-dec-78', "%d-%b-%y")

c# - How to implement click events on Microsoft Chart Control on ASP.NET MVC? -

mschart control webforms control. typical strategy including control on asp.net mvc create chart in controller render image view. here's example of how it's done . my concern since chart rendered image, not able bind chart-related events normal methods, such mouse hover on point show tooltip or click event on bar. possible on mvc? nope. not mschart control. because webforms, gets sent browser , rendered there. chart image. a lot of people use highcharts. i've used google charts.

sql server - TFS 2012 TF255062 Error after removing 'Active Directory' Role -

initially, had deployed windows server 2012 in workstation mode tfs 2012 sql server 2012 did not install sharepoint nor configured reporting services tfs everything working fine. had users created under computer management > users , roles. the client machines able connect server, developers connected tfs , tfs portal. later decided move server have ad roles installed, installed , installation of ad went fine without issues, of-course had restart server couple times , change ad name. then tried connect server "name" can, "ip" never able to, quite ok. but later tried connect tfs using vs 2012 not able connect. sql server working fine, instance name working fine working fine in regards sql server, still tfs not able connect. later decided remove ad role - did!!! after users got removed, tfs entire setting got affected , tfs virtual folder under iis got corrupted, default collections under tfs got removed. in total entire project in stake. sys

java - Working with Linked List Stacks -

public class matcher { public matchrtncode matcher(string str){ stack<character> s=new llstack<character>(); for(int =0; i<str.length(); i++){ char c=str.charat(i); if(c=='{' || c=='[' || c=='('){ s.push(c); }else if (c=='}'){ character temp=s.pop(); if(temp!='{'){ s.push(temp); return matchrtncode.unexpected_symbol; } }else if (c==']'){ character temp=s.pop(); if(temp!='['){ s.push(temp); return matchrtncode.unexpected_symbol; } }else if (c==')'){ character temp=s.pop(); if(temp!='('){ s.push(temp); return matchrtncode.unexpected_symbol; } }else{ } } character temp = s.pop(); if(temp=='{' || te

andengine - Is it possible to have an Kinematic Body that moves along x axis, but still responds to user input to move it in y direction -

using andengine i'm trying create ball move across screen @ set velocity, want able move ball when user swipes or down. have move in x direction fixturedef boxbodyfixturedef = physicsfactory.createfixturedef(20f, 0f, 0.5f); kinematicbody = physicsfactory.createboxbody(mphysicsworld, mmarblesprite, bodytype.kinematicbody, boxbodyfixturedef); mphysicsworld.registerphysicsconnector(new physicsconnector( mmarblesprite, kinematicbody)); kinematicbody.setlinearvelocity(1f, 0f); kinematicbody.setangularvelocity((float) (-math.pi)); and in onscenetouchevent have mmarblesprite.sety(pscenetouchevent.gety()); i move sprite before, since adding velocity in x direction not respond swiping screen. help if connecting sprite physics world have update body sprite follows: kinematicbody.settransform(pscenetouchevent.x/ptm_ratio, pscenetouchevent.y/ptm_ratio, 0); then have update sprites position ev

bioinformatics - PyMOL get the name of selected protein -

so i'm using pymol script find surface residues on protein (found @ http://www.pymolwiki.org/index.php/findsurfaceresidues ). , need write text file containing name of protein selected in pymol session. far i've searched, can't find pymol command name of selected protein. more experience pymol have idea on how accomplish this? thanks i think looking get_names function.

javascript - self execute function is not a function error -

var module = (function () { console.log('hello world'); }()); the above function did work upon loading, means did self executed. when want run second time, wrote module() , doesn't work, why? don't want paste entire function body run again.. i tried on angularjs btw, either $scope.moudule() or module() work me. self-execute result of attribution, you're storing result of self execution (in case nothing). try this: (module = function () { console.log('hello world'); })();

image - how to find low element from 3 dimension array -

when read color image information data in rows x cols x 3(rgb color) i want extract min value separate color originally r = i(:,:,1); g = i(:,:,2); b = i(:,:,3); to extract separate data color , find min by rmin = min(r(:)); and on... but there proper solution use min? i tried min(i(:,:,1:3)); but didn't right (dimension answer 1xcolx3 : should 1x3) my guess have use nested min. example use following command min(min(i, [], 1), [], 2) this should give result want.

Implementing and fixing a recursion method in Java -

public boolean generateproblems(integer[] nums, int start) { if (start == nums.length) { return false; } (int = -range; < range; i++) { nums[start] = nums[start] + i; system.out.println(printarray(nums)); target game = new target(nums, target); if (game.solutionsize() == difficulty) { if (!possiblegames.contains(game.getvalues())) { possiblegames.add(game.getvalues()); } return false; } if (generateproblems(nums, start + 1)) { return true; } nums[start] = nums[start] - i; } return false; } overview: in game, 24, must add, subtract, divide, , multiply 4 numbers reach target, 24. have similar, more abstract class called target, takes array of integers , counts (and solves) solutions reach given target value. i have class called targetgenerator takes "seed array", target value, range, , number of solution

Order unversioned files in PhpStorm by folder -

i wonder if there way in phpstorm ide order unversioned files (in bottom window under "9: changes" tab) folder in are, instead file name. found "group directory" button (or ctrl + p) groups files folders. this not wanted though, because in way have explore folder tree. instead, list of files (as before), ordered folder name.

Submit Button in Bootstrap 3 Modal Not Working -

i want form submit same page, left form action black. i've tried using <button type="submit"> , <input type="button"> , <input type="submit"> . here live version more context. when click "add student," click "save student info" button, nothing, close button works. here code modal. <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title">add new student</h4> </div> <div class="modal-body">

How to wake up the android app at specific time? -

i want wake whole android app daily @ 9 . tried using alarm manager of android. calls pending intent. in case not pending intent , want wake full app. following code . beginner in android development appreciated . public void setalarm() { calendar cal = calendar.getinstance(); cal.set(calendar.hour_of_day, 09); cal.set(calendar.minute, 00); cal.set(calendar.second, 0); cal.set(calendar.millisecond, 0); alarmmanager alarmmgr = (alarmmanager)getsystemservice(context.alarm_service); intent intent = new intent(this, mainactivity.class); pendingintent pendingintent = pendingintent.getbroadcast(this, 0, intent, 0); alarmmgr.set(alarmmanager.rtc_wakeup, cal.gettimeinmillis(), pendingintent); } and in mainactivity class : public class mainactivity extends activity { string ua = "mozilla/5.0 (android; tablet; rv:20.0) gecko/20.0 firefox/20.0"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(saved

javascript - NodeJS async callback. How to return the list, from a async callback? -

so making database query, posts id, add them list, can return. list returned, before callback has finished. how prevent being returned before callback has finished? exports.getblogentries = function(opid) { var list12 =[]; entry.find({'opid' : opid}, function(err, entries) { if(!err) { console.log("adding"); entries.foreach( function(currententry){ list12.push(currententry); }); } else { console.log("eeeerroor"); } //else {console.log("err");} }); console.log(list12); return list12; }; all callback asynchronous, don't have guarantee if run in order have leave them. to fix , make process "synchronous" , guarantee order executation have two solutions : first : make process in nested list: instead of this: mymodel1.find({}, function(er

php - FastCGI: aborted: select() failed -

i have vps server (centos 6.5) running apache 2.2.4 , php-fpm (fastcgi process manager). 2-3 times day following errors in error_log : [error] [client 127.60.158.1] (4)interrupted system call: fastcgi: comm server "/usr/lib/cgi-bin/php5-fcgi" aborted: select() failed [error] [client 127.60.158.1] fastcgi: incomplete headers (0 bytes) received server "/usr/lib/cgi-bin/php5-fcgi" [notice] caught sigterm, shutting down [alert] (4)interrupted system call: fastcgi: read() pipe failed (0) [alert] (4)interrupted system call: fastcgi: pm shutting down, apache seems have disappeared - bye and result apache not stops, main process stops , worker processes still run prevents me restart apache it's still listening on port 80, without main process , pid file. i saw mention update mod_fastcgi 2.4.7 (patched) fixes bug, unfortunately rhel/centos doesn't have updates, not option me. ( apache php5-fpm connection reset peer ) also there thread on google answers in

c# - wrong number of arguments provided in nunit -

developed testcase testcasesource in selenium using c#. after running test case in nunit, shows error "wrong number of arguments provided". , test case code [testfixture] class testcases { static string[] exceldata= readdata("inputdata.xls", "data", "testcase1"); [setup] public void setup() { //setupcode here } [test, testcasesource("exceldata")] public void sample (string level,string username,string password,string firstname) { //testcase code here } [teardown] public void teardown() { tstlogic.driverquit(); } the 4 values retrieved , can see values in nunit. shows error "wrong number of arguments provided". can anyaone please help? the method marked testcasesource supposed return bunch of "testcases" - each testcase set of inputs required test method. each test-input-set in case must have 4 string params. so testcase

java - I am having trouble making a directory while iterating through a text file -

i new java , trying tie separate code, "making directory" , "reading text file". have far: import java.io.*; public class filedir { public static void main(string[] args){ boolean dirflag = false; try { file myfile = new file("michael.txt"); file folder = new file("/users/chucknorr/desktop/"); filereader filereader = new filereader(myfile); bufferedreader reader = new bufferedreader (filereader); string line= null; while((line= reader.readline()) != null) { dirflag = folder.mkdir(line); } reader.close(); } catch(exception ex){ ex.printstacktrace(); } } } i understand not correct, failed attempt tie code together. dirflag = folder.mkdir(line); any appreciated, thanks! there's no such method file#mkdir(string) instead use... file subfolder = new file(folder, line); if (!subfolder.mkdirs()) { // dea

quickblox - How to find Places near a certain location -

i know how add place , places in android how find places near location (lati, long). i see place has geodata associated , can retrieve geodatas near location api retrieve geodata retrieves users near location not places. so in android possible find places near location (just can find users near location)? thanks. there ways it: load places , sort in on mobile side use geodata place entity

php - How to write this query in Laravel 4? -

i search net not find solution problem, codeigniter developer , started project in laravel my query in codeigniter active record this: public function show_brt($id = 0,$tax_cat_id,$lang="en") { $records = $this->db ->select(' t1.id, t1.date_received, t1.customer_name, t1.memo, t1.percent_tax_withheld, t1.gross_invoice_amount, t1.tax_amount_withheld, t1.net_amount_received, t1.tax_payment_date, t2.rate, t3.name_' . $lang. ' deposit_account' ) ->from('brt t1') ->join('exchange_rate t2', 't2.id = t1.exchange_rate_id','left') ->join('balance_sheet_accounts t3', 't3.id = t1.deposit_account_id','left') ->where('t1.income

settimeout - Set and hold a variable in javascript -

i have 3 javascript functions: function updatetest() { if (totalmin == "0") { coolvar = "start"; } else { coolvar = "stop"; } } setinterval(updatetest, 1000) var audvar = setinterval(function () { cooltrigger() }, 60000); function cooltrigger() { updateaudio(coolvar); } i need design function checks state of coolvar same interval, updates html code once upon coolvar=start. should hold , not update variable 60 seconds , returns previous state. function updateaudio(coolvar) { var a_str; if (coolvar == "start") { a_str = '<audio autoplay source src="audio/coolsound.mp3" type="audio/mpeg"></audio>'; } if (coolvar == "stop") { a_str = '<!--coolsound go off @ 0:00 timer -->'; } document.getelementbyid('audio_span').innerhtml = a_str; } //settimeout(updateaudio, 6000); at moment usin

javascript - Need to generate randoms alphabets on each time page load -

i need generate random letter a-z multiple times on page when refresh or reload. may bit confused here whether can create array storing alphabets , use .random method of javascript . i'm pretty sure need use random here. there other simple way doing in jquery. i don't think there's simpler way of doing jquery. you'll have use random method generate desired text. try like: function generaterandomtext(n) { var text = ''; (var = 0; < n; i++) { text += string.fromcharcode(65 + math.floor(math.random() * 26) + 32 * (math.round(math.random()))); } return text; } the math.floor(math.random() * 26) bit picks letter, , math.round(math.random()) gives random 0 or 1 value, decides case(upper , lower respectively) demo

c# - Generic Return Type -

i write class provides me decrypted values given domain model. following logic works fine, don't know declare in place of xxxxxx . sample domain model: public class emp { public string empname{get;set;} } i call decryptbyobject method like: var x = decryptbyobject(emp,key); decryptbyobject method: public xxxxx decryptbyobject(xxxxxx myobject, string decryptkey) { type t = myobject.gettype(); foreach (memberinfo mi in t.getmembers()) { try { if (mi.membertype == membertypes.property) { string value = ((propertyinfo)mi).getvalue(myobject).tostring(); var bytes = convert.frombase64string(value); var decryvalue = machinekey.unprotect(bytes, decryptkey); ((propertyinfo)mi).setvalue(myobject, encoding.utf8.getstring(decryvalue)); } } catch (exception ex) { } } return myobject; } you should use below

c++ - I want to design E-mail client design -

i want design email client , environment in c++ languagewhich can provide similar facilities gmail client has. can tell me things need read , follow? or help? read lot of books , web pages smtp , imap , email clients , mta . consider using qt , libraries vmime study source code of several free software email clients mutt , evolution , kmail .... be familiar linux, read advanced linux programming . you might need several years of work.

android - Refresh tab fragment page on scroll -

i have 3 fragment tabs in viewpager. fragment1 contains listfragment , fragment2 contains listfragment. after clicking item in fragment2, should go fragment1 , refresh list. (the list populated via web service using gson). fragment2 passes value fragment1 can reload according parameter carried along. i've tried many ways refresh/update state of list in fragment1 including reloading whole fragment1 oncreateview , using fragmenttransaction , calling host activity within itself. still couldn't find way make it. also noticed upon scrolling tab 3 , tab 1, refreshes it. doesn't refresh list tab 2 tab 1. read solution in suggests set viewpager.setoffscreenpagelimit(0); , still problem persists. here code currently. in host activity ( usershopactivity ), i've implemented interface listener fragment2 ( usercategoriesfragment ) obtain category_id passed fragment1 ( useritemsfragment ): public class usershopactivity extends fragmentactivity implements

javascript - Ajax not working. I need the header and footer not to reload every time. Can you help me? -

i need header , footer not change in webpages simple ajax code have copied stackoverflow.com. not working. please me. <html> <head> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#activities").click(function(){ $("#body").load("activities.html"); }); }); </script> </head> <body> <div id="header"> <a href="#" id="#activities">activities</a> header. </div> <div id="body"> <p> body. <p> </div> <div id="footer"> footer. </div> </body> </html> yo

java - Spring Integration AMQP - Wrong JSON type on Response -

i'm using spring integration & si amqp 3.0.0-release. i have simple request-response on amqp between 2 si instances. i'm finding when response arrives on requesting server, si attempting deserialize response using the request object's type, not response object. ie., given gateway interface of: public analyticsreponse getanalyticsreport(entitymessage objecturi); i find though correct json of analyticsresponse arrives on server, si attempting deserialize entitymessage , failing. i've debugged through, , suspect cause responding side copying inbound json__typeid__ header, rather supplying it's own. however, can't see i've misconfigured this. here's config -- have done wrong? requesting side: <int:channel id="analytics.reports.requests.channel" /> <int:channel id="analytics.reports.responses.channel" /> <int:gateway service-interface="com.project.analytics.gateway.analyticsreportinggateway

express - "not listed in package.json" , node.js while installing NTVS -

Image
in red box following status show modules.. can me.. advance open command prompt , cd project directory (you can right-click project in solution explorer , choose open command prompt here... ). type npm init , fill in fields when prompted (or hit enter take default). output should this... c:\anthony\demo\expressapp1\expressapp1>npm init utility walk through creating package.json file. covers common items, , tries guess sane defaults. see `npm json` definitive documentation on these fields , do. use `npm install <pkg> --save` afterwards install package , save dependency in package.json file. press ^c @ time quit. name: (expressapp1) version: (0.0.0) description: entry point: (app.js) test command: git repository: keywords: author: license: (isc) write c:\anthony\demo\expressapp1\expressapp1\package.json: { "name": "expressapp1", "version": "0.0.0", "description": "", "main":

javascript - Regular expresssion to validate zipcode/postal code -

i want validate zipcode or pincode in address fields. that's why trying write regular express except a-z (upper , lower both), 0-9 numbers, round breckets (eg. '()' ) , hyphen (-) , space. rules must followed single white space can not on first position, 2 or more white space can not allowed. some of invalid entries 1254588 125 255 ((125)) 255 125--255 (125) (255) 125>2458 el$ 2458 @l$ 2458 if rules matter, it's easy: ^ # start of string (?! ) # first character mustn't space (?!.* ) # no 2 spaces in row [a-za-z0-9 ()-]* # match number of these allowed characters $ # end of string or, javascript: /^(?! )(?!.* )[a-za-z0-9 ()-]*$/ but i'm guessing strings "))))((((" , "-------" , "a" or "" shouldn't matched, allowed rules.

rpmbuild - Bad exit status from /var/tmp/rpm-tmp.b1DgAt (%build) -

i trying compile tizen source code. compilation tools uses rpm build environment. while compiling specific package i'm getting rpm build issue "bad exit status /var/tmp/rpm-tmp.b1dgat (%build)" here build log building cxx object cmakefiles/osp-messaging.dir/src/fmsg_pushurlrequestlistener.cpp.o [ 8s] [ 69%] building cxx object cmakefiles/osp-messaging.dir src/fmsg_wappushmanagerimpl.cpp.o [ 8s] [ 71%] building cxx object cmakefiles/osp-messaging.dir/src/fmsg_wappushmessageimpl.cpp.o [ 8s] [ 73%] building cxx object cmakefiles/osp-messaging.dir/src/fmsg_composerevent.cpp.o [ 8s] [ 75%] building cxx object cmakefiles/osp-messaging.dir/src/fmsg_composereventarg.cpp.o [ 8s] [ 77%] building cxx object cmakefiles/osp-messaging.dir/src/fmsg_recipientlistimpl.cpp.o [ 8s] [ 79%] building cxx object cmakefiles/osp-messaging.dir/src/fmsg_smsevent.cpp.o [ 8s] [ 81%] building cxx object cmakefiles/osp-messaging.dir/src/fmsg_smseventarg.cpp.o [ 9s] [ 83%

windows - C++ casting to base and "overwriting" vptr issue -

i reading new c++ challenge: http://blogs.msdn.com/b/vcblog/archive/2014/02/04/challenge-vulnerable-code.aspx the supplied code if full of issues, obvious programming habits, visible c++ natives :-) it described in comments, 1 particular line (37) particularly dangerous: imagefactory::debugprintdimensions((imagefactory::customimage*)image); the function calls virtual method of customimage (defined first time in customimage ). this allegedly causes first member of customimage treated vptr of instance (it's unique_ptr actually) , make binary pointed treated executable (perhaps malicious) code.. while can understand this, wonder why work. customimage virtual class, (probably) first 4 bytes (just assume x86) vptr, , unique_ptr member next.. , since cast doesn't seem shifting anything... ... how possible execute data held unique_ptr ? my take (and i'm more happy corrected): here, customimage polymorphic class (with vptr first "member&quo