Posts

Showing posts from July, 2010

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...

javascript - How to use google marker manger with dynamically data from php -

javascript - How to use google marker manger with dynamically data from php - hello guys have lots of google marker showing on maps. because of website page slow. got solution of google maker manger load marker. don't understand proper how load marker marker manger. google illustration differnt case code seek please help me guys index.html file <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>google maps api illustration - random weather map</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true">...

javascript - Why do HTML/SVG Coordinate 0,0 starts at top left corner? -

javascript - Why do HTML/SVG Coordinate 0,0 starts at top left corner? - just wondering whats reasoning behind saying 0,0 top left corner in browser both html/svg? there advantage this? it goes against conventional wisdom (classic geometry) y values become greater in value lower on screen. because that's how css predates svg works. in cases, such stand-alone svg documents or svg document fragments embedded (by reference or inline) within xml parent documents parent's layout determined css [css2] or xsl [xsl], initial viewport coordinate scheme (and hence initial user coordinate system) has origin @ top/left of viewport, positive x-axis pointing towards right, positive y-axis pointing down, javascript html svg

java - Getting EditText name to array variable android -

java - Getting EditText name to array variable android - i developing application randomly chooses string arrays.xml file. every string has 3 variables (%1$s, %2$s, %3$s). first taken edittext, sec spinner (gets array) , 3rd edittext. i tried utilize string.format didn't work, logcat gives nullpointerexception. <string-array name="blabla"> <item>blabla %1$s blabla %2$s blablabla %3$s.</item> <item>blablabla %1$s blablabla %3$s blabl %2$s.</item> </string-array> and java code: public void invia(view v){ spinner eta = (spinner) findviewbyid(r.id.etaspin); string etastring = eta.getselecteditem().tostring().trim(); edittext nome = (edittext) findviewbyid(r.id.nomeins); string nomestring = nome.gettext().tostring(); edittext citta = (edittext) findviewbyid(r.id.cittains); string cittastring = citta.gettext().tostring(); resources res = getresources(); string tot = res.getstring(r.array....

java - The operation could not be performed (using a LINKED-SERVER in Hibernate) -

java - The operation could not be performed (using a LINKED-SERVER in Hibernate) - i'm trying perform update query in database located in remote server through linked server connection. i'm tested , works fine when utilize sgbd. in web app, have hibernate 3.5 and, when seek utilize execute query, i'm faced next error message: "the operation not performed because ole db provider "msdasql" linked server "xyz" unable begin distributed transaction" although, if seek utilize pure jdbc, works fine. whats hibernate's problem externals access? java sql-server hibernate linked-server

ruby on rails - Rspec controller testing for update of article does not work -

ruby on rails - Rspec controller testing for update of article does not work - here controller_spec file portion of relevant code..... login_user context 'update article valid attributes' 'update article'do article = article.create!(attributes_for(:article)) set :update, id:article.to_param, :article => attributes_for(:article, title: "title changed") article.reload expect(article.first.title).to eq("title changed") end end end i getting error failure/error: expect(article.first.title).to eq("title changed") expected: "title changed" got: "my first post" (compared using ==) the controller code of update # ..articlescontroller#update def update @article = article.find(params[:id]) if @article.update(article_params) redirect_to @article else render 'edit' end end ruby-on-rails rspec

extjs - load chart data.store using php as a variable -

extjs - load chart data.store using php as a variable - i trying utilize chart view , store variable , load info php outputs valid json. decided utilize because want show different chart based on different submit value. ext.require('ext.chart.*'); ext.require('ext.layout.container.fit'); window.store1 = ext.create('ext.data.store', { extend: 'ext.data.store', autoload: true, idproperty: 'name', fields: [{ name: "name", type: "category" }, { name: "mangrove_area", type: "integer" }], data: [{ "name": "kenya", "mangrove_area": 295.3404 }, { "name": "tanzania", "mangrove_area": 821.6568 }, { "name": "mozambique", ...

html - get a link from an tag with multiple attributes using HTMLAgilityPack -

html - get a link from an <a> tag with multiple attributes using HTMLAgilityPack - i trying link piece html page, link looks this: class="snippet-code-html lang-html prettyprint-override"> <a name="345463" id="325435" href="/site/linkpage/"> i need href, reason cannot it. have ideas? never mind, link case-sensitive html asp.net

php - Using presenters in Laravel 5 -

php - Using presenters in Laravel 5 - i've watched laracasts video presenters , want utilize them in project. i have page display user activity log. in foreach loop display "activity" model. activity uses polymorphic relationship, depending on activity type need display different kind of content. example, user may send email, add together task, create something, delete etc. depending on action should display different icons, different content (some activities may contain links, may contain else). when watched , read examples of presenters, realize of them quite simple , uses such things ucfirst or date-formatting. however, should set lot of html logic in presenters? example, since have different icon different actions set big switch returns <i> tag appropriate icon class. then, when displaying description of action switch , homecoming html, links, <audio> tag. also not convenient utilize html in presenters, @ same time want maintain vie...

Find the letters in a python list that follow each other most frequently -

Find the letters in a python list that follow each other most frequently - i have python list one: list = [s,b,s,d,h,a,h,e,h,a] is there easy way find out letters follow each other frequently. in list: h,a = 2x it cool have finish table of letters follow how often. not sure how tackle this b d e s 1 1 h 2 1 use collections.counter() , feed letter pairs: from collections import counter pair_counts = counter(zip(list, list[1:])) demo: >>> collections import counter >>> list = ['s', 'b' , 's', 'd', 'h', 'a', 'h', 'e', 'h', 'a'] >>> pair_counts = counter(zip(list, list[1:])) >>> pair_counts.most_common() [(('h', 'a'), 2), (('d', 'h'), 1), (('s', 'b'), 1), (('s', 'd'), 1), (('b', 's'), 1), (('h', 'e'), 1), (('a', 'h'),...

c++ - What does this line of code do? -

c++ - What does this line of code do? - void expand_combinations(const char *remaining_string, string const & s, int rema in_depth) { if(remain_depth==0) { std::cout << s << std::endl; return; } for(int k=0; k < strlen(remaining_string); ++k) { string str(s); str.append(1, remaining_string[k]); expand_combinations(remaining_string+k+1, str, remain_depth - 1); // what? } return; } on phone call function, it's passing string + integer. become? remaining_string not string; it's pointer character. hence adding integer moves pointer. for example, if char *blah = "hello" , blah+1 point "ello" . c++ function

javascript - Loading an image to a from -

javascript - Loading an image to a <img> from <input file> - i'm trying load image selected user through element. i added onchange event handler input element this: <input type="file" name="picfield" id="picfield" size="24" onchange="preview_2(this);" alt=""/> and preview_2 function is: var outimage ="imagenfondo"; function preview_2(what){ globalpic = new image(); globalpic.onload = function() { document.getelementbyid(outimage).src = globalpic.src; } globalpic.src=what.value; } where outimage has id value of tag want new image loaded. however, appears onload never happens , not load html. what should do? in browsers supporting file api, can utilize filereader constructor read files 1 time have been selected user. example document.getelementbyid('picfield').onchange = function (evt) { var tgt = evt.target || window.event...

ruby on rails 4 - searching belongs_to association via friendly_id slug -

ruby on rails 4 - searching belongs_to association via friendly_id slug - an appointment belongs schedule. without using friendly_id, next code works, expected, build list of appointments: def show @appointments = appointment.where(schedule_id: params[:id]) end however, when send slug instead of id, things more complicated. appointment.where(schedule.slug = "myslug") love do, ended piece o' ugliness: def show @appointments = appointment.where(schedule_id: schedule.where(slug: params[:id])) end it works, seems i'm making complicated. suggestions improve code gratefully accepted. i'd go pair of scopes. helps maintain code readable , reusable (you utilize same schedule.for_slug method while searching schedules , appointments). # class schedule def self.for_slug(slug) where(slug: slug) end # class appointment def self.for_schedule_slug(slug) joins(:schedule). merge(schedule.for_slug(slug)) end put them this appo...

vba - Conditionally Coloring a Graph in Excel -

vba - Conditionally Coloring a Graph in Excel - hi there! i trying color graph (a task tracker) via vba, in excel. thought color "categories" color -- visually, mean making bars on each "row" particular color. i'm using next code, copied http://peltiertech.com/vba-conditional-formatting-of-charts-by-category-label/: sub colorbycategorylabel() dim rpatterns range dim icategory long dim vcategories variant dim rcategory range set rpatterns = activesheet.range("a1:a5") activechart.seriescollection(2) vcategories = .xvalues icategory = 1 ubound(vcategories) set rcategory = rpatterns.find(what:=vcategories(icategory)) .points(icategory).format.fill.forecolor.rgb = rcategory.interior.color next end end sub and can't figure out wrong. basically, have series (series2), horizontal (category) axis labels consisting of integers 1-5. category determines vertical position of bar, want color each bar in s...

Meteor: what is the right way to add custom settings object to users collection? -

Meteor: what is the right way to add custom settings object to users collection? - there multiple examples on publish/subscribe not clear on best practice storing custom info in in-built "users" collection in meteor (especially in new possibility of template specific collections). for example, need store user browse history - accessible through meteor.user().settings.history.lastvisited[] the challenge is: is special publish / subscribe required above? (the reason being, assuming users collection published , available on client side - need another?) how take care of border cases user new , hence settings.history object may not defined? can have special publish automatically takes care of creating empty object if settings undefined? how it? i did : // server side meteor.publish('usersettings', function (maxrows) { if (this.userid) { homecoming meteor.users.find({ _id: this.userid }, { fields: {'settings':1}}); } this....

Copy filenames from synchronizing perspective in Eclipse -

Copy filenames from synchronizing perspective in Eclipse - is there way re-create file names listed in synchronizing perspective ? (i mean list of files synchronize) thanks in advance help. no can't re-create multiple file names @ once. re-create multiple files if want. eclipse copy-paste

c# - Compiler help (transition matrix) -

c# - Compiler help (transition matrix) - i have matrix transitions in programming language. lets have next code: if(x=0) { x=10; } when start reading '(' store word "if", after loss character '(' . how can maintain parenthesis?? far code looks this: for (int = 0; <code.length ; i++) { char currentchar= code[i]; (int j = 0; j < chars.length; j++) { if (currentchar == '(') { column= 15; i--; } } but loops , stays on reading '(' , wont go on reading rest of code. the reason code looping because moving before '(' , loop moving '('. loop infinitely. example: when = 2: currentchar == '(' column = 15 i = i-1 becomes 1 loop iteration finishes i = + 1 becomes 2; when = 2:... your code description above not create possible me provide solution dilemma however. can tell causing infinite loop. edit: best can provide know in general token collecting. need buffer current token sa...

slf4j - Custom Storm logback appender for Topology -

slf4j - Custom Storm logback appender for Topology - i have storm topology , log events occur within topology separate log file. trying create custom appender in storm/logback/cluster.xml used log these events. here cluster.xml snippet setting up: <appender name="a2" class="ch.qos.logback.core.rolling.rollingfileappender"> <file>${storm.home}/logs/custom-logger/cl-log.log</file> <rollingpolicy class="ch.qos.logback.core.rolling.fixedwindowrollingpolicy"> <filenamepattern>${storm.home}/logs/${logfile.name}.%i</filenamepattern> <minindex>1</minindex> <maxindex>9</maxindex> </rollingpolicy> <triggeringpolicy class="ch.qos.logback.core.rolling.sizebasedtriggeringpolicy"> <maxfilesize>100mb</maxfilesize> </triggeringpolicy> <encoder> <pattern>%d{yyyy-mm-dd_hh:mm:ss} %c{1} [%p] %m$n</pa...

c# - itemcommand in datalist for image button does not fire in first click -

c# - itemcommand in datalist for image button does not fire in first click - my code <asp:datalist enabletheming="false" id="dldocument" showheader="false" showfooter="false" repeatcolumns="3" runat="server" onitemcommand="dldocument_itemcommand" datakeyfield="id" repeatdirection="horizontal" onitemdatabound="dldocument_itemdatabound"> <itemtemplate> <table border="0" cellpadding="0" cellspacing="0" dir="ltr" align="center"> <tr> <td class="c2-tl"></td> <td class="c2-tm"></td> <td class="c2-tr"></td> </tr> <tr> <td class="c2-lm">&nbsp; </td> <td class="c2-content"> <table...

active directory - Determine usergroups/claims of user given LDAP server details in C# -

active directory - Determine usergroups/claims of user given LDAP server details in C# - we have test active directory ldap server. have user names , passwords. determine claims/user groups of particular user, whilst logged domain. can done c# code? presume have utilize system.directoryservices.dll if can utilize .net 3.5 of higher, seek system.directoryservices.accountmanagement.dll assembly. provides system.directoryservices.accountmanagement namespace , principal-based classes, such userprincipal , groupprincipal. represent higher level of abstraction , easier use. for example, connect ldap server in domain (get principal context in terms of abstraction) need create instance of principalcontext class this constructor: principalcontext anotherdomaincontext = new principalcontext(contexttype.domain, domaindnsname, rootou, contextoptions.simplebind, queryusername, queryuserpassword); rootou "dc=company,dc=com", hence domaindnsname "company.com...

How to initilize Spring bean using factory method in Java config? -

How to initilize Spring bean using factory method in Java config? - i using spring in java based config. want initialize bean using mill method. in xml, done such: <bean id="repositoryservice" factory-bean="processengine" factory-method="getrepositoryservice" /> how do same thing in java? it should simple. have mill called processengine , within mill have method getrepositoryservice, should somewhere like: public class processengine { public xxxx getrepositoryservice() { ... } } java spring

python - How to use ax with Pandas and Matplotlib -

python - How to use ax with Pandas and Matplotlib - i have basic question. using pandas dataframe create plot, want add together highlighting around dates. in[122]: df1_99.plot(x='date', y='units', ylim=[0,11], figsize=[12,12]) out[122]: i found code on stackoverflow add together highlighting. fig, ax = plt.subplots() ax.plot_date(t, y, 'b-') ax.axvspan(*mdates.datestr2num(['10/27/2011', '11/2/2011']), color='red', alpha=0.5) fig.autofmt_xdate() plt.show() my question how can utilize ax.avxspan current code? or need convert x='date', , y='units' numpy arrays , utilize format in code above? pandas.dataframe.plot homecoming matplotlib axessubplot object. ax = df1_99.plot(x='date', y='units', ylim=[0,11], figsize=[12,12]) ax.axvspan(*mdates.datestr2num(['10/27/2011', '11/2/2011']), color='red', alpha=0.5) plt.show() if want create ax object in a...

vhdl - how to connect output signal of one module to input signal of other module -

vhdl - how to connect output signal of one module to input signal of other module - suppose vhdl code this: entity x1: port(a: out std_logic; .... .... ); architecture behv1 of x1 .... end behv1; entity y1 port(b: in std_logic; .... .... ); architecture behv1 of y1 begin m1: x1 port map(a=>b); end behv1; so, here output signal of entity x1 whcih connected straight input b of other entity y1 you're kinda going in wrong way. entity y1 provides interface of y1 entity. specifies have input entity, b . means can read value of b within architecture declaration. should implement want y1 module within architecture behav1 . from understand though, want instantiate x1 , y1 , connect them together. this, need provide implementation of x1 , y1 , , instantiate both in separate top-level , connect them together. this: entity x1: port(a: out std_logic; .... .... ); architecture behv1 of x1 -- something... end behv1; entity y1 port(b: in std_logic;...

javascript - Create a smart, interactive map like the ones used on the FourSquare site -

javascript - Create a smart, interactive map like the ones used on the FourSquare site - first off, i'm trying create using angular.js: https://foursquare.com/explore?mode=url&near=san%20francisco%2c%20ca&q=comedy in summary, here tools i've tried: mapbox.js leaflet.js angular-leaflet directive for each, i've attempted create directive manage list of locations associated map displaying locations such that, when user hovers on list item, tooltip appears above location's marker on map, , when hover atop location's marker on map, tooltip appears above marker. (if isn't clear, visit link above.) hyperlinks, image, etc. should able appear within tooltip. none of above seem give me map portion of functionality straight out of box. also, in order markers appear on map, have break away idiomatic angular, since markers vector items generated via leaflet/mapbox toolkit. writing code feels wrong. yes, i'm able see marker, can't associate them in...

Windows app development using windows 2012? -

Windows app development using windows 2012? - can develop windows phone & store apps on both using visual studio 2012. although recommended utilize visual studio 2013. you can develop apps wither not able create universal. why want when can download vs2013 express version , develop proper 8.1 universal apps? visual-studio-2012 windows-phone windows-applications

controls - vb.net scrollable content panel -

controls - vb.net scrollable content panel - is there command in vb.net designed displaying content larger command itself? i know it's possible code own using panel , 2 scrollbars, there existing method this? thanks help all command containers, such panel , flowlayoutpanel etc. have autoscroll property, want. vb.net controls

Haskell - Do literal backslashes always have to be escaped in a string? -

Haskell - Do literal backslashes always have to be escaped in a string? - in haskell, in order represent literal string "\" , 1 write: "\\" however, there way escape string such single backslash can written without needing escaped? example, can in c# pre-pending @ string: @"\" does haskell have equivalent? no, see section 2.6 of haskell lexical structure. haskell doesn't have raw strings, heredocs or triple strings. sorry. fanciness this: "ab\ \cd" => "abcd" white space between line-ending , -beginning slashes ignored. useful, example, if want emit inline html indented in haskell source, not overly indented in output. (not i'd advocate doing complicated html output way.) string haskell

uiwebview - How to resize webview correctly in landscape mode in iPhone? -

uiwebview - How to resize webview correctly in landscape mode in iPhone? - i add together navigationbar, webview , toolbar(from top bottom) subviews of viewcontroller's view. want navigationbar , toolbar's height shrink little in landscape orientation utilize autoresizingmask create height flexible. (uiviewautoresizingflexibleheight create navigationbar , toolbar's height shrink 44 around 30): webnavbar.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight | uiviewautoresizingflexiblebottommargin; webtoolbar.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight | uiviewautoresizingflexibletopmargin; webview.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight; now found when rotate device landscape mode, there 2 blank white bars on top , bottom of webview(each blank bar's height 44-30). navigationbar , toolbar appear in right position. there way resize webvie...

regex - Regular expression needed for PHP -

regex - Regular expression needed for PHP - can tell me regular look utilize within php find following: <p>&nbsp;</p> variation of white space between tags <p><br/> 1 time again variation of white space between tags any help appreciated, thanks! pretty straightforward (and folks, because he's asking things whitespace between them, not nested tags or attributes or of that, parser isn't necessary in case...) /<p>\s+<\/p>/ /<p>\s+<br\/>/ php regex

c++ - What is the right way to link to a DLL which was linked to a static library and other shared libraries? -

c++ - What is the right way to link to a DLL which was linked to a static library and other shared libraries? - greetings, hope has patience read this. have setup @ hand, confusing me. have c source code directory generated eiffel compiler. want utilize output java, need dll jni, in i'll implement jni functions. when compile c code, gives me static library, has dependencies other libraries. setup is: mydll.dll (c++) [depends on --> staticlib.lib [depends on --> (sharedlib1, sharedlib2...) my c++ project compiled eclipse cdt, , end 1 dll. can utilize dll java without problems needs 1 other dll in path during execution. code static library compiled dll, , java jni calls dll in turn uses code. i wanted utilize same dll c++ project. however, when link dll, linker complains not finding particular symbol. symbol declared in static library extern, must somewhere in 1 of dependencies of static library. the way link , compile dll c++ project linking static library...

graph - Adjacency list c++ -

graph - Adjacency list c++ - i'm trying create adjacency list store graph. i'm having problem accessing list 1 time create it. class weighted_graph { private: std::vector <std::vector<std::pair<double, int>> > adjacencylist; ... weighted_graph::weighted_graph(int n) { std::vector <std::vector<std::pair<double, int>> > adjacencylist(n); (int = 0; < n; i++) { std::vector<std::pair<double, int>> row; // create empty row adjacencylist.push_back(row); } ... } this how create list. whenever seek access in list error: debug assertion failed! expression: vector subscript out of range this happens whenever seek lsit, example, calling: bool weighted_graph::insert_edge(int i, int j, double d) { if (!adjacencylist[i].empty()) { or bool weighted_graph::insert_edge(int i, int j, double d) { std::cout << adjacencylist[i].front().second am creating list wrong? ...

python - replacing all but first commas with blank value -

python - replacing all but first commas with blank value - i have csv in format: a, hello, name john, how you? b, hello john, i'm doing well, thanks! right now, csv shows 4 values first , sec entry since both delimited commas. goal have csv show 2 values each entry so: a, hello name john how you? b, hello john i'm doing thanks! i tried replace function converts every single comma space. wondering if there such thing skip first comma , have every comma (after first one) replaced "". here's have far: fin = open ('example.csv', 'r+') fout = open ('newexample.csv', 'w') reader = csv.reader(fin) line in reader: in range(1, len(line)): line[i].replace(',', ''); fout.write(line); fin.close() fout.close() i don't mind if solution doesn't follow below code, whichever fine, long produces desired output thanks in advance! >>> line = 'a, hello, nam...

java - Fails running spring mvc and eclipse's tomcat -

java - Fails running spring mvc and eclipse's tomcat - i'm facing spring 3 mvc + tomcat 7 stack , using eclipse job. in eclipse (luna) installed new server pointing tomcat installation. maintain .war smaller possible, lot of libs embedded %tomcat_home%/shared . created new tomcat server eclipse pointing %tomcat_home% , want utilize run maven + spring 3 webapp. when run webapp run on server got this 8-apr-2015 8.29.04 org.apache.catalina.startup.classloaderfactory validatefile avvertenza: problem directory [/home/francesco/scrivania/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/shared], exists: [false], isdirectory: [false], canread: [false] 8-apr-2015 8.29.04 org.apache.catalina.core.aprlifecyclelistener init info: apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: /home/francesco/jdk1.6.0_20/jre/lib/amd64/server:/home/francesco/jdk1.6.0_20/jre/lib/amd64:/home/francesco/jdk1.6.0...

csv - C# - Trouble reading a tab delimited file using Microsoft Jet OLEDB -

csv - C# - Trouble reading a tab delimited file using Microsoft Jet OLEDB - i trying read excel .csv file tab delimited. there's 8 columns mixed info in each. post image of output don't have plenty reputation (this first post, bear me). essentially, output table dt contains single column gibberish column heading. here code using: from app.config: <add key="cnprovider" value="microsoft.jet.oledb.4.0"/> <add key="cnproperties" value="&quot;text;hdr=yes;fmt=tabdelimited;characterset=65001&quot;"/> from program.cs: string sqlstatement_1 = configurationsettings.appsettings["sqlstatement_1"]; string cnproperties = configurationsettings.appsettings["cnproperties"]; string cnstr = "provider=" + cnprovider + ";data source=" + folder + ";extended properties=" + cnproperties + ";"; oledbdataadapter adp; adp = new oledbdataadapter(sqlstatement_1, cn...

php - Adjusting header in CSV file -

php - Adjusting header in CSV file - i have log routine on php website, puts info on daily csv files. here's code: public function generatelogpmweb($action){ session_start('usuario'); $head_data = "hospede_codigo" . ";" . "reserva_codigo" . ";" . "hospede_nome" . ";" . "hospede_sobrenome" . ";" . "hospede_email" . ";" . "reserva_descricaosistema" . ";" . "reserva_codigolocalizador" . ";" . "reserva_codigohotel" . ";" . "reserva_datareserva" . ";" . "reserva_datacheckin" . ";" . "reserva_datacheckout" . ";" . "acao" . ";\n"; file_put_contents(config::retorna("document_root", "root").'/logpmweb/logpmweb_'.date("ymd").'.csv', $head_data, file_append); // mudar aqui $lo...

haskell - Convert String to Int checking for overflow -

haskell - Convert String to Int checking for overflow - when tried convert long integer int , surprised no error thrown: prelude> read "123456789012345678901234567890" :: int -4362896299872285998 readmaybe text.read module gives same result. two questions: which function should phone call perform safe conversion? how can type safe language on earth allow such unsafe things? update 1: this effort write version of read checks bounds: {-# language scopedtypevariables #-} parseintegral :: forall . (integral a, bounded a) => string -> maybe parseintegral s = integertointegral (read s :: integer) integertointegral n | n < fromintegral (minbound :: a) = nil integertointegral n | n > fromintegral (maxbound :: a) = nil integertointegral n = $ frominteger n is best can do? background: why unchecked overflow wonderful haskell 98 leaves overflow behavior explicitly unspecified, implementers , bad else. haskell 2010 discusses...

linux - Am I missed something in Ngnix Conf Setting? -

linux - Am I missed something in Ngnix Conf Setting? - i'm using ngnix in ubuntu 14.04 in vps. couldn't find out worker process in /etc/nginx/nginx.conf file. how insert worker timeout, worker process, worker connection etc. file? what value should write that, i'm using 4gb ram, 60gb disk , 2 core processor. this ngnix.conf file: user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { #... client_max_body_size 100m; #... } http { ## # basic settings ## sendfile off; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # logging settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.lo...

java - error handling/propagation in spring integration -

java - error handling/propagation in spring integration - i've read if exception thrown in flow first thing framework check message header error-channel property. case? in particular case i'm assigning custom error-channel message header , yet message seems propagated stream nearest error-handler/error-channel. <int:chain id="buildaggregatedresponsechain" input-channel="aggregatedresultchannel" output-channel="sendaggregatedchannel"> <int:header-enricher> <int:error-channel ref="myerrorchannel"/> </int:header-enricher> <int:service-activator ref="service" method="dosomething"/> </int:chain> i explicitly throw exception within dosomething exception never ends in myerrorchannel. instead, "propagated" nearest errorhandler stream or error-channel specified stream int-mail:imap-idle-channel-adapter(tried severa...

Python how to exit main function -

Python how to exit main function - possible duplicates: terminating python script terminating python programme my question how exit out in python main function? have tried ' return ' gave error syntaxerror: 'return' outside function . can help? thanks. if __name__ == '__main__': try: if condition: (i want exit here) finally: you can utilize sys.exit() exit middle of main function. however, recommend not doing logic there. instead, set in function, , phone call __main__ - can utilize homecoming normal. python

audio - Reading soundcard output with python -

audio - Reading soundcard output with python - i have succesfully utilized pyaudio read , record microphone data. same soundcard output. (i.e. playing wavfile , open stream pyaudio , read frame frame soundcard output). for reading mic opened pyaudio stream following stream = pyaud.open( format = pyaudio.paint16, channels = 1, rate = 22050, input_device_index = 0, input = true) when alter input_device_index 1 next error ioerror: [errno invalid number of channels] -9998 below system_info macbook soundcard default devices: ================ default input device : 0 defaultsamplerate: 44100.0 defaultlowoutputlatency: 0.01 defaultlowinputlatency: 0.00199546485261 maxinputchannels: 2 structversion: 2 hostapi: 0 (core audio) index: 0 defaulthighoutputlatency: 0.1 maxoutputchannels: 0 name: built-in microph defaulthighinputlatency: 0.0121541950113 -------------------------------- default output device: 1 ...

python - Weird sum coming out of complex dictionary -

python - Weird sum coming out of complex dictionary - having problem python code (dealing info midi files if you're curious variable names). song.getintervals() matrix of assorted integers, e.g.: [[-2,0,0,5,3],[2],[4,3,0]] except much longer. chrom defined as: def createintfunc(a,b): temp1={} temp2={} x in range(a,b): temp1[x]=0 x in temp1: temp2[x]=dict(temp1) homecoming temp2 chrom=createintfunc(-17,18) so it's dictionary keys integers , values dictionaries have integers both keys , values. here piece of code of concern: for phrase in song.getintervals(): noteind in range(1,len(phrase)): chrom[phrase[noteind-1]][phrase[noteind]]+=(1/float(sum([len(a) in song.getintervals()]))) print sum([sum(a) in [b.values() b in chrom.values()]]) which prints value that's close 0.8 depending on song.getintervals() is. don't see how wouldn't homecoming 1. i'm repeatedly adding value starts @...

python - Reading csv with unicodecsv: UnicodeDecodeError -

python - Reading csv with unicodecsv: UnicodeDecodeError - i have these lines of code: zf = zipfile.zipfile(self.temp_file, 'r') info = zf.open('myfile.csv', mode='r') result = [link link in unicodecsv.dictreader(data)] and here's exception code: unicodedecodeerror: 'utf8' codec can't decode byte 0xc9 in position 13: invalid continuation byte input string is: cafÉ restaurant so doing wrong , why unicodecsv can't handle utf-8? it because input not utf-8, latin-1 (or similar). in utf-8, É encoded 2 bytes: '\xc3\x89' . error informs \xc9 byte met in input; É s encoding in latin-1 or win-1252 codepages. python csv unicode

debugging - How to remove code analysis from ida pro as olly debugger? -

debugging - How to remove code analysis from ida pro as olly debugger? - (1) reverse engineer programme in ida pro , see lots of "db" instructions (2) in olly debugger ,"db" instruction can remove alternative "remove code analysis module". (3) how can remove code analysis ida pro? (4) have tried code deobfuscator plugin in ida not seem work you might want "undefine" bytes. there other possibilities depending on want exactly. select in main window press 1 of key: 'u' undefine 'c' code 'd' data 'a' ascii string see "edit" menu more options. debugging reverse-engineering ida

html - How do I disable caching of form elements? -

html - How do I disable caching of form elements? - i'd disble caching of form elements. how possible? i'm making login page website , don't want cache fields. <!doctype html> <html dir="ltr" lang="en-in" class="js"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta charset="utf-8"> <meta name="description" content="find free ads different kind of items sale in {% if regionname , regionname != 'none' %}{{regionname}}{% else %}{% if cityname , cityname != 'none' %}{{cityname}}{% else %}{% if country , country != 'none' %}{{country}}{% endif %}{% endif %}{% endif %}"> <meta name="googlebot" content="noarchive"> {% if cursor %} <link rel="next" href="/delhi/?o=2"> {% endif %} <link rel="canonical...