Posts

Showing posts from July, 2013

javascript - Line chart auto scaling -

Image
i'm using google visualization charts in grails app. i'm using line chart present data behaves oddly when add alot rows data here screens how prevent such scalling ? woudl scalling same when have alot data , none data. don't mean length of chart because natural gets bigger when add more data, size of labels haxis labels , vaxis label getting bigger without reason here how created chart visualization.draw(visualization_data, {width: 55840, title: 'wykres wydajno\u015bci', vaxis: {textposition: 'in'}, haxis: {direction: 1, slantedtext: true, slantedtextangle: 90}, pointsize: 10, chartarea: {top: 10, width: '50%', height: '50%', left: 10}, legend: {position: 'right'}}); and styling #linechart { overflow-x: scroll; overflow-y: hidden; width: 100%; height: 500px; } you can use textstyle option on both axis' set fontsize textstyle: { fontsize: 12 } see follo

java - How to sort a TreeSet by Value? -

i pretty new treemap , treeset , likes , wondering how sort data structures value? realise treeset can sort alphabetical order automatically want order via value? idea on how this? it prints like... aaa: 29 aaahealthart: 30 ab: 23 abbey: 14 abdomin: 3 aberdeen: 29 aberdeenuni: 20 when want print like... aaahealthart: 30 aaa: 29 aberdeen: 29 ab: 23 aberdeenuni: 20 abbey: 14 abdomin: 3 here method here... arraylist<string> fullbagofwords = new arraylist<string>(); public map<string, integer> frequencyone; public void termfrequency() throws filenotfoundexception{ collections.sort(fullbagofwords); set<string> unique = new treeset<string>(fullbagofwords); printwriter pw = new printwriter(new fileoutputstream(frequencyfile)); pw.println("words in tweets : frequency of words"); (string key : unique) { int frequency = collections.frequency(fullbagofwords, key); system.out.println

nltk - Python: Retrieving WordNet hypernyms from offset input -

i know how hypernyms of words, : word = 'girlfriend' word_synsets = wn.synsets(word)[0] hypernyms = word_synsets.hypernym_paths()[0] element in hypernyms: print element synset('entity.n.01') synset('physical_entity.n.01') synset('causal_agent.n.01') synset('person.n.01') synset('friend.n.01') synset('girlfriend.n.01') my question is, if wanted search hypernym of offset , how change current code? for example, given offset 01234567-n hypernyms outputted. hypernyms can either outputted in synset form example, or (and preferably) offset form. thanks. here's cute function pywsd that's http://moin.delph-in.net/semcor def offset_to_synset(offset): """ synset given offset-pos (thanks @fbond, see http://moin.delph-in.net/semcor) >>> synset = offset_to_synset('02614387-v') >>> print '%08d-%s' % (synset.offset, synset.pos)

python - I am trying to find the set of lists in a tuple -

for example, (['2', '3', '5'], ['1', '3', '4', '5']) the above should yield numbers 3 , 5 (['1', '2', '4'], ['1', '2']) this should give out 1 , 2 (['2', '3', '5'], ['1', '2', '4'], ['2', '3']) this, should give out 2, because 2 contained in 3 lists in tuple. if there no set should return empty list for i,e in enumerate(tup): while index < len(tup): print(tup[index], tup[index + 1]) index = index + 1 for have this, not sure how go through tup(tuple) , extract each list find set of each 2 lists , iterate , compare rest of lists in tuple def intersect(lists): return list(set.intersection(*map(set, lists)))

php - Join Three tables in mysql with weird requirement -

i have 3 tables in db. table a has fields keyid | keyname 27 | income 28 | account number table b has fields userid | email | name | phone 481 | test@gmail.com | test | 99999999 table c has fields id | keyid | userid | value 1 | 27 | 481 | 10,000 i need display table fields headers are: userid | email | name | phone | income and table values should this: 481 | test@gmail.com | test | 99999999 | 10,000 i can keyids should displayed in table. in example keyids string '27' . tried joining , can fetch & display value in table. dont know how can show key name table header. any idea.? you can use pair of inner join select b.userid, b.email , b.name, c.value income tableb b inner join tablec c on b.userid = c.userid inner join tablea on a.keyid = c.keyid , a.keyname = 'income'; and query provided in comment select b.userid , b.email , b.name , group_concat(di

dataset - R subset data by id value pattern -

Image
i trying make subset of data table (counties) consisting of rows id number ends in zero. have tried using grep , %like% these specific entire id value , not last integer value. use sqldf package: library(sqldf) sqldf("select * dat id '%0'") or data.table package: as suggested frank dat[id %like% "0$"]

c# - Namespace not recognised after adding MVC6 project dependency to class library project -

Image
i have created default mvc6 (.net framework 4.6.1) project. contains valuescontroller. in same solution have added class library (.net framework 4.6.1). when added reference of mvc6 project class library not able use classes , namespaces. error cs0246 type or namespace name 'mvc6test' not found (are missing using directive or assembly reference?) in class library project, make sure required asp.net mvc nuget package added, same way web project itself. it add various missing assemblies in class library project, system.web.mvc, system.web.razor etc. note: wondering why need access mvc project within class library. it's other way around.

javascript - integrating angular and joint js -

i trying integrate angular joint js.i have wrapped joint js content within angular directive reasons, code not working. view contains: <joint-diagram graph="graph" width="width" height="height" grid-size="1" /> directive: app.directive('jointdiagram', [function () { var directive = { link: link, restrict: 'e', scope: { height: '=', width: '=', gridsize: '=', graph: '=', } }; return directive; function link(scope, element, attrs) { var diagram = newdiagram(scope.height, scope.width, scope.gridsize, scope.graph, element[0]); } function newdiagram(height, width, gridsize, graph, targetelement) { var paper = new joint.dia.paper({ el: targetelement, width: width, height: height, gridsize: gridsize, m

java - Spring user destinations -

i have spring boot application have publish user defined destination channels such: @autowired private simpmessagingtemplate template; public void send() { //.. string uniqueid = "123"; this.template.convertandsendtouser(uniqueid, "/event", "hello"); } then stomp on sockjs client can subscribe , receive message. suppose have stomp endpoint registered in spring application called "/data" var ws = new sockjs("/data"); var client = stomp.over(ws); var connect_fallback = function() { client.subscribe("/user/123/event", sub_callback); }; var sub_callback = function(msg) { alert(msg); }; client.connect('','', connect_callback); actually there more 1 user client subscribing same distinct user destination, each publish/subscribe channel not 1 one , doing way since spring's concept of "/topic" have defined programmatically , "/queues" can consumed 1 user. how know w

delphi - Inline asm (32) emulation of move (copy memory) command -

i have 2 two-dimensional arrays dynamic sizes (guess that's proper wording). copy content of first 1 other using: dest:=copy(src,0,4*x*y); // src,dest:array of array of longint; x,y:longint; // setlength(both arrays,x,y); //x , y max 15 bit positive! it works. i'm unable reproduce in asm. tried following variations no avail... enlighten me... mov esi,src; mov edi,dest; mov ebx,y; mov eax,x; mul ebx; push ds; pop es; mov ecx,eax; cld; rep movsd; also tried lea (didn't expect work since should fetch pointer address not array address), no workie, , tried with: p1:=@src[0,0]; p2:=@dest[0,0]; //being no-type pointers mov esi,p1; mov edi,p2... (the same asm) hints pls? btw it's delphi 6. error is, of course, access violation. this two-fold three-fold question. what's structure of dynamic array. which instructions in asm copy array. i'm throwing random assembler @ cpu, why doesn't work? structure of dy

php - unable to get the name of checkbox through $_GET and multiple rows -

Image
i have choices options given in above image. each option can select 1 or can restrict have choose 1 choice each option. i having problem when select 1 each option not inserting value of checkbox. <input name="pc<?php echo $mitemch_id; ?>" type="checkbox" value="<?php echo $mitemchch_id; ?>"> <font size="2"><?php echo $mitemch_enm; echo " kd: "; echo $mitemch_prit; ?></font> in name pc , <?php echo $mitemch_id; ?> option id if option 1 value 1 , on. how can put name in $_get name given above of checkbox? and below how using save: $minsitid = mysql_real_escape_string($_post['mitemid']); $insitid = mysql_real_escape_string($_post['itemid']); $inspr = mysql_real_escape_string($_post['op']); $iqty = mysql_real_escape_string($_post['qty']); $ses_mem = session_id(); mysql_query(" insert temp_cart (item_id, price_id, qty, ses_mem) va

php - completely run in localhost but not in live server in postgreSQL -

my code these. $host = "host=localhost"; $port = "port=5432"; $dbname = "dbname=test_db"; $credentials = "user=postgres password="; $db = pg_connect( "$host $port $dbname $credentials" ); $query = "insert table_test_som(uid, book_status, book_datetime, dom_id, from_date, to_date, from_time , to_time, event) values ('4', '1', '2016-07-19 12:29:42', '27', '2016-07-22', '2016-07-22', '11:30', '12:00', 'booking_vijay')"; $result = pg_query($query); if (!$result) { $errormessage = pg_last_error(); echo "error query: " . $errormessage; exit(); } printf ("these values inserted database"); pg_close(); in localhost code run completely, when execute in server display error : error query: error: permission denied sequence table_test_som this should not happen postgres user. betting have ch

c# - Confused with SOLID and Dependecy Injection -

so trying learn solid principles , dependency injection. have read blog posts on subject , starting understand bit. however, there 1 case can't find answer , try explain here. i have developed library text matching, contains class matcher has function called match returns result in matchresult object. object contains information percentage, time elapsed, whether success or not , on. understand in dependency injection high level class should not "know" low level class or module. have set library , matcher class use interface matcher class, allow me register using ioc container. however, because function returning matchresult object, "high level class" have know matchresult object breaks rules of di. how should go solving problem , recommended way so? "high level" , "low level" terms associated dependency inversion has relation dependency injection different concept. both have initials "di", , "d" in

sql - Count records which has no association or association of association meets condition -

assume have 3 classes: class person belongs_to :group end class group has_many :people has_many :tags end class tag belongs_to :group end it possible, person may have group_id = null . what need, count person records has group_id = null or group doesn't have tag record attribute status in ('active', 'finished') one more thing, has fast possible. querying on milions of records. ideas? thanks.

javascript - Angular 1.5.0. Root Template is duplicated when reloading the page with UI GRID via ocLazyLoad. $$animateJs is undefined -

Image
i'm using: angular, angular-animate both v. 1.5.0 angular ui grid v. 3.1.1 oclazyload v. 1.0.9 angular ui router v. 0.2.18 the error is : typeerror: $$animatejs not function @ d (angular-animate.js:2141) @ angular-animate.js:2131 @ h (angular-animate.js:3174) @ array.d.push.fn (angular-animate.js:3020) @ c (angular-animate.js:423) @ b (angular-animate.js:393) @ angular-animate.js:3042 @ m.$digest (angular.js:16714) @ m.$apply (angular.js:16928) @ g (angular.js:11266) this error occurs when refresh page contains ui grid and ui grid module loaded oclazyload. if place ui grid script in <'body'> work fine. when use oclazyload. other pages work fine. when change state works fine. when refreshing. not matter if f5 or ctrl + f5 the strange thing i've seen root template duplicated update: i've uploaded project sample github so initial state $state without grid if switch between

android - not receiving firebase notification from console -

Image
i not receiving notification after sending through firebase console , tried sending many notification received 1 or 2 around 20 notifications, followed guide firebase messaging github ,why not receiving notification, app installed in 1 emulator , in 1 of phone when receive notification have sent through notification panel them either on phone or emulator never got them on both. below screenshot of console check android app configuration in firebase console use restful client make request, suggest chrome-extension://aejoelaoggembcahagimdiliamlcdmfm/dhc.html, there can see response of request, if request sent sucessfully or if have error, , response tells kind of error have check android app , in method onmessagereceived , print see if receive information, besides can print property "from" id_number of proyect, , can see if messages come firebase android app check firebase documentation . had implementing guides , working pretty well

doctrine - The ability to pass file names to the Symfony\Component\Yaml\Yaml::parse method is deprecated -

i'm new symfony2 , working on 3 weeks. things going have 4 deprecated warning @ each page require doctrine interact (mapping done through yaml file), whatever entity used. the ability pass file names symfony\component\yaml\yaml::parse method deprecated since version 2.2 , removed in 3.0. pass yaml contents of file instead. (4 times) i don't know did wrong, or if there problem somewhere can fix rid of warns. thank ! just in case, here full stacktrace : yaml::parse() (called yamldriver.php @ line 712) yamldriver::loadmappingfile() (called filedriver.php @ line 115) filedriver::getelement() (called yamldriver.php @ line 55) yamldriver::loadmetadataforclass() (called mappingdriverchain.php @ line 102) mappingdriverchain::loadmetadataforclass() (called classmetadatafactory.php @ line 116) classmetadatafactory::doloadmetadata() (called abstractclassmetadatafactory.php @ line 332) abstractclassmetadatafactory::loadmetadata() (called abstractclassmetadatafactory.

mysql 5.7 can't allow docker IP access on CentOS7 -

i've installed mysql5.7 , docker service on centos 7.1. it's ok connect mysql command mysql -u root locally. it's fail connect when tried use mysql -u root -h 172.17.0.1 , in 172.17.0.1 local docker0 ip address. [root@test1 workspace]# mysql -u root -h 172.17.0.1 error 1130 (hy000): host 'test1.novalocal' not allowed connect mysql server i've googled reason , trying grant access test1.novalocal without lucky. mysql> grant on *.* root@'test1.novalocal' grant option; error 1133 (42000): can't find matching row in user table any other clue? try: grant on *.* 'root'@'test1.novalocal' identified 'somepassword' grant option; mysql latest versions comes no_auto_create_user prevent grant statement automatically creating new users if otherwise so, unless authentication information specified. statement must specify nonempty password using identified or authentication plugin using identified wit

ruby on rails - How can I allow only a specific user role to update an attribute to a specific value -

afternoon, got bit of issue not sure how resolve. i trying setup rules allows types of user roles update status attribute on model status. so looked doing pundit seems authorisation issue, 1 problem cannot pass params pundit policy need access (so can see attribute trying change to), , seems bad practise pass params pundit policy. the next option make callback in model, problem here don’t have access current_user inside callback , again seems bad practise add current_user helper model. so left perhaps doing in controller? again not seem right place it? an example make little easier understand: i want allow user role of admin allowed change status of post "resolved", no 1 else allowed change status "resolved" try this, create instance method in user model bellow, def is_admin? self.has_role(:admin) # if using rolify ---or--- self.status == "admin" # if have status attribute in user table end then call method on cur

c# - Show Form Message using non-Main UI Thread -

i have project without usign form/button or nothing that, connects websocket , using async methods receives message(on form created myself) supposed appear on top-right corner of screen. but message can appear time time (2 or 3 minutes) on screen if websocket doesn't must stop. , message can big enough, in order make better make message appear in more 1 form. it causes impression it's notification. class connects websocket , receives message async, calls class using thread controller. purpose of controller time time, show message in various new form() notifications , don't if websocket doesn't return message. but when call form.show program stops working. i've looked around stackoverflow already, ideas i've found didn't seem work. some should use invoke, kept giving error saying "invoke or begininvoke cannot called on control until window handle has been created", tried solve this: c# calling form.show() thread didn't work. some

Classifying two lists and arrange accordingly in python -

i'm working 2 lists looks this: list_a = [x,y,z,.....] list_b = [xa,xb,xc,xd,xe,ya,yb,yc,yd,za,zb,zc,zd,ze,zf] what i'm trying achieve is, make more lists while arranging data following: list_x = [x,xa,xb,xc,xd,xe] list_y = [y,ya,yb,yc,yd] list_z = [z,za,zb,zc,zd,ze,zf] now if use loops like: final_list=[] item in list_a: value in list_b: if value[0] == item: print item, value it filters data can not reach desired format. guys please give valuable comment on this. thank you not 100% formatting, use list of lists. list_a = ["x","y","z"] list_b = ["xa","xb","xc","xd","xe","ya","yb","yc","yd","za","zb","zc","zd","ze","zf"] final_list = [] item in list_a: item_list = [item] value in list_b: if value[0] == item: item_l

What does "PRIVATE" in "PRIVATE int func_name()" in c? -

i have following c function, private int func_name() { return 0; } what "private" mean here? in "normal" c private has no meaning. it #define static (or perhaps nothing). i'd suggest trying grab output of pre-processor see looks like. in gcc it's -e stop after pre-processor stage.

java - SqLite: Cursor does not increment correctly -

i having issue cursor's respective while loop not running. cursor.columncount() returns appropriate amount of columns. there errors in how increment cursor? a pictoral view (column returned): |rating| |2 | |3 | |6 | function should return 11/3 (3.66666) public double getaveragerating(string title) { title = title.touppercase(); int rating = 0; int count = 1; sqlitedatabase db = this.getreadabledatabase(); string str = "select rating " + table_name + " title=" + "'" + title + "'" + ";"; cursor cur = db.rawquery(str, null); while(cur.movetonext()) { int b = integer.parseint(cur.getstring(cur.getcolumnindex("rating"))); rating += b; count++; } cur.close(); return (double) rating/count; //return rating; }

java - Gradle sync failed: Unable to load class 'org.gradle.internal.logging.LoggingManagerInternal' -

i tried import new library module in android project (using android studio), work without problem, when imported have error (when trying sync gradle): gradle sync failed: unable load class 'org.gradle.internal.logging.loggingmanagerinternal'. bulid.gradle module apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.1" defaultconfig { applicationid "com.amazon.mysampleapp" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" multidexenabled = true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } debug { debuggable true } } lintoptions { abortonerror false } sourcecompatibility = 1.7 targetcompatibility = 1.7 } dependencies { compile filetree(include: ['*.jar'], dir: 'libs') compile file

jquery - $(...).dialog is not a function while opening popup on button click event -

already got answer this. when workout got error on console.log(). don't know issue. here jsfiddle link jsfiddlelink this html code.i have created 1 button open dialog , 1 div popup dialog. <button id="opener">cick open</button> <div id="dialog1" title="dialog title" hidden="hidden">dialog opened</div> this script trigger popup on clicking button $(document).ready(function() { $( "#dialog1" ).dialog( { autoopen: false }); $("#opener").click(function() { $("#dialog1").dialog('open'); }); });

java - How to set different colors to individual items in an SWT Combo -

i have combo dropdown in swt , have been thinking of setting different colors different items in list based on conditions. i'll decide later (i.e if string has on 5 characters item should have red background otherwise should green) i managed change background of whole combo widget have noticed no method change background individual items. color colorgreenswt = new color(null, 0, 255, 0); combo combo = new combo(comp, swt.drop_down); string[] languages = { "i", "it", "item", "items", "more_items" }; (int = 0; < languages.length; i++) combo.add(languages[i]); combo.setbackground(colorgreenswt); so there method select background color each item in part? combo not allow that. nebula project has tablecombo widget [1] might interest you. swt has extended custom combo called ccombo might want @ [2]. [1] https://eclipse.org/nebula/widgets/tablecombo/tablecombo.php [2] http://help.eclipse.org/luna/index.jsp?topi

java - How to set no indicator for the group having zero child in Expandable ListView? -

i want set no indicator groups having 0 child .i have used expandable list view .this screenshot initial layout .initially groups 0 child have no indicator .but expand group definite number of childs groups no child starts showing indicator . mainactivity.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:ads="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:opendrawer="start"> <include layout="@layout/app_bar_main" android:layout_width="match_parent"

c# - Using Fastmember to bulk insert only selected columns -

i have application being used insert large amounts of data (up 250,000 records per file) file table has several computed columns. there way select columns fastmember inserts data don't try writing computed columns? using (sqlbulkcopy bcp = new sqlbulkcopy(yourconnectionstring)) { // +1 marc gravell neat little library mapping // because datatable isn't available until .net standard library 2.0 using (var datareader = objectreader.create(yourlistofobjects, nameof(yourclass.property1), nameof(yourclass.property2))) { bcp.destinationtablename = "yourtablenameinsql"; bcp.columnmappings.add(new sqlbulkcopycolumnmapping("property1", "mycorrespondingtablecolumn")); bcp.columnmappings.add(new sqlbulkcopycolumnmapping("property2", "tableproperty2"));

java - Create Object Name with Array -

i want create object name using arrays. how can it? for example : string dizi ={"person1","person2","person3"}; person dizi[0] = new person(); you cannot change type of object stored in array string person. instead, need 2 separate arrays, , supposing have person(string) constructor, loop on first array fill second array: string[] names = {"person1","person2","person3"}; person[] persons = new person[3]; (int = 0; < 3; i++) persons[i] = new person(names[i]);

http - Best solution for waiting on response in Android? -

i want create android background service, creates notification, if server has restarted, need ideas how implement it. i thought http connection, background service waits until message comes in, think connection can not keep while restart. after there came new idea, background service pushes notification, when connection breaks. would possible (if yes, easiest way) or there better way solve this? create asynchronous task tries connect server in endless loop. use time limit cancel process after given time or return ok value if server responds 200.

java - Deserializing cyclic JSON with only one class involved with Jackson -

is possible deserialize following class jackson? so original version of question wasn't entirely accurate. here's minimal example reproduce problem. import java.io.ioexception; import com.fasterxml.jackson.annotation.jsoncreator; import com.fasterxml.jackson.annotation.jsonidentityinfo; import com.fasterxml.jackson.annotation.jsonproperty; import com.fasterxml.jackson.annotation.objectidgenerators; import com.fasterxml.jackson.databind.objectmapper; @jsonidentityinfo( generator = objectidgenerators.intsequencegenerator.class, property = "id") public class thing { public thing thing; @jsoncreator public thing(@jsonproperty("thing") thing thing) { this.thing = thing; } public static void main(string[] args) throws ioexception { objectmapper mapper = new objectmapper(); thing cyclic = new thing(null); cyclic.thing = cyclic; string serialised = mapper.writevalueasstring(cyclic); system.out.println(serialised);

postgresql - Error importing map with osm2pgsql -

i've been following guide setting own osm node. https://switch2osm.org/serving-tiles/manually-building-a-tile-server-14-04/ i've gone trough compiles , configurations no complications (twice) in both runs ended following error using built-in tag processing pipeline using projection srs 3857 (spherical mercator) setting table: planet_osm_point osm2pgsql failed due error: create table planet_osm_point (osm_id int8,"access" text,"addr:housename" text,"addr:housenumber" text,"addr:interpolation" text,"admin_level" text,"aerialway" text,"aeroway" text,"amenity" text,"area" text,"barrier" text,"bicycle" text,"brand" text,"bridge" text,"boundary" text,"building" text,"capital" text,"construction" text,"covered" text,"culvert" text,"cutting" text,"denomination" text,"

apple watch - WatchOS app running in background -

how keep apple watch app running in background. build timer, every time screen dims , wake app resets timer. how avoid this? i don't think you're supposed to. apple say : do not use background execution modes technology. watch apps considered foreground apps because run while user interacts 1 of interfaces. result, corresponding watchkit extension cannot take advantage of background execution modes perform tasks. you might want check elapsed time on wakeup instead.

regex - Bash sed how to mask brackets -

i want search 'start') in file /etc/init.d/fhem , , write code read textfile file after statement above. @ moment message have close bracket 'start') . think have mask properly, far no luck trying that. may give me missing link? cocconf=$(<coc.txt)#reading cod file insert in other file sed -r "\'start\')/a $cocconf" /etc/init.d/fhem #inserting said code you're missing / before regular expression. , there's no need escape single quotes inside double quotes. when use extended regexps, need escape parentheses. a command requires backslash after it, , text added must on next line. sed -r "/start\)/a\ $cocconf" /etc/init.d/fhem

Null Pointer Exception in array passed class -

so have project requires generic class extends number , finds largest , smallest value in array, average of values, , size of array. seems easy enough implement, have problem before putting generic part of in place, runtime error of null pointer exception @ x.length, regardless of method call, in same place. import java.util.comparator; public class test { public int x[]; public test(int x[]) { } public void setx(int newx[]) { x = newx; } public int[] getx() { return x; } public int findsmallest() { int = 0; int temp = x[i]; while (i < x.length) { i++; if(x[i] < temp) { temp = x[i]; } else { } } return temp; } public int findlargest() { int = 0; int temp = x[i]; while (i < x.length) { i++; if(x[i] > temp) { temp = x[i]; } else { } } return temp; } public double findmean()

c# - Epicor v9 to v10 Customization Reference Missing and BPM import -

i'm working company upgrading epicor v9 v10. have custom bit of code done 3rd party. i've been brought in upgrade process don't know history. previous developer around when 3rd party developed install package left years ago. best can tell form utilizes custom code missing reference. error message starts off with: 'erp.bo.partplantlistdataset' defined in assembly not referenced. must add reference assembly i have install documents provided 3rd party company v9 , v10 seem differ bit. when follow instructions go "system management/business process management/directive import" , try import bpm error message "the file not bpm import file" the file has .bpm extension , used in v9. have files ending in .i , .p install instructions don't match @ all. i'm versed in c# , ms sql new version of epicor uses, can't these customizations configured properly. how can import customizations? need conversion v9 code prior

javascript - $.ajax is not a function? -

i have started learn javascript , working on small project. having error stating "$.ajax not function". endpoint , token , , body defined variables. var $ = require('jquery'); $.ajax({ type: 'post', url: endpoint + token, contenttype: 'application/json', data: json.stringify(body), success: function(data, status) { console.log(data); console.log(status); }, error: function(jqxhr, status, errorthrown) { console.log(errorthrown); console.log(status); console.log(jqxhr); } }); anyone see problem have? 2 possible reasons : check if jquery has been added in index.html (or whatever name main html has) file. if above not relate problem, need put check i.e. jquery available you, below code : if(window.jquery) { ...do stuff here } else{ ... handle according need here } also, don't forget check if document object ready

r - Predictive power of date variable reduces when changed from as.Date to as.numeric -

i'm building regression model several date , numeric variables. quick check on 1 of date variables lm.fit = lm(label ~ firstday, data = rawdata) summary(lm.fit)$r.squared to gauge predictive influence on model. accounted 41% of variance. attempted change date numeric can work better variable. used command as.numeric(as.posixct(rawdata$firstday, format = "%y-%m-%d")) doing reduced variance 10% - not want. doing wrong , how go it? i've looked @ https://stats.stackexchange.com/questions/65900/does-it-make-sense-to-use-a-date-variable-in-a-regression answer not clear me. edit 1: a reproducible code sample of did shown below: label = c(0,1,0,0,0,1,1) firstday = c("2016-04-06", "2016-04-05", "2016-04-04", "2016-04-03", "2016-04-02", "2016-04-02","2016-04-01") lm.fit <- lm(label ~ firstday) summary(lm.fit)$r.squared [1] 0.7083333 on changing numeric: fi

c# - Android ProgressBar in my View -

i trying place loading spinner canvas. in constructor: this.progressbar = new progressbar(context, null, resource.attribute.progressbarstyle); and in ondraw : protected override void ondraw(canvas canvas) { base.ondraw(canvas); // other code draw other stuff... this.progressbar.draw(canvas); } it not appearing. missing something? checked width property , 0 while debugging, still don't know how fix it. my class extends view you need extend class viewgroup or layout (e.g. framelayout), during initialization need call addview methods progress bar. if extending simple viewgroup additionally need override onmeasure , onlayout methods providing computing size of progress widget , placing on view group accordingly. here tutorial xamarin users more info.

minify - CSS minificator removes units for zero values (px, ms, em) -

in combres file, use defaultcssminifierref="msajax" . this minifier remove units (px, em, ms) 0 values. 0ms not same 0s. so, should do, if need save units after minification? the unit identifier can omitted lengths of zero. other units require unit identifier values of zero. lengths include em , px , etc. there debate on whether better include or not (see this question , this one ). minifier , should remove unit identifier on lengths of zero. see spec here : for 0 lengths unit identifier optional non-lengths require unit identifiers, whether 0 or not. if minifier removes unit identifier of non-length, such ms in time given value of property transition-duration , bug in minifier.

vbscript - Rename part of file -

i require vbscript finds recent file in folder , renames it. have been able write script finds recent file. however, cannot figure out how correctly have file renamed once identified. have been able rename file basic name, confirming script works. the file name needs letter "a" added in middle. the file saved 20160229_titles , needs become 20160229a_titles . below script tried pull year , add "a". figured if year add beginning, add in month , year. date current date. continues cause error message. option explicit dim fso, folder, file, date, recentfile dim foldername, searchfilename, renamefileto foldername = "c:\ticket\test\" set fso = createobject("scripting.filesystemobject") set folder = fso.getfolder(foldername) set recentfile = nothing each file in folder.files if (recentfile nothing) set recentfile = file elseif formatdatetime(file.datelastmodified) = date set recentfile = file

r - How to produced group barplot with different color codes? -

Image
i trying make grouped barplots below formatted data. wrote below code not serving purpose data data1 <- read.table(text=" nas ag pt st 1kb_+/-tss 1239 885 1232 952 1.5kb_+/-tss 1440 1092 1467 1181 2kb_+/-tss 1647 1248 1635 1398 2.5kb_+/-tss 1839 1403 1794 1594", header=true) code data2=as.matrix(data1) b<-barplot(data2, legend= rownames(data2), beside= true,las=2,cex.axis=0.7,cex.names=0.7,ylim=c(0,3000), col=c("cornflowerblue","cornsilk4","red","orange")) tx2 <- data2 text(b,tx2+10, as.character(tx2),pos = 3, cex = 0.5, col = "darkgreen") below image i not want have color combination want color each group nas(shades of blue each rows),ag(shades of cornsilk4, pt(shades of read), st(shades of orange) how shall modify code? each category has lighter shades of 4 colours used in main code if want different shades each of colors, have create colors selves

asp.net mvc - Live search MVC -

i'm looking live search asp.net , entity framework. i'm little bit green it. read needs use ajax, never used before , can't example. here piece of code, cshtml (part of textbox) <div class="form-horizontal"> <hr /> <h4>search client: </h4> <div class="input-group"> <span class="input-group-addon" id="name"> <span class="glyphicon glyphicon-user" aria-hidden="true"></span> </span> @html.textbox("name", "", new { @class = "form-control", placeholder = "name" }) </div> <div><h6></h6></div> <div class="input-group"> <span class="input-group-addon" id="surname"> <span class="glyphicon glyphicon-user" aria-hi

excel - How do I find out if/where xlsxwriter is on my system (for python)? -

i attempting use xlsxwriter package write , image excel file, keep getting 'no module name 'xlsxwriter' error on import statement. on closed network, wondering how can find out xlsxwriter on system other packages/extensions available on system. reading post - help, ideas, or suggestions appreciated! thanks, don

Selenium webdriver-Jenkins Email notification -

i not getting mails on project success when using jenkins, please tell me stable plugins jenkins & email-ext plugin. now, getting email when test fails sounds need add trigger success emails. default, failure trigger added email-ext project configuration. need expand "advanced" section , add success trigger well.

java - IndexOutOfBoundsException when trying to add more instances to training set using Weka -

i trying add more instances training set , perform 10-fold cross validation. my instances in string format use stringtowordvector filter transform them numbers. things work if not add pages want. when add command trainset.addall(data2); , pass trainset filter strange indexoutofboundsexception in first iteration @ instances ftrainset = filter.usefilter(trainset, filter); instances data = getdatafromfile("pathtofile.arff");//main dataset 1821 instances instances data2 = getdatafromfile("anotherpath.arff");//709 instances want add int folds = 10; for(int i=0;i<folds;i++){ instances trainset = data.traincv(folds, i);//training set system.out.println(trainset.numinstances());//prints 1638 instances testset = data.testcv(folds, i);//testing set //add more instances trainset.addall(data2); system.out.println(trainset.numinstances());//prints 2347 //filter stringtowordvector filter = new stringtowordvector(); fil