Posts

Git - submodules HEAD is always detached after running update? -

i have configuration submodule in .gitmodules file: [submodule "sub"] shallow = true branch = master path = sub url = https://path/to/repo.git now want when clones repo , runs these commands: git submodule init git submodule update is shallow master branch of submodule. happens not checkout master branch. detached head, need manually run git checkout master . instead of 2 commands, user needs run 1 additional. i looked this: why git submodule head detached master? but advice on accepted answers, not seem help: added branch want in .gitmodules file, added remote upstream master (this works cloned/updated repository after had checkout master myself). so intended detached head if clones repository , wants set submodule? i'm still investigating this, here script came , using now: #! /bin/bash ...

html - CSS - How to autonavigate to a color on the page when page loads -

i have page work on daily , need through page text has html of: <tr style="background-color:#33ff00"> how can use css auto navigate color or html code when page loads? there way? i cannot edit html it's not hosted locally , don't have access write access, read. using stylebot modify css own display purposes , want know if can same auto navigate colored section. if there way similar using style bot html userscripts etc, not familiar enough if have workaround tutorial great show me how implement it. thanks! updated copy , paste code below text file , save html file. open in browser. this code loads target page host 'result' element, uses post-load javascript navigate colored tr elements. if page requires scripts on external stylesheets, etc., these need loaded explicitly. <!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script...

c# - XmlSerializer ignores attributes -

xmlserializer ignores class attributes. i'm writing simple serializer, , used [serializable] , [nonserialized] attributes, tried use [xmlroot] , [xmlignore] . , i've noticed, although field has attribute [nonserialized] serialized. and ignores other attributes such [xmatribute] . i've noticed it's not necessary use attributes, , can serialize class without these attributes, how can ignore fields? my class: [serializable] public class route { int busnumber; string bustype, destination; datetime departure, arrival; [nonserialized]datetime creationdate; ... } and i'm trying serialize list<route> private void savetoolstripmenuitem_click(object sender, eventargs e) { stream stream = file.openwrite(environment.currentdirectory + "\\routes.xml"); xmlserializer xmlser = new xmlserializer(typeof(list<route>)); xmlser.serialize(stream, ((fileform)activemdichild).routes); stream.close(); } i...

r - different values by fitting a boosted tree twice -

i use r-package adabag fit boosted trees (large) data set (140 observations 3 845 predictors). i executed method twice same parameter , same data set , each time different values of accuracy returned (i defined simple function gives accuracy given data set). did make mistake or usual in each fitting different values of accuracy return? problem based on fact data set large? function returns accuracy given predicted values , true test set values. err<-function(pred_d, test_d) { abs.acc<-sum(pred_d==test_d) rel.acc<-abs.acc/length(test_d) v<-c(abs.acc,rel.acc) return(v) } new edit (9.1.2017): important following question of above context. as far can see not use "pseudo randomness objects" (such generating random numbers etc.) in code, because fit trees (using r-package rpart) , boosted trees (using r-package adabag) large data set. can explain me "pseudo randomness" enters, when execute code? edit 1: similar phenomeno...

How to add Android.mk file to gradle by using UI -

i'm following below url add android.mk file gradle file . https://developer.android.com/studio/projects/add-native-code.html#link-gradle i've installed ndk before, don't know android.mk file . you select ndk-build, use field next project path specify android.mk script file external ndk-build project. android studio includes application.mk file if located in same directory android.mk file. my os windows 64.

java - countChars - So close, yet so far -

i feel there, i've starred blind after trying know(which isn't lot.) alright, trying input string method should read , give me numbers of each character or first. i'm lost. please help. public class sam { private static string countchars; public static void main(string[] args) { system.out.println(countchars); } static int countchars(string str, char searchchar) { // count number of times searchchar occurs in // str , return result. int i; // position in string, str. char ch; // character in string. int count; // number of times searchchar has been found in str. count = 0; (i = 0; < str.length(); i++) { ch = str.charat(i); // i-th character in str. if (ch == searchchar) { count++; } } return count; } } best regards, sam you not correctly calling countchars() function in main() function. you use following example system.out.println(countchars("hello,...

javascript - how to create dots(scatterplot) on a line in a d3 line chart -

Image
my code working fine, there issue first dot on line. first dot y=2 , x=1 position, other dots placed correctly. please me place first dot in correct place. graph:- json data graph:- var data = [{ "label": "execution: 6 - defadmin@gmail.com", "x": [1, 2, 3, 4, 5, 6], "y": [2, 1, 1, 1, 1, 1], "xaxisdisplaydata": ["1", "2", "3", "4", "5", "6"] }]; here code regarding dot creation, // set ranges var x = d3.time.scale().range([0, innerwidth]); var y = d3.scale.linear().range([innerheight, 0]); // scale range of data x.domain(d3.extent(datasets[0]['x'], function (d, i) { return datasets[0]['x'][i]; })); y.domain([1, d3.max(datasets[0]['y'], function (d, i) { return datasets[0]['y'][i]; })]); // add scatterplot svg.selectall("dot") ....