Posts

Showing posts from September, 2013

dynamics crm - Hiding a link in the sitemap based on security role in crm 2011 using javascript -

is there way hide link in sitemap in crm 2011 using javascript? link not of entity. it's injected link opens custom html page in dashboard. there way can wire javascript function link can made visible/hidden invoking javascript function? if not possible, there possibly workaround this? thanks. you can restrict users' access subarea using privilege element. if user doesn't have right privilege, subarea won't show, though not trigger programmatically on load. <subarea id="search" icon="" url="http://www.dropbox.com"> <titles> <title lcid="1033" title="dropbox search" /> </titles> <descriptions> <description lcid="1033" description="dropbox searching." /> </descriptions> <privilege entity="product" privilege="create" /> </subarea>

Zsh : for loop makes failing awk pattern -

i’m writing scripts manage users specifics quotas on server. so, apply quota 10gb users in group quota10, i’m using "setquota -p", have several groups. so made script manage users groups. #!/bin/zsh groups=(1002 1007) gid in $groups echo $gid echo $(awk -f: '$4 == gid {print $1}' gid=$gid /etc/passwd) but when execute it, there last group give me users in group. /etc/passwd kimino:x:1010:1002::/home/kimino:/bin/bash kiminoo:x:1011:1007::/home/kiminoo:/bin/bash /etc/group quota10:x:1002: quota20:x:1007: output of script # ./apply_quota_on_users.zsh 1002 1007 kiminoo do have idea what’s wrong ? you have wrap functions in block: for gid in $groups echo $gid echo $(awk -f: '$4 == gid {print $1}' gid=$gid /etc/passwd) done

oracle - Rank function in MySQL with Order By clause -

how (oracle) sql: select a.*, rank() on (partition a.field1 order a.field2 desc) field_rank table_a order a.field1, a.field2 be translated mysql? this question seems similar there no order in end of base query. also, matter ordered fields of partition? according link gave should this: select a.*, ( case a.field1 when @curtype @currow := @currow + 1 else @currow := 1 , @curtype := a.field1 end ) + 1 rank table_a a, (select @currow := 0, @curtype := '') r order a.field1, a.field2 desc; here 2 fiddles, 1 oracle , 1 mysql based on example link gave: oracle mysql

stored procedures - Nested select statements -

i trying return results based on number of cases if greater 0 when try execute stored procedure error stating: operand type clash: uniqueidentifier is incompatible tinyint. , nested select statement in clause. select o.officeid, o.officename name, at.description caseactivity, sum(a.duration) [caseminutes], cast(sum(a.duration) float) / 60 [casehours], count(a.activityid) activities, count(distinct a.caseid) cases, min(cast(a.duration float) / 60) [case min time], max(cast(a.duration float) / 60) [case max time], sum(cast(a.duration float) / 60) / count(a.activityid) [case avg time], sum(cast(a.duration float) / 60) [case totalhours] activity inner join activitytype @ on a.activitytypeid = at.activitytypeid inner join activityentry ae on a.activityentryid = ae.activityentryid inner join [case] c on a.caseid = c.caseid inner join [office] o on ae.officeid = o.officeid inner join [u...

dreamweaver - Eclipse snippet grouping -

Image
i'm in process of transitioning dreamweaver eclipse when comes php development , have admit eclipse offers brilliant features far class browsing , syntax completion concerned. i'm using code snippets mechanism speeds process of developing app. playing around snippets in eclipse , similar, difference can't find way of grouping snippets . ie. in dreamweaver had code snippets referring our db class (for connecting, fetching fields etc.), session handling etc. in eclipse, however, can create snippets in 1 big list. there way of grouping them or using 3rd party tool (commercial?) recommend? thanks, paul just use built-in snippets tool eclipse window > show view > other .....type "snippets" or select general/snippets right-mouse click inside area click "customize..." then following menu pops up. create new "category" the categories cannot nested, though. there 1 single level.

visual studio - "type 'int' unexpected" in constructor, Can't find WHY? -

i'm quite new c++ , syntax. have programmed in c# before, thought give c++ try. i created classlibrary in visual studio , want add classes it. know managed c++. but can't wrap head around why keep getting these errors: error c2062: type 'int' unexpected error c2143: syntax error: messing ; before '{' error c2447: '{' : missing function header (old-style formal list?) this header file: // librarylib.h #pragma once #include <string> using namespace system; namespace librarylib { public enum entrytype {book, newspaper}; public ref class entry { public: int id; int year; string ^ title; entrytype type; entry(int id, int year, string ^ title, entrytype type); }; } this cpp file: // main dll file. #include "stdafx.h" #include "librarylib.h" namespace librarylib { librarylib::entry(int id, int year, string ^ title, entrytype type) // line of errors { id = id; year = year; ...

c# - EF does not include where clause -

i have small issue ef. i'm performing query on large table, , takes long. think found cause, cannot find solution; my linq query looks this: ienumerable<string> o = (from p in table p.itemid == itemid && p.imagesize == size select p.path); return o.any() ? o.firstordefault() : null; i expect produce sql query clause, produces this: select [extent1].[itemid] [itemid], [extent1]......... snap 10 columns [dbo].[table] [extent1] the clause , select (i try select 1 column) executed after enumeration. want produce sql query clause , select 1 column. what doing wrong? since creating ienumerable<string> type of object, ef runs query in first line. any() or firstordefault() executed in memory set. if want "continue" writing linq statements , run query in end; go iqueryable<t> . iqueryable<string> o = (from p in table p.itemid == itemid && p.imagesize == size select p.path); return o.singleordefault(); bu...

javascript - Remove from ... to -

so have kind of problem: need remove "information" tag tag including text between it. so somewhere in html is: <input type="radio" rel="1" value="surname1" name="lastnames">surname1<br> <input type="radio" rel="2" value="name2" name="lastnames">name2<br> <input type="radio" rel="3" value="lol" name="lastnames">lol<br> <input type="radio" rel="4" value="lol2" name="lastnames">lol2<br> and example: var current_id = $('input:checked:radio').attr('rel'); $.get('index.php?delete_by_id='+current_id); $("input:radio[rel='"+current_id+"']").remove(); so, after php sent, need delete radio list deleted item. input ok, name next him have problems... ps. know, situation stupid, don't have time rewrite until tomor...

implementing an onclick event on the nodes of a spacetree with Javascript Infovis Toolkit -

i'm using infovis library plot spacetree. unfortunately there problem when implementing event on nodes nodes false. there thread on associated google group: https://groups.google.com/forum/?fromgroups#!topic/javascript-information-visualization-toolkit/njtbe9hq5bq the solution given fix 'contains' in nodetypes: https://github.com/philogb/jit/blob/master/source/visualizations/spacetree.js#l1370 i copy-pasted new nodetypes implementations, unfortunately it's still not working (nodes still false). any idea? edit: it's possible close creating label on plot of nodes. this known bug stated in question, 2 solutions: correcting library shown on line 1370 of spacetree.js using work-around i managed implement desired functionality creating label using onplot option each node.

Evade polling when accessing Matlab from Python -

i access matlab python (on windows, remotely , via com-interface). goal is: matlab doing work , permanently changes value of variable. need know when value exceeds constant. right now, i'm polling matlab value of variable in indefinite loop breaks on exceeding value. however, let matlab work , tell me when case, while i'm lazily sitting there listening. there way achieve this, , how done best? have thought of defining callback function i'm passing matlab, on exceed-event triggers break out of non-busy-wait-loop in python, doubt work. i'm not experienced neither in matlab nor python, cues appreciated. there's lot of other code involved, right like connecttomatlab(*args) while true: val = getvaluefrommatlab() if val > constant or timeout: break what have in mind is def breakloop(): ... connecttomatlab(breakloop, *args) while true: time.sleep(1) # or alternate non-busy-wait and let matlab invoke breakloop() upon val > constant ....

How to enable OpenSSL support in an alternate install of Python 2.5.1? -

some background info: i'm trying run server program in python 2.5.1 (the version server written , tested on). program needs openssl library of functions. installed python 2.5.1 source yum repository amazon linux instance i'm running on not have version of python need. when try run server python 2.5.1 following import error: traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named openssl i know openssl libraries installed can import them python 2.6 (the version of python installed yum). it's python 2.5.1 installation can't see them. i have installed pyopenssl via yum no luck. installed python libraries specific particular version. pyopenssl installed yum system python. need install separate instance of pyopenssl alt-installed 2.5 python. if use python2.5 install distutils you'll find have easy_install-2.5 can use: easy_install-2.5 pyopenssl (or similar). note may inst...

c# - XHTML file reading using HTMLAgilityPack.dll -

i working on c# (windows form based) project. requires read contents xhtml files.the xhtml files stored on local drive , not on web. possible read contents of xhtml pages (without tags) using 'htmlagilitypack.dll'? if not there other solution it? thanks; mayuresh. yes can. i'm using library , works fine. exposes api similar .net's system.xml.xmldocument class, except prefixed html, obviously. html document tree can queried using xpath, xml document.

embedded - ARM clock speed on raspberry pi -

running bare-metal (no operating system, no linux) the specs implies arm can/does run 700mhz, sys clock matches manual , appears running @ 250mhz. simple tests on arm imply doing same, example instruction cache on test: subs r0,r0,#1 bne test and vary number of subs instructions dominate on branch, in ball park of 250mhz long way away 700mhz. i there phy setting not seeing in datasheet multiplying arm clock? edit: maybe assumptions flawed... .globl armtest0 armtest0: subs r0,r0,#1 bne armtest0 bx lr .globl armtest1 armtest1: subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 bne armtest1 bx lr .globl armtest2 armtest2: subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 subs r0,r0,#1 ...

ruby on rails - pass variable through render -

i making nested form, done in railscasts , have problem render. in form have <% form_for @question, :url => user_questions_path, :html => {:multipart => true} |f| %> <%= f.label :name %> <%= f.text_field :name, :class => "text_input" %> <%= f.label :description %> <%= f.text_area :description, :cols => "1", :rows => "1", :class => "textarea" %> <div id="reg"> <%= render :partial => "user_form", :f => f %> </div> ... <% end %> and in user_form file have <% f.fields_for :user |builder| %> <%= builder.label :email %> <%= builder.text_field :email, :class => "text_input" %> <%= builder.label :password %> <%= builder.text_field :password, :class => "text_input...

Change z-index of marker in openlayers -

i've layer multiple markers rather big icons, overlap. via list on side of map users can select marker , map pan (and zoom) it. still behind other makers. how individual makers z-index , set it? useful highest used z-index , add one. (another solution add total number of markers z-index) the markers (or features) in mylib.features array. console doesn't show z-index type functions. i can't find appropriate example or api function this. edit: i found example: http://dev.openlayers.org/examples/ordering.html don't understand it. somehow created feature takes next z-index given layer via somekind of symbolizer. have no idea how work static sort dynamic one. try this: first of all, make sure using openlayers.layer.vector layer, not openlayers.layer.markers layer. apparently markers layer old news , new development done in vector layer. has more features. (i wasted pile of time markers layer myself). then, each of markers needs openlayers.feature...

iphone - Can't understand why my tableview with GCD is crashing -

i've finished re-writing this, , covered every conceivable angle can think of. don't know why crashing. perhaps me figure out. this cellforrowatindexpath code: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; jhomeviewcell *cell = (jhomeviewcell *)[tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[jhomeviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; cell.delegate = self; } cell.cellcontent.cellinfo = [self cellinfoforcellatindexpath:indexpath]; if (cell.cellcontent.cellinfo.thumbnailscomplete == yes || cell.cellcontent.cellinfo.thumbnailsbeingcreated == yes) { [cell.cellcontent setneedsdisplay]; } else { [cell.cellcontent setup]; } return cell; } and in cellcontent, there...

php - Optimizing sql statements to reduce MySQL server load -

$sql1 = "select questions last_check_date user_id=? order questions desc limit 1"; $sql2 = "select id questions add_dt>?"; what statements above do? when execute sql1 , gets last check date user. then i'm executing second query, fetch id's add date>last check date (from sql1 ) , return affected rows count. what want merge 2 statements 1, , optimize query count. following problem may occur: there no row user in $sql1 : must select rows in sql2 , return affected rows count. i can't figure out how must like.. thx in advance update show create table last_check_date; result is create table `last_check_date` ( `id` int(11) unsigned not null, `user_id` bigint(20) unsigned not null, `questions` datetime default null, `users` datetime default null, primary key (`id`) ) engine=innodb default charset=utf8 and show create table questions; create table `questions` ( `id` int(11) unsigned not null auto_increment, `autho...

java - sqlite and mysql. which is better when the applications has all processes running on the same machine and when the database has hardly 2 tables -

i need choose between sqlite , mysql. little confused on choose. know both database engines have no recursive query mechanisms , sqlite doesn't support stored procedures. situation. have application has around 1000 processes accessing same database. database has around 2 tables , around 10,000 entries in total. application isn't distributed, mean processes running on same machine. want embed database in application itself. think mysql isn't idea keeping these in mind. application doesn't involve complex queries (a couple of select, update , insert queries) know sqlite lighter mysql mysql supports stored procedures , sqlite doesn't. need locking mechanisms. don't want process lock table long time. i've read locking/unlocking operations pretty fast in sqlite (http://sqlite.org/lockingv3.html). new databases, please bear me. please me deciding better. for embedding small database app, sqlite best way go - mysql more useful database on server. loca...

How can I insert data from a text file into a sql database in android? -

i'm quite new sqlite databases , need using external text file create initial database store bunch of items can selected , added second database. put in context, want have initial database stores list of grocery store items. each item have 2 traits them, name , type. there items such as( name bread, type bakery. name grape juice, type beverage. name toothbrush, type toiletries. ) i need go this: grocerystore.txt -- -- -- -- -- -- name - type bread - bakery rolls - bakery juice - beverages soda - beverages to this: dbhelper.insert("bread", "bakery"); or: dbhelper.insert(name, type); for each item in text file. first of all, know how format text file, or other type of file read , inserted database if text file not easiest way go this. second, how go reading text file , inserting database? i'm thinking use buffered reader , inputstream within loop go , insert each item database. i'm not sure how parse each line give each item na...

javascript - populating a dropdown box, based on the selection of another dropdown box using php, mqsql and ajax -

i trying populate drop down box, based on selection drop down box. here have php code: <form id="inventory" method="post" action=""> <fieldset> <label for="area" >select shelf area</label> <select id="area" name="area"> <option value=""></option> <?php $area = $conn->query(" select substring_index(location, ' ', 1) area location group substring_index(location, ' ', 1)"); while ($row = $area->fetch_assoc()) { echo '<option value="' . $row['area'] . '" >' . $row['area'] . '</option>'; } > </select><br/> </fieldset> </form> when run query, fine, need take results of , use populate drop down box ( <'value previous ...

ruby on rails - Select context dynamically -

in models have contexts like acts_as_taggable_on :sport, :music in console can this @student = student.first @student.sport_list = ("baseball, soccer") @student.save @student.music_list = ("rock, pop") @student.save @student.sport_list [baseball, soccer] @student.music_list [rock, pop] all works right but, in views want dynamic catch in 1 string context selected between others contexts javascript example: mycontext = music my doubt is: possible make dynamic do @student.mycontext_list = "rock, pop" because following error undefined method `mycontext_list=' student:0xb4475d4c greetings friends!!! try below: @student.send :"#{mycontext}_list=", "rock, pop"

json - Creating an Rails based API. A bit lost what to do after object is saved -

i'm creating rails based api manage sms subscriptions. there's subscriptions controller respond_to :html, :json, :xml , subscription model. both working fine. when subscription made, user still needs confirm subscription entering pin on page sent phone, i'm thinking of confirms controller manage that. i have few questions regarding how implement this. (1) right approach or best practice after subscription made. show subscription object created (html, json or xml depending how created) , manage confirms controller separated action or should redirect confirmation controller instead? i guess since api responds json , xml, not idea redirect other page/controller , better show object created? (2) if case, i'm using cancan manage role abilities. since subscriptions belong user owner (the developer) doesn't need authenticated post (i know who's user owner associated because of combination of keyword/shortcode given) , subscriptions can made surfer (...

android - Keep connection between activities using DefaultHttpClient -

i'm developing app sends requests sap, i’ve been wrestling keep connection alive while i’m in app. i got 3 activities: main , connection , list . when start app goes main , after tap on connection establish connection between sap , device , connects successfully. the issue have when press return button main , go list activity, cannot retrieve data because have lost defaulthttpclient had connection. public string logintosap(string pip, int pport, string pschema, string puser, string ppassword) { string result = ""; // httphost targethost = new httphost(pip, pport, pschema); httphost targethost = new httphost(pip, pport, pschema); // defaulthttpclient httpclient = new defaulthttpclient(); httpclient.getcredentialsprovider().setcredentials(new authscope(targethost.gethostname(), targethost.getport()), new usernamepasswordcredentials(puser, ppassword)); // create authcache instance authcache authcache = ...

c++ - Trying to build Boost with gcc toolchain -

for reason when try run b2 toolset=gcc following. c:\boost_1_49_0>.\b2.exe toolset=gcc c:/boost_1_49_0/tools/build/v2/tools\gcc.jam:129: in gcc.init module gcc error: toolset gcc initialization: error: no command provided, default command 'g++' not found error: initialized c:/boost_1_49_0/tools/build/v2/build\toolset.jam:38: in toolset.using modul e toolset c:/boost_1_49_0/tools/build/v2\build-system.jam:481: in process-explicit-toolset -requests module build-system c:/boost_1_49_0/tools/build/v2\build-system.jam:562: in load module build-s ystem c:\boost_1_49_0\tools\build\v2/kernel\modules.jam:283: in import module mod ules c:\boost_1_49_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build mod ule c:\boost_1_49_0\boost-build.jam:17: in module scope module what doing wrong? edit: had add c:\mingw\bin path environment variable. you should run command in command line can access mingw/cygwin bin directory. mean when type g++ works , doesn't return c...

javascript - PNG images with hot spots? -

Image
i have few full screen png's want create regions on images such when user clicks on 1 of regions, specific png dissolves in replace current image. i'm creating sort of slide show might have 3 or 4 active regions cause different images appear. techniques doing have not changed much: use imagemap or place transparent elements on image , give them click event.

php. dictionary data structure, (integer, string) as a key -

in python dictionary can use tuples keys. can use key next combination: (integer, string) . want same in php. standard php array can use strings or integers. splobjectstorage uses objects key. how can same functionality in php? the simple answer cannot. functionally equivalent though should simple: $array["$int,$str"] or maybe multi-dimensional array: $array[$int][$str]

Alternative way to write string literals in PHP? (without ' or ") -

what use in php in place of normal ' , " symbols around something? example: echo("hello world!") thanks! there 4 ways encapsulate strings, single quotes ' , double quotes " , heredoc , nowdoc . read full php.net article here . heredoc a third way delimit strings heredoc syntax: <<<. after operator, identifier provided, newline. string follows, , same identifier again close quotation. http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc $str = <<<eod example of string spanning multiple lines using heredoc syntax. eod; nowdoc nowdocs single-quoted strings heredocs double-quoted strings. nowdoc specified heredoc, no parsing done inside nowdoc. construct ideal embedding php code or other large blocks of text without need escaping. shares features in common sgml construct, in declares block of text not parsing. a nowdoc identified same <<< sequence ...

ruby - How to modify a gem files in rails 3 project -

i'm using rails 3 bundler, installed gem using bundler, need modify flow of gem modifying controller of gem, how supposed so, i'm sure there command install files locally can modify it, tried override controller creating controller same name sounds not working . you should able make controller, inherit gem controller , override method behavior see fit class mycontroller < contactus::contactscontroller def create # code changes behavior end end and may have tell routes go controller resources :contacts, :controller => 'my_controller'

html - Having Trouble Applying CSS to a form -

hello trying apply css form: <form action="http://billerica.mvlc.org/opac/en-us/skin/default/xml/rresult.xml" accept-charset="utf-8" method="get"> <div id="search-box"> catalog search:<br /> <input type="hidden" id="rt" name="rt" value="keyword" /> <input type="hidden" id="tp" name="tp" value="keyword" /> <input type="text" alt="input box catalog search" maxlength="250" size="20" id="t" name="t" value="" /> <input type="hidden" id="ft" name="ft" value="" /> <input type="hidden" id="l" name="l" value="9" /> <input type="h...

android - ndk-build arm-linux-androideabi-gcc: Command not found -

i've spent day , have looked @ several tutorials, cannot ndk-build compile make file. see current code is, @ tutorial i'm following here: https://thenewcircle.com/s/post/1153/introduction_to_ndk i'm on windows 7 64-bit system i'm running cygwin. go project directory "fibonaccinative" , type "ndk-build" , i'm getting: $ ndk-build make: /cygdrive/c/android/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows-/bin/arm-linux-androideabi-gcc: command not found make: /cygdrive/c/android/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows-/bin/arm-linux-androideabi-gcc: command not found compile thumb : com_marakana_android_fibonaccinative_fiblib <= com_marakana_android_fibonaccinative_fiblib.c /bin/sh: /cygdrive/c/android/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows-/bin/arm-linux-androideabi-gcc: no such file or directory /cygdrive/c/android/android-ndk-r8/build/core/build-bi...

c# - WPF "Calendar only month" fire DisplayDateChanged on hover -

i best explain problem: first wanted calendar shows month, make it <calendar x:name="_calendar" displaymode="year" displaymodechanged="_calendar_displaymodechanged" displaydatechanged="_calendar_displaydatechanged"/> then when displaymodechanged fire simple this: private void _calendar_displaymodechanged(object insender, calendarmodechangedeventargs ine) { if (_calendar.displaymode != calendarmode.year) { _calendar.displaymode = calendarmode.year; } } its until want refresh data on grid when user change selected month, example: private void _calendar_displaydatechanged(object insender, calendardatechangedeventargs ine) { _refreshgrid(); } the first time (i mean before user interact calendar), grid refresh ok, , if user hover mouse on others month nothing happens (i want this). after user click on month grid refresh ok again,...

javascript - Why does not onChange event produced? -

assume, have following markup: <form> <button type="button" id="all">check all</button> <button type="button" id="none">check none</button> <input type="checkbox" value="one" /> <input type="checkbox" value="two" /> <input type="checkbox" value="three" /> </form> and following javascript code: (function($, document) { $('#all').on('click', function() { $('input', $(this).parent()).prop('checked', 'checked'); }); $('#none').on('click', function() { $('input', $(this).parent()).removeprop('checked'); }); $('input').on('change', function() { alert(this.value); }); }(jquery, document)); (see http://jsfiddle.net/inst/h7kyq/1/ ) why doesn't input's onchange event ...

Using Python/Django to update GitHub -

this broken code wrote update github repo django powered web-based code-editor, see https://github.com/djangocoder/djangogui/blob/master/projects/views.py line 763. how rewrite code work? def update_github(request, project_slug): print 'update github\n' * 100 project = project.objects.get(created_by=request.user, slug=project_slug) import pexpect child = pexpect.spawn('/bin/bash',) import sys child.logfile = sys.stdout print 'a' child.sendline('cd %s' % (project.get_current_directory())) print 'b' child.sendline('git add *') child.sendline('git commit -m "commit"') print 'c' child.sendline('git push -u origin master') print 'd' child.sendline('ssgmssgm2') print 'e' return httpresponse('') i think should use github api kind of work. see http://developer.github.com/v3/ more more details....

math - vectorial ODE in mathematica -

i want solve following equation in mathematica : dsolve[{x'[t] == a.x[t], x[0] == ( {{0},{0}} )}, x[t], t] it system of 2 odes coupled matrix a , don't want put in form {{a,b},{c,d}} in order have output function of matrix exponential. mathematica understands gives solution strangely expresed : {{x[t] -> inversefunction[dot, 2, 2][a, e^(t a.1) inversefunction[inversefunction[dot, 2, 2], 2, 2][a, 0]]}} where indeed uses matrix exponential, relies on strange notation inversefunction [...] my question how rid of inversefunction notation have more readable expression. example have manner postulate a (2,2) matrix, invertible, inverse b ? if can hope better result maxima, please advise. lot help

asp.net mvc - Url.Action passing fragment -

how 1 pass inline anchor using urlhelper in asp.net mvc? for example, if have url: /foo/bar/information/faq#toc and using following url.action except #toc fragment <a class="next" href='@url.action("bar", "foo", new { subpath = "information/faq" } )'>my link text</a> my question: there overload url.action pass in #toc fragment? i'd rather not use hardcoded concatenation or @url.content (admittedly way cheat of time). use html.actionlink linkextensions passing "toc" fragment parameter: https://msdn.microsoft.com/en-us/library/dd460522.aspx

android - onTap on map-marker give me NullPointerException -

having problem ontap on markers in google map. this error 05-31 21:46:21.420: e/androidruntime(5541): java.lang.nullpointerexception 05-31 21:46:21.420: e/androidruntime(5541): @ com.android.internal.app.alertcontroller$alertparams.(alertcontroller.java:753) 05-31 21:46:21.420: e/androidruntime(5541): @ android.app.alertdialog$builder.(alertdialog.java:273) 05-31 21:46:21.420: e/androidruntime(5541): @ my.class.hellomapview$locationoverlay.ontap(hellomapview.java:1361) and code error @ my.class.hellomapview$locationoverlay.ontap(hellomapview.java:1361) public class locationoverlay extends itemizedoverlay<overlayitem> { //public class locationoverlay extends itemizedoverlay{ private arraylist<overlayitem> overlaylist = new arraylist<overlayitem>(); private mapview mapview; public string pickedlat; public string pickedlng; private context mcontext; public locationoverlay(mapview mapview, d...

c++ - Losing data after reading them correct from file -

i have fallowing class of object class data structure use in main combined. adt(abstract data type) linked list. after read file input data , create , object @ print looks fine after print. after push_back() 3-rd int variable initializated 0. example , code: ex.in: 1 7 31 2 2 2 3 3 3 now create objects each line, @ print suppose, after push_back(): 1 7 0 2 2 0 3 3 0 class.h: class rangle { private: int x, y, l, b; public: int solution,prec; rangle(){ x = y = solution = prec = b = l =0; } rangle(int i,int j,int k){ x = i; y = j; l = k; solution = 0; prec=0; b=0; } friend ostream& operator << (ostream& out, const rangle& ra){ out << ra.x << " " << ra.y << " " << ra.l <<endl; return out; } friend istream& operator >>( istream& is, rangle& ra){ >> ra.x; >> ra.y;...

javascript - regex - get numbers after certain character string -

i have text string can number of characters attach order number end. can pluck off order number when need use again. since there's possibility number variable length, regular expression catch's after = sign in string ?order_num= so whole string be "aijfoi aodsifj adofija afdoiajd?order_num=3216545" i've tried use online regular expression generator no luck. can please me extracting number on end , putting them variable , put comes before ?order_num=203823 own variable. i'll post attempts of own, foresee failure , confusion. var s = "aijfoi aodsifj adofija afdoiajd?order_num=3216545"; var m = s.match(/([^\?]*)\?order_num=(\d*)/); var num = m[2], rest = m[1]; but remember regular expressions slow . use indexof , substring / slice when can. example: var p = s.indexof("?"); var num = s.substring(p + "?order_num=".length), rest = s.substring(0, p);

optimization - Java game development. Making a tile-map faster. Advices on optimisations -

i'm trying make fully-automated game engine needs working based on events. problem i'm facing i've made map class , it's initialized in game class. it's static , 1 map exists game. new maps loaded clearing objects in current map , adding new maps. can see source of map class here. http://code.google.com/p/game-engine-for-java/source/browse/src/com/gej/map/map.java the main problems comes in collision detection, i'm using brute-force collision detection should not. slows down game lot , wanna check collisions objects nearer object. i've been using maploader interface construct maps. i'm thinking calling collision() method of objects in thread might help. how-ever map objects updated in game class. here's game class if in case might help http://code.google.com/p/game-engine-for-java/source/browse/src/com/gej/core/game.java there's problem some-times, objects aren't destroyed. i'm calling map's removeobject() method takes 1...

Why does my php code to edit my mySQL table show as blank page? -

i have edit button @ end of table of mysql records displays in webpage. when click edit button, however, edit.php generates blank page. i can't figure out why: <?php // contact database $connect = mysql_connect("localhost", "xxx", "xxx") or die ("error , check server connection."); mysql_select_db("xxx"); ?> <?php $posted_id = $_post['id']; ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> </head> <body> <div class="form"> <?php $result = mysql_query("select * ff_projections id = '$posted_id'") or die ("error in query"...

Android Libgdx application, failed resolving AndroidApplication -

i'm stuck on android project using libgdx. desktop project works perfectly. android project contains libs folder containing armeabi , armeabi-v7a , android gdx backends. activity declared in manifest i'm used using these tools. used work , sudden facing persistent error (after project fixing, cleaning, restarting, redownloading libs, trying different api, sdk levels, jdk...). here log of error 06-05 03:28:38.953: i/dalvikvm(5312): failed resolving lcom/badlogic/gdx/backends/android/androidapplication; interface 73 'lcom/badlogic/gdx/application;' 06-05 03:28:38.963: w/dalvikvm(5312): link of class 'lcom/badlogic/gdx/backends/android/androidapplication;' failed 06-05 03:28:38.963: w/dalvikvm(5312): unable resolve superclass of lcom/me/example/example_rlactivity; (94) 06-05 03:28:38.963: w/dalvikvm(5312): link of class 'lcom/me/example/example_rlactivity;' failed 06-05 03:28:38.963: d/androidruntime(5312): shutting down vm 06-05 03:28:38.96...

What's the rails way to include a field in a join model when listing an association? -

so if have following relationship class item < activerecord::base has_many :item_user_relationships has_many :users, :through => :item_user_relationships end class user < activerecord::base has_many :item_user_relationships has_many :items, :through => :item_user_relationships end class itemuserrelationship < activerecord::base belongs_to :item belongs_to :user attr_accessible :role end what's rails way include role attribute when listing users of item? @users = @item.users # want include role part of user thanks! update : i'm still having trouble this. goal array of user models have role included in attributes. i'm note sure if understand correctly, maybe want? @users = @item.users @users.each |user| puts user.item_user_relationships.first.role end

xcode - live content from html to html -

i'm using uiwebview display data organization data (publicize , legal), however, instance, want pull specific data html file rather pulling whole url. e.g. want pull "news" section of html , want user stay in page, not enabling them go other parts of website (e.g. home page, contact us) , allowing them view pdf article on html file. i've asked around , read on dom , screen scraping, seem data pulled stored in database instead. is there way can pull html "news" section pdf url customized html file , updated live (maybe every 30second refresh , pull information website content , list of pdf date)(e.g. added in 3new article main website, customize html file refresh , pull information website , update article list) if can point me specific method allow html html data passing (live), great , can go more research on it. lost , confuse first time doing this. help/feedback appreciated :) edit: example, google map or google search. don't want use whole...

android - Why fragment not working -

i want change text in textview in fragment , can in instantiateitem , after instantiateitem , textview null , can not call mypageradapter.textview.settext(); private class mypageradapter extends pageradapter { textview textview; public int getcount() { return 5; } public object instantiateitem(view collection, int position) { layoutinflater inflater = (layoutinflater) collection.getcontext() .getsystemservice(context.layout_inflater_service); int resid = 0; switch (position) { case 0: resid = r.layout.farleft; view view = inflater.inflate(resid, null); ((viewpager) collection).addview(view, 0); textview = (textview)view.findviewbyid(r.id.textvvvv); return view; case 1: resid = r.layout.left; break; case 2: re...

com - CoCreateInstance fails with E_FAIL when CLSCTX_LOCAL_SERVER is specified and Surrogate process is used -

i trying use surrogate process, dllhost, run com 64 bit dll in separate 64 bit dllhost process. have made required registry entries same. when try create object of class using cocreateinstance or cogetclassobject , createinstance e_fail error. error observed if specify clsctx_local_server flag. call works fine clsctx_inproc_server flag of course not in separate process, dllhost. on using clsctx_local_server, can see dllhost.exe in task bar, indicates surrogate related registry entries correct call cocreateinstance/createinstance fails error e_fail. here code snippet:- hr = coinitialize (null); if(failed(hr)) return hr; iclassfactory *ptr; // can see dllhost in task manager after call hr = cogetclassobject(clsid_myid, clsctx_local_server, 0,iid_iclassfactory,(void**)&ptr); // works fine clsctx_inproc_server //hr = cogetclassobject(clsid_myid, clsctx_inproc_server, 0,iid_iclassfactory,(void**)&ptr); if(failed(hr)) return hr; ptr->lockserver(true...