Posts

Showing posts from August, 2011

LINQ - How to select with subquery -

LINQ - How to select with subquery - my info is: +-----+--------+-----------+ | id | name | parentid | +-----+--------+-----------+ | 1 | | 0 | | 2 | b | 0 | | 3 | c | 1 | +-----+--------+-----------+ how c if have parentid = 0 linq? assuming "categories" collection name, think need. var parentcategoryids = collections.where(c => c.parentid == 0).select(c => c.id); var results = collections.where(c => parentcategoryids.contains(c.parentid)); and if want name, can do var names = results.select(r => r.name); these 3 statements written 1 linq statement did clarity. linq

android - EADDRINUSE When creating server socket on google glass -

android - EADDRINUSE When creating server socket on google glass - i developing google glass/android application. video streaming application has server/client setup phone/glasses server , hooks pc session description playing video. works great on android , runs fine seek test on google glass throws error @ line ssocket = new serversocket(sport); the exception message says "eaddrinuse" i'm assuming means port opened never opened it. if had opened , programme didn't close changed port couple of times , still says it's in use. thanks tyler, google glass, android, consistently have many of it's ports occupied applications running in background. when creating socket server hear on, have 2 choices: 1) have predetermined list of ports can take have server hear on. if take this, can have datastructure (list, queue, heap [if have priority of ports use], etc) contain of ports, can traverse them until find open port. this can achieved i

javascript - mouse out event handler not working when mouse over event handler is a there in Google chart script -

javascript - mouse out event handler not working when mouse over event handler is a there in Google chart script - for below code mouse out handler not working, when removed mouse on relevant code works fine. (due chart.draw() not working properly). guys can u give me hand problem. google.setonloadcallback(drawchart); function drawchart() { var info = google.visualization.arraytodatatable([ ['task', 'hours per day'], ['work', 11], ['eat', 2], ['commute', 2], ['watch tv', 2], ['sleep', 7] ]); var options = { title: 'my daily activities', legend: 'none', pieslicetext: 'percentage', slices: { } }; var chart = new google.visualization.piechart(document.getelementbyid('piechart')); chart.draw(data, options); google.visualization.events.addlistener(chart, 'onmouseout',

c# - Using linq to group a table that contains substrings -

c# - Using linq to group a table that contains substrings - my info table(deviceinfo): id | os | device ----------------------------------------------- 1 | android 2.2 | samsung 2 | linux/android 4.2 | lg 3 | linux/android 4.4.2 | htc 4 | android 3.2 | samsung 5 | android 3.0 | motorola 6 | ios 7.1.2 | ipad 7 | ios 8.0 | iphone 6 8 | ios 6.1.6 | iphone 4 i want grouping table android , ios user using linq.actually have grouping table using substring "android" , "ios". output should be id | user | count ---------------------------- 1 | android | 5 2 | ios | 3 how able table using linq? you can seek : // db datacontext var groupbyos = (from c in (from d in db.deviceinfo

Facebook and Android - user_groups permission -

Facebook and Android - user_groups permission - i received result of review of android app should utilize user_groups permission. said submission not approved because the user_groups permission approved apps allow people utilize facebook on platforms facebook not available. if you're building app on android , ios, example, won't approved permission. web, desktop , tv apps not granted permission. i understand reason why submission has been unapproved searching on play store, can find lot of reent app have permission granted (they show list of user's group). so, there way obtain this? there other way read user group's list? thank in advance. those apps using older facebook app created before end of apr 2014. can still utilize v1.0 of graph api, , don´t need go through review process until end of apr 2015. stop working after date, because not approved user_groups. so there no way obtain permission, unfortunately. unless still got facebook app cr

javascript - How to enhance such piece of code -

javascript - How to enhance such piece of code - i'm working on kind of typing tutor now. have simple keyboard model written in pure html. html here <div class="keyboard"> <div class="keyboardrow"><span class="key" id="q">q<sub>Й</sub></span> <span class="key" id="w">w<sub>Ц</sub></span> <span class="key" id="e">e<sub>У</sub></span> <span class="key" id="r">r<sub>К</sub></span> </div> </div> then want alter color of border of key pressed. i've create such piece of "trashcode" in javascript document.onkeypress = checkkeypress; function checkkeypress(e) { var keyid = e.charcode; switch (keyid){ case 113: pkey = document.getelementbyid("q"); pkey.style.bordercolor = "red"; break; case 119: pke

ruby on rails 3 - Gemfile.lock Error while trying to deploy RoR application on server -

ruby on rails 3 - Gemfile.lock Error while trying to deploy RoR application on server - i getting next error on server while deploying application the --deployment flag requires gemfile.lock. please create sure have checked gemfile.lock version command before deploying. i have checked in gemfile.lock code repository. can please guide me on ? thanks. make sure gemfile.lock checked out during deployment. for illustration check not listed in .gitignore files. hope helps! ruby-on-rails-3 deployment gemfile.lock

java - IOException, not finding file -

java - IOException, not finding file - i hoping explain why not work , solution might be. i have tried next larn happens: string s = "\\users\\udc8\\a4471\\my documents\\matlab\\blockdiagram.xml"; string st = "\\"; string st2 = st + s; system.out.println(st2); giving me next output: \\users\udc8\a4471\my documents\matlab\blockdiagram.xml which right path file. seek parse file using sax , ioexception saying file not exist. have tried using file , getpath(),getcanonicalpath() , getabsolutepath(). when running parser msg: due ioexception, parser not check \\users\udc8\a4471\my documents\matlab\\blockdiagram.xml this code starting parsing: try { xmlreader parser = xmlreaderfactory.createxmlreader(); parser.parse(st2); system.out.println(s + " well-formed."); } grab (saxexception e) { system.out.println(s + " not well-formed."); } grab (ioexception e) { system.o

java - android Date and SimpleDateFormat output wrong -

java - android Date and SimpleDateFormat output wrong - i not know why different input output duplicate, here code date d = new date(1409716800); date d1 = new date(1409716801); simpledateformat sdf = new simpledateformat("dd.mm.yy-hh:mm:ss"); string formatteddate = sdf.format(d); string formatteddate1 = sdf.format(d1); log.d("time", formatteddate); log.d("time", formatteddate1); the output 10-24 06:12:50.508: d/time(29097): 17.01.70-07:35:16 10-24 06:12:50.508: d/time(29097): 17.01.70-07:35:16 can tell me why output duplicate? timezone gmt+7 date d = new date(1409716800); date d1 = new date(1409716801); simpledateformat sdf = new simpledateformat("dd.mm.yy-hh:mm:ss:sss"); string formatteddate = sdf.format(d); string formatteddate1 = sdf.format(d1); log.d("time", formatteddate); log.d("time", f

java - How to use several UserTransactions (javax) -

java - How to use several UserTransactions (javax) - let's have bean method uses @inject private usertransaction utx; utx.begin(); and want test method indirectly calls above. before, in test setup, phone call this: @before public void setup() throws exception { utx.begin(); } so testclass , bean both have injected javax.transaction.usertransaction object. calling sec (bean) utx.begin() lead error: javax.transaction.notsupportedexception: basetransaction.checktransactionstate - arjuna016051: thread associated transaction! how can utilize several usertransactions, i.e. when rollback outer one, want rollback inner one, if has been committed? java transactions

javascript - Trying to reference a class after the page loads with colorbox -

javascript - Trying to reference a class after the page loads with colorbox - i have list of links generated after button click, obviously, these links rendered after page , jquery has loaded. links like: <a class="person" href="xxxxxx.xxx"</a> the jquery i'm using is: $(document).ready(function(){ $(".person").colorbox({iframe:true, width:"80%", height:"80%"}); }; assigning class link on page renders page works correctly. how can utilize jquery reference tags, classes, etc. load afterwards? maybe im missing something.. cant set .ready function own callable function ? so example: var reloadpeople = function(){ $(".person").colorbox({iframe:true, width:"80%", height:"80%"}); } then everytime 1 added after document load can run function reloadpeople(); im not familiar colourbox javascript same round! :) javascript jquery html colorbox

statistics - Why are some Android Versions unchecked in my Google Developer Console? -

statistics - Why are some Android Versions unchecked in my Google Developer Console? - i see next under "statistics" android app in google developer console. question - why app versions unchecked when open page? the checked versions 1 visible in graph above - default lists current installs android version: if check more versions, show in graph well. android statistics

Ruby on Rails -in coffeescript how do I access data returned from controller -

Ruby on Rails -in coffeescript how do I access data returned from controller - ruby-on-rails application using javascript/coffee access returned info re-display drop-down list on view. app/assets/javascripts $('document').ready -> if $('#x_eval_assum').length == 1 $('#x_eval_assum') # evaluation assumption saved .submit (event) -> event.preventdefault() info = $("#x_eval_assum").serialize() user_save_name = data.user_save_name drill_id = $('.form.assumption').attr('data-drillid') $.post "/drills/#{drill_id}/discovery_target_saved.json", data, (res)-> console.log res # response shown below # line causing errors - how access whats in res assumption in res.assumptions # $(select).append(<option val="id" using developer -> tools view res (e.g. data) returned coffeescript controller data:

jquery - Changing class during scroll jumps to the top -

jquery - Changing class during scroll jumps to the top - i'm trying create div alerts that the alerts below header when header visible on screen the alerts @ top of screen when header scrolled off of screen. when (i've tried jquery , twitter bootstrap), , drag scrollbar down, scrollbar jumps top when css class on element changed. i'm running in chrome, v38.0.2125.104 run width of 750px or less see issue: http://jsbin.com/jenibimaze/1 it turns out addition/removal of horizontal scrollbar causing page jump top. i able create horizontal scrollbar consistent adding overflow:none css. jquery html css twitter-bootstrap affix

java - Simple Adapter, Invalid index when filtering -

java - Simple Adapter, Invalid index when filtering - i'm populating listview info database, includes images text. can't filter info pass listview. have filter listview it's self. have populated listview using simple adapter , images load. problem when filtering list view crashes.(see logcat). code i'm using: custom simple adapter handle images public class extendedsimpleadapter extends simpleadapter{ list<hashmap<string, string>> map; string[] from; int layout; int[] to; context context; layoutinflater minflater; public extendedsimpleadapter(context context, arraylist<hashmap<string, string>> data, int resource, string[] from, int[] to) { super(context, data, resource, from, to); layout = resource; map = data; this.from = from; this.to = to; this.context = context; } @override public view getview(int positio

oracle - How to wait until a query returns rows? -

oracle - How to wait until a query returns rows? - on oracle db, how below logic (that "wait until @ to the lowest degree 1 row returned , homecoming column value form it"), without polling (looping, wasting cpu , perchance i/o) wait/block mechanism? when calling get_one() function should not homecoming until can fetch row table matching conditions. function get_one() homecoming number c1 sys_refcursor; n number; begin loop open c1 select number_column t1 some_conditions; fetch c1 n; if not c1%notfound homecoming n; close c1; dbms_lock.sleep(1); -- wait reduces load, still polling, delays reaction time end loop; end; the solution should work external applications (like application servers j2ee, .net , similar), utilize of triggers not fit. function get_one() homecoming number n number; begin loop select (select number_column t1 some_conditions) n dual; if n null dbms_lock.

derived - Differentiation using r -

derived - Differentiation using r - i'm new using r or type of programming , i'm trying differentiate 3xcos(xy) respect x. i've tried 4 different ways , wondering 1 best/correct. d(expression(3*x*cos(xy)),"x") d(expression(3*x*cos*(xy)),"x") d(expression(3*x*cos*(xy)),"x") d(expression(3*x*cos*(x*y)),"x") thanks in advance shane none of those. this right expression: d(expression(3*x*cos(x*y)),"x") #3 * cos(x * y) - 3 * x * (sin(x * y) * y) this treats xy 1 variable: d(expression(3*x*cos(xy)),"x") #3 * cos(xy) this treats xy 1 variable , cos variable (and not function): d(expression(3*x*cos*(xy)),"x") #3 * cos * (xy) this treats cos variable: d(expression(3*x*cos*(x*y)),"x") #3 * cos * (x * y) + 3 * x * cos * y r derived differentiation

javascript - Can't seem to horizontally center text that has been translated 270 deg? -

javascript - Can't seem to horizontally center text that has been translated 270 deg? - so have these html tables "vertical headers". using css3 translate property rotate text. of working great, except, cannot find way correctly center text horizontally. can of course of study manually center text using padding, margin, or several other properties, works if of vertical header cells same width, not case. i have created test case in js fiddle handy slider dynamically adjusting width of 1 of columns: http://jsfiddle.net/c7ft8nzc/ just in case, here code sample using. html: <table> <tr class="header"> <td>a header</td> <td>some other header</td> <td id="v"><div class="vert">a vert. header</div></td> <td><div class="vert">another vert. header here</div></td> </tr> <tr> <td

javascript - Vertical multilevel Menu slideToggle -

javascript - Vertical multilevel Menu slideToggle - i newbie in jquery/js , trying create tabbed menu jqueryui/jquery. wanted inner tabs there created using slidetoggle. have slidetoggle in tabs , want 1 close when slidetoggle open, did tabs slideup menu if open not able 1 slidetoggles. here code tried: $(function() { $( "#tabs" ).tabs(); }); $(document).ready(function() { $(".menu a").click(function(){ $(".video").each(function(){ $(this).get(0).pause(); }); }); //tabbing selection $(".menu li:eq(0)").addclass("active"); $(".menu li").click(function(){ $(this).addclass('active'); $(this).siblings().removeclass('active'); }); $(".subtabs").click(function(){ $(this).nextuntil("li.tabsclose").slidetoggle(); $(this).removeclass('active'); $(this).next().addclass('active'); }); $(".tabs").cli

java - Error 405 Method Not Allowed error, when sending DELETE to server -

java - Error 405 Method Not Allowed error, when sending DELETE to server - i next response when seek delete: 405 method not allowed. in logs there written allowed, delete isn't. java: @responsebody @requestmapping(method = requestmethod.delete, value = "/{id}") public void delete(@pathvariable string id) { speakerservice.delete(id); } angularjs app.factory('speakerresource', function ($resource) { homecoming $resource('rest/speaker/:speakerid', { speakerid: '@speakerid' }, { 'update': { method: 'put' } }, { 'delete': { method: 'delete', params: { 'id': 'speakerid' }} } ) }); speakerservice this.delete = function (id, callback) { speakerresource.delete({ speakerid: id }, function () { callback(); }); } i not know finish code, , not expert in angularjs, looks want send

javascript - $scope variable value not accessible outside of $http success callback in AngularJS -

javascript - $scope variable value not accessible outside of $http success callback in AngularJS - i started learning angularjs. i created simple app display content in json file. the info assigned scope within $http, returns undefined outside. var app= angular.module('app',[]); app.controller('apctrl',['$scope','$http',function($scope,$http){ $http.get('/path/to/data.json').success(function(){ console.log(data); // returns info --working $scope.data=data; // assiged console.log($scope.data); // returns info --working }); console.log($scope.data); // returns 'undefined' --not working }]); please help me understand problem. thanks! it's because making asynchronous call. info not prepared when seek phone call outside of success function. check documentation. for example, if wait couple seconds, it'ld show: app.controller('apctrl',['$scope','$http'

gradle - Anyone know how I can run an android sample app? -

gradle - Anyone know how I can run an android sample app? - i'm new android development using android studio. examples online build gradle. take gradle when importing project error saying not gradle based project. know how can on run on phone? pick sample project import has build.gradle file in both app module directory , project root directory. android gradle

c++ - Debug Boost.Serialization Address Tracking -

c++ - Debug Boost.Serialization Address Tracking - roughly speaking, have object o , pointer object po = &o , serialize this: // somewhere ar & o; // somewhere else, after somewhere ar & po; when serializing po , boost.serialization should find has serialized o , not serialize *po again. have situation library fails @ discovering situation , instead serializes o twice. unfortunately, attempts @ reproducing behaviour in simple illustration failed, , original code way big posted here. instead of solution problem, inquire pointer relevant code section in boost.serialization tracks addresses , determines whether pointer needs "deeply" serialized or not. hope can debugging myself. of course, best guesses error might welcome, don't want strain crystal balls much. ;-) btw, utilize boost::archive::text_oarchive if relevant. the code section in question save_pointer() function in basic_oarchive. boost.serialization uses 2 character

c++ - COM registration : handle ProgID for two versions of software -

c++ - COM registration : handle ProgID for two versions of software - i creating new version of software , there requirement new version(version 2) of software run alongside previous software (version 1) currently, when version 1 of software uninstalls, removes progid in hkey_classes_root\progid, impacts version 2 running properly. my questions: do need create new progid version 2 ? there numerous progid in software. or should utilize version independent progid ? clsidfromprogid() function works version independent progid ? msdn not seems it. or code should not utilize clsidfromprogid() clsid ? please advice proper way handle progid different version of software ? thank you c++ com registry

scala - How to configure rhino to run jasmine tests for angularjs controllers -

scala - How to configure rhino to run jasmine tests for angularjs controllers - i having problem getting unit tests working angular js app using jasmine sbt plugin. when add together angular.js ( ver 1.3.1) test.dependecies.js envjasmine.loadglobal(envjasmine.libdir + "/angular.js"); envjasmine.loadglobal(envjasmine.libdir + "/ui-bootstrap-0.11.2.js"); envjasmine.loadglobal(envjasmine.testdir + "/lib/angular-mocks.js"); i got next error [ envjs/1.6 (rhino; u; linux amd64 3.13.0-32-generic; en-us; rv:1.7.0.rc2) resig/20070309 pilotfish/1.2.13 ] not read file: /opt/scala/myproject/src/main/webapp/static/js/lib/angular.js error was: typeerror: cannot find function queryselector in object [object htmldocument]. i cant figure if there compatibility issue angular , rhino or in jasmine config angularjs scala sbt rhino

machine learning - Why do we use gradient descent in linear regression? -

machine learning - Why do we use gradient descent in linear regression? - in machine learning classes took recently, i've covered gradient descent find best fit line linear regression. in statistics classes, have learnt can compute line using statistic analysis, using mean , standard deviation - this page covers approach in detail. why seemingly more simple technique not used in machine learning? my question is, gradient descent preferred method fitting linear models? if so, why? or did professor utilize gradient descent in simpler setting introduce class technique? the illustration gave one-dimensional, not case in machine learning, have multiple input features. in case, need invert matrix utilize simple approach, can hard or ill-conditioned. usually problem formulated to the lowest degree square problem, easier. there standard to the lowest degree square solvers used instead of gradient descent (and are). if number of info points hight, using standard to

cannot write an angular ui typeahed handler with typescript -

cannot write an angular ui typeahed handler with typescript - i'm writing angular controller using typescript, , i'm using angular ui typeahead receive error during phone call update handler. angular directive <input type="text" ng-model="vm.censimento.quartiere" placeholder="prima selezionare il comune" typeahead="address address in vm.updatequartieri($viewvalue)" typeahead-loading="loadinglocations" class="form-control" /> <i ng-show="loadinglocations" class="glyphicon glyphicon-refresh"></i> this typescript routine public updatequartieri = (typed: string) => { var filtro: factories.filtroricercaquartieri = new factories.filtroricercaquartieri(); filtro.testo = typed; filtro.idcomune = this.censimento.comuneid; var ultimipromise = this.censimentofactory.quartiericomune(filtro); ultimipromise.then((data: string[]) => {

java - Database access with SOAP WS -

java - Database access with SOAP WS - i trying utilize crud operations on object in database through soap web service. i have: created web service , launched on local server. tested crud methods. created new project , used 'wsimport' on service's wsdl generate portable artifacts. whenever running methods generated endpoint class within new project, next exception: exception in thread "main" com.sun.xml.internal.ws.client.clienttransportexception: server sent http status code 404: not found as have mentioned, when running methods within web service project endpoint class, no exception thrown. requested code: https://github.com/vladmatvei/bank-ws thank you maybe problem isn't crud's method, problem maybe how declare web service within java's classes. have seek invoke endpoint tool soapui? if invoke webservice soapui, problem in client or way have used generate java artifacts using wsimport. java spring web-s

MongoDB MMS only monitoring "local" database -

MongoDB MMS only monitoring "local" database - i have installed mongodb (2.6.5) instance , created database several collections. after which, installed , configured mms (following mongo's guide within of mms site) , able monitor instance. monitoring the database called 'local'. when log in mongo shell can see following: show dbs testv1 7.950gb admin 0.078gb local 0.078gb but when in dashboard mms seeing stats local database. thought how other databases show show up? assuming nodes in replica set running mongodb 2.6.x, here possibilities: db stats not appear until ~30 minutes after host added mms monitoring. if has been longer that, should seek refreshing mms page in browser create sure latest configuration info has been loaded in web ui. check "collect database specific statistics" alternative enabled on "administration => grouping settings" page in mms. note: setting defaults enabled. you have

c++ stack overflow in windows 8 minGW -

c++ stack overflow in windows 8 minGW - i wrote next c++ code. compiled in windows 8 mingw(from msys), if run windows stop , give stack overflow error(c00000fd). what's problem? #include <iostream> using namespace std; class test{ public: int txt[1000]; }; int main(){ test a[1000]; homecoming 0; } update: ok, should if want store image size of 1920*1080? it'll 1920*1080*4 bytes. each test object contains 1000 integers, clocking in @ 4kb each. in main creating array of 1000 objects total of 4mb. stack can't hold 4 megs. http://msdn.microsoft.com/en-us/library/windows/desktop/ms686774%28v=vs.85%29.aspx says mutual default 1mb. note that std::vector<test> a(1000); will work fine. std::vector not store contents on stack local array does. c++ mingw stack-overflow

playback - Can VLCJ play reverse? -

playback - Can VLCJ play reverse? - dear programming special video player in java , in part of work have reverse play video. there way play video in vlcj reversely? all the simple reply "no". neither vlcj nor vlc can play video in reverse. reverse playback vlcj

javascript - jQuery this inside event -

javascript - jQuery this inside event - i tought understand utilize of this in jquery/js, showes me i'm wrong. wanted add together class on dom element , used this: $("#content").on("click",function(){ this.addclass("bonus"); }); but nil happened, changed sec line of code , worked: $("#content").addclass("bonus"); shouldn't this in first illustration refer $("#content") already? this refers dom element triggered. it's not jquery object, native dom object. you need do: $(this).addclass("bonus"); javascript jquery dom

javascript - Audio pause/play with JS variable (ubernewb) -

javascript - Audio pause/play with JS variable (ubernewb) - i'm working on simple project includes media (mp3) player in sidebar. can play/pause button visually switch , can turn off sound assigning href image when trying swapped image pause sound can't seem figure out, here's code.. edit: deleted shotty code edit: figured out 3 ways this, 2 kind people below posted great ways figured out how crudely via jquery. $('#left-05-pause_').click(function(){ $('#left-05-pause_').hide(); $('#left-05-play_').show(); }); $('#left-06-audio_').click(function(){ audio.volume = 1; $('#left-06-audio_').hide(); $('#left-06-mute_').show(); }); mitch, have 3 points you: there's no need wrap <a> around <img> for performance avoid overuse of selecting elements (like getelementbyid), because 1 time you've selected link element set variable , utilize 1 time again acces

Difference between protocol & behaviour in elixir -

Difference between protocol & behaviour in elixir - behaviours define callbacks & protocols define methods without signatures. modules implementing protocol should give definition methods. same modules using behaviour. semantic difference? one difference can think of is, protocol can implemented single type 1 time can implement behaviour module multiple times based on our requirements. clear when utilize what. there other difference other this? protocol type/data based polymorphism. when phone call enum.each(foo, ...) , concrete enumeration determined type of foo . behaviour typeless plug-in mechanism. when phone call genserver.start(mymodule) , explicitly pass mymodule plug-in, , generic code genserver phone call module when needed. elixir

How can I inlcude the Vagrant API into a ruby program? -

How can I inlcude the Vagrant API into a ruby program? - i'd create calls vagrant's api through ruby program,like so: puts vagrant.constants how can include vagrant @ level ? new ruby, see there lot of libraries in vagrant, , not sure mutual way phone call such libraries or include them recursively - maybe there dynamic way include vagrant libraries application using gem api ? update : vagrant doesnt back upwards gems ? some of comments below have implied maybe declaring vagrant gem solution this. however, when attempting setup vagrant gemfile dependency, noticed error message: thus, think there must improve way add together vagrant ruby dependency, without resorting gem file. ruby api gem vagrant

asp.net - JavaScript How to enabled button on client-side on CallBack and Postback -

asp.net - JavaScript How to enabled button on client-side on CallBack and Postback - i have asp.net page 2 buttons. 1 triggers , updatepanel (ajax callback). other total page refresh (postback). i need disable both buttons when of them clicked (this part manage create work) , reenabled them when postback or callback complete. wich event or on javascript should phone call function enabled buttons in both cases? thanks! edit here's code. buttons definition: <asp:button id="cmdfiltrar" usesubmitbehavior="false" style="width:48%" runat="server" cssclass="botonactivo" text="<%$ resources:idioma, historico_consultar%>"/> <asp:button id="cmdexcel" usesubmitbehavior="false" style="width:48%" runat="server" cssclass="botonactivo" text="<%$ resources:idioma, historico_excel%>"/>

Programming C++ on Mac -

Programming C++ on Mac - i wanted ask, if knows how programme c++ on mac. can utilize xcode doing this? read utilize commandline tool in xcode don't know how userinterface then. great if help me. you have 2 ways start c++ coding namely command line , using ide xcode. suggest start via command line means need c++ compiler (i.e. g++ compiler free) , editor (for mac users, ppl utilize textwrangler editor). ides hide lot of stuff sake of simplicity, beginner, should start command line see how c++ compilation flows. let's got g++ compiler , textwrangler. first: open textwrangler editor , create new document , name main.cpp second: type next in main.cpp #include <iostream> int main() { std::cout << " hello world! " << std::endl; homecoming 0; } third: open terminal (i.e. in utilities folder) fourth: move directory main.cpp in using cd command fifth: type g++ main.cpp -o output you notice file in directory of ma

internet explorer - GWT - Horizontal scroll bar resets when scrolling vertically -

internet explorer - GWT - Horizontal scroll bar resets when scrolling vertically - we have table of data, made datagrid, horizontal , vertical scrollbars. if scroll table right, , scroll table downwards using downwards scroll button, horizontal scroll bar will, half time, jump start position. this appears happen in net explorer, , not firefox, , every other time move horizontal scroll. if log sequence of event, mousedown, blur , mouseup event sequence. if jump doesn't happen, event sequence mousedown, mouseup. we can "fix" resetting horizontal scroll bar, causes screen jump noticeably. the vertical slider separate widget, while horizontal slider part of info grid. does have thought why happening, , can prepare it? internet-explorer gwt

ruby on rails - Is it better to do direct table loads in a high performance application? -

ruby on rails - Is it better to do direct table loads in a high performance application? - i'm using postgresql in rails 3.2 application receives updates 3rd party day long. 3rd party throw on 2,000 requests min @ application, each update consisting of big xml file. right storing basic info each xml file table. then, background process picks big chunks of info in table , copies info table using postgresql's copy feature. am doing right thing or wrong thing here? table load target major crud target of ui. copy feature lock entire table when load happens, , should doing bunch of inserts instead? thought inserts expensive, if direct load locks whole table that's going problem. copy lowest level way mass-insert records postgresql. solution post-process records in background job. alternatively, if need have performance , maintain rails/ruby functionality, consider activerecord-import gem. gem perform mass-insertions , allow activerecord callbacks ,

split - R - Subset of matrix based on cell value of one column -

split - R - Subset of matrix based on cell value of one column - hi there i have matrix (is.matrix(users)=true) x users , 7 columns. first column indicates male/female either 0 or 1. how can split matrix 2 new matrices. 1 boys scores , 1 girls scores. i have users all users sex intelligence ... status user1 0 1234 ... ... user2 1 5678 ... ... user3 1 8765 ... ... ... ... ... ... ... userx 0 4321 ... ... i need boys sex intelligence ... status user2 1 5678 ... ... user3 1 8765 ... ... girls sex intelligence ... status user1 0 1234 ... ... userx 0 4321 ... ... you seek split lst <- setnames(lapply(split(1:nrow(mat1), mat1[,"sex"]), function(i) mat1[i,])

Ember.js: bind query param to select menu whose content is loaded asynchronously -

Ember.js: bind query param to select menu whose content is loaded asynchronously - i have user search form country filter. countries in select menu (drop down) loaded asynchronously ember-data. selected country bound query param: https://myapp.com/users?country=123 working: when user selects country select menu, url updated , contains country id not working: when user browses url containing country query parameter, select menu contain countries but not selecting right country + query param becomes undefined: /users?country=undefined template: {{view "select" content=countries value=country optionlabelpath="content.name" optionvaluepath="content.id"}} controller: export default ember.controller.extend({ countries: ember.computed(function () { homecoming this.store.find('country'); }), country: null, queryparams: ['country'], }); route: export default

ios - Latency issues with MIDI Over Bluetooth -

ios - Latency issues with MIDI Over Bluetooth - i'm playing around midi-over-bluetooth, getting latency issues between ios devices, , between ios , osx yosemite. haven't done extensive testing on desktop, between devices there's around 34ms of latency, far much midi. experiencing similar issues, , there ways create bit more snappy? the test sends timestamp device, sends original device. split difference between current , transmitted timestamp values 2, , have rough score of latency. according the pr of bluetooth latency-optimized product, [our cool product] offers total end-to-end latency of 32 milliseconds (ms) – far less standard bluetooth latency of more 150 ms (+/-50ms). so if around 34 ms own code, that's gets. bluetooth not suitable real-time midi. ios osx bluetooth midi

android - How can a custom listview communicate back to the fragment? -

android - How can a custom listview communicate back to the fragment? - i have dynamic list view (gesture based drag & rearrange) based on custom list view devbytes. in fragment set custom list view. private dynamiclistview mlistview; ... this list view set values (tasks): mlistview.setlistvalues(mtasklist); this mtasklist modified e.g. when task deleted via swipe. happens outside dynamiclistview. whenever order of tasks changed in dynamiclistview needs communicated fragment. due lack of knowledge/experience don't know how custom dynamiclistview can allow fragment know tasks have swapped positions. dynamiclistview: private void swapelements(arraylist<tasklineitemobject> arraylist, int indexone, int indextwo) { tasklineitemobject temp = arraylist.get(indexone); arraylist.set(indexone, arraylist.get(indextwo)); arraylist.set(indextwo, temp); // inform fragment on swap } does have recommendations? android listview andr

r - Grouping based on measurement datetime continuity -

r - Grouping based on measurement datetime continuity - my problem has grouping measurements based on continuity. here example. a=seq(as.posixct("2014-07-20 10:00:00"), as.posixct("2014-07-20 12:00:00"), by="30 min") b=seq(as.posixct("2014-07-20 20:00:00"), as.posixct("2014-07-20 22:00:00"), by="30 min") c=seq(as.posixct("2014-07-21 08:30:00"), as.posixct("2014-07-21 10:30:00"), by="30 min") df= data.frame(date=c(a,b,c), conc=runif(15)) the desired output this date conc grouping 2014-07-20 10:00:00 0.30899449 x 2014-07-20 10:30:00 0.25436235 x 2014-07-20 11:00:00 0.01122904 x 2014-07-20 11:30:00 0.38944058 x 2014-07-20 12:00:00 0.26457760 x 2014-07-20 20:00:00 0.50039528 y 2014-07-20 20:30:00 0.72761115 y 2014-07-20 21:00:00 0.06544978 y 2014-07-20 21:30:00 0.01836020 y 2014-07-20 22:00:00 0.26401722 y 2014-07-21 08:30:00 0.51394754

MSGestureHold event not trigerred in Windows 8.1 -

MSGestureHold event not trigerred in Windows 8.1 - my app uses silverlight 8.0 sdk, msgesturehold event works on windows 8, if same tested on 8.1 event not triggered. can suggest solution? this code works fine in webview wphone 8.1 apps : var init = function(){ var mystate = // context var target = // dom variable target var msg = new msgesture(); msg.target = target; target.addeventlistener("msgesturehold", function (evt) { buttontactilelistener.apply(mystate, [evt, msg]); }, false); target.addeventlistener("pointerdown", function (evt) { buttontactilelistener.apply(mystate, [evt, msg]); }, false); target.addeventlistener("msgestureend", function (evt) { buttontactilelistener.apply(mystate, [evt, msg]); }, false); } var buttontactilelistener = function (evt, msgesture) { var mystate = this; if (evt.type == "pointerdown") { msgesture.addpointer(evt.pointerid); return; }

rest - RESTful APIs when multiple actions on the same URI -

rest - RESTful APIs when multiple actions on the same URI - so far know, 4 kind of methods used in restful apis: get getting resource. post updating resource. put creating or substituting resource. delete deleting resource. assume have resource named apple, , can 'update' in several ways. example, pare it, piece it, or create apple juice. each of these 3 different updating actions takes different arguments, , of apis, mutual part be: post /apple http/1.1 host: www.example.com <different combination of arguments> in situation, 3 apis share same uri , same request method, differences of them arguments. think forces backend ready accepting union set of arguments, , distinguish action requested, backend need check out combination of arguments. it's much complicated , not graceful. so question is: in apple cases, how work out elegant set of restful apis create backend handle it. first of all, seek avoid conflating http methods crud operati

C++ Can I declare a Struct using a variable value as the Struct name? -

C++ Can I declare a Struct using a variable value as the Struct name? - i have declared simple struct utilize in program. when go create variable based on struct in main program, name based on name have stored in variable. is possible? e.g. struct declared this: struct mygreatstruct{ int foo; int fum; } then later in program, user inputs name gets stored in variable called somevariable and need utilize variable value name struct: mygreatstruct somevariable; use associative container e.g. std::unordered_map example: #include <iostream> #include <unordered_map> int main(int argc, char *argv[]){ std::unordered_map<std::string, mygreatstruct> vars; std::string var_name; std::cout << "input var name" << std::endl; std::cin >> var_name; vars[var_name].foo = 1; // using name user gave } c++ struct

How do i convert a date string from user input to date.today() python -

How do i convert a date string from user input to date.today() python - python newbie, need convert string user input in format dd/mm/yyyy , check see if in future?, need re order format of input comparing , convert date object. thanks not sure you're wanting do, take in dd/mm/yyyy , tell if it's older now. import time # input date = input("enter date: ") # convert timestamp date_timestamp = time.mktime(time.strptime(date, "%d/%m/%y")) # check if in future if(date_timestamp > time.time()): print("it's in future,") else: print("it's not in future,") python

java - Modify a form in Spring MVC -

java - Modify a form in Spring MVC - application : spring, jsp is possible create editable form in spring mvc + jsp? can create new form using <sf:form modelattribute="employee method="post> but 1 time inputs saved in database, how form provided user allow them modify inputted values? sorry, don't have thought how can done, have not posted have tried! thanks in advance i assume adding sort of empty employee entity or form object model when render form. example: model.addattribute("employee", new employee()); if want edit employee record after save it, add together employee instance model instead of empty instance. example: employee employee = employeeservice.getemployeebyid(employeeid); model.addattribute("employee", employee); you need create separate controller method has id of employee want edit in path variable or request param know employee instance retrieve , add together model (the illustration abov

content security policy - Polymer Vulcanize CSS -

content security policy - Polymer Vulcanize CSS - i trying bundle polymer web app chrome packaged app, running issues surrounding chrome's content security policy (csp). vulcanizing app (with --csp option) before packaging it, works great javascript portion, fails extract css inlined in polymer's elements. there way either 1) override csp polymer's css or 2) extract css , place in separate file polymer elements? as far can tell, there pr in works resolve issue, hasn't been updated since august: https://github.com/polymer/vulcanize/pull/33. you can utilize gulp-cssmin concatenate css extracted inline htmls vulcanize --csp option. see illustration of clean-css in github page: type one.css two.css three.css | cleancss -o merged-and-minified.css polymer content-security-policy google-chrome-app

"IF" statement MySQL -

"IF" statement MySQL - i making app can vote things, have table contains "rating" goes 0 100 , contains "votes" too, represents number of votes. using: update maincategory set rating='75'/votes but when nobody else have voted yet, votes "0". , makes "75/0" (division "0"). how can create "if" statement or else verifies if thing have "0" votes yet , not split "votes" (because they're "0")? thanks in advance edit: vote logic doesn't create much sense, have seen now... sorry, must create right this? maybe add together ratings , split number of votes? just run on rows have votes. update maincategory set rating='75'/votes votes>0 leave others @ default of 0 or null rating , handle in app. also, '75'/votes bit sounds bit off me. 1 vote, it'll have rating of 75. 2 votes, it'll have rating of 37.5. votes typically

jsp - Cannot iterate through HttpSession after going to the controller for 2nd time -

jsp - Cannot iterate through HttpSession after going to the controller for 2nd time - in controller have : switch(testing){ case "display" : arraylist<> list = new arraylist<>(); list.add(filldata) // string values httpsession test = request.getsession(); test.setattribute("testdata",list); test.setmaxinactiveinterval(50000); break; case "read" : arraylist<> list2 = new arraylist<>(); // logic request.setattribute("testdata",list2); break; } requestdispatcher view = request.getrequestdispatcher("/" + page); // jsp page view.forward(request, response); and in jsp have : <c:choose> <!-- iteration works , sessionscope.testdata not null. --> <c:when test="${sessionscope.testdata !=null && requestscope.testdata == null> <c:foreach items="${sessionscope.testdata}" var="elems" v

c# - Import excel to SharePoint 2010 custom forms -

c# - Import excel to SharePoint 2010 custom forms - i having problem in uploading excel info .net forms deployed on sharepoint 2010 environment. functionality upload excel trough .net forms , excel saved location on server. 1 time excel saved on server microsoft.ace.oledb.12.0 provider fetch info excel , upload comma separated values on .net text box control. here challenges facing currently. 1.) functionality working when user logged in service account(higher permissions account) on sharepoint 2010. 2.) tried logging in user business relationship on sharepoint did not work , throwing error below. think happening due permissions issue. cannot assign users service business relationship permissions. is there way can impersonate login service business relationship finish activity of uploading excel , dispose login of user account? or suggestions help me prepare issue? error message: error occured: system.data.oledb.oledbexception: unspecified error @ system.data.

authentication - Laravel: Dependency Inject Auth -

authentication - Laravel: Dependency Inject Auth - how dependency inject auth in laravel? like this: public function __construct(auth $auth) { $this->auth = $auth; } if not work: $user_type = auth::user()->user_type; you should type hint illuminate\auth\authmanager : public function __construct(illuminate\auth\authmanager $auth) { $this->auth = $auth; } authentication laravel laravel-4 dependency-injection

jquery - Struts 2 i18n not working on dynamic content -

jquery - Struts 2 i18n not working on dynamic content - i want translate page changes content depending on click. i.e. i have jsp code, main.jsp: <%@ page contenttype="text/html; charset=utf-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!doctype html> <html> <head> <meta charset="utf-8"> <title>main</title> <script type="text/javascript" src="js/jquery-1.11.1.js"></script> </head> <body> <div id="header"> <!-- when click on link, #content load page [cars.jsp | plains.jsp | ships.jsp] --> <a id="cars" href="#"><s:text name="global.cars" /></a> <a id="plains" href="#"><s:text name="global.plains" /></a> <a id="ships" href="#"><s:text name="global.ships"

java - getting exception .NoClassDefFoundError: com/itextpdf/text/log/CounterFactory -

java - getting exception .NoClassDefFoundError: com/itextpdf/text/log/CounterFactory - i trying create pdf/a document using itext , java next code: pdfawrite author = pdfawriter.getinstance(mydoc, mystream, pdfaconformancelevel.pdf_a_1a); but maintain getting exception: java.lang.noclassdeffounderror: com/itextpdf/text/log/counterfactory @ com.itextpdf.text.pdf.pdfawriter.<init>(pdfawriter.java:210) @ com.itextpdf.text.pdf.pdfawriter.getinstance(pdfawriter.java:86) this pom.xml <dependency> <groupid>com.itextpdf</groupid> <artifactid>itextpdf</artifactid> <version>5.5.3</version> </dependency> <dependency> <groupid>com.itextpdf</groupid> <artifactid>itext-pdfa</artifactid> <version>5.5.3</version> </dependency> can tell should prepare problem? thanks i similiar exceptions when have said class in more 1 jar. maybe should chec

r - dplyr: put count occurences into new variable -

r - dplyr: put count occurences into new variable - would hand on dplyr code, cannot figure out. have seen similar issue described here many variables (summarizing counts of factor dplyr , putting rowwise counts of value occurences new variables, how in r dplyr?), task smaller. given info frame, how count frequency of variable , place in new variable. set.seed(9) df <- data.frame( group=c(rep(1,5), rep(2,5)), var1=round(runif(10,1,3),0)) then have: >df grouping var1 1 1 1 2 1 1 3 1 1 4 1 1 5 1 2 6 2 1 7 2 2 8 2 2 9 2 2 10 2 3 would 3rd column indicating per-group ( group ) how many times var1 occurs, in illustration be: count=(4,4,4,4,1,1,3,3,3,1). tried - without success - things like: df %>% group_by(group) %>% rowwise() %>% do(count = nrow(.$var1)) explanations appreciated! all need grouping info both columns, "group" , "var1

What excel format i have file in? -

What excel format i have file in? - i got excel file .xls format, excel 2007 can open it, throws message file in format extension , if im sure want open it. i opened file in notepad , these first lines <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/tr/rec-html40"> <meta name="progid" content="excel.sheet" /> <meta name="generator" content="microsoft excel 9" /> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> i tried save file formats .xml, .ods , on, cant find real format/extension name. dont know ? seems compatible excel. ok found format, .xlhtml and c# code told me microsoft.office.interop.excel.application excelapp = new microsoft.office.interop.excel.application(); excelapp.visible = false; microsoft.office.intero

Java boolean conditioned while loop seemingly ignoring an if statement? -

Java boolean conditioned while loop seemingly ignoring an if statement? - around here - if (code<10 || code>99) seems issue. when entering number outside range loop continues infinitely, seemingly ignoring condition. tried system.exit(0) , though did job seek , utilize while loop stop code. import java.util.*; public class lockpicker { public static void main(string[] args) { scanner kb = new scanner(system.in); random r = new random(); boolean stop = false; while (!stop) { system.out.print("what unlock code? "); int code = kb.nextint(); if (code<10 || code>99) { system.out.println("your number must between 10 , 99"); stop = !stop; } system.out.println("picking lock..."); system.out.println(""); int x = -1, counter = 0; while (x!=code) { x = r.

android - Eclipse doesn't apply changes in AndroidManifest -

android - Eclipse doesn't apply changes in AndroidManifest - so, question isn't coding knowledge , technical competence, that's why i'll omit code. the problem since unknown moment in past, nil declare in manifest has impact on android application. these handful of examples , expected outcomes fail perform: declaring service in manifest doesn't allow run via startwakefulservice(context, intent) method changing class name of declared (it doesn't work either) receiver doesn't cause application crash on launch (if manifest work should crash due resourcenotfound) there declaration of receiver isn't nowadays in project (my coworker didn't commit repository) , doesn't crash application. i've tried many things don't want list them, i'll maintain browsing through answers , find haven't tried. the code works. i've copy/pasted in project , works okay. in original application works except parts handled manifest. edit:

scala - lazy iterator calls next too many times? -

scala - lazy iterator calls next too many times? - i'm trying build lazy iterator pulls blocking queue, , have encountered weird problem next() appears called more times expected. because queue blocking, causes application stuck in cases. some simplified sample code: "infinite iterators" should { def mkiter = new iterable[int] { var = 0 override def iterator: iterator[int] = { new iterator[int] { override def hasnext: boolean = true override def next(): int = { = + 1 } } } override def tostring(): string = "lazy" } "return subsets - not lazy" in { val x = mkiter x.take(2).tolist must equal(list(1, 2)) x.take(2).tolist must equal(list(3, 4)) } "return subsets - lazy" in { val x = mkiter x.view.take(2).tolist must equal(list(1, 2)) x.view.take(2).tolist must equal(list(3, 4)) } } in illustration above, lazy test fails be