Posts

Showing posts from March, 2011

Why are defined variables not turning black in Mathematica v10? -

i upgraded mathematica version 8 10, , having problem syntax colouring. before, when assigned value variable, turn blue black indicate defined. now, when define variables, stay blue! however, still work expected, meaning there value assigned them, , can call upon it. why coloured incorrectly? confusing work not sure if variable has been defined or not! variables still turn black, while others stay blue. have no idea why happens , not all.

ruby on rails - How to check if the user should be assigned the role admin -

the goal of method check when user signs up, if on list of users should admins. i new ruby , think syntax error: def set_role if self[:email] == ("email@gmail.com" || "sample@gmail.com" || "test@gmail.com") self[:role] = "admin" else self[:role] = "customer" end end this time use case statement: def set_role self[:role] = case self[:email] when "email@gmail.com", "sample@gmail.com", "test@gmail.com" 'admin' else 'customer' end end it's easy add new values when test.

Spring cloud config with Subversion backend -

is possible? perforce? need use 1 of these or file based , check in crontab or something. it possible implement svn or perforce. need implement environmentrepository . see jgitenvironmentrepository example. see question working local files: spring cloud configuration server not working local properties file

Recompiling JS in the arangodb codebase? (trying to hack sth into Foxx) -

i've made change .js file in arangodb codebase , did make clean && make , restarted arangod, change doesn't seem picked up. how make sure change activated? the changed file was: js/server/modules/org/arangodb/foxx/query.js the docs chapter brought me idea https://docs.arangodb.com/foxx/foxxrepository.html#defining_custom_queries which, btw, doesn't show how pass arguments query , references 'chapter on foxx queries' couldn't find. ultimately, goal pass arguments not query transform function called. diff is diff --git a/js/server/modules/org/arangodb/foxx/query.js b/js/server/modules/org/arangodb/foxx/query.js index 49e320c..ac37f34 100644 --- a/js/server/modules/org/arangodb/foxx/query.js +++ b/js/server/modules/org/arangodb/foxx/query.js @@ -61,7 +61,7 @@ exports.createquery = function createquery (cfg) { throw new error('expected transform function.'); } - return function query(vars) { + return function query(vars,

vb.net - DataGridViewRow numerically order -

how can sort datagridviewrow numerically order? my code: dim name new list(of string) dim price new list(of integer) x = 0 math.max(name.count, price.count) if x < name.count andalso x < price.count dim row string() = new string() {name(x), price(x)} datagridview1.rows.add(row) end if next price row example: 1345 1533 4555 6744 you've got them 2 separate lists... i'll take leap , make assumption need keep source data in format... having them in 2 lists you've got dependency on positions. use sortable collection pair them e.g. imports microsoft.visualbasic imports system.collections.generic imports system.data.linq dim name new list(of string) dim price new list(of integer) dim sortable new list(of keyvaluepair(of string, integer)) 'your checking weren't going past last pair odd 1 x = 0 math.min(name.count, price.count) - 1 'pair

memory - Monitor and/or log the performance of a specific application (not all system) in windows 7 -

i need keep track of peak memory usage, , average memory usage, cpu time of specific application. know there windows' perfmon tool, keeps record of system, need keep record of 1 specific application. tried kiwimonitor app, not provide precise result. know how filter perform tool keep record of single application's performance statistics? or there useful tool can use purpose? many thanks list item you can create user defined data set (under data collector sets) , limit performance counters specific process. once select process object, choose process want monitor , counters specific process.

php - How to prefer prefix over a general "like" result? -

so let's have following columns selected when use %un% like search: fun unlikely mundane but want prefixed results show first - basically, returned in following order: unlikely fun mundan is there simple way in mysql, or have modify array of results after them in php? i going on php side, although i'm not sure if there's mysql way of doing it. you add order left (column,2) = 'un' desc that put them @ top

Running a report by view + ID with AtTask API -

i see how run reports based on instructions given here: https://developers.attask.com/api-docs/#report the problem that method requires me specify columns, order, grouping, etc. in code. i've done using attask gui. example, have report can view navigating https://company-attask-url.com/report/view?id=540f82490073dc256050c0575959c472 . is possible retrieve contents of view? otherwise, time updates report in attask gui, i'll have go in , update code reflect change. it possible wrong, don't think report function works way want to. best of knowledge, report function of api doesn't have connection reports create inside attask application. way ask aggregates of columns such average or sum. fields ask via api independent of fields set in report inside system. news you can create want in api. fields shouldn't have change data.

c++builder - How to detect the application is about to terminate? -

i'm working on vcl application communicates on bluetooth microcontroller , want execute code right before application terminates. how can detect application terminate ? write handler onclose event of main form. reference describes app. shutdown notification as: when application shuts down, main form receives onclose event, child forms not receive onclose event. the code executed when form closed means (other process being killed or segfaulting etc.)

Magento Category Thumbnail Missing -

Image
i'm moving first steps on magento cms cannot understand why in local installation xampp can insert thumbnail backend while in server installation dont' have field upload thumbnail of category. thx all! alex screen of local installation

c++ - Program not using all of CPU? -

this question has answer here: how 100% cpu usage c program 7 answers i wrote simple program in c++ like: while(1){var+=1;var-=1;} and ran it, seems use 25% of cpu. how can increase amount of cpu program use, 95%? sounds you're running on 4-processor system. are using 100% of cpu on 1 core. use other cores, have write multi-thread version of application. multi-threading complicated, there lots of tutorials out there; hit google. luck!

android - Enable toolbar button only during live card display -

in glass application, display button on toolbar. button shows on/off state of camera , lets user toggle state. the problem running glass moves focus button. result, tap keeps activating button. it seems glass automatically converts toolbar menu items live cards when top-to-bottom swing used. nice. gives users ability select menu item. i thinking if set default state of button "disabled," solve problem. however, results in disabling button in live cards. enable button during live cards. is there way achieve this? or, there better way remove focus out of toolbar? regards.

python - Pandas cumulative function of series with dates and NaT -

this may known limitation, i'm struggling calculate cumulative minimum of series in pandas when series contains nat's. there way make work? simple example below: import pandas pd s = pd.series(pd.date_range('2008-09-15', periods=10, freq='m')) s.loc[10] = pd.nat s.cummin() valueerror: not convert object numpy datetime this bug has been fixed in pandas 0.15.2 (to released). as workaround, use skipna=false , , handle nats "manually": import pandas pd import numpy np np.random.seed(1) s = pd.series(pd.date_range('2008-09-15', periods=10, freq='m')) s.loc[10] = pd.nat np.random.shuffle(s) print(s) # 0 2008-11-30 # 1 2008-12-31 # 2 2009-01-31 # 3 2009-06-30 # 4 2008-10-31 # 5 2009-03-31 # 6 2008-09-30 # 7 2009-04-30 # 8 nat # 9 2009-05-31 # 10 2009-02-28 # dtype: datetime64[ns] mask = pd.isnull(s) result = s.cummin(skipna=false) result.loc[mask] = pd.nat print(result) yiel

go - Golang "net/http" Error: undefined: DetectContentType -

the "net/http" package implements function detectcontenttype http://golang.org/pkg/net/http/#detectcontenttype but when try use it, error undefined: detectcontenttype package main import ( "fmt" "io/ioutil" "log" "net/http" ) func main() { res, err := http.get("http://www.google.com/robots.txt") if err != nil { log.fatal(err) } robots, err := ioutil.readall(res.body) res.body.close() if err != nil { log.fatal(err) } filetype := detectcontenttype(robots) fmt.println("filetype: ", filetype) } https://play.golang.org/p/wjduu8xx-5 what doing wrong? it part of "net/http" package therefore have write, http.detectcontenttype(robots) note if wanted use function in way change import statement such: import ( ... . "net/http" )

android - SQLiteAssetHelper db.getVersion() null when upgrading database -

i getting intermittent crash reports on variety of devices when upgrade shipped database using sqliteassethelper. seems occur when database has not yet finished transfer assets/databases folder device file system. have put number of checks in place check see upgrade finished, still having problems. first check make sure database exists. has solved problem initial loading of database upon installation of app not updates: public boolean databaseloaded(context context) { file dbfile = context.getdatabasepath(myconstants.default_database); return dbfile.exists(); } here databasehelper: class databasehelper extends sqliteassethelper { public databasehelper(context context, string databasename, int databaseversion) { super(context, databasename, null, databaseversion); if (databaseversion>1 && databasename.equals(myconstants.default_database)) { setforcedupgradeversion(databaseversion); } } } and in content provider

r - How do I move a row in one data frame to a column in another data frame? -

i trying move row in 1 data frame add make new column in data frame. have frame d1: x y 1 vbr 33333 2 vea 33333 3 vtv 33333 and frame sh: vbr vea vtv 2014-02-04 360.9457 875.3501 469.1532 sh started out zoo class have tried converting both frames matrix or data frame , using merge , nothing seems work. when try merge (d1, shares) get: x y vbr vea vtv 1 vbr 33333 360.9457 875.3501 469.1532 2 vea 33333 360.9457 875.3501 469.1532 3 vtv 33333 360.9457 875.3501 469.1532 what want is: 1 vbr 33333 360.9457 2 vea 33333 875.3501 3 vtv 33333 469.1532 how do this? try: cbind(d1, t(sh)) this should work you. cbind() combines data.frames column , t() transposes sh 1 row , 3 columns 3 rows , 1 column.

python - Dynamically Add Field to Model Form Using Django -

i have model has fields address such street, city, state, zip. have created form allows user input values each of these. make user can press button, "add address" , each field repeated. use jquery add fields html, issue how these fields need represented in model? ultimately, i'd take additional addresses , use them in search retrieve has of addresses user has input. or suggestions appreciated. thanks vijay! couldn't mark yours answer (not sure why) link helped me. since wanted fields repeat, put fields in table. <form id="myform" method="post" action=""> {% form in formset.forms %} <p> {{ form.nonduplicatingfield }} <p> {{ fomr.anothernonduplicatingfield }} <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td>{{ form.duplicatingfield }}</td> <td>{{ form.duplicat

c++ - Cost of conversion between integral types -

i creating supplemental library of math functions use in programs, , wish implement gcd function . may end using function frequently, optimization extremely important . i wondering if, regard optimization, there point in implementing several gcd overloads different integral types. illustration: int gcd(const int lhs, const int rhs); long gcd(const long lhs, const long rhs); long long gcd(const long long lhs, const long long rhs); is there inherent cost when converting between integral types, or can implement long long version , call "good enough"? well, first of all, can template it: template <typename t> t gcd(const t lhs, const t rhs); and call gcd<int>(a, b) or whichever type need, if primary concern code duplication. that said, while doubt integral type conversion ever show in profiling, sort of thing should first write in convenient way , worry optimizing if , when have optimize it.

ember.js - How to check controller name -

i wanted display below html section in index page not show up. {{#if name}} <header> <div class="container"> <div class="intro-text"> <div class="intro-lead-in">welcome our joint!</div> <div class="intro-heading">it's nice meet you</div> <a href="#services" class="page-scroll btn btn-xl">tell me more</a> </div> </div> </header> {{/if}} this put in index controller: app.indexcontroller = ember.objectcontroller.extend({ name: function() { if (controller == this.get('indexcontroller')) { return true; } else { return false; } }.property() }); any appreciated.

ruby on rails - Sum mongoid specified field -

def self.group_by(field, format = 'day') key_op = [['year', '$year'], ['month', '$month'], ['day', '$dayofmonth']] key_op = key_op.take(1 + key_op.find_index { |key, op| format == key }) project_date_fields = hash[*key_op.collect { |key, op| [key, {op => "$#{field}"}] }.flatten] group_id_fields = hash[*key_op.collect { |key, op| [key, "$#{key}"] }.flatten] pipeline = [ {"$project" => {"name" => 1, field => 1}.merge(project_date_fields)}, {"$group" => {"_id" => group_id_fields, "count" => {"$sum" => "$qtyused"}}}, {"$sort" => {"count" => -1}} ] collection.aggregate(pipeline)<br> end when execute script, count result 0. how can sum attributes qtyused ? you not projecting "qtyused" field pipeline = [ {"$project" => {

javascript - How do I execute .js files locally in my browser? -

hello wondering how can type javascript game on textmate mac , have regular .js file take .js file , open , have run in chrome if have "hello world!" hello world! show in chrome. an example of i'm after in video: http://vimeo.com/105955605 around 1:51 in video, notice how puts <script> tag in there? way works this: create html file (that's text file .html ending) somewhere on computer. in same folder put index.html , put javascript file (that's textfile .js ending - let's call game.js ). then, in index.html file, put html includes script tag game.js , mary did in video. index.html should this: <html> <head> <script src="game.js"></script> </head> </html> now, double click on file in finder, , should open in browser. open console see output of javascript code, hit command-alt-j (those 3 buttons @ same time). good luck on journey, hope it's fun has been me fa

oauth - Gmail API access on desktop + service bus endpoint, share token? -

i have desktop , service bus works in unison. basically want set desktop app allows user authorise desktop , service bus access read , create emails on behalf of user. firstly if pass access token server save, read it's short lived, how ensure server can access gmail apis if access token ends expiring? on desktop interactive gmail api libraries spawn new web page, on service bus endpoint, can't call 1 of authorize methods gmail .net app provides , able have user re-authorise it. so what's best approach keep seamless possible? thanks in advance!

javascript - Shopify Drop down Validation -

i'm building web store on shopify. want add validation dropdown if no size/value selected drop down, automatically select 1st size/value. when click on add cart button. thanks help. given html: <select id="drop"> <option value="0">please select</option> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select> <button id="add">add cart</button> use javascript/jquery: $(document).ready(function() { var $drop = $("#drop"); $("#add").on("click", function() { if($drop.val() == 0) { $drop.val(1); } }); }); http://jsfiddle.net/82vrccem/1/

How to play purchased movies on embeded Youtube using android api -

i want create android app playing purchased movies (purchased google play store) in android app using youtube api android. have had go @ making anything? have googled find tutorials/information? if have problem using youtube api, post specific question , can try you.

types - Does Julia have a strict subtype operator? -

question: julia have strict subtype operator? note: operator <: not strict subtype operator, since number <: number evaluates true . interested in operator evaluate false number <: number true int <: number . possible use case: consider function defined: myfunc{t<:union(int, string)}(x::array{t, 1}, y::array{t, 1)}) currently, function constrains x , y arrays of same type, type int , string , or union(int, string) . strict subtype operator, force input arrays of type int or string , , eliminate (rather odd) union(int, string) scenario. i don't think there such operator in julia, quite easy write function same check: strictsubtype{t,u}(::type{t}, ::type{u}) = t <: u && t != u # note: untested! however, have question use case. if want like function my_func{t<:string}(x::vector{t}, y::vector{t}) # handle strings # note string abstract type, inherited e.g. asciistring , utf8string end function my_func(x::vect

java - Spring-Data-Neo4j: org.springframework.beans.factory.NoUniqueBeanDefinitionException -

i trying configure spring-data-neo4j example java based configuration. when trying run test case, following stack trace print. according exception that, transaction neo4jtemplate multiple transaction manager thought. org.springframework.beans.factory.nouniquebeandefinitionexception: no qualifying bean of type [org.springframework.transaction.platformtransactionmanager] defined: expected single matching bean found 2: neo4jtransactionmanager,jtatransactionmanagerfactorybean @ org.springframework.beans.factory.support.defaultlistablebeanfactory.getbean(defaultlistablebeanfactory.java:332) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.getbean(defaultlistablebeanfactory.java:298) @ org.springframework.transaction.interceptor.transactionaspectsupport.determinetransactionmanager(transactionaspectsupport.java:354) @ org.springframework.transaction.interceptor.transactionaspectsupport.invokewithintransaction(transactionaspectsupport.java:256) @ org.springframewor

apache - IP and Domain Based Virtual Hosts -

my vps giving me 16 ip v6 addresses, , want host 16 domains , want them in such way each domain has own unique ipv6 address. if wanted this, how proceed ? lot of research tells me should use virtual hosts, how done ? should use simple panel webmin instead ? or map ipv6 addresses domain names in dns [2001:0db8:100::1 -> domain1 [2001:0db8:100::2 -> domain2 and use name based virtual hosts in apache makes accessing application via browsers more readable: http://httpd.apache.org/docs/2.2/vhosts/name-based.html <virtualhost *:80> servername www.domain1.com documentroot /www/domain1 </virtualhost> <virtualhost *:80> servername www.domain2.com documentroot /www/domain2 </virtualhost>

object - php SplObjectStorage Detach() not working -

i have found error in php splobjectstorage detach method. it's working fine in removing object if object comes 1 skip next one. example: $s = new splobjectstorage(); $o1 = new stdclass; $o2 = new stdclass; $o3 = new stdclass; $o1->attr = '1'; $o2->attr = '2'; $o3->attr = '3'; $s->attach($o1); $s->attach($o2); $s->attach($o3); echo 'removing objects...<pre>'; var_dump($s->count()); foreach ($s $obj) { var_dump($obj->attr); if($obj->attr == 2 || $obj->attr == 1) { echo "deleting...".$obj->attr; $s->detach($obj); } } echo 'checking objects....'; var_dump($s->count()); foreach ($s $obj) { var_dump($obj->attr); } and gives me result. shouldn't be, because want delete object (attr == 1) , object (attr == 2) both. detach() method delete first object, skip next 1 , loop. removing objects... int 3 string '1' (length=1) deleting...1 stri

nsmutablearray - Issue in replacing value in NSMutable Array in swift -

i have nsmutable array in swift contains inner array respective key this. array sample: { item = ( studio, "1 bed", "2 bed", "3 bed", "4 bed", "5+ bed", "individual lease" ); status = ( none, none, none, none, none, none, none ); }, { item = ( "1+ bath", "2+ bath", "3+ bath", "4+ bath" ); status = ( none, none, none, none ); }, { item = ( "on campus", "off campus", "downtowm lafayette", lafayette ); status = ( none, none, none, none ); } code is: var itemsarray = nsmutablearray() var itemarr1:[string] = "s

python - jQuery remote validate not showing an error message DJango -

i using jquery remote validation check whether email available register calling django view. views.py def check_email(request): is_available = "false" if request.is_ajax(): username = request.post.get("username") try: user.objects.get_by_natural_key(username) except user.doesnotexit: is_available = "true" return httpresponse(is_available) url.py url(r'^check_email/$', 'app.views.check_email', name='check_email') jquery {$( "#myform" ).validate({ rules: { email: { remote: "check-email/" } } messages: { email: {remote: "the email taken."} } }); the jquery code not rendering error message. missing? thanks. def check_email(request): is_available = "false" if request.is_ajax(): username = request.get.get("username") # change post try: user.objects.get_by_natural_key(username)

android - Parsing XML results in SAXParseException with Unexpected End of Document -

i running strange error trying parse xml android device. strange parsing xml worked several days before , have not touched code. today, loading xml not work. the xml files located in "assets" folder in project directory. here part passing path of specific xml file parser called mazefilereader . private void generatefromfile() { log.v(tag, "generating file"); file maze_file = new file(getcachedir() + "/" + pregen_maze); if (!maze_file.exists()) try { inputstream = getassets().open(pregen_maze); int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); fileoutputstream fos = new fileoutputstream(maze_file); fos.write(buffer); fos.close(); } catch (exception e) { throw new runtimeexception(e); } mazefilereader mazefilereader = new mazefilereader(getapplicationcontext(), maze_file.getpath()); here mazefilereader taking path ,

C++: Using wrapper classes with stack implementation? -

my c++ instructor gave assignment told translate bunch of linked list functions linked stack functions using wrapper classes as possible. unfortunately, however, didn't explain them i'm not entirely sure how they're used nor how they're implemented. as of right now, "stack_wrapper" class kind of looks this: template<class s> struct node { s data; node<s>* next; }; template<class s> class stack_wrapper { public: stack_wrapper(); stack_wrapper(const stack_wrapper<s>& altstack); ~stack_wrapper(); const stack_wrapper<s>& operator = (const stack_wrapper<s>&); void initialize(); bool isempty(); bool isfull(); void push(const s& newitem); void pop(s& poppedelement); void destroy(); protected: stack_wrapper<s> *first; stack_wrapper<s> *last; }; i suppose asking is: how start translating use wrappers?

javascript - How to access multiple database dynamically using Entity framework 6.1(Power Tool Beta 4) with ASP.NET web api -

i've created project using asp.net mvc 4 => web api... i have integrated angularjs in it. , i'm using single page app. i'm using entity framework 6.1. for database connectivity, i'm using entity framework power tool beta 4 target particular db , generate dbcontext. now scenario is: there 1 other application end user can register himself. when it, new database generated database server "projectname+clientname" name eg. missteve,misjohn... this new user entry goes misdbmanager database there in database server new connectionstring , new user. so, misdbmanager has clientname , relevant connectionstring. so overall. in database, 1 misdbmanager has different registered users db connection strings. eg, (clientname) - (connectionstring) bv - data source=pdev-3\xyz;initial catalog=misbv;integrated security=true steve - data source=pdev-3\xyz;initial catalog=missteve;integrated security=true now pro

c++ - 3D Convolution with Intel MKL -

i have written c/c++ code uses intel mkl compute 3d convolution of array has about 300×200×200 elements. want apply kernel either 3×3×3 or 5×5×5 . both 3d input array , kernel have real values. this 3d array stored 1d array of type double in columnwise fashion. kernel of type double , saved columnwise. example, for( int k = 0; k < nk; k++ ) // loop through height. for( int j = 0; j < nj; j++ ) // loop through rows. for( int = 0; < ni; i++ ) // loop through columns. { ijk = + ni * j + ni * nj * k; my3darray[ ijk ] = 1.0; } for computation of convolution, want perform not-in-place fft on input array , kernel , prevent them getting modified (i need use them later in code) , backward computation in-place . when compare result obtained code 1 obtained matlab different. kindly me fix issue? missing in code? here matlab code used: a = ones( 10, 10, 10 ); kernel = ones( 3, 3, 3 ); aconvolved = convn( a, kerne

rails 4 bootstrap 3 collapsable navbar -

sorry newbie question, can see i'm doing wrong? followed directions on bootstrap website, , unable create collapsing navbar in web app. list items under ="nav pull-right" won't collapse when decrease width of window. think maybe because don't have collapse plugin in bootstrap.js. issue? <%= link_to "catalyst", users_path, class: "brand" %> <header class="navbar navbar-fixed-top navbar-inverse"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <%= link_to "webapp", users_path, class: "brand" %> <div class="nav-collaps

unit testing - Mocking domain classes in Grails -

i've got set of domain , controller classes called: organization , organizationcontroller respectively. the organizationcontroller has 1 method: def index() { def organizations = organization.list() [orgs: organizations] } i've tried mock out domain class 2 ways. the first way using @mock annotation, , creating objects , saving: void "test index"() { given: new organization(name: 'jimjim').save() new organization(name: 'abc').save() def expected = [org: [new organization(name: 'jimjim'), new organization(name: 'abc')]] when: def actual = controller.index() then: actual == expected } that caused oraganization.list return empty list. actual returns [org: []] i tried using mockdomain: void "test index"() { given: mockdomain(organization, [new organization(name: 'jimjim'), new organization(name: 'a

c - HDF5 Attribute unsigned long long value -

Image
when try , add unsigned long long attribute dataset, attribute added not value. using similiar method integer seems work file. am using hdf view view attributes. attribute names displayed, unsigned long long attributes, values not visible the code follows: herr_t result; //open file hid_t datafile = h5fopen(filename, h5f_acc_rdwr, h5p_default); //open dataset hid_t dataset = h5dopen2(datafile, "/summary", h5p_default); //create data space attribute. hsize_t attributedims = 1; hid_t attributedataspace = h5screate_simple(1, &attributedims , null); hid_t attribute; //attribute 1: fail write long long attribute attribute = h5acreate2 (dataset, "longattribute", h5t_std_u64be, attributedataspace, h5p_default, h5p_default); if (attribute < 0) { fprintf(stdout, "failed add unsigned long long attribute file %s.", filename); return false; } //write attribute data unsigned long long* ullattribute = (unsigned long long*) malloc(siz

ember.js - I have a json response and my Ember model is not matching for it -

my json response { "object": { "assignments": [ { "assignmentid": 14706368, "sectionid": 0, "assignmenttype": "fileattach", "assignmenttitle": "file attachment a", "assignmentstartdate": "01/01/1900", "assignmentstarttime": "01:00am", "assignmentduedate": "01/01/2100", "assignmentduetime": "01:00am", "ismarathonchain": "no", "assignmenttimelimit": 0, "assignmenttimeremaining": "0", "marathonassignmentstatus": "marathon_not_associated", "showassignmentattem

plsql - Group by function column -

i'm writing query this... select to_char(e_date, 'mon/yyyy') month , location_code, count(employee_number) from ... now want group month , location_code. how use to_char(e_date, 'mon/yyyy') month in group clause? edit: select to_char(vheda.e_date, 'mon/yyyy') months , hla.location_code, count(vheda.employee_number) emp_count virtu.virt_hr_emp_daily_attendance vheda inner join per_all_people_f papf on vheda.party_id = papf.party_id inner join per_all_assignments_f paaf on papf.person_id = paaf.person_id inner join hr_locations_all hla on paaf.location_id = hla.location_id (trunc(sysdate) between papf.effective_start_date , papf.effective_end_date) --and (vheda.e_in_time not null) , vheda.e_duration <> 0 , (trunc(sysdate) between paaf.effective_start_date , paaf.effective_end_date) , vheda.e_date between '1-aug-2014' , '31-oct-2014' group hla.location_code, vheda.e_date order vheda.e_date out put when use group clause

Trying to find the maximum term in an array using C -

i trying write program can find maximum of array using maxterm function. basically tell program how many numbers want put in array, put in each number, , tells largest number. the program works fine arrays of size 4 or smaller arrays longer 4 maxterm returned incorrect: it's large number wasn't part of array. for example: please enter number of data values: 4 enter value 1: 1 enter value 2: 3 enter value 3: 4 enter value 4: 1 maximum term 4 but: please enter number of data values: 5 enter value 1: 1 enter value 2: 3 enter value 3: 8 enter value 4: 4 enter value 5: 2 maximum term 32767 here code: #include <stdio.h> int maxterm(int *numbers, int *size) { int index = 0; int max = numbers[0]; (index = 0 ; index < *size ; index++) { if (max < numbers[index+1]) { max = numbers[index+1]; } } return max; } int main(int argc, const char * argv[]) { int num, index; printf(" please enter number of data values: "); sc

Going Live with paypal MECL library for ios app?Getting live App id and paypal device id? -

i'm using paypal mecl app.i'm going live app soon.for need live app id.so went x.com submit app.where mecl listed deprecated.though can select option. question: 1.is ok use mecl still now? 2.for submitting app there option submit ad-hoc build.where paypal device id add build? thanks in order create app, need login developer.paypal.com(with live paypal account credentials) dashboard->application-> my apps ->create app once created, client id , secret can use in integration.

c++ - partial sort a vector with lambda predicate -

i partial sort vector predicate such std::vector<std::pair<std::string, int>> vp; std::partial_sort(vp.begin(), vp.begin()+10, [](const std::pair<std::string,int> &left, const std::pair<std::string,int> &right) { return left.second > right.second; }); however error no matching function call ‘partial_sort(std::vector<std::pair<std::basic_string<char>, int> >::iterator, __gnu_cxx::__normal_iterator<std::pair<std::basic_string<char>, int>*, .... the above works fine std::sort , not partial_sort suggestions ? looking @ reference documentation , find std::partial_sort requires 3 iterators, not 2: start, middle , end. re-arrange range range [start, middle) sorted, , contains smallest elements range [start, end) . depending on you're trying achieve, need provide appropriate 3rd iterator. if you're trying find 10 smallest elements, this: std::partial_sor

image processing - Marking fingerprint minutiae - Matlab -

i have project on fingerprint matching , got stuck on marking minutiae . have binarized image, closed , thinned , have use crossing number find termination , bifurcation points. how mark them on image , store them? thanks! you should bwmorph - function allows perform sorts of morphological operations on images. ep = bwmorph( bw, 'endpoints' ); %// returns mask "terminations" bp = bwmorph( bw, 'branchpoints' ); %// returns mask "bifurcations" to coordinates of special points masks, can use find : [epy epx] = find( ep ); %// x,y coordinates of endpoints.

c# - EF Code first one way navigation property -

i have following entities: [knowntype(typeof(script))] public class application : ientity { public long id { get; set; } public string name { get; set; } public long? startscriptid { get; set; } // other properties... // navigation properties: public virtual script startscript { get; set; } // new public virtual list<script> scripts { get; set; } } [knowntype(typeof(application))] public class script : ientity { public long id { get; set; } public string name { get; set; } // other properties... // navigation properties: public virtual application application { get; set; } } i have no fluent configurations on dbcontext so model exists of scripts must bound application. applications can have startscript defined. have working. now in need of navigation property: application.startscript . the question how can add navigation property on application without having add equivalent navigation property on script . than

Java deepclone an object without some properties -

i have following classes class { private long id private list<b> listb; private c c; ... } class b { private long id private a; private list<d> listd; ... } class c { private long id private a; ... } class d { private long id private b b; ... } i need copy of a, include of it's properties except id column. i have 2 solutions: 1. clone each object , set of ids null; 2. make constructor this: public (a a){ //copy properties except id this.xxx = a.xxx; ... } but need write code function, 1 has better method implement function? lot. when saying deep cloning of object particularly 1 of type class have instance variable of container type, have below 2 known ways: 1) serialize , deserialize object. 2) traverse through each method , call clone explicitely. for first implementation, may mark id fields transient , should solve purpose. for second approach, may override clone

java - Finding duplicate expressions/parameters -

i have structure below parameter -> condition -> rule let need create business rule , customer age > 18 i have 2 parameters, customer age (p1) , 18(p2) , p1 field parameter (ognl) , p2 constant parameter value 18 . so condition , customer age > 18 , rule . problem statement : avoid user creating duplicate parameter/condition , rules. solution : constant parameters, field parameters etc can check in db , compare if present. now condition me, customer age > 18 , 18 < customer age same in business terms. the above cases can more complex. (a + b) * (c + d) same (b + a) * (d + c) i need validate above expressions. first approach - load expression db (can 10000's) , compare using stack/tree structure , kill objective. second approach - thinking of building power full, let hashcode generator or can 1 int value against every expression (considering operators/brackets also). value should generated in such way validates above expre

apigee - Node.js:Unable to invoke pipe function -

i trying out simple program invoke call backend & response back, here node.js code: 'use strict'; var util = require('util'); var http = require('http'); var request = require('request'); var stream = require('stream'); module.exports = { summary:summary } function summary(request, response) { var id = request.swagger.params.id.value; var url = "http://localhost:8080/test-org/myapp/summaries?q='id'"; console.log('executing request: '+url); request.get(url).pipe(response); }; however following error: curl http://localhost:10010/v1/customers/1123/summary executing request: http://localhost:8080/test-org/myapp/summaries?q=' id' typeerror: cannot call method 'pipe' of undefined @ summary (c:\apigee127\api-116\api\controllers\summary.js:17:19) @ swaggerrouter (c:\apigee127\api-116\node_modules\a127-magic\node_modules\ swagger-tools\middleware\2.0\swagger-router.js:114:18) @

Svg image element not displaying in Safari -

safari browser (i'm testing under windows) seems having problem in displaying svg image element. <!doctype html> <html> <body> <h1>my first svg</h1> <img src="image.svg" /> </body> </html> and here content of image.svg: <?xml version="1.0" encoding="utf-8" standalone="no"?> <!-- created inkscape (http://www.inkscape.org/) --> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="50" y="50" width="100" height="100" style="fill:blue"></rect> <rect id="foo" x="50" y="150" width="500" height="500" style="fill:green"></rect> <image x="50" y="10" width="200" height="200" xlink:href="data:image/png;base64,ivb

c++ - Two pcap_compile() on one device at same time? -

i have 2 threads , each 1 has packet capture same deviсe @ same time program crashes when second thread reaches pcap_compile() function. each thread has own variables , don't use global. seems same handle of device, therefore program crashes. why need 2 threads? because want seperate packets on sent , on recived specified pcap filter. how solve this? or better use 1 thread , sort manually sent , received packets using address tcp header? pcap_compile not thread safe. must surround calls may encountered separate threads critical section/mutex prevent errors because of non thread-safe state within parser compiles expression (for gory details, uses yacc create code parsing expression , code generated eminently not thread safe). you need explicitly open device once per thread you're planning on using capture, if reuse same device handle across multiple threads not you're asking for. should open pcap handle within thread you're planning on using it, each

Liferay CustomSQL table doesn't exist -

i have service entity declaration follows: <entity name="mycontentrepo" local-service="true" remote-service="true" table="contentrepo"> </entity> i trying use custom sql fetch details: session = opensession(); string sqlquerystring = customsqlutil.get("query_id"); sqlquery query = session.createsqlquery(sqlquerystring); query.addentity("mycontentrepo", mycontentrepoimpl.class); querypos qpos = querypos.getinstance(query); qpos.add("someparameter"); list = (list<mycontentrepo>) query.list(); but following error upon execution: 08:02:26,640 error [http-bio-8090-exec-72][jdbcexceptionreporter:82] table 'mysqldb.mycontentrepo' doesn't exist com.liferay.portal.kernel.dao.orm.ormexception: org.hibernate.exception.sqlgrammarexception: not execute query the query taking name of entity declared not table="contentrepo". can tell me how bypass issue? addentity onc

asp.net mvc - Navigate from HTML Page to MVC View -

i have home.html page have redirect user view in mvc on button click. how can ? use jquery code on button click shown : $('#buttonid').on('click',function(){ window.location.href = "/controllername/actionname"; });

Deploy orange Model as web service -

i have created model using orange data mining happy with. use model web service real time categorization, there option use orange flow web service using trained model ? no, there no way can deploy orange workflows created through visual programming web services.

javascript - Reverse the sort order in Angular -

i have list of products , prices pass angular iterator. user can select option drop down allows them sort 1 of properties associated objects. when try , reverse order alphabetic properties order doesn't work. see jsfiddle here: http://jsfiddle.net/pga6yaxg/ else if ($scope.orderby == 'name-za') { return -result.name; click on added, price , name a-z , these work fine, when choose z-a order incorrect. ideas? i modified fiddle make work. basically, added reverse variable, in angularjs orderby documentation : <li data-ng-repeat="orderby : [orderbyoptions, recent] : reverse track $index"> it works now! update by way, have spared whole filtering in controller assigning predicate value actual value of <option> tag , binding orderby filter model of <select> . way not use reverse variable! check other jsfiddle improved version.