Posts

r - How to check the consistency of specific variables from different IDs registered repeated times in a dataframe -

i know how can detect if different individuals captured repeated times have same value in specific variables along different measures. specifically, have repeated measures of individuals (column id) values of different variables along time (e.g. sex, weight) i check individuals assigned time same sex, having reference last measure because measure reliable. later store every row or register mismatch references in 1 dataframe. id <- c("1", "2", "3", "1", "2", "3", "1", "2", "3") sex <- c("m", "f", "m", "m", "m", "m", "f", "f", "m") weight <- c(20, 15, 30, 22, 18, 32, 26, 21, 36) time <- c(1, 1, 1, 2, 2, 2, 3, 3, 3) df <- data.frame (id, sex, weight, time) df to that, have selected last register of each id library (data.table) dt <- as.data.table (df) dt_last_register <- dt [...

c - Passing array to function results in segmentation fault (core dumped) -

i trying build quicksort function results in segmentation fault (core dumped) . having read error sure have stray pointer can't spot it. used valgrind me debug , comment lines valgrind told me in following piece of code: #include <stdio.h> #include <assert.h> int partition(int *a,int l, int h, int pivot) { l++; while(l <= h && a[l] < a[pivot]) { l++; } while(a[h] >= a[pivot]) { //conditional jump depends on uninitialised value here h--; } if(l < h) { int tmp = a[l]; a[l] = a[h]; a[h] = tmp; partition(a,l,h,pivot); } else { int tmp = a[pivot]; a[pivot] = a[h]; a[h] = tmp; return h; } return -1; } void quicksort(int *a, int low, int high) { //base case. if(low - high == 0){ return; } //just 2 elements in array sorted if(low - high == -1) { if (a[low] < a[high]) { int tmp = a[low]; a[low] = a[high]; a[high] = tmp; } ...

java - Eclipse error adding images to an array -

i new android programming. found tutorial on how create simple gallery app android phones/tablets. finished beta of app, using 10 example images called a1.png, a2.png... a10.png in new resource folder (app/res/drawable/) my code was: private integer[] smallprev = { r.drawable.a1, r.drawable.a2... r.drawable.a10 }; and working should when tested app on phone. saw a1, a2... a10 indentified somehow in r.java file in project: public static final class drawable { public static final int a1=0x7f020000; public static final int a10=0x7f020001; public static final int a2=0x7f020002; public static final int a3=0x7f020003; public static final int a4=0x7f020004; public static final int a5=0x7f020005; public static final int a6=0x7f020006; public static final int a7=0x7f020007; public static final int a8=0x7f020008; public static final int a9=0x7f020009; so far, good... today tried make new version of app, using original amount of images - ...

html - Atom - Emmet package: closing comments -

emmet atom: auto comments after html closing tag. i can't seem find solution problem anywhere i've resorted asking on here. http://iaintnoextra.tumblr.com/post/68089741466/automatically-add-closing-comments-to-html-using in sublime text 3, using emmet user preferences file link above, emmet automatically adds comments after closing html tag; example: div.container would produce: <div class="container"></div><!-- /.container --> i can't seem find anywhere within emmet's package settings make happen on atom v1. know can change mimics same functionality? http://www.devstavern.com/emmet/custom-comments-in-emmet-sublime-atom-and-others/ with of link above managed figure out on own, here's answer: edit emmet settings on atom. update extensions path under "settings" heading location you'd save preferences.json file we'll create next, i've created folder in dropbox folder can access file loca...

java - Jackson's @JsonView annotation does not work -

i annotated class user @jsonview , when returned see fields not contains in view class. here class @entity @table(name = "users") public class user implements serializable{ /** * */ private static final long serialversionuid = 1l; @id @column(name="id") @generatedvalue(strategy=generationtype.auto) private long userid; @jsonview(view.summary.class) @column(name="email") private string email; @jsonview(view.summary.class) @column(name="user_name") private string firstname; @jsonview(view.summary.class) @column(name="user_last_name") private string lastname; @jsonview(view.summary.class) @column(name="phone") private string phone; @jsonview(view.summary.class) @column(name="origin") private string address; @jsonview(view.summary.class) @column(name="birth_date") private long birthdate; @jsonview(view.summary.class) @column(name="gender") private long gender; @jsonview(view.summary.class) @...

javascript - Android Cordova canvas app lags only for specific device running 2.3.6 Gingerbread when no touch events are being fired -

my app uses html5 canvas , uses cordova build .apk file. i have tested app on 5 devices running varying versions of android os , of varying hardware capabilities. 1 lagged samsung galaxy ace 2, running android 2.3.6 gingerbread. believe os issue because phones tested similar/worse hardware not lag. when screen touched , remains touched, lag reduced. noticed pixels seem smoothed or anti-aliased when screen not touched more pixelated when screen touched, believe causing lag. prefer less pretty no lag opposite. javascript not cause happen, , stuck on how resolve it. the following did not solve problem: context.imagesmoothingenabled = false; and using css image-rendering settings did not help. the javascript has touchstart, touchend , touchmove event listeners attempted hack way faking touchmove event if user not touching screen, although couldn't working , it's not elegant solution anyway. i have had problem weeks , want apps work on devices. does have sug...

android - How to get lollipop status bar on kitkat -

Image
i'm trying achieve status bar primarydarkcolor , primarycolor lollipop on kitkat , here try: <style name="populartheme" parent="theme.appcompat.light.darkactionbar"> <item name="colorprimarydark">@color/colorprimarydarkpopular</item> <item name="colorprimary">@color/colorprimarypopular</item> <!--here i've added try transparency --> <item name="android:statusbarcolor">@android:color/transparent</item> <item name="android:windowactionbaroverlay">true</item> <item name="android:windowcontenttransitions">true</item> <item name="android:windowtranslucentnavigation">true</item> <item name="android:windowtranslucentstatus">true</item> </style> also, test method https://github.com/jgilfelt/systembartint won't choice because i'm using color each...