Posts

Showing posts from September, 2015

visual studio 2010 - Error on RDLC Expression -

i using exp calculate total fees paid on rdlc report: =sum(iif(fields!responsedescription.value ="approved successful",int(fields!amount.value), 0)) and #error in resulting column , can issue ? . and similar exp above work fine : =sum(iif(fields!responsedescription.value <> "",int(fields!amount.value), 0)) few notes: 1- amount integer , present. 2- responsedescription string , present. thank you you can use expression: =sum(cint(iif(fields!responsedescription.value ="approved successful", fields!amount.value, 0))) you have convert every possible values same type before aggregation. i think second expression works fine because in true case ( fields!responsedescription.value <> "" ) used expression converted integer .

javascript - Why is this 2d array pushing values when it shouldn't? -

edited: pointing out oblivious mistake temprndnumber being reset in inner loop. i'm still seeing "," characters show in array though. i want create 2d array gets populated when random number meets particular criteria (rnd >= 7). following code populates 2d array combination of "," , numbers meets criteria. var tempallrndnumbers = []; (var = 0; < 10; i++) { (var j = 0; j < 10; j++) { var temprndnumber = []; var rndnumber = math.floor(math.random() * 10); if (rndnumber >= 7) { temprndnumber.push(rndnumber); } } tempallrndnumbers.push(temprndnumber); } tempallrndnumbers should populated numbers 7 , above, right? instead, i'm getting 2d array full of "," , numbers 7 , above. since reset temprndnumber empty array on each iteration of j loop, contain number if last iteration >= 7. move initialization outside of innermost l

math - Calculating exp(x) with the use of recursion in Python -

this question has answer here: python division 11 answers i'm attempting calculate e^x using recursion, e^x = e^(x/2)*e^(x/2), , third order maclaurin expansion e^x , script keeps returning 1. i'm not looking higher accuracy solution, understand script goes wrong : ) my thought enough iterations should end (1+x/n+(x/n)^2/2)^n when function value goes below limit. def exp(x): if abs(x)<0.0001: return 1+x+x**2/2 else: y=exp(x/2) return y*y try instead (note 2.0 in recursive call): def exp(x): if abs(x) < 0.0001: return 1 + x + x**2 / 2.0 else: y = exp(x / 2.0) return y * y it failing because if pass integer in x , 1 , x / 2 integer division (in python 2.x), result in 0 instead of 0.5 . using x / 2.0 , forces python use float division.

c# - how to read all files in particular folder and filter more than one type? -

this question has answer here: how filter directory.enumeratefiles multiple criteria? 6 answers to loop through files of 1 type, : foreach (string file in directory.enumeratefiles(folderpath, "*.txt")) { (code here) } taken how read files inside particular folder is there way have 2 tags other making 2 loops? having *.bmp, *.png... note : answer accepted down here way more simple 1 in proposed answer, both works. you can concatenate 2 results this foreach (string file in directory.enumeratefiles(folderpath, "*.txt").concat(directory.enumeratefiles(folderpath, "*.bmp"))) { // (code here) } or make function so ienumerable<string> enumeratefiles(string folderpath, params string[] patterns) { return patterns.selectmany(pattern => directory.enumeratefiles(folderpath, pattern)); }

What's a clean way to sharing common markup among partials in Rails? -

assume have image viewer partial, image viewer shown both visitors , admins. admins should have additional buttons remove/edit images, while else remains same both visitors , admins. what's clean approach keep views dry without clogging them if statements everywhere? here's how i'm doing it: image_partial.html.haml : .image %img if is_admin? .admin-stuff-here what's clean way achieve same results separated views(for admins/visitors) without duplicating same markup? if admin functionality nested within single dom element (not spread out throughout html _image_partial.haml.erb file) , conditionally include _admin_controls.haml.erb partial. maybe makes sense have these nested within directory. - app/views/_image_viewer |- viewer.haml.erb |- admin_control.haml.erb and within _viewer.haml.erb .image %img = render partial "_image_viewer/admin_control" if is_admin?

macro use in array initialization -

i'm pretty confused bit of code in microchip demo application pic24f microcontroller. looks macro being assigned @ runtime address of array. didn't think possible, limited knowledge of c failing me right now. able provide insight? #define mbr_addr_tag #define mbr_attributes __attribute__((space(psv), address(drv_fileio_internal_flash_config_files_address))) ... const uint8_t mbr_attributes masterbootrecord[fileio_config_media_sector_size] mbr_addr_tag = {....}

swift - UIButton action generates a SIGABRT but no breakpoint triggers -

i have code create button on storyboard override func viewdidload() { super.viewdidload() ... signupbutton.addtarget(self, action: "pressed:", forcontrolevents: .touchupinside) ... } func pressed(sender:uibutton!) { println("pressed") } however, throws sigabrt error when press button. so, added breakpoint on exceptions. however, no breakpoint ever - threw exception. how find out what's causing error? you have 2 issues here... first: placed pressed function in scope of viewdidload, when needs outside of function , in scope of class. move function pressed out of viewdidload() . second: not causein signal abort crash, needed nonetheless. add semicolon action selector name. signupbutton.addtarget(self, action: "pressed:", forcontrolevents: .touchupinside) or, if don't need pass object function pressed , change function header func pressed() . basic example: (tested , working in new project

php - Eclipse HTML Validation Setup -

Image
i trying setup eclipse html validation wordpress , have read , seen several articles on here , others online have set bunch of settings or plain ignore or exclude wordpress folders. reason don't want exclude folders , code because still want autocomplete , other dtd functionality work. i noticed option in html syntax settings, "ignore specified element names in validation" , "ignore specified attribute names in validation". to start trying rid of error: start tag (<video>) not closed properly, expected '>' so got settings right clicking on project in php explorer , select properties. check "enable project specific settings" , enabled "ignore specified element names in validation". in text box entered "video". when hit "ok" dialog validation settings have been changed , want validate project , select "yes". nothing seems change. doing wrong here? misreading how "should" wor

sql - Split comma separated values to columns in Oracle -

i have values being returned 255 comma separated values. there easy way split columns without having 255 substr? row | val ----------- 1 | 1.25, 3.87, 2, ... 2 | 5, 4, 3.3, .... to row | val | val | val ... --------------------- 1 |1.25 |3.87 | 2 ... 2 | 5 | 4 | 3.3 ... you can use regexp_substr() : select regexp_substr(val, '[^,]+', 1, 1) val1, regexp_substr(val, '[^,]+', 1, 2) val2, regexp_substr(val, '[^,]+', 1, 3) val3, . . . i suggest generate column of 255 numbers in excel (or spreadsheet), , use spreadsheet generate sql code.

ssas - Calculated Member as an existing measure filtered by both a tuple and a set -

i'm looking create calculated member sql server data tools analysis services on olap cube combines following filtering approaches: tuple ( [enrolment planning actuals].[year].&[1], [enrolment planning actuals].[attribute 1].&[y], [enrolment planning actuals].[attribute 2].&[n], [enrolment planning actuals].[attribute 3].&[n], [measures].[count] ) set single member sum( except( [enrolment planning actuals].[year].[year], { [enrolment planning actuals].[year].&[1] } ), [measures].[count] ) the [enrolment planning actuals].[year] has members of values 1, 2, 3, 4 , want calculated member provide [measures].[count] filtered on: include [enrolment planning actuals].[year] members except [enrolment planning actuals].[year].&[1] [enrolment planning actuals].[attribute 1].&[y] [enrolment planning actuals].[attribute 2].&[n] [enrolment planning actuals].[attribu

cryptography - CBC-MAC decryption, how MAC works in encryption -

Image
i figured out triple des encryption , decryption credit card. can 1 tell me how de-crypt cbc-mac...cbc-mac @ end give 4 byte mac. mac encryption, how work? mac doing? once there encryption done through cbc-mac, how can de-crypt them? triple-des not work case. another question here . have heard of decryption algorithm involves: dukpt tdes, and mac variant (versus pin variant) i have understanding of tdes , dukpt, how mac variant play role in decryption algorithm? how mac variant different pin variant? thank you! i figured out triple des encryption , decryption credit card. can 1 tell me how de-crypt cbc-mac...cbc-mac @ end give 4 bit mac. here's visual of how cbc mode works via wikipedia . what cbc-mac take last block of ciphertext output , calls mac. mac should size of block cipher not 4 bits. if you're using 3des 64 bits. from mac encryption, how work? mac doing? mac , encryption 2 separate things. i'll try give brief rundown o

Gawk "system" call. Run external program in several instances -

i using gawk on mac based unix. have "system" call runs program. have understood things, program waits external program before going on next line. start several instances of external program, wait them finish, "cat" results , continue gawk program. value in use processors on mac pro machine. takes days run , running external program in several instances help. thank in advance on this. system call bash script ran various programs in background. used bash script "wait" command make sure programs finished before returning gawk program. worked. got idea son of friend. helpful. ellis

javascript - get the style of the marker I clicked on in mapbox -

Image
i'm trying style of icon clicked on, in order translate values. i'm doing because want create div have same location on map icon got clicked on. website far: http://www.david-halfon.com/radio/index.html basically, each time presses yellow circle, div should appear around it. this code events happen when icon being clicked: locale.on('click', function(e) { $("#music").attr("src", prop.url); $(".player").show(); play(); sendwithajax(prop.country, prop.city); $("h1").html(prop.station); $("h2").html(prop.country); $("h3").html(prop.city); //console.log($(this).css("transform")); //console.log($(this).attr("style")); console.log($(this)); settimeout(function(){ $("h4").html(globalvar);}, 500); $(".plusb").show(); $(".shareb").show(); map1.setview(locale.getlatlng(), 4); playnow = prop.station;

android - Can a SQLite database be Open, but not Readable? -

i working on android application , want ask if might possible sqlitedatabase object, object used interact underlying sqlite db, open (as in returns true on db.isopen() ), still not readable? what scenarios possible? locking? example: sqliteapphelper sqlitehelper = sqliteapphelper.getinstance(context); sqlitedatabase appdb = sqlitehelper.getreadabledatabase(); note: code above using class extends sqliteopenhelper .

javascript - How do I show/hide divs accurately using jQuery? -

i'm working on mini project interview people on short gif animations. need let people see gif 10 seconds , code, i've realised timer inaccurate. i've searched around , found fix in sitepoint article james edwards . in javascript , i've been trying combine js , jquery no success @ all. here $(function() { //when showing image settimeout(function() { $("#div2").fadeout(0); }, 10000) //edit timer $('#btnclick').click(function() { $('#div2').show(); settimeout(function() { $("#div2").fadeout(0); }, 10000) $('#div3').delay(10000).fadein(0); //show interview }) }) the code works fine want implement self-adjusting mechanism described on sitepoint. has done before or know how can this? the html here: <div id="div1" class="div1"> <!--show image button--> <center> <input type="button&

php - How to delete data from sql with pdo? -

hello have search web day trying find example of deleting data when use pdo found mysql , mysqli , stuck can't see missing when run it give me /search.php?del=array(id). code please help <?php //load database connection $host = "localhost"; $user = "abcd"; $password = "******"; $database_name = "abcd"; $pdo = new pdo("mysql:host=$host;dbname=$database_name", $user, $password, array( pdo::attr_errmode => pdo::errmode_exception )); // search mysql database table $search=$_post['search']; $query = $pdo->prepare("select * wfuk post_code '%$search%' or telephone '%$search%' limit 0 , 10"); $query->bindvalue(1, "%$search%", pdo::param_str); $query->execute(); // display search result ?> <html> <head> <title> how create database search mysql & php script | tutorial.world.edu </title> &

jquery - iron-ajax GET returning bad request -

i'm using polymer starter kit , configured app.js file creates , iron-ajax element , send call server data. here code: var _ajax = document.createelement('iron-ajax'); _ajax.url = 'url'; _ajax.headers = '{ "authorization": "auth (number)"}'; _ajax.method = 'get'; _ajax.handleas = 'json'; _ajax.debounceduration = 300; _ajax.auto = true; the error returned code tells me "authorization" in headers not passed through, when console log iron-ajax element before request can see "auth" in headers. doing wrong in code? what's right way headers pass server authentification. note: tested server google "advanced rest api" works fine "auth" set in headers. (using slim php rest server) headers expects object, not json string representing object: var _ajax = document.createelement('iron-ajax'); _ajax.url = 'url'; _ajax.headers

polymer - Is it possible to make geany also highlight unknown HTML-tags? -

Image
i'm playing around polymer , use custom tags, such <paper-icon-button icon="menu" on-tap="...">...</paper-icon-button></code> . geany doesn't highlight them normal html-tags (bold blue <div , > , bold darkblue class= , medium green "label" ) – whole text displayed in medium blue. here's demonstration of both types of tags: now question: possible make geany highlight unknown html-tags? or, can install syntax highlighter solves problem? thanks in advance! you can add keywords custom filetypes.html. copy file geany-installation-dir/data .config-folder of geany -- on linux somewhere @ ~/.config/geany/filedefs ; on windows somewhere c:\users\\appdata\roaming\geany\filedefs , add new tag keyword. the file normal key-value section, find inside: [keywords] html=a abbr acronym address applet area b base basefont bdo big blockquote .... that's point need add new keywords. current upstream version

php - PDO connection refuses access -

i trying add records database using pdo make code more secure. gives me connection error: sqlstate[28000] [1045] access denied user 'root'@'localhost' (using password: yes) the connection file includes 2 scripts, 1 regular mysql , second 1 new pdo. first 1 working well, pdo throws error. doing wrong on here? edit: code deleted due shieet your first connection 127.0.0.1 , while second connections localhost . they might same, server (mysql) side not. use 127.0.0.1 in pdo line , should work.

javascript - ReactJs: How to update property of state -

i trying update isselected property row of data stored in state, property doesn't update can please tell me best way this? var selectedidspush = []; var selectedidspush = this.state.contacts.slice(); for(var i=0;i<selectedidspush.length;i++) { var idasnumber = parseint(id); if (page.state.contacts[i].id === idasnumber) { page.state.contacts[i].isselected = true; break; } } reacts wants consumers setstate instead of assigning properties directly. in example, build , assign new contacts list using: var idasnumber = parseint(id); var newcontacts = this.state.contacts.map(function (contact) { if (contact.id === idasnumber) { contact.isselected = true; } return contact; }); this.setstate({ contacts: newcontacts });

org.springframework.jdbc.CannotGetJdbcConnectionException: java.sql.SQLException: No suitable driver found for jdbc:mysql -

i'm creating maven spring mysql application , i'm facing issue below org.springframework.jdbc.cannotgetjdbcconnectionexception: not jdbc connection; nested exception java.sql.sqlexception: no suitable driver found jdbc:mysql below pom-file <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.ec</groupid> <artifactid>ecws</artifactid> <version>0.0.1-snapshot</version> <packaging>war</packaging> <properties> <jersey.version>2.2</jersey.version> <javax.servlet.version>2.3</javax.servlet.version> <spring.batch.version>2.2.0.release</spring.batch.version> <spring.version>3.1.1.release&l

r - Use the first Row like Column Name. Data Frame of factors -

i'm using dataframe of factors , need use first row of df column names. problem next when make >df[1,] df[1,] tradestation.trade.list na. na..1 na..2 na..3 na..4 1 # type date/time signal price roll on pips na..5 na..6 na..7 1 shares/ctrts/units - profit/loss net profit - cum net profit % profit na..8 na..9 na..10 na..11 na..12 1 run-up/drawdown efficiency total eff. comm. slippage if make names(df) <- df[1,] receive number of different factors name, not first row. how can that?? thank much pd: have gotten dataframe read.xlx() xlsx library you need coerce factors characters instead of integer representations dat <- data.frame(a=factor(letters[1:10]), b=factor(letters[11:20])) out <- setnames(dat[-1,], sapply(dat[1,], as.character)) # k # 2 b l # 3 c m # 4 d n # 5 e o # 6 f p # 7 g q # 8 h r # 9 s # 10 j t

Why is puppet not finding my environment module path? -

i have simple environment set puppet. on master have [root@ak-puppetm develop]# pwd /etc/puppet/environments/develop [root@ak-puppetm develop]# puppet config print modulepath --section master --environment develop /etc/puppet/modules:/usr/share/puppet/modules [root@ak-puppetm develop]# ls -lah total 28k drwxr-xr-x 5 akropp akropp 4.0k jul 16 15:16 . drwxr-xr-x 4 akropp akropp 4.0k jul 16 15:16 .. -rw-r--r-- 1 akropp akropp 6.1k jul 16 15:16 .ds_store drwxr-xr-x 4 akropp akropp 4.0k jul 16 15:16 files drwxr-xr-x 2 akropp akropp 4.0k jul 16 15:16 manifests drwxr-xr-x 3 akropp akropp 4.0k jul 16 15:20 modules [root@ak-puppetm develop]# ls -lah modules/ total 12k drwxr-xr-x 3 akropp akropp 4.0k jul 16 15:20 . drwxr-xr-x 5 akropp akropp 4.0k jul 16 15:16 .. drwxr-xr-x 3 akropp akropp 4.0k jul 16 15:08 domains [root@ak-puppetm develop]# and yet can see module path doesn't seem contain develop? if move module code /etc/puppet/modules puppet finds classes fine. i tried pu

Android Java How to properly remove int from list? -

Image
currently trying write code create list various points coordinates , remove 3 smallest ints list. when run app, crashes. figured out happens in remove part. have looked other similar threads, solution similar have. here's code have: list<integer> xpoint = arrays.aslist(a.x, b.x, c.x, d.x, e.x, f.x, g.x, k.x); list<integer> xpleft = arrays.aslist(); int xplefttimes = 0; //find 3 min x values(left) while(xplefttimes != 2){ int left = collections.min(xpoint); xpoint.remove(left); <-app crashes here xpleft.add(left); xplefttimes++; } what doing wrong? in advance. arrays.aslist() returns fixed-size list backed specified array. try list<integer> xpoint = new arraylist(arrays.aslist(a.x, b.x, c.x, d.x, e.x, f.x, g.x, k.x));

Why does chrome.webRequest.OnBeforeRequest fire before chrome.webNavigation.onBeforeNavigate? -

i'm trying understand logic. in mind, onbeforenavigate event should complete before hear request. find onbeforerequest event fires first. here's sample code demonstrate mean. test.js function test(url) { chrome.tabs.create({ url: "" }, function (tab) { chrome.webnavigation.onbeforenavigate.addlistener(function (details) { console.log("chrome.webnavigation.onbeforenavigate hit on " + details.timestamp); }); chrome.webrequest.onbeforerequest.addlistener(function (details) { console.log("chrome.webrequest.onbeforerequest hit on " + details.timestamp); }, { tabid: tab.id, urls: ["<all_urls>"] }); chrome.tabs.update(tab.id, { url: url }); }); } test("http://www.steam.com"); // simple url 2 requests resulting console messages: chrome.webrequest.onbeforerequest hit on 1437083141916.896 chrome.webnavigation.onbeforenavigate hit on 1437083141916.906 ch

covariance - Java vs Smalltalk - covarince and contravariance -

does smalltalk support covariance , contravariance? these concepts apply language? smalltalk strictly , dynamically typed. cares if parameter object responds messages gets send. if not, raises dnu (does not understand) @ run time when message sent (which can handle either hand, or respond in code). @ compile time, every parameter object, , allowed send message object.

android - App crash when execute asynctask -

my app crash when execute asynctask. try send data android server app crashes when execute asynctask ` input input = new input(); input.execute(); mainactivity = this; latitude = "-6.711647"; longitude ="108.5413";` public class input extends asynctask<string, string, string> { hashmap<string, string> user = db.getuserdetails(); string email = user.get("email"); string success; @override protected void onpreexecute() { super.onpreexecute(); pdialog = new progressdialog(mainactivity.this); pdialog.setmessage("sending data server..."); pdialog.setindeterminate(false); pdialog.show(); } @override protected string doinbackground(string... arg0) { string stremail = email.tostring(); string strnama = latitude.tostring(); string strprodi = longitude.tostring(); list<namevaluepair> params = new

Selenium logging in Java - best practice? -

what current best practices logging selenium webdriver activity? are there out-of-the-box tools hook in native webdriver actions? i interested in specific tools have used, helpful references might have, , evidence might have justify assessment of current state-of-the-art of web automation logging loggingpreferences class native selenium class available in java binding logging. see doc here . give option logging in different level of activities , events. also, see logs interface

Create an r data.table with a date formatted column -

i'm trying create data.table date/time formatted column populated in next steps. i've tried bunch of different functions can't find 1 package wants. see column3 in below examples: require(data.table) num_rows <- 5 dt <- data.table(column1 = character(num_rows), column2 = integer(num_rows), column3 = date(num_rows) ) dt <- data.table(column1 = character(num_rows), column2 = integer(num_rows), column3 = posixct(num_rows) ) dt <- data.table(column1 = character(num_rows), column2 = integer(num_rows), column3 = idatetime(num_rows) ) what function creates date or time column in data.table? can't find anywhere. cheers. note integer(num_rows) makes vector of 0s, character(num_rows) makes vector of "" s etc. so initialise dates value, e.g. column3=rep(sys.time(), num_rows) # pos

php - Count MySql database rows with field value = '1' -

i'm trying count number of rows in database field 'level' equal '1'. have set count fields, see code below. $result = mysql_query("select count(1) username"); $row = mysql_fetch_array($result); $total = $row[0]; now adapt select field level = 1 in database. i have database connection setup , working fine. i did try code gettign nowhere. $admins = mysql_query("select count(1) level='1'"); $totaladmins = mysql_fetch_array($admins); $totaladmins = $admins[0]; once number of rows have been calculated displayed users through following code <h4><?php echo $total?> users registered</h4> any supper appreciated. there problem you're having because forgot include table select from. instead of: select count(1) level='1'; your query should be: select count(1) username level='1'; hopefully fixes problem. :)

java - The content doesn't appears when I return to the previous activity -

i have android app, writing notes. when press edit button in second2 activity move second3 activity without problems (in second3 activity can edit note without problem). when press save button, return second2 nothing appears there! it's empty activity! me, please! mainactivity class: package com.twitter.i_droidi.mynotes; import android.app.alertdialog; import android.content.dialoginterface; import android.content.intent; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.contextmenu; import android.view.menu; import android.view.menuinflater; import android.view.menuitem; import android.view.view; import android.widget.adapterview; import android.widget.arrayadapter; import android.widget.listview; import android.widget.toast; import java.util.list; import com.google.android.gms.ads.adrequest; import com.google.android.gms.ads.adview; public class mainactivity extends actionbaractivity implements adapterview.onitemclicklist

html - Whitespace gap in page and CSS does not include element.style -

i have strange whitespace in login page: http://buy.sd/index.php?route=account/login when inspect code, following: element.style { width: 1000px; height: 400px; position: relative; background: url(http://buy.sd/undefined) no-repeat; if adjust height 10px fixes issue i'm having, element.style lines not in css files @ all. can please advise? i can see div element no content in it. possible disable backside configuration? alternatively, quick fix, hide div display: none; follows: #slideshow0{ display: none; }

osx - OS X QuickLook implementation for Collada DAE file? -

i'm developing quicklook generator convert existing file 3d collada dae format supported quicklook out of book , can zoomed/panned around directly in quicklook window. have looked on apple quicklook document mentioned if convert document representing 3d model collada dae format, quick can display preview interface allowing model zoomed , rotated. however, came across part need pass data quicklook requires content type uti in third argument, provided in documentation. (in case, type rtf) qlpreviewrequestsetdatarepresentation(preview, (__bridge cfdataref)rtfdata, kuttypertf, null); however, have no idea display dae file. uti ? to determine uti of file on os x, can launch mdls path/to/file in terminal. 1 of attributes kmditemcontenttype . uti of file. collada file returns: kmditemcontenttype = "org.khronos.collada.digital-asset-excha

c - iOS library to BitCode -

i downloaded xcode 7 beta, , xcode complains of c libraries not being compiled bitcode. how go telling clang produce bitcode compatible ios? i've seen similar answers on stackoverflow, don't know if apply producing bitcode libraries ios. edit: i using correct setting, -fembed-bitcode, when try archive, error: ld: warning: ignoring file xxxx/xxxx, file built archive not architecture being linked (arm64). when use -fembed-bitcode-marker, can archive, error: full bitcode bundle not generated because xx/xx built bitcode marker. library must generated xcode archive build bitcode enabled. any ideas on going wrong? library compiling successfully, doesn't let me archive. created simple add function , made library, , same symptoms, not library i'm compiling. edit 2: must build both arm64 , armv7 versions using bitcode , lipo them together. using bitcode doesn't take away need fat library when archiving. source : https://forums.developer.apple.com/message/25132#25

Home directory Postgresql in Ubuntu 14.04 -

i installed postgresql 9.3 using terminal in ubuntu 14.04 by sudo apt-get install postgresql postgresql-contrib my postgresql running, can't find home directory. tutorial says home directory located in /usr/local/pgsql, can't find mine. i've been searching week, , found nothing. and directory should use if wanna set ld_library_path? appreciated. thank you. to set ld_library_path want add path globally, creating *.conf file in /etc/ld.so.conf.d/ (i use oracle client library path example): $ echo '/usr/lib/oracle/12.1/client64/lib/' | sudo tee /etc/ld.so.conf.d/oracle.conf then need rebuild library cache , restart postgres: $ sudo ldconfig $ sudo service postgresql restart and home in /var/lib/postgresql . users homes set in /etc/passwd file: $ grep postgres /etc/passwd postgres:x:116:125:postgresql administrator,,,:/var/lib/postgresql:/bin/bash

mysql - Fetching websites name contains the HTML code in python 27 -

i have facing problem when running python script download companies business directories company name, address, location address , web address. but when script fetching websites name of company www.example.com fetch websites name html code instead of fetching websites name , store html code mysql server of current websites. i have using following library of python beautifulsoup, lxml, html, hashlib, urllib2 , store websites name html code mysql server like <input><tr><td>www.example.com</td></tr></input> i want remove html tag , store companies web url www.example.com in mysql server my code here: for hit in soup2.findall(attrs={'id' : 'website_0'}): web = str(hit).replace('<input type="hidden" value="', '') web = web.replace('" id="website_0" />', '') if web == "": flog.write("\nwebsite extraction... failed") prin

R - Error in For Loops and If Statements on list of Data Frames: Subscript Out of Bounds -

i'm using r create occupancy model encounter history. need take list of bird counts individual leks, separate them year, code count dates 2 intervals, either within 10 days of first count (interval 1), or after 10 days after first count (interval 2). year 1 count occurred need add entry coded "u", indicate no count occurred during second interval. following need subset out max count in each year , interval. sample dataset: complexid date males year category 57 1941-04-15 97 1941 57 1942-04-15 67 1942 57 1943-04-15 44 1943 57 1944-04-15 32 1944 57 1946-04-15 21 1946 57 1947-04-15 45 1947 57 1948-04-15 67 1948 57 1989-03-21 25 1989 57 1989-03-30 41 1989 57 1989-04-13 2 1989 57 1991-03-06 35 1991 57 1991-04-04 43 1991 57 1991-04-11 37

eclipse - My java application does not read my files (maven project) -

i have application in java simple project. however, need paste project maven project. so, made simple maven project, , copied , pasted classes it. need war run in server, , need run main java application, because application configures war application. however, when run main, errors wasn't having before: java.io.filenotfoundexception: resources\config.properties (the system cannot find path specified) when in code is: input = new fileinputstream("resources/config.properties"); this didn't work either: facedetector = new cascadeclassifierdetector("d:/retinoblastoma/workspace/resources/cascadeclassifiers/facedetection/haarcascade_frontalface_alt.xml"); how can fix this? if you're using "simple maven project", maven way there src/main/resources folder. did configure pom.xml different that? if you've done jar creation portion correctly, right way file that's on classpath is: getclass().getresourceasstream(

java - Storing doubles in an array -

alright, want store values in array. here code : import java.util.scanner; public class test { public static void main(string args[]){ scanner bob = new scanner(system.in); double[] mylist; system.out.println("what first value?"); mylist = bob.nextdouble(); system.out.println("what second value?"); mylist = bob.nextdouble(); } } issue #1: i'm being told mylist = bob.nextdouble() should nextline() . why if double? goal: want somehow store values given array later pull them out. can help? update for issue #1, tells me cannot convert double() double[] . mean? mylist array of doubles, not single double . when mylist = bob.nextdouble(); trying make entire array equal single number. you instead need assign number specific place in array. initialize array amount of elements going store in array: double[] mylist = new double[2]; assign double specific place in array: mylis

php - Error: Object of class mysqli could not be converted to string -

i know question has been asked several times on platform, however, none of them able solve problem. i getting error code below. //this working $edition=mysqli_query($con,"select price books name='$book'"); //this showing error. query working when run on phpmyadmin. //$edition=mysqli_query($con,"select price books name='$book' , edition='$edition'"); //i using mysqli_fetch_assoc store in $row , use answer later. $row = mysqli_fetch_assoc($edition); let me know problem , solution. in advance. :) here go :) considering in working example variable $book been used, bet on other variable $edition . thinking if debug code , check value assigned before using make query, confirm if acceptable type.

NuGet Fails to Install FluentValidation -

i attempting install nuget package nancy.validation.fluentvalidation installation fails due to, think, unsupported frameworks? the full nuget error below. using .net 4.5. cant see why fail? ideas going wrong? output when installing nancy.validation.fluentvalidation : attempting resolve dependency 'nancy (≥ 1.2.0)'. attempting resolve dependency 'fluentvalidation'. installing 'fluentvalidation 5.6.2.0'. installed 'fluentvalidation 5.6.2.0'. installing 'nancy.validation.fluentvalidation 1.2.0'. installed 'nancy.validation.fluentvalidation 1.2.0'. adding 'fluentvalidation 5.6.2.0' server. uninstalling 'fluentvalidation 5.6.2.0'. uninstalled 'fluentvalidation 5.6.2.0'. install failed. rolling back... specified argument out of range of valid values. parameter name: supportedframeworks output when installing fluentvalidation : installing 'fluentvalidation 5.6.2.0'. installed 'fluentvalidation 5

Connecting to SQL Server LocalDB in Delphi -

i have .mdf database file, want connect file adoconnection , sql server localdb provider my connection string looks : data source=(localdb)\v11.0;integrated security=sspi;attachdbfilename="mymdffileaddress"; but when try connect, error shown: an attempt attach auto-named database file "mdf file" failed. database same name exists, or specified file i have tried many ways, error above shown! i have installed sqllocaldb , sql server native client 11.0 on machine can connect own created instance on localdb , database, when want connect file in machine , use default instance , attachdbfilename , error shown i copied .mdf file default instance folder of localdb , tried connect, same error shown i searched lot found no correct answer ! i'm using delphi xe 6 did try this? data source=(localdb)\v11.0;integrated security=true;attachdbfilename=|datadirectory|\"mymdffileaddress.mdf";initial catalog=yourdatabasename;prov

regex - How to write Regular Expression in perl with generic way -

i have written code as: $body =~ s/&iacute;/Í/g; $body =~ s/&oacute;/Ó/g; $body =~ s/&uacute;/Ú/g; $body =~ s/&yacute;/Ý/g; but not way. could please provide generic solution? this solved problem phrased: use html::entities qw(decode_entities); $unescaped_body = decode_entities($escaped_body); if want arbitrary pairs of in , out, should set hash. my %remap = ( red => "rojo", white => "blanco", blue => "azul", ); while (my($from, $to) = each %remap) { $text =~ s/\q$from/$to/g; } but slow; there better ways of doing it, aren't ready them yet.

linux - Probability Distribution of each unique numbers in an array (length unknown) after excluding zeros -

part of datafile looks as ifile.txt 1 1 3 0 6 3 0 3 3 5 i find probability of each numbers excluding zeros. e.g. p(1)=2/8; p(3)=4/8 , on desire output ofile.txt 1 0.250 3 0.500 5 0.125 6 0.125 where 1st column shows unique numbers except 0 , 2nd column shows probability. trying following, looks lengthy idea. facing problem in loop, there many unique numbers n=$(awk '$1 > 0 {print $0}' ifile.txt | wc -l) in 1 3 5 6 ..... n1=$(awk '$1 == $i {print $0}' ifile.txt | wc -l) p=$(echo $n1/$n | bc -l) printf "%d %.3f\n" "$i $p" >> ofile.txt done use associative array in awk count of each unique number in 1 pass. awk '$0 != "0" { count[$0]++; total++ } end { for(i in count) printf("%d %.3f\n", i, count[i]/total) }' ifile.txt | sort -n > ofile.txt

AutoCompleteTextView drop down has different full screen and background color behavior in Android 4+ and Android 5+ -

Image
currently, i'm using autocompletetextview, toolbar 's component. i want achieve following thing. have autocompletetextview 's dropdown full screen, left-right margins. have autocompletetextview 's dropdown background red. i use following code achieve such behavior // full screen, left-right margins. msearchsrctextview.setdropdownwidth(getresources().getdisplaymetrics().widthpixels); int color = color.parsecolor("#ffff0000"); drawable drawable = msearchsrctextview.getdropdownbackground(); drawable.setcolorfilter(color, porterduff.mode.multiply); // if use colordrawable, in android 4.3, drop down left-right margins gone. //colordrawable drawable = new colordrawable(color); msearchsrctextview.setdropdownbackgrounddrawable(drawable); in android 4+, yields desired behavior (with left-right margins, pure red background) in android 5+, yields undesired behavior (no margins, not pure red background) i wondering, why there's such differ

windows phone 8.1 - XAML ItemsControl to repeat X number of times? -

i working in windows phone 8.1 application (non sl) , have property on viewmodel called apples has value of 3 . i want repeater draw x apples (i have image) x value of apples on viewmodel. how can achieve in xaml? have following @ moment: <itemscontrol grid.column="0" itemssource="{binding lives, converter={}}"> <itemscontrol.itemtemplate> <datatemplate> <!-- image here --> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol> i guessing need somehow convert integer sort of items? i did search on that, couldn't find obvious! appreciated. thank you. itemssource="{binding somenumber, converter={staticresource numbertoitemsconverter}}" public class numbertoitemsconverter: ivalueconverter { public object convert(object value, type targettype, object parameter, cultureinfo culture) { var number = (int)value; return en