Posts

codeblocks - C++ Infinity Sign -

codeblocks - C++ Infinity Sign - hello wondering how can display infinity (∞) in c++? using codeblocks. read couple of q&a's on topic i'm newbie @ stuff, hex coding , stuff. have include , type out exactly. if can write code , explain it, that'd great! thanks! the symbol not part of ascii code. however, in code page 437 (most of time default in windows command prompt english language locales/us regional settings) represented character #236. in principle std::cout << static_cast<unsigned char>(236); should display it, result depends on current locale/encoding. on mac (os x) not displayed properly. the best way go utilize unicode set of characters (which standardized big amount of characters/symbols). in case, std::cout << "\u221e"; should job, unicode character #221 represents inf . however, able display unicode, output device should back upwards utf encoding. on mac, terminal uses utf, windows command prompt ...

html - The text goes over the image and not under it -

html - The text goes over the image and not under it - the problem when added image html page,and tried write go on working,the text going on image.i want text going under image.i don't want utilize 50 "br" tags can write under it.do know what's problem guys ? .poze { max-width: 100%; margin-top: 0.5em; margin-bottom: 1em; -webkit-box-shadow: rgba(0, 0, 0, 0.199219) 0px 0px 20px; background: white; border: 1px solid #ccc; border-bottom-left-radius: 5px 5px; border-bottom-right-radius: 5px 5px; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; padding: 8px; " } .cerculet { display: block; } .cerculet:after { display: block; clear: both; content:' '; } .cerculet p { font-weight: bold; } .cerculet h2 { font-size: 120%; height: 145%; width: 1.6em; height: 1.6em; text-align: center; border-radius: 50%; background-color: black; color: ...

for loop - sapply or other apply function in R -

for loop - sapply or other apply function in R - i wrote code yesterday , confusing help. sorry that. wrote 1 time again in easier way. my question is: there easier (or faster) way implement next code? k <- c(.04, .08, .12, .16, .2); library(plyr) valfcn <- function(k, v_next){ <- .3; b <- .6; return_val <- vector() for(i in 1:5){ tmp <- vector() for(j in 1:5){ tmp[j] <- (log(k[i]^a - k[j]) + b*v_next[j]); } return_val <- c(return_val,max(tmp[i])) } return_val } v0 <- c(rep(0,5)) v1 <- valfcn(k,v0) v2 <- valfcn(k,v1) v1 v2 i'd utilize alternative way might shorter faster, instead of using for-loop method. best! i believe sapply() isn't necessary based on description. might you're looking for: valfcn <- function(k, v_next){ <- .3; b <- .6; max(log(k^a - k) + b*v_next); } in version, transformation beingness done k produces vector , max() operates on entire vector. no n...

bare metal - How do I add a delay of 150 cycles on ARM? -

bare metal - How do I add a delay of 150 cycles on ARM? - changing pull up/down resistors gpio pins on raspberry pi requires waiting 150 cycles after enabling , disbaling clock signal according specs. doing bit longer doesn't wound using timer wait longer magnitudes don't want that. have simple busy loop: for (int = 0; < 150; ++i) { asm volatile (""); } 0: e3a03096 mov r3, #150 ; 0x96 4: e2533001 subs r3, r3, #1 8: 1afffffd bne 4 <foo+0x4> that loops 150 times, executing 300 instructions. without instruction caching , without branch prediction more 150 cycles. 1 time turned on loop runs way faster, faster 150 cycles think. so how wait close 150 cycles or without instruction caches , branch prediction enabled? note: worst case 2 functions, delay_no_cache() , delay_cache() this not duplicate of how delay arm cortex m0+ n cycles, without timer? since instruction cache , branch prediction completly t...

excel - How I copy multiple worksheet and multiple chart obj sheet to another workbook -

excel - How I copy multiple worksheet and multiple chart obj sheet to another workbook - sub cpysht2nwb() dim bkname string dim numsht integer dim begsht integer begsht = 1 numsht = activeworkbook.worksheets.count bkname = activeworkbook.name set newbook = workbooks.add newbook .saveas filename:="c:\e2eperformance\test.xlsm", fileformat:=xlopenxmlworkbookmacroenabled end x = 1 numsht workbooks(bkname).sheets(x).move _ before:=workbooks("test.xlsm").worksheets(x) next end sub it procedure error: run-time error '1004': excel cannot insert sheet destination workbook, because contains fewer rows , column source workbook. move or re-create info destination workbook, can select data, , utilize re-create , paste commands insert sheets of workbook. suppose: have 10 worksheet , 10 chart object sheet how can prepare this? try alter end : , if have charts sheets, worksheets won't include them, utilize sheets ...

MySQL Swap Values(not between fields) -

MySQL Swap Values(not between fields) - i'd inquire help swapping values within single field. table goes this: table field1 field2 x hello y test basically i'd swap x , y values(x becomes test , y becomes hello). know how swap or move values between fields i'm having difficulty this. sorry lame table illustration. this job successfully update rules rule1 bring together rules rule2 on ( rule1.rule_id = 1 , rule2.rule_id = 4 ) set rule1.priority = rule2.priority, rule2.priority = rule1.priority ; mysql

java - Play-framework 2 Validation -

java - Play-framework 2 Validation - so did 1 line tweak on play-computer-database-java activator template the models: computer: package models; import java.util.*; import javax.persistence.*; import play.db.ebean.*; import play.data.format.*; import play.data.validation.*; import com.avaje.ebean.*; /** * computer entity managed ebean */ @entity public class computer extends model { private static final long serialversionuid = 1l; @id public long id; @constraints.required public string name; @formats.datetime(pattern = "yyyy-mm-dd") public date introduced; @formats.datetime(pattern = "yyyy-mm-dd") public date discontinued; @constraints.required @manytoone public company company; /** * generic query helper entity computer id long */ public static finder<long, computer> find = new finder<long, computer>(long.class, computer.class); /** * homecoming page of...