Posts

Showing posts from July, 2015

ASP.NET MVC TASK MANAGER one-to-many relationship -

i trying learn asp.net mvc have started build small application - task manager based on tutorials on internet (mvc music store, nerd dinner, etc ...). ive got stuck while trying define actionresult method in controller. i have model, defining activities. each activity can have several tasks. activity 1 (each activiy has got several tasks (task 1, task 2, etc)) activity 2 activity 3 activity n question: i ask definition of actionresult method, return view list of tasks related selected activity. picture here: http://sdrv.ms/z46nze the problém is, not able define method one-to-many relationship. whole project here in skydrive folder: http://sdrv.ms/zicbqi please help. in model, have following classes , context class generated mvcscaffolding: using system; using system.collections.generic; using system.linq; using system.web; using system.componentmodel.dataannotations; using system.componentmodel.dataannotations.schema; namespace task3.models { public class tas

ios - UITableViewCell with a custom selectedBackgroundView that is wider than the master view controller on a UISplitViewController -

Image
i have ipad app uisplitviewcontroller displayed on landscape. master controller uitableviewcontroller. i want have selectedbackgroundview cells on uitableviewcontroller overflowing detail viewcontroller. this: how can accomplish that? if try set red arrow image (that 342px wide), gets resized 320px. tried subclassing uiimageview , overriding setframe ignore calls try resize image, still no luck. any ideas? (updated on 2013-10-01 make work on ios7) kudos user erway software helping me out. here how got code work: on uitableviewcontroller: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { // ... uitableviewcell *cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:@"someid"]; uiimage *image = [uiimage imagenamed:@"image_name"]; selectionimageview *imageview = [[selectionimageview alloc] initwithimage:image]; [cell setselectedba

javascript - What is the 'iterator' function in Firebug? -

in firebug, when looking @ getelementsbytagname array, of type htmlcollection see following functions listed: item() iterator() nameditem() i know how use item(number of item) , nameditem(name of item) . use of iterator() ? i couldn't find answer, i'm asking here. it's method javascript calls when iterate on object using for…of loop, instance. see: http://wiki.ecmascript.org/doku.php?id=harmony:iterators#for-of_loop_bodies an example: var myobj = { iterator: function() { (let = 0; < 5; i++) yield i; } } (let value of myobj) console.log(value); see yield . in case of htmlcollection helps write code like: let divs = document.getelementsbytagname("div"); (let div of divs) { // `div` }

c# - Debugging Dllimport code -

is possible see/debug code c# compiler generates methods dllimport attribute? tried stepping method defined dllimport attribute inside vs debugger not allow me this. in disassembly view can see call instruction particular address, when hit f11 key (step into) steps on it. have "enable native code debugging" checkbox checked in project properties. update if understand correctly, compiler performs operations when sees dllimportattribute attached method. couldn't find in dllimportattribute class documentation. source code dllimportattribute class has basic class definition. in debugger when calling external function can see call ffa0c0c8 assembly instruction , when step it, moves imported function body, imported function has different address ffa0c0c8. couldn't change disassembly view address. looks dll loading logic inside function, debugger skips. i'm wondering if library function or function generated compiler? you can debug p/invoke calls if

eclipse call hierarchy incomplete -

when execute call hierarchy (eclipse indigo) results receive fewer know exist. strange thing functionality seemed working few weeks ago. when run same operation on same workspace in juno call hierarchy results expect. does eclipse auto-update under covers? else might cause this?

coursera, "Functional Programming Principles in Scala", Setting up IntelliJ on OSX -

the "functional programming principles in scala" coursera prepared eclipse. here there tutorial using intellij instead of eclipse course: http://www.guardian.co.uk/info/developer-blog/2012/sep/21/funtional-programming-principles-scala-setting-up-intellij however, fails with: sbt gen-idea [error] not valid command: gen-idea [error] expected '/' [error] expected ':' [error] not valid key: gen-idea [error] gen-idea [error] ^ what can problem? based on error looks don't have sbt intellij plugin installed. need add depencency sbt config : addsbtplugin("com.github.mpeltonen" % "sbt-idea" % "1.3.0") you can add line your_project/project/plugins.sbt - work have each project (note might have create plugins.sbt). a more convenient way : add dependency in ~/.sbt/plugins/build.sbt - way, plugin available each time start sbt, regardless of project specific config.

Pass parameter by "in" Delphi -

i need pass parameter sql in delphi using bde using "in", example below: select * customers id in (:p_in) i need pass: p_in list of customers. query.parambyname.('p_in').asstring: = '1, 2,3 ', , did not work .. have make array? or passed asvariant? try : p_in : string ; := 0 customerlist.count p_in := p_in +customerlist[i] + ','; myquery.text := 'select * customers id in (' + p_in + ' )' ;

backbone.js - Backbone collection export issues -

i have collection of users (model user) model has boolean value: isexport have button on click supposed post server users isexport=true can suggest suitable solution problem? i know it's possible wrap collection model , overwrite tojson function couldn't manage far (can please give code example?) app.user = backbone.model.extend({ defaults: {isexport: false}...}); app.users = backbone.collections.extend({model: app.user...}); thanks! roy backbone collections default don't have write operations server, you'll need add new method collection subclass such doexport , use .where models isexport=true , tojson() array of objects can send server backbone.sync or $.post .

ios - Animating a box drawn in drawRect via CGMutablePathRef -

my aim drow empty rounded box, should appear hole, onto uiview show what's under. made overriding drawrect method shown below. gives me ability create rounded rect of size of holerect property (which cgrect), drop inner shadow , place on view, clearing (using clearcolor , cgcontextsetblendmode(context, kcgblendmodesourceout) )the area covered box , revealing what's behind view (i took code this question , modified it) . problem have move , resize rect animation, , can't find way so, maybe choose wrong way i'm not expert in drawing hint appreciated. - (void)drawrect:(cgrect)rect { //i set frame of "holey" rect cgrect bounds = self.holerect; cgcontextref context = uigraphicsgetcurrentcontext(); cgfloat radius = 20; //fill whole view gray cgcontextsetfillcolorwithcolor( context, [uicolor colorwithred:.5 green:.5 blue:.5 alpha:.8].cgcolor ); cgcontextfillrect( context, rect ); // create "visible" path, shape gets inner shadow // in case i

Assemble AMF request with Ruby RocketAMF -

Image
i make amf request body same followings (charles log): as show in charles, has , "command" value object , "cclocalplayerchanges" value object. confused value such object, how can make them using rocketamf? i have tried using hash such object: data = [{ :method => "load", :service => "start.game", :player_delta => {:stamina => 0}, :sequence_num => self.sequence_num, :transaction_time => time.now.to_i.to_s, :icp => 0, }] env = rocketamf::envelope.new :amf_version => 3 env.messages << rocketamf::message.new('batchcontroller.authenticate_iphone', '/1', data) body = env.to_s res = restclient.post "http://localhost/amf", env.to_s, :content_type => 'application/x-amf' or classmapping: class classcommand; attr_accessor :service, :sequence_num, :transaction_time, :icp; end; command_obj = classcommand.new com

sql server - Select a table by value inside BLOB column -

we use ado , sql server. our table has blob column xmlfield , inside blob store complete xml file information. <xml> .... much text , fields .... <\xml> reading , writing xml field no problem how can build query select datasets xmlfield contains text / word select * mytable xmlfield contains special word or select * mytable xmlfield contains special field , has special value

ruby - Rails: Testing Cron Jobs in development environment -

i have custom environment called 'reports' setup hit slave database. trying configure cron jobs using whenever gem , want test them in development before deploy. there way test cron jobs in development? there anyway schedule them locally , start reports server , see if run? thank you! i start off reviewing how gem ( whenever gem ) conducting tests. extract 1 of their functional test : context "weekday @ (single) given time" setup @output = whenever.cron \ <<-file set :job_template, nil every "weekday", :at => '5:02am' command "blahblah" end file end should "output command using time" assert_match '2 5 * * 1-5 blahblah', @output end end

playframework 2.0 - How to set the header of a response in production mode in play 2 -

i made website lets users upload images , serves them back. lower load i've tried use client side caching so: byte[] data = files.readallbytes(path); response().setheader(cache_control, "max-age=3600"); response().setheader(etag, image); return ok(data); this works fine in development mode (play run) when run site in production mode headers gone , nothing cached. thanks

android - Dynamically display imagebuttons in AsyncTask -

so retrieving images parse , dynamically displaying them in scrollview linearlayout, can't seem add clicklistener or add them view. here's have: mytaskparams params = new mytaskparams(drinklist.get(j).getstring("name"), data, lpos, drinklist.get(j).getobjectid(), j); mytask mytask = new mytask(); mytask.execute(params); and in pass data , try adding imagebutton view. private static class mytaskparams { string name; byte[] data; int lpos; string id; int j; public mytaskparams(string name, byte[] data, int lpos, string id, int j) { this.data = data; this.name = name; this.lpos = lpos; this.id = id; this.j = j; } } private class mytask extends asynctask<mytaskparams, void, mytaskparams> { @override protected mytaskparams doinbackground(mytaskparams... params) {

Delphi obtain stack trace after exception -

i'm trying figure out how obtain stack trace after exception thrown in delphi. however, when try read stack in application.onexception event using function below, stack seems flushed , replaced throwing procedures. function getstackreport: ansistring; var retaddr, walker: ^pointer; begin // ... // history of stack, ignore esp frame asm mov walker, ebp end; // assume return address present above ebp while cardinal(walker^) <> 0 begin retaddr := walker; inc(retaddr); result := result + addressinfo(cardinal(retaddr^)); walker := walker^; end; end; here's kind of results i'm getting: 001a63e3: tapplication.handleexception (forms) 00129072: stdwndproc (classes) 001a60b0: tapplication.processmessage (forms) that's not i'm looking for, although it's correct. i'd retrieve stack before exception thrown, or in other words contents before (after too) onexception call. is ther

r - how to find the list of different geoms and aesthetics -

this question has answer here: is there table or catalog of aesthetics ggplot2? 2 answers i trying find list of aesthetics , geoms in ggplot2 package r , problem help(qplot ) not yield results. can not find way invoke aesthetics or geoms. what correct way invoke aesthetics in r? the best approach can think of @ help(aes) gives links to help(aes_colour_fill_alpha) help(aes_group_order) help(aes_linetype_size_shape) help(aes_position) which summarize various aes sub groups. you 1 of these if search particular aes theic (eg help(alpha) or help(group) for list of geoms, @ index help, under g . perhaps when documentation layer completed (or started) spur similar listing / sub grouping. you extract relevant exported objects within ggplot2 namespace using ls(pattern = '^geom_', env = as.environment('package:ggplot2')) ## [1] &qu

Java XML Transform - Strange Issue -

i having strange issue cannot seem figure out. until now, transform methods seemed have worked flawlessly, tool building causing me major headaches. here methods: this 1 works without error , produces proper xml public static void transform(string filename, string filepath, string stylesheetpath, string outputto, boolean prettyprint, boolean excludedeclaration) throws transformerexception, ioexception { if (!new file(outputto).exists()) new file(outputto).mkdir(); transformerfactory factory = transformerfactory.newinstance(); source xsl = new streamsource(new file(stylesheetpath)); templates template = factory.newtemplates(xsl); transformer transformer = template.newtransformer(); if (!prettyprint) { transformer.setoutputproperty(outputkeys.indent, "no"); } else { transformer.setoutputproperty(outputkeys.indent, "yes"); transformer.setoutputproperty("{htt

Is there a way to temporarily turn off exception dialogs in the Delphi 5 IDE without implementing an own exception handler? -

this question has answer here: how let delphi know i've handled exception? 4 answers i've got old delphi 5 project bug needs fixed. it loads right delphi 5 ide, on execution lot of indy exceptions are handled correctly program "connection closed gracefully". these not part of bug i'm trying fix, since exception dialogs displayed again , again it's unbelievable pain debug app. is there way temporarily turn off exception dialogs in delphi 5 ide without implementing own exception handler ? helpful when specific exception dialogs "connection closed gracefully" not displayed. in debugger settings there option 'break on language exceptions'. turn off (uncheck). can anytime, in middle of debugging session. if option switched on, debugger break when exceptions raised, if code subsequently handles them. important in

mysql get X(point) along with join -

i trying run select query joining multiple tables. ont of tables has got column coordinate point type. works correctly in joins not allow me select x(coordinate) or x(point(coordinate)). i can select coordinate in join , can select x(coordinate) directly on table both dont work. select x(coordinate) location_coordinate the above 1 works select ca.campus_id, ca.campus_name, ca.status_code, ca_loc.location_id, ca_loc.address, ca_coo.coordinate, ca_loc.locality_id, ca_loc.area_id, ca_loc.city_id, ca_loc.state_id, loc_locality.name locality_name, loc_area.name area_name, loc_city.name city_name, loc_state.name state_name campus_account ca left join location ca_loc on ca_loc.location_id=ca.location_id left join location_coordinate ca_coo on ca_loc.location_id=ca_coo.location_id left join location_master loc_locality on(ca_loc.locality_id = loc_locality.location_master_id) left join location_master loc_area on(ca_loc.area_id

Kendo-UI Grid in a Tab -

i looking using kendo ui web on new html5 web app , wireframes call grids inside tabs. looked everywhere on telerik's site, , web, don't see examples of being done. not possible? or there better approach, using tab control above area grid control appear, giving appearance grid part of tab? there should nothing stopping using kendo ui grid within kendo ui tabstrip. check out demo tabstrip , demo grid . gets on way.

ruby on rails - Sidekiq Delayed Mailer not sending emails -

good afternoon, i'm trying use sidekiq/redis send emails in background. should note following: i using devise-async , works no issues my actionmailer settings good if change mailer calls usermailer.contact_email(name).deliver! email sends fine. not working usermailer.delay.contact_email(name) i can see jobs going through in logs, , you'd go far assume mails making through. when sent myself noticed wasn't working: apr 08 18:36:58 app01-production sidekiq: 2013-04-09t00:36:58z 31155 tid-1jdwoq sidekiq::extensions::delayedclass jid-6143790ebbf6e8bbc4a7bb85 info: done: 4.923 sec it calling delayedclass extension on mail object, no-go. given devise-async works, i'm wondering if using wrong syntax or something?` thanks!! i hit similar issue too. made tiny change in way delayed extension calls #deliver. try out: gem 'sidekiq', :git => "git@bitbucket.org:benjamintanweihao/sidekiq.git" . if works out you, might due msg.

jquery - How to check all check boxes by checking one? -

i trying check check boxes when "selectall" check box selected i have tried codes work still not working me. when click on main check box nothing happens. here have done far <script> $(document).ready(function() { if( $('#selectall').is(':checked') ){ $.each($('input[name=activitie]'){ $('input[type=checkbox]').prop('checked', true) } } }); </script> shameless self-promotion: there's jquery plugin that . in case, think trick: $(function () { $('#selectall').checkall('input[type="checkbox"]'); }); without seeing markup, however, can't sure...

python - Requests body empty -

why following print none? import requests r = requests.request('http://cnn.com', data={"foo":"bar"}) print r.request.body # none if change cnn.com www.cnn.com, prints proper body. noticed redirect (there 301 in r.history). what's going on? your code stands doesn't work—it'll raise typeerror right off bat. think can guess @ you're trying do. if change request post , indeed return none . why? because you're asking body of redirect, not body of original request. that, want r.history[0].request.body . read redirection , history more info. note auto-redirecting isn't documented work post requests, though anyway. note in earlier versions of requests , history entries didn't have complete request objects. (you'll have @ version history if need know when changed. seems there in 1.2.0, , not in 0.14.2—and lot of things added or changes in 1.0.0 aren't documented, because major rewrite.) as side note

html - not able to load contents in div using javascript -

this shan , i'm javascript noob , i'm trying work qa code example here. i'm trying load small javascript content div element not working great , here code. <html> <head> <title> using d statement </title> <script> function displaytext () { var loopindex=0; var sum=0; (var loopindex=1; loopindex <=100; loopindex++) { sum +=loopindex; }; document.getelementbyid('targetdiv').innerhtml="adding 1 100 gives "+sum; } </script> </head> <body> <div id="targetdiv"> </div> </body> </html> you need call function. it's idea wait until window loaded (or can use more advanced js detect dom ready state .): <html> <head> <title> using d statement </title> <script> function displaytext() { var loopindex=0; var sum=0; (var loopindex=1; loopindex <=100; loo

shopping cart - Prestashop shipping error: There are no carriers that deliver to the address you selected -

Image
i new prestashop. have installed , added products shop. testing when tried checkout, says "there no carriers deliver address selected.". need all cash on delivery our own shipping flat shipping fee 2usd. how can achieve above requirements. in prestashop 1.6.1.4 go shipping --> carriers and select " your carrier name " , click edit it. in 2nd tab " shipping locations , costs " tab slect ranges. (which select during prestashop installation) or if don't know click on " all " ranges.

Read More link in Drupal Advanced Poll module not respecting the path alias -

i have advanced poll on home page , reason read more url shows as: http://www.mydomain.com/node/265 but, in poll have url path setting set this... , works great directly: http://www.mydomain.com/poll/name-of-my-poll does know why poll doesn't use path alias or how can fix it? thanks much! figured out... i had put in template.php file: function mytheme_advpoll_view_block_poll($nid) { $node = advpoll_view(node_load($nid), false, false); $output = ''; if ($node && $node->status && $node->active && $node->start_date < time() && $node->end_date > time()) { $output .= '<h3>' . $node->title . '</h3>'; unset($node->content['body']); $output .= drupal_render($node->content); $output .= l('read more...', drupal_get_path_alias('node/' . $nid)); } return $output; }

database - python sqlite3 cannot retrieve column values with @ in them like x@y.com -

very simple question here, couldn't find real answer out there. c.execute('select * users email = ?', ['x@y.com']) c.fetchon() what special @? so tried recreate issue on own small amount of information you've given , wasn't able so. i'm wondering if perhaps issue how you're doing escape characters? there's answer on here goes in great depth. if doesn't solve problem think we'll need more information.

Pivot table from column to row in excel or R -

this question has answer here: reshape data wide long? [duplicate] 3 answers i have table header id x.1960 x.1970 x.1980 x.1990 x.2000 y.1960 y.1970 y.1980 y.1990 y.2000 i want pivot table id time x y what best way in excel or r? something using base r reshape : get data first test <- read.table(text="id x.1960 x.1970 x.1980 x.1990 x.2000 y.1960 y.1970 y.1980 y.1990 y.2000 1 2 3 4 5 6 7 8 9 10 b 10 20 30 40 50 60 70 80 90 100",header=true) then reshape: reshape( test, idvar="id", varying=list(2:6,7:11), direction="long", v.names=c("x","y"), times=seq(1960,2000,10) ) resulting in: id time x y a.1960 1960 1 6 b.1960 b 1960 10 60 a.1970 1970 2 7 b.1970 b 1970 20 70 a.1980 1980 3 8 b.1980 b 1980 30 80 a.1990 1990 4 9 b.1990 b 1990 40 90 a.2000

iOS and Android programming -

i have developed few android applications , working on developing ios application scratch. there method can focus on developing ios application in such way can reuse of components or features developing same application on android platform? is there method can focus on developing ios application in such way can reuse of components or features developing same application on android platform? you can if use web technologies (html, css, javascript). can if build web-based app or hybrid app, i.e. 1 uses web-based content running inside native shell. phonegap if you're interested in building hybrid app -- offers quick way started. there cross-platform frameworks titanium purport offer write once/run on several platforms functionality. if want build app that's native on both platforms, won't able reuse application logic. ios , android use different frameworks written in different languages running on different hardware, , apps on each platform work diffe

python - Why is encrypt() returning None? -

i know it's little gutsy ask bunch of people through several blocks of code try anyway. trying create clone of enigma (the german encryption machine used in world war two) in python tk. looking through code logically,the method encrypt() either returning string "alert", highly unlikely, or returning none . please give quick dedicated glance can fix this? thank you. from tkinter import * string import letters import tkmessagebox root = tk() root.title("enigmatk") def rank(x, d = dict((letr,n%26+1) n,letr in enumerate(letters[0:52]))): return d[x] def shift(key, array): counter = range(len(array)) new = counter in counter: new[i] = array[i-key] return new alph = ["a", "b", "c", "d", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q&quo

Getting a lists of times in Python from 0:0:0 to 23:59:59 and then comparing with datetime values -

i working on code generate time entire day 30 second intervals. tried using dt.datetime , dt.time end either datetime value or timedelta value (0,2970). can please tell me how this. so need list has data like: [00:00:00] [00:00:01] [00:00:02] till [23:59:59] , needed compare against datetime value 6/23/2011 6:38:00 am. thanks! is there reason want use datetimes instead of 3 loops counting up? similarly, want fancy or want compare against time? if don't need account leap seconds or that, easy way. import datetime = datetime.datetime.now() h in xrange(24): m in xrange(60): s in xrange(60): time_string = '%02d:%02d:%02d' % (h,m,s) if time_string == now.strftime('%h:%m:%s'): print 'you found it! %s' % time_string can give more info why doing this? seems much better off parsing datetimes or using strftime need instead of looping through 60*60*24 times.

r - Programmatically sum columns of a data frame? -

suppose have following data frame: dd <- data.frame(x1 = c(1, 2, 3), x2 = c(3, 4, 5), x3 = (5, 6, 7)) i want create new column, so: dd$x.sum <- dd$x1 + dd$x2 + dd$x3 but instead of writing out addition (suppose have 100 columns x1, x2, ..., x100 want sum together), want write programmatically. like: dd$x.sum <- sum(sapply(1:3, function(i) { return(dd[paste0("x", i)]) })) except doesn't work. how do this? you use reduce + , although won't have na.rm argument dd <- data.frame(matrix(runif(1e6),ncol=1000)) dd$sum <- reduce('+', dd[paste0('x',seq_len(1000))]) # benchmarking xx <- paste0("x", seq_len(1000)) library(microbenchark) microbenchmark(reduce('+', dd[xx]), rowsums(dd[xx])) ## unit: milliseconds ## expr min lq median uq max neval ## reduce("+", dd[xx]) 14.93642 15.197

javascript - Why in Jasmine, we cannot put the expect in an outside function? -

if using jasmine 1.3.1, use describe("trytry", function() { var i; function checkforsituation(a) { // say, if made function because // there lot of processing console.log("there", a); expect(foo(3, a)).toequal( 3 + ); } (i = 0; < 5; i++) { console.log("here", i); it("should add " + i, function() { checkforsituation(i); }); } }); and foo just: function foo(a, b) { return + b; } i expect check 0 4, , print out here 0 there 0 here 1 there 1 ... but instead, print in chrome's console as: here 0, here 1, ... , there 5 5 times. know why expect cannot put in outside function , in jasmine if need put many steps function? as side note, in javascript, feel whole new language developed , can won't work -- , wonder can done prevent type of things happening, without knowing happen. if you'd try out, on https://gith

html - How to write into a table with Javascript? -

<script> function getexperience() { var xp = document.getelementbyid('txt_xp').value; document.getelementbyid("plank").innerhtml = xp/30; } </script> so here code, , problem seem unable write on data in table id's planl, oakplank, teakplank, , mahoganyplank. thinking may making obvious mistake has done sort of thing before, can't seem catch it. appreciated, , here snippet of table, if helps: <tr> <td>plank</td> <td id="plankxp">30</td> <td id="plank">0</td> </tr> edit: didn't realize may pertinent, bad. form used input, after putting alert in see if retrieve xp, functioned correctly: <form name="experience" id="experience_frm" action="#"> experience: <input type="text" name="xp" id="txt_xp"/> <input type="submit" value="go" onclick="getexpe

mysql - How do I view the contents of an ibdata file? -

given mysql ibdata file (originally located @ /var/lib/mysql/ on ubuntu server), there way view in human readable format. i understand it's not possible convert csv. appears kind of hex format. and understand, ibdata file steps take database it's current state. essentially view each of steps. don't have associated .frm files tables. although not human readable, it's possible convert mysql ibdata files various purposes. have tried innodb recovery tool? https://launchpad.net/percona-data-recovery-tool-for-innodb documentation available @ http://www.percona.com/docs/wiki/innodb-data-recovery-tool:start

internet explorer 8 - jQuery error in IE8 - $ undefined -

i have looked through answers , still don't know why error. here html code @ top of page: <!doctype html> <html lang="en-us"> <head> <meta charset="utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <title>magi in box - login</title> <link href="css/main.css" rel="stylesheet" type="text/css" media="all" /> <link href="css/grids.css" rel="stylesheet" type="text/css" media="all" /> <link href="css/misc.css" rel="stylesheet" type="text/css" media="all" /> <link href="css/tables/demo_table_jui.css" rel="stylesheet" type="text/css" media="all" /> <link href="css/tables/jquery-ui-1.8.4.custom.css" rel="styl

java - Updating deprecated WAS-MQ code -

i working on migration of 6.1 based application 7.0 found below 2 statements com.ibm.mq.mqenvironment.securityexit = null; // 1 and mqqueueconnectionfactory factory = new mqqueueconnectionfactory(); factory.settransporttype(jmsc.mqjms_tp_client_mq_tcpip); // 2 on line# 1 securityexit deprecated doc says: the security exit used when connecting queue manager. allows customise security flows occur when attempt made connect queue manager. if want provide own security exit, define class implements mqsecurityexit interface , assign securityexit instance of class. if set field null no security exit called. what understand com.ibm.mq.mqsecurityexit interface needs implemented. assign securityexit instance of class mean ? on line# 2 jmsc deprecated . doc says: this parameter can passed mqconnectionfactory.settransporttype(int) indicate application should connect queue manager in client tcp/ip mode. also interface doc says: use constants defined in classes in com.ibm

c# - How to parse this String using System.Runtime.Serialization.Json? -

can me how use system.runtime.serialization.json ( not json.net ) information of each book in tring array: { "books": [ {"name":"book 1","orig":"author 1","date":2009,"lang":"en"}, {"name":"book 2","orig":"author 2","date":2012,"lang":"fr"} ], "src":"lib", "id":212 } here's quick sample whipped appears work: using system; using system.collections.generic; using system.io; using system.runtime.serialization; using system.runtime.serialization.json; class test { static void main() { using (stream stream = file.openread("test.json")) { var serializer = new datacontractjsonserializer(typeof(library)); library library = (library) serializer.readobject(stream); console.writeline(library.b

maps - java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable in android -

Image
i tried demo on displaying google maps v2 in android. the java code is, package com.example.gpslocator; import android.os.bundle; import android.app.activity; import android.view.menu; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } } the xml code is, <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name

sql server - Sum of count of records from different tables group by records' created date -

i using sql server 2008 r2. have 6 tables fetching number of rows grouped created date. for example : select count(*) noofreading tablea isdeleted = 0 group convert(varchar(10), createddtutc,111) select count(*) noofreading tableb isdeleted = 0 group convert(varchar(10), createddtutc,111) select count(*) noofreading tablec isdeleted = 0 group convert(varchar(10), createddtutc,111) and onwards.. now want make sum of noofreading of tables group created date. solution?? p.s. : have tried using "+" between of queries giving error. thanks i think simple addition can work.. select ( (select count(*) tablea isdeleted = 0 group convert(varchar(10), createddtutc,111)) + (select count(*) tableb isdeleted = 0 group convert(varchar(10), createddtutc,111)) + (select count(*) tablec isdeleted = 0 group convert(varchar(10), createddtutc,111)) ) noofreadingsum

asp.net - Fullcalendar events, with MVC asp -

$(document).ready(function () { $('#calendar').fullcalendar( { header: { left: 'prev,next today', center: 'title', right: 'month,agendaweek,agendaday' }, editable: true, events: function (start, end, callback) { var event = []; event.push({ title: 'garten', start: '2013-06-10t00:00:00', allday: true }); callback(event); } }); }); guys thats event example want extract events database, im working mvc 2 asp.net , database on ado.net can me making example of how can extract data ideally asp.net web service should return data calendar in json format. kindly refer following url: http://arshaw.com/fullcalendar/docs/event_data/events_json_feed/

spring - SpringSocial XML Configuration Schema Error -

i tried spring social showcase using xml appears have error in xml. the xml file not working. have read x marks on line 23 27. <facebook:config app-id="${facebook.clientid}" app-secret="${facebook.clientsecret}" app-namespace="socialshowcase" /> <twitter:config app-id="${twitter.consumerkey}" app-secret="${twitter.consumersecret}"/> <linkedin:config app-id="${linkedin.consumerkey}" app-secret="${linkedin.consumersecret}"/> <social:jdbc-connection-repository/> i tried check schema ( http://www.springframework.org/schema/social/ )and pasted in url says it not found. tried check root springframework.org/schema/ , not able find child relating spring social. is there new link xmnls or schema location spring social? here xml file: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans"

c++ - Importing DLL functions in c# code -

i have dll, functions want use in c# code here functions of dll : extern "c" { __declspec(dllimport) const char* __stdcall zajsonrequesta(const char *szreq); __declspec(dllimport) const wchar_t* __stdcall zajsonrequestw(const wchar_t *szreq); __declspec(dllimport) const bstr __stdcall zajsonrequestbstr(bstr sreq); } can tell me how use in c# project, dll seems in other language ? please have @ following article on code project in depth explanation a small sample linked article shown below to call function, methodname int __declspec(dllexport) methodname(int b) { return b; } include class library (methodnamelibrary.dll) containing above method shown below in c# class program { [dllimport(@"c:\methodnamelibrary.dll")] private static extern int methodname(int b); static void main(string[] args) { console.writeline(methodname(3)); } }

php - Dynamic keys in fat-free framework -

in order access array has been created in php script on html page, {{@somearray['somevalue']}} . how deal situation key ( 'somevalue' ) obtained other array {{@someotherarray['someotherindex'}} ( i.e. value @ {{@someotherarray['someotherindex']}} = somevalue )? i using f3 version 2.1.x. this has been fixed in 3.x , doesn't work in 2.x. syntax in 3.x is: {{@arr1.@arr2.@field}}

ruby on rails - save_and_open_page and spork, spork is loosing test suite / output -

when run rspec tests spork, every time use capybara's save_and_open_page, spork loosing test suite.. or maybe doesnt output anymore... see log # => without save_and_open_page 09:04:24 - info - spork server rspec, test::unit started 09:04:24 - info - guard::rspec running 09:04:24 - info - running specs running tests args ["--drb", "-f", "progress", "-r", "/users/myuser/.rvm/gems/ruby-1.9.3-p392/gems/guard-rspec-2.5.2/lib/guard/rspec/formatter.rb", "-f", "guard::rspec::formatter", "--failure-exit-code", "2", "spec"]... ................ finished in 4.1 seconds 16 examples, 0 failures randomized seed 50331 done. # => save_and_open_page, no .... shown anymore 09:04:29 - info - guard watching @ '/users/myuser/coding/myproject' 09:04:39 - info - running: spec/features/registration/registration_process_spec.rb running tests args ["--drb", "-f",

Customized view of ads in android using admob -

Image
i want display ads in android application, found ads in footer/header want show ads shown in image (just gallery view). is possible display ads ? if yes, how ? the type of ad want interstitial opposed banner ad. you can serve these ads via admob mediation have serve them (via admob mediation) network other admob because admob interstitial's invite only.

ios - Uploading Big Image In Background Thread. -

i need upload image webservice. below code snippet have return upload image. image size big (around 6mb). uploading image in background thread using gcd. if([vscore connectedtointernet ]) { bgtask = [[uiapplication sharedapplication]beginbackgroundtaskwithexpirationhandler: ^{ dispatch_async(dispatch_get_main_queue(), ^{ //[application endbackgroundtask:self->bgtask]; //self->bgtask = uibackgroundtaskinvalid; }); }]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ [vrs write:data touri:uri]; [[uiapplication sharedapplication]endbackgroundtask:bgtask]; bgtask = uibackgroundtaskinvalid; }); // } -(bool)write:(nsdata *)

ios6 - Problems with facebook share, how does login method influence share behavior? -

i have ios 6 app facebook login on first page. using facebook-sdk 3.2. login process similar scrumptious tutorial . if there session, user logged in automatically, else has press login. have share dialog. similar share tutorial . if user has filled in facebook login in ios-settings , there native login dialog (the popup box). if user logs in , touches share button there native share dialog . if user has not filled in facebook login in ios-settings , there fast-app-switch-login. if user logs in , touches share button ends in fallback share dialog . now odd part: if user goes way 2, closes , restarts app, gets logged in automatically if facebook session exists. if user touches share, native share dialog (expected fallback share dialog) pops , user asked fill in credentials in ios-settings. is there way behavior consistant? don't care if there fallback share dialog or native dialog request. i believe facebook works on single sign-on experience. when user goes

backbone.js - How to make selected item to change class(How to make property observable in backbone) -

i want build simple screen, list of items in 1 side , selected item details -on another. when user click on 1 of items - details displayed in 'details' section. selected item in 'list' section must decorated 'active' class. here router code: var approuter = backbone.router.extend({ routes:{ "":"list", "users/:id":"userdetails" }, list:function () { this.userslist = new userscollection(userslist);/* new userscollection()*/ var self = this; //this.userlist.fetch({ // success: function () { this.userslistview = new userslistview({ model: this.userslist }); $('#sidebar').html(this.userslistview.render().el); // } //})//end of fetch }, userdetails:function (id) { if(this.userslist){ //unselect prevously selected if(this.user )this.user.set({'selected':false}); this.user = this.userslist.get(id); //se

java <= not working correctly -

{ system.out.println("please enter cost: "); cost1 = input.nextdouble(); } while (cost1 <= 100000 || cost1 >= 900000); that's code. if enter 100001 skips loop, if put 100000 not. why this? wrong condition (based on expect it) cost1 <= 100000 || cost1 >= 900000 means while cost1 <= 100k or cost1 >=900k so when put 100001 neither less equal 100k nor greater equal 900k

How to use C-x ^ shortcut on German keyboard layout without space key in Emacs? -

as described here ( https://stackoverflow.com/a/6315267/772434 ) short key c-x ^ can used in emacs increase size of split window. on german keyboard layout however, have type control-x ^ **space** work, ^ character appears after hitting space key. is there way avoid , make command work without having type space in end (which not elegant)? i use standard english layout emacs. if need type different characters, use c-\ switch different keyboard layout in emacs .

ios - C# PresentViewController to a viewcontroller in storyboard -

i creating first xamarin-application (c#) in ios , having trouble navigating in storyboard. of tabbar-,navigation- , viewcontrollers in storyboard. in every viewcontroller, added menu (facebook- , youtube-style) slides side. there has possible return first viewcontroller (home) in storyboard. because menu active in every controller of application, don't use segues (it mess in storyboard). so want use presentviewcontroller(), when this, page turnes black , doesn't show anything. homeviewcontroller home = new homeviewcontroller(); presentviewcontroller(home, true, null); does turn black because presentviewcontroller expects xib-file homeviewcontroller? want user stay in storyboard, can continue segueing through application. does has idea? thanks in advance. did create empty constructor yourself? if so, not loading information storyboard, why it's black. to create controller call this: var controller = storyboard.instantiateviewcontroller("homev

sencha touch - does extjs keep a list of open calls? -

i need happen after calls server handled. don't know in order these happen. so wondering if extjs/sencha touch keeps list of open calls somewhere. seems exist. ext.ajax.requests keeps list of open calls.

video - C++ FFMPEG not writing AVCC box information -

i'm trying encode raw h264 mp4 container using ffmpeg api in c++. works fine, avcc box empty, , returns error: [iso file] box "avcc" size 8 invalid if use command line tool on output file: ffmpeg -i output.mp4 -vcodec copy fixed.mp4 the output file works , avcc populated required information. i'm @ loss why command line argument works i'm unable produce same result using api. what in c++ code (also things in between function calls): outputformat_ = av_guess_format( "mp4", null, null ); //av_codec_h264 formatcontext_ = avformat_alloc_context(); formatcontext_->oformat = outputformat_; ... avdictionary *opts = null; char tmpstr[50]; sprintf(tmpstr, "%i", muxrate * kilobytestobytes); av_dict_set(&opts, "muxrate", tmpstr, 0); avformat_write_header( formatcontext_, &opts); av_write_trailer(formatcontext_); the output of correct, except it's missing avcc information. adding manually (and fixing box lengths accor