Posts

Flash.h errors with Arduino 1.0.6 and Teensy 3.1 (Teensyduino, Version 1.20) -

i have been using flash.h library ( http://arduiniana.org/libraries/flash/ ) version 5 arduino 1.0.5 , teensy 3.1 without issues. had upgrade version 1.0.6 , getting error [removed path message] /.../libraries/flash/flash.h: in member function 'char* _flash_string::copy(char*, size_t, size_t) const': /.../libraries/flash/flash.h:79:44: error: operands ?: have different types 'int' , 'char*' and code in flash.h char *copy(char *to, size_t size = -1, size_t offset = 0) const { return size == -1 ? strcpy_p(to, _arr + offset) : strncpy_p(to, _arr + offset, size); } at first glance can see operand comparing strcpy , strncpy , both of them return char* not sure why thinks 1 int. this page has reference 2 functions used http://tuxgraphics.org/common/src2/article12051/avr-libc-user-manual/manual/group__avr__pgmspace.html any appreciated figure out problem. library test works vailla arduino 1.0.6, when install teensyduino, version 1.20 ,...

c# - Read All Bytes Line By Line In .txt -

i need read in bytes on 1 line , throw them array, , move onto next line , on , forth. for instance: .txt file word apple zzz now in program have read in first line bunch of bytes, , array consist of 4 elements. i'd processing , move on next line , on. i have looked in many places no luck. ideally, need readallbytes() except instead of reading entire file need read 1 line. edit: since going speed, cannot readalllines() or anything require me read string first , convert array of bytes. edit2: have backtrack bit because understand not best @ explaining anything, try. ideally, how code work loop through lines of txt file loop through bytes on line read byte , process if need to, break loop , move on next line this give better understand of dilemma. even though problem remains unsolved i'd still thank tried me: thank trying assuming text file ascii: var lines = file.readlines(@"c:\temp\foo.txt"); foreach (var line i...

c# - XamlReader and Custom ContentPropertyAttribute -

i'm trying make custom graphic layout engine. it's xaml-based , thought reusing system.xaml types deal xaml. as objects defined inside portable class libraries, cannot decorate them standard contentpropertyattribute , problem, because have specify each content explicitly this: <window> <window.content> <textblock /> </window.content> </window> as can appreciate, set textblock window.content withing tags. i work does: <window> <textblock /> </window> can configure xamlreader/xamlobjectwriter use property default when nothing specified? thanks!

java - Spring Data 'Left Join Fetch' query returning null -

my query looks this: @query("select p pilot p left join fetch p.playerships p.nickname = (:nickname)") so far good. i'm getting pilot instance when playerships empty. now, want fetch inactive ships modified query this: @query("select p pilot p left join fetch p.playerships s p.nickname = (:nickname) , s.active = false") and i'm getting null pilot doesn't work. i'd glad if explain me how create join fetch query clause applies child elements. in advance. just move join condition: @query("select p pilot p left join fetch p.playerships s on s.active = false p.nickname = (:nickname)") the on clause defined in jpa 2.1

variables - Extract line below Findstr criteria in Batch file for cycle -

i'm trying extract set of txt files line placed 2 rows below 1 matching search criteria , redirect output csv file. i managed specific txt file in set, i'm getting troubles in writing cycle batch-scan each txt in given folder. through this , wrote following code scan a specific file. works fine: setlocal enabledelayedexpansion cd "myfolder" if exist myoutput.csv del myoutput.csv /f "delims=:" %%a in ('findstr /b /n /c:"mycriteria" "myfile.txt"') ( set /a linebelow=%%a+2 set "linebelow=!linebelow!: " ) (for /f "tokens=1* delims=:" %%a in ('findstr /n "^" "myfile.txt" ^| findstr /b "%linebelow%"') ^ echo %%b>>myoutput.csv) start myoutput.csv endlocal when tried generalize code in cycle scan each txt in myfolder got error in findstr: !linebelow! happens empty variable... here's flawed cycle: setlocal enabledelayedexpansion cd "myfolder...

supress PATH in batch file -

i have batch file: set path=c:\cygwin\bin\;%path%@ c:\cygwin\bin\bash.exe c:\cygwin\home\cmccabe\newbatch.sh that outputs: c:\users\cmccabe\desktop>set path=c:\cygwin\bin\;c:\windows\system32;c:\windows; c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program files (x86)\intel\opencl sdk\2.0\bin\x86;c:\program files (x86)\intel\opencl sdk \2.0\bin\x64;c:\program files (x86)\microsoft sql server\100\tools\binn\vsshell\ common7\ide\;c:\program files (x86)\microsoft sql server\100\tools\binn\;c:\prog ram files\microsoft sql server\100\tools\binn\;c:\program files (x86)\microsoft sql server\100\dts\binn\@ c:\users\cmccabe\desktop>c:\cygwin\bin\bash.exe c:\cygwin\home\cmccabe\newbatch. sh menu ================================== 1 match patient 2 sanger analysis 3 batch analysis 4 individual analysis 5 supplemental analysis 6 exit ================================== choice: how c...

java - Shuffling a deck of cards - array or stack? -

im planning develop simple card game on android-java, in app shuffle cards wonder best way store deck of cards in array or in stack..? problem stack dont know how shuffle it. i believe trick stack: stack<card> deck = new stack<>(); // add card types deck... collections.shuffle(deck);