Posts

Showing posts from January, 2010

accessibility vs visibility Oracle SQL -

my teacher asked me today what's difference between accessibility , visibility in oracle sql points. i'm new this, searched internet didn't found anything. can me? thanks i searched in oracle database concepts , found 1 match visibility : indexes have following properties: ■ usability indexes usable (default) or unusable. unusable index not maintained dml operations , ignored optimizer. unusable index can improve performance of bulk loads. instead of dropping index , later re-creating it, can make index unusable , rebuild it. unusable indexes , index partitions not consume space. when make usable index unusable, database drops index segment. ■ visibility indexes visible (default) or invisible. invisible index maintained dml operations , not used default optimizer. making index invisible alternative making unusable or dropping it. invisible indexes useful testing removal of index before dropping or using indexes temporari

java - Cassandra NoHostAvailableException caused by DriverException while traversing a resultset -

i getting error repeatedly while traversing resultset of size 100,000 . have used .withreconnectionpolicy(new constantreconnectionpolicy(1000)) .withretrypolicy(defaultretrypolicy.instance) .withqueryoptions(new queryoptions().setfetchsize(2000)) in connector. still getting error. typically fails after fetching 80000 rows. com.datastax.driver.core.exceptions.nohostavailableexception: host(s) tried query failed (tried: /172.16.12.143:9042 (com.datastax.driver.core.exceptions.driverexception: timed out waiting server response), /172.16.12.141:9042 (com.datastax.driver.core.exceptions.driverexception: timed out waiting server response)) @ com.datastax.driver.core.exceptions.nohostavailableexception.copy(nohostavailableexception.java:65) @ com.datastax.driver.core.defaultresultsetfuture.extractcausefromexecutionexception(defaultresultsetfuture.java:259) @ com.datastax.driver.core.defaultresultsetfuture.getuninterrupt

ios - How to find available screens with AirPlay? -

i trying detect when airplay device available on network , if there one, i'd display list. for example, app "dailymotion" want : when connect iphone network apple tv, "airplay" icon appears : https://dl.dropbox.com/u/4534662/photo%2004-03-13%2010%2007%2014.png (just next hd) and then, when clicking on airplay icon, picker shows available airplay devices : https://dl.dropbox.com/u/4534662/photo%2004-03-13%2010%2007%2018.png i didn't find way apple documentation. so, how can programmatically? you can display airplay picker view (if airplay available) so: mpvolumeview *volumeview = [ [mpvolumeview alloc] init] ; [volumeview setshowsvolumeslider:no]; [volumeview sizetofit]; [view addsubview:volumeview]; the mpvolumeview displays available airplay devices. code above disables volume slider, may or may not want do. can't programatic access airplay device information.

ios - Change NSAttributedString text color without having to set title again -

is possible change nsattributedstring color without having set title again? i've tried: for case let uibutton in myview.subviews { if i.backgroundcolor != uicolor.greencolor() && i.backgroundcolor != uicolor.graycolor() { i.titlelabel?.textcolor = color // i.settitlecolor(color, forstate: .normal) // i.settitlecolor(color, forstate: .selected) // i.tintcolor = color } } i.titlelabel.textcolor changes color of .normal state not .selected state you can't set color without setting title can using attributedtitleforstate(.selected) , accessing string property. can create own setattributedtitlecolor method extending uibutton follow: extension uibutton { func setattributedtitlecolor(color: uicolor, forstate: uicontrolstate) { guard let title = attributedtitleforstate(forstate)?.string else { return } setattributedtitle(nsattributedstring(string: title, attributes

c++ - how to use strcpy on dynamic char * buffer -

having trouble allocating dynamic buffer data using strcpy (sigsegv (qt linux)) char ** data = new char *[10]; int current = 0; char temp[20]; std::cin >> temp; strcpy( data[ current++ ], temp); //works(before edit) //i saw sigsegv message on dynamic input //that's why thinking works char * dynamictemp = new char [ 20 ]; std::cin >> dynamictemp; strcpy( data[ current++ ], dynamictemp ); //sigsegv how should store data? it's knowledges, no need string examples. you have allocated array of char pointers. need allocate memory each of strings, this: char * dynamictemp = new char [ 20 ]; std::cin >> dynamictemp; data[ current++ ] = new char [ 20 ]; strcpy( data[ current ], dynamictemp );

mocking - XPATH Dispatch in SoapUI Mock service/ Mock operation -

i new in soapui, , trying understand use of xpath dispatch mock operation in mock service. here have done far created mock service calculator added mock operation substract following sample request operation <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://www.parasoft.com/wsdl/calculator/"> <soapenv:header/> <soapenv:body> <cal:subtract> <cal:x>1</cal:x> <cal:y>1</cal:y> </cal:subtract> </soapenv:body> </soapenv:envelope> following sample response same <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://www.parasoft.com/wsdl/calculator/"> <soapenv:header/> <soapenv:body> <cal:subtractresponse> <cal:result>?</cal:result> </cal:subtractresponse> </soapenv:body>

javascript - Multiple firings of event listener even after element has been removed? -

i'm using bit of code remove element dom once css transition has completed. elem.addeventlistener('transitionend',function(e) { this.parentnode.removechild(this); }, false); but since transition affects 2 properties opacity 1 -> 0, height 20px -> 0, event fires twice, , errors on second firing (since element has been removed dom @ point). i tried testing property (as seen here: https://stackoverflow.com/a/18689069/1058739 ), test fails instead. surely when element removed dom event listeners attached should removed? what's trick i'm missing here? thanks why detaching element dom remove event handlers? element still exists, not in dom. imagine trying move element 1 parent another element.parentelement.removechild(element) newparent.appendchild(element) do think detaching event handlers idea? that being said, can solve issue in 2 ways. check if element has parent elem.addeventlistener('transitionend', function(e) {

subset lists based on a condition in r -

i have data frame looks like: df = read.table(text="s00001 s00002 s00003 s00004 s00005 s00006 gg aa gg aa gg ag cc tt tt tc tc tt tt cc cc tt tt tt aa aa gg aa ag aa tt cc cc tt tc tt gg gg gg aa gg gg", header=t, stringsasfactors=f) i count number of character strings same letters (i.e. "aa", "cc", "gg", or "tt") each row. did use table() function count elements , generated list based on if names of lists "homo". tried subset lists didn't work. here scripts: a <- apply(df,1, function(x) table(x)) b <- apply(df,1, function(x) (names(table(x)) %in% c("aa","cc","gg","tt"))) a[b] ## didn't work i expect data frame generated: 2 3 1 3 2 4 4 1 2 3 1 5 appreciate helps. we single apply t(apply(df, 1, function(x) {tbl <- table(x) tbl[names(tbl) %in% c("aa", "cc", "gg"

jquery - How to enable button based on both checkbox and textbox content -

i have following code : <html> <body> <form action=""> <input type="checkbox" id="condition" value="conditions">conditions<br> <input type="text" id="txtagree" disabled> <input type="submit" name="generate" id="generate" disabled> </form> </body> and wrote following method in jquery if ($("#condition").is(":checked")) { $('#txtagree').prop('disabled',false); $('#txtagree').keyup(function () { if ($(this).val().length != 0) { $('#generate').prop('disabled', false); } else { $('#generate').prop('disabled', true); }

r - as.Date converts wrong date from POSIXct data -

i have 3848 rows of posixct data - stop times of bike trips in month of april. can see, of data in posixct format , within range of month of april. length(output2_stoptime) [1] 3848 head(output2_stoptime) [1] "2015-04-01 17:19:27 est" "2015-04-02 07:26:06 est" "2015-04-08 10:09:37 est" [4] "2015-04-12 20:08:00 est" "2015-04-13 17:53:11 est" "2015-04-14 07:17:34 est" class(output2_stoptime) [1] "posixct" "posixt" range(output2_stoptime) [1] "2015-04-01 00:34:29 est" "2015-04-30 20:49:22 est" sys.timezone() [1] "est" however, when try converting table of stop times per day, 4 dates converted 1st of may. thought might occurring due different system timezone located in europe @ moment, after setting timezone est, problem persists. example: by_day_output2 = as.data.frame(as.date(output2_stoptime), tz = "est") colnames(by_day_output2)[1] = "sum&q

java - Configuring PHP on Tomcat gives exception: UnsatisfiedLinkError -

i have been trying use php on tomcat (don't ask why, have to), , have been following configure php tomcat , several tutorials given php pecl & tomcat. i've done of things required tutorials, setting environment variables required, still run errors such 1 shown below, on startup: javax.servlet.servletexception: servlet.init() servlet php threw exception org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:102) org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:293) org.apache.coyote.http11.http11processor.process(http11processor.java:849) org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:583) org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:454) java.lang.thread.run(thread.java:619) root cause java.lang.unsatisfiedlinkerror: c:\windows\system32\php5servlet.dll: specified procedure not found java.lang.classloader$nativelibrary.load(native

Installing Selenium on Python -

i trying install selenium on computer. i downloaded python , far know pip installed, when write in command prompt "pip" , nothing happends, sits there , nothing , can't write in console anymore, loading. if write python in console there comes version , commands work should in python client. i add right paths , double check alot of times. anyone had problem? tried pretty every solution out there.

Apache Flink: Why do reduce or groupReduce transformations not operate in parallel? -

for example: dataset<tuple1<long>> input = env.fromelements(1,2,3,4,5,6,7,8,9); dataset<tuple1<long>> sum = input.reduce(new reducefunction()<tuple1<long>,tuple1<long>>{ public tuple1<long> reduce(tuple1<long> value1,tuple1<long> value2){ return new tuple1<>(value1.f0 + value2.f0); } } if above reduce transform not parallel operation, need use additional 2 transformation 'partitionbyhash' , 'mappartition' below: dataset<tuple1<long>> input = env.fromelements(1,2,3,4,5,6,7,8,9); dataset<tuple1<long>> sum = input.partitionbyhash(0).mappartition(new mappartitionfunction()<tuple1<long>,tuple1<long>>{ public void map(iterable<tuple1<long>> values,collector<tuple1<long>> out){ long sum = getsum(values); out.collect(new tuple1(sum)); } }).reduce(new reducefunction()<tuple1<long>,tuple1<long>&

saving files to a specific folder in vb.net -

pls working on windows application destop messenger want save file folders music images e.t.c don't know how go please appreciated in visual studio 2013 can use folderbrowserdialog , dialogresult messagebox.show("select path", "attention") dim select new folderbrowserdialog() dim resultsel dialogresult = select.showdialog() if not select.selectedpath.equals(string.empty) ' save file end if

javascript - How can we show Nifty window modal popup on page load? -

this question has answer here: nifty modal - how trigger modal without button 5 answers i want show nifty window modal popup on page load. nifty window popup modal code: <div class="md-modal md-effect-1" id="modal-1"> <div class="md-content"> <h3>modal dialog</h3> <div> <p>this first nifty modal window. </p> <button class="md-close">close me!</button> </div> </div> </div> thanks in advance. i've looking in source code of demos, , believe trick: $(function() { $('#modal-1').addclass('md-show'); });

eclipse - Java deck of cards -

i'm trying piece of java return int total of value of cards in deck. using test data of 10 cards of different values should result 64 i'm getting random answers around 73 every time run it, changes slightly. got ideas why?? confused piece of program trying return array of cards of suit(in test case hearts). if code messy or wrong because i'm beginner haha. methods , stuff have been completed lecturer im trying show me in right direction methods. thanks in advance. 1st question public int totalpack() { int total = 0; ( int = 0; < pack.size(); i++){ total = total + pack.get(i).getnumber() ; } return total; } end 2nd question public arraylist<card> findsuit(string suit) { ( int = 0; < pack.size(); i++){ if (pack.get(i).getsuit().equals(suit)){ return null; } else return ???; } return findsuit(suit); } for second question: as jurfer mentions, don't need recur

Java regex, delete content to the left of comma -

i got string bunch of numbers separated "," in following form : 1.2223232323232323,74.00 i want them string [], need number right of comma. (74.00). the list have abouth 10,000 different lines 1 above. right i'm using string.split(",") gives me : system.out.println(string[1]) = 1.2223232323232323 74.00 why not split 2 diefferent indexds? thought should on split : system.out.println(string[1]) = 1.2223232323232323 system.out.println(string[2]) = 74.00 but, on string[] array = string.split (",") produces 1 index both values separated newline. and need 74.00 assume need use regex, kind of greek me. me out :)? if it's in file: scanner sc = new scanner(new file("...")); sc.usedelimiter("(\r?\n)?.*?,"); while (sc.hasnext()) system.out.println(sc.next()); if it's 1 giant string, separated new-lines: string onegiantstring = "1.22,74.00\n1.22,74.00\n1.22,74.00"; scanner sc = new scann

python - How to find the name of a list -

i want find name of list, how can in python ? this code: ab = "the sky blue" #in code don't know text in ab #others lists... bannana = ["white", "red", "blue"] tomato = ["red", "shiny", "grey"] peach = ["séché", "mure", "moisi"] spicybannana = ['uigyig','iuig','iug'] #other lists... l1 = [bannana, tomato, peach] randomlist = randrange(0, len(l1)) in l1[randomlist]: if in ab: #if list name contain 'bannana': as per @tim_castelijns suggestion - store lists in dictionary: other_lists = { 'bannana': ["white", "red", "blue"], 'tomato': ["red", "shiny", "grey"], 'peach': ["séché", "mure", "moisi"] } randomlist = random.choice(['bannana', 'tomato', 'peach']) in other_lists[

javascript - RequireJS does not load dependencies consistently -

i tasked implement requirejs architecture in existing project. project single page app, though has page order form. after documentation lurking , experimentation able ball rolling. but happines faded, realised not work expected. when page reloaded works , other times throws error: uncaught typeerror: $beforeafter.beforeafter not function i wrote config file (also 'data-main' entry point in html script tag) follows: config.js: // requirejs configuration, see http://requirejs.org/docs/api.html#config require.config({ // todo: set right path , clean '../../' nonsense baseurl: '', paths: { // vendor javascript jquery: "../../node_modules/jquery/dist/jquery", jqueryui: "../../src/vendor/jquery-ui/jquery-ui", bootstrap: "../../node_modules/bootstrap/dist/js/bootstrap", jquerycookie: "../../node_modules/jquery.cookie/jquery.cookie", owlcarousel: "../../node_modules/owl.carouse

sql - How to only pull data from table 1 if table 2 also have data -

my problem is, have 2 tables using shipping , happening. if ca.addr_1 has data fine if there data in c.addr_2 show it. , want if ca.addr has data on line use if lines null use c.addr. co.ship_to_addr_no addr_no, isnull(ca.name, c.name) name, isnull(ca.addr_1, c.addr_1) addr_1, isnull(ca.addr_2, c.addr_2) addr_2, isnull(ca.addr_3, c.addr_3) addr_3, isnull(ca.city, c.city) city, isnull(ca.state, c.state) state, isnull(ca.zipcode, c.zipcode) zipcode, isnull(ca.country, c.country) country, case when should allow need. case when ca.addr1 null , ca.addr_2 null , ca.addr_3 null c.addr else when .... you can add in many variations using else when need account whatever permutation of address results want select.

java - One to Many projections using QueryDSL with Spring -

i'm trying use querydsl in spring boot , working fine until bumped problem i'm not finding answer. suppose have following structure: +-------+ +----------+ +-------+ | foo | | foo_bar | | bar | +-------+ +----------+ +-------+ | id | -------->| foo_id | +- | id | | name | | bar_id |<------| | name | +-------+ | position | +-------+ +----------+ i'm trying use projections querydsl manage service response, have classes defined like: foo.class @entity @table(name = "foo") public class foo{ @id @generatedvalue(strategy = generationtype.identity) private long id; @column(nullable = false, length = 100) private string name; // relations @onetomany(fetch = fetchtype.lazy, mappedby = "foo") private list<foobar> foobars; // getters , setters } foobar.class @entity @tab

python - Keras autoencoder accuracy/loss doesn't change -

here code: ae_0 = sequential() encoder = sequential([dense(output_dim=100, input_dim=256, activation='sigmoid')]) decoder = sequential([dense(output_dim=256, input_dim=100, activation='linear')]) ae_0.add(autoencoder(encoder=encoder, decoder=decoder, output_reconstruction=true)) ae_0.compile(loss='mse', optimizer=sgd(lr=0.03, momentum=0.9, decay=0.001, nesterov=true)) ae_0.fit(x, x, batch_size=21, nb_epoch=500, show_accuracy=true) x has shape (537621, 256). i'm trying find way compress vectors of size 256 100, 70, 50. have done lasagne in keras seems easier work w/ autoencoders. here output: epoch 1/500 537621/537621 [==============================] - 27s - loss: 0.1339 - acc: 0.0036 epoch 2/500 537621/537621 [==============================] - 32s - loss: 0.1339 - acc: 0.0036 epoch 3/500 252336/537621 [=============>................] - eta: 14s - loss: 0.1339 - acc: 0.0035 and continues on , on.. it's fixed on master:) openn

Insert serial COM message in to MySQL database -

i've got arduino setup outputs messages via serial port via usb. nothing 'clever' needs done filter or sort these messages. i want insert these messages (along datestamp) in mysql database. best way reliably? c++/php/etc? please supply bit of info point me in right direction. any programming language use, should have interrupt function com port ( func get_com implements com_listener) you have use interrupt function , write db.

php - Zend / Apache2: Getting 302 Found when requesting url several times -

i programming rest api zend framework . when calling url several times (e.g. 1000 times 1 request per second), in 0.2 % of cases instead of getting 200 ok response 302 found - redirect different page. here entire server response: 302 found date: mon, 04 mar 2013 11:56:04 gmt server: apache/2.2.17 (ubuntu) x-powered-by: php/5.3.5-1ubuntu7.11 set-cookie: phpsessid=ui9r8jqa63dbom8osknso6eea5; path=/ expires: thu, 19 nov 1981 08:52:00 gmt cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 pragma: no-cache location: /de/default/index/index/error/500 vary: accept-encoding content-length: 0 content-type: text/html; charset=utf-8 so zend redirects error 500 (internal server error) page. question why - , can't figure out... php page called inserts one row mysql database , returns json string - that's all. apache2 has 20 concurrent connections open , server load <<1 not understand why requests cause problems. i know difficult probl

python - MapReduce with paramiko how to print stdout as it streams -

i have created small python script using paramiko allows me run mapreduce jobs without using putty or cmd windows initiate jobs. works great, except don't see stdout until job completes. how can set can see each line of stdout generated, able via cmd window? here script: import paramiko # define connection info host_ip = 'xx.xx.xx.xx' user = 'xxxxxxxxx' pw = 'xxxxxxxxx' # commands list_dir = "ls /nfs_home/appers/cnielsen -l" mr = "hadoop jar /opt/cloudera/parcels/cdh/lib/hadoop-0.20-mapreduce/contrib/streaming/hadoop-streaming.jar -files /nfs_home/appers/cnielsen/product_lookups.xml -file /nfs_home/appers/cnielsen/mapper.py -file /nfs_home/appers/cnielsen/reducer.py -mapper '/usr/lib/python_2.7.3/bin/python mapper.py test1' -file /nfs_home/appers/cnielsen/process.py -reducer '/usr/lib/python_2.7.3/bin/python reducer.py' -input /nfs_home/appers/extracts/*/*.xml -output /user/loc/output/cnielsen/test51" getmerge =

jmeter - Getting 404 error after sending username and password as post requests -

i have jmeter script main purpose of script post username , password read excel sheet. have excel sheet saved in e:\ drive of local system , sending post requests reading username , password excel getting issue in response received.please me. response data: <!doctype html> <html> <head> <title>the resource cannot found.</title> <meta name="viewport" content="width=device-width" /> <style> body {font-family:"verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"verdana";font-weight:bold;color:black;margin-top: -5px} h1 { font-family:"verdana";font-weight:normal;font-size:18pt;color:red } h2 { font-family:"verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"consolas&q

python - Issue with rotating x tick labels in matplotlib subplots -

Image
i having issue getting x axis tick labels rotate. have tried following matplotlib documentation axes.set_xticklabels() using ax1.set_xticklables(labels, rotation=45) . have tried using plt.setp per this post still havent been able rotate labels. reference code follows: import matplotlib.pyplot plt import numpy np import pandas pd import datetime print("enter symbol:") symbol = input() symbol = symbol.upper() print("enter interval:") interval = input() print("you entered: " + symbol) # obtain minute bars of symbol google finance last ten days bars = pd.read_csv(r'http://www.google.com/finance/getprices?i={}&p=10d&f=d,o,h,l,c,v&df=cpct&q={}'.format(interval, symbol), sep=',', engine='python', skiprows=7, header=none, names=['date', 'close', 'high', 'low', 'open', 'volume']) bars['date'] = bars['date'].map(lambda x: int(x[1:]) if x[0] == 'a&

php proxy woff font using fpassthru -

Image
hi trying proxy woff font file using php this code using $path path file on harddisk. error in console failed decode downloaded font: http://localhost/font/fontawesome-webfont.woff?v=3.2.1 fakemboard.com/:1 ots parsing error: invalid version tag if use phpstorm default http server works fine. i have attached 2 images: 1) first problematic response php proxy 2) second 1 ok 1 using phpstorm default server can me find out missing proxy? believe may headers buy weak @ that. helpful if provide missing code. thanks header('content-type: application/font-woff'); $file = fopen($path, 'rb'); if ($file) { fpassthru($file); exit; } i flowed mike 'pomax' kamermans advice , compered file font file bad font file. indeed different. bad file has 2 blank lines in beginning. it happened because in 1 of php files have included accidentally added blank lines before <?php tag , php rendered them. hope helps else

tfsbuild - How to Increase build vnext build agent execution time? -

Image
i running large suite of tests on build server , takes longer hour through them all. failing after hour stating this: the job running on agent xagentnamex has exceeded maximum execution time of 01:00:00. i thought in user capabilities settings build agent not see there. how can increase limit? it under settings of build definition: general->build job timeout in minutes.

timeout - Response Time of sleeping gwan server script -

i want figure out how gwan responds if script takes longer 1 second finish. to so, used sleep() function in hello.c example: #include "gwan.h" #include <unistd.h> int main(int argc, char **argv) { sleep(5); static char msg[] = "hello, ansi c!"; xbuf_ncat(get_reply(argv), msg, sizeof(msg) - 1); return 200; // return http code (200:'ok') } the response time got chrome >= 5 seconds, expected. then, have run weighttp concurrency test, , here response time got chrome in ms (millisecond). caching issue? 5 second sleep time has gone? thanks. your sleep(5); test pointless (at best) and, expected, g-wan timeouts blocking script avoid blocking server because of buggy script. if blocking servlet used under concurrency, lik eyou did later, then, instead of pointlessly timing-out every execution (this take time), g-wan flags servlet buggy , no longer executes it. this blocking issue not exist more int

javascript - How to set the date as a placeholder when view loads? -

i using plugin angular extension when view loads see empty input, when click on input, calendar comes , today's date displayed in input. what need load today's date in input when view ready. here way using it <input type='text' datetimepicker datetimepicker-options="{format: 'mm/dd/yyyy', usecurrent: true}"/> what recommend ? edit i added autofocus input, , datepicker it's been displayed, not date need. my controller: (function () { 'use strict'; angular .module('palpatine') .controller('rotationsctrl', rotationsctrl); /* @nginject */ function rotationsctrl (rotations, $scope, $rootscope, $state) { /*jshint validthis: true */ var vm = this; activate(); function activate () { $(document).ready(function () { var today = new date(); var dd = today.getdate(); var mm = today.getmonth()+1; //january 0! var yyyy = today.

python - Converting string into hex representation -

i looking way convert string hex string. for example: '\x01\x25\x89' -> '0x012589' '\x25\x01\x00\x89' -> '0x25010089' here have come with: def to_hex(input_str): new_str = '0x' char in input_str: new_str += '{:02x}'.format(ord(char)) return new_str it seems there better way haven't been able find yet. you want binascii module. >>> binascii.hexlify('\x01\x25\x89') '012589' >>> binascii.hexlify('\x25\x01\x00\x89') '25010089'

php - Moodle password check on external script -

i have moodle 2.7. users logins , passwords hashes stored in mdl_user table. want create external script can check - if login , password correct. as see - moodle version use function php password_hash() generate password hash. my php version 5.4 can't use function. use library https://github.com/ircmaxell/password_compat code $password_hash = password_hash( $password , password_default, array()); the problem hash different each time calculate it. cant compare hash string placed in mdl_user table. if function similar of password_hash() native php, salt generated along hash, , salt randomized. because of this, comparing results of 2 separate calls of password_hash() not going match. the function you're looking password_verify() , takes inputted password , hash on database. if returns true, passwords match.

Configuring Couchbase connection ports through their Node.js API [Docker] -

i using official couchbase docker container. some important ports couchbase server uses. those exposed through container random ports on host. is there way supply host ports on obtaining couchbase server connection? akin how server configured preinstall client. i using latest node.js sdk don't see options hash, e.g., in cluster . i fall on 1:1 mapping (container:host) in docker run if else fails. docker publishes exposed ports random port on host interface if container started using -p . port within range 32768 , 61000 . each exposed port can mapped explicit port -p hostport:containerport . this approach independent of client sdk. its recommended start 1 couchbase server on 1 docker host ensure ports available.

nmake - Added Makefile project to Visual Studio 2015 solution is always out of date -

i have rather large solution (80 projects). upgraded vs2015u1 , modified solution include makefile (nmake) project prerequisite other projects. intention makefile should copy third party software project's bin directory make easier bring things testing , packaging. the problem is, makefile project appears out-of-date. mean dialog popup when hit f5 test. i've googled till googler sore, including found on stackoverflow. none of solutions listed appear help: there no files listed project, none out of date. put makefile project file, doesn't help. i added fake output file makefile project including in properties, , causing make file create 1 when it's run. i've set build output verbosity diagnostic , have gone through .log file extensively , not found hint of file missing or out-of-date. none of other projects appear rebuild, 1 makefile project. when makefile runs, appears up-to-date files copied. there no .tlog files related new project. doing c

node.js - TypeError: n is undefined in underscore template -

i using underscore temperating in jade. index.jade extends layout block content .wrap .container-fluid#container script(type='text/template' id='main-template') .row .col-xs-8.col-sm-9 .heading h2 welcome node chatroom hr/ .content ul.list-group#chatlist .col-xs-4.col-sm-3 .sidepanel .panel-heading h3.panel-title online users span.badge pull-right#usercount hr/ .panel-body ul.list-group#userlist .push .footer .container-fluid .row form .form-group .col-xs-8.col-sm-9 input(type="text" id="chatinput" class="form-control input-lg" placeholder="write message here..." rows="3") .col-xs-4.col-sm-3 button(id="send-message-btn" class="btn btn-primary btn-lg

asp.net mvc - Multiple views modifying one object MVC -

i building service requires lengthy setup process. have broken 4 models , 4 corresponding views. setup, setup2, setup3, , setup4. each of these views gathers information user stored in user object. have been passing user along this: [httppost] public actionresult setup(formcollection values) { user registeringuser = new user(); registeringuser.email = user.identity.name; registeringuser.fname = values["fname"]; registeringuser.lname = values["lname"]; registeringuser.phone = values["phone"]; return redirecttoaction("/setup2", registeringuser); } for reason, seems work fine first jump (from setup setup2) after i'm getting weird behavior, such user. getting set null when user passed view. in related, different issue, need last screen (setup4) recursive. screen adds course in user enrolled, , if don't check "this last class" button, needs clear form

html - How to create media query with max width? -

i have wordpress boss 2.0 theme installed , custom header want hide on mobile device , show on desktop 720px or wider. i created <div class="container" id="custom-header"> and in css file did: @media screen , (max-width: 720px) { /* remove header phone portrait */ #custom-header { display: none; } } obviously doesn't work, if try opposite: @media screen , (min-width: 720px) { /* remove header phone portrait */ #custom-header { display: none; } } it work hiding header when stretch window more 720px. first reflex add display: none !important; no better results. any solutions hiding content on device less 720px wide? probably "custom-header" inheriting css, check on style elements of developer tool (f12 in major browsers) another thing should see cascade declaration in mediaquerys if using max-width, rembeber declarate them higher lower . with min-width lower higher. hope works you

c++ - Libraries VS2015 -

good evening i'm trying set development environment on newly boot-camped windows 10. i know how link include/lib in vs. on mac external libraries , include files @ either: /use/local/ or /opt/local/ i'm wondering whether there easy way on windows, or there way force vs in particular dir? cheers vs has concept of property sheets predefined set of properties project. every c++ project includes default few property sheets , there's special property sheet called microsoft.cpp.[platform].user [platform] either win32 or x64. editing contents of file can set paths projects (or other arbitrary values such macros). to edit these files either of following: make new cpp project in vs. go view -> other windows -> property manager . show new pane in current window , there can find property sheet , edit see fit. approach has benefit of being more user-friendly vs provides nice gui. here's 1 tutorial find files (they located in %localappdata%\micros

timezone - Where is the full list of exemplar cities for English in the CLDR time zone xml? -

there couple exemplar cities , metazone names in core/common/main/en.xml cldr, however, full list not included in en.xml there in other languages. why , find entire list of exemplar cities english? i found answer in cldr bug tracker .

android - how can i style this activity to be show in square style -

Image
i have activity_main.xml nested linear layout creating blocks , have little problem xml code : <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/xmltoolbarmain" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="#f44336"/> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent

ajax - JQuery: Dynamic page content and attaching button click -

i have grid when click on pager link html return server side ajax call , new grid html getting append in div. new html content has button has class called edit-user . so wrote code attach jquery click button adding in page dynamically.....but in case not working. $(function () { $('#gridcontent').on('click','.edit-user', function () { var tr = $(this).parents('tr:first'); $(tr).addclass('editing'); if ($(tr).find("td:nth-child(2)").hasclass('padon')) { $(tr).find("td:nth-child(2)").removeclass("padon"); $(tr).find("td:nth-child(3)").removeclass("padon"); $(tr).find("td:nth-child(4)").removeclass("padon"); $(tr).find("td:nth-child(5)").removeclass("padon"); } $(tr).find("td:nth-child(2)").addclass("padoff"); $(tr).find(&quo

c# - Why does binding the MainWindow datacontext in XAML fail to act the same as binding in the codebehind with this.datacontext=this? -

Image
i trying use data binding bind observablecollection itemssource of datagrid, learn wpf , stuff. in code-behind can set datacontext this.datacontext = this; or bloopdatagrid.datacontext = this; . that's fine , dandy. i thought try like <window.datacontext> <local:mainwindow/> </window.datacontext> in main window, causes stack overflow exception explained in this question . fine, makes sense. after reading this , other questions/answers try datacontext="{binding relativesource={relativesource self}}" in window's xaml code, thought actually this . apparently cannot . or @ least, ide lets me , it's syntactically correct, not want (ie, this.datacontext = this; does). then read this using "{binding elementname=, path=}" , tried use so: <datagrid name="bloopdatagrid" grid.row="1" itemssource="{binding elementname=testwin, path=outputcollection}"> </datagrid> wh

java - Avoiding cyclic dependencies when using listeners -

what best way avoid cyclic dependencies in simplistic example? avoid inlining selectionchangedlistener rather large/complex class. class somegui extends dialog { treeviewer somewidget; selectionchangedlistener somelistener; private void somemethod(){ somelistener = new selectionchangedlistener(this); somewidget.addselectionchangedlistener(somelistener); } public void dosomething(){ } } class selectionchangedlistener implements iselectionchangedlistener{ somegui reference; public selectionchangedlistener(somegui reference) { this.reference = reference; } @override public void selectionchanged(selectionchangedevent event) { reference.dosomething(); } } normally make listener 'inner' class of dialog, has implicit instance of dialog: class somegui extends dialog { treeviewer somewidget; iselectionchangedlistener somelistener; private void somemethod() { someli