Posts

postgresql - Set initdb and pg_ctl -

i installed postgresql source. i tried running commands: which initdb pg_ctl but blank response. i know these executables reside in directory. how might set initdb , pg_ctl ? thanks help. you have received blank output command 'which', these binaries not known linux machine. , hence need run these binaries using './' (like ./pg_ctl) can add path of postgres bin directory $path. eg. export path=$path:/postgres/installation/path/bin/ you can set permanently adding above path value in .bash_profile file in home of directory of postgres user.

javascript - Posting data in form html to server using AngularJS Http Post -

i ask posting problem, have form below, in form, have using ng-submit , ng-click function didn't work, can me? <form method="post" class="sky-form" name="form"> <div class="row"> <div class="col col-12"><img src="public/images/icon_namapasien.png" alt=""/> nama pasien</div> </div> <div class="row"> <div class="col col-10"> <div ng-repeat="profile in profil"> <label class="input disabled"> <input type="text" ng-model="profile.name"> </label> </div> </div> <div class="col col-2"> <a class="btnstatus">&nbsp;</a> </div> </div><!-- /row --> <div class="row...

python - Get the first url from list that contains 'posts' in it -

i have list: ['http://exampleurl.com/index.php', 'http://exampleurl2.com/in_dex1.php', 'http://exampleurl.com/posts/images', 'http://exampleurl2.com/posts/tags/etc'] how first url contains 'posts' ? your approach correct needs few changes. can loop through list this: x = ['http://exampleurl.com/index.php', 'http://exampleurl2.com/in_dex1.php', 'http://exampleurl.com/posts/images', 'http://exampleurl2.com/posts/tags/etc'] in x: if 'posts' in i: print break

WCF Activation for MSMQ where the service (.svc) is on the root -

vs 2012/.net4.5, windows 8/iis8 , 64 bit using wcf service application, documentation i've seen far in naming msmq queue match service name assume fact using application or virtual directory underneath iis website. this quoted msdn http://msdn.microsoft.com/en-us/library/ms789042.aspx the application being activated must match (longest match) prefix of queue name. for example, queue name is: msmqwebhost/orderprocessing/service.svc. if application 1 has virtual directory /msmqwebhost/orderprocessing service.svc under it, , application 2 has virtual directory /msmqwebhost orderprocessing.svc under it, application 1 activated. if application 1 deleted, application 2 activated. also, http://blogs.msdn.com/b/tomholl/archive/2008/07/12/msmq-wcf-and-iis-getting-them-to-play-nice-part-1.aspx however when hosting msmq-enabled service in iis 7 was, queue name must match uri of service's .svc file. in example we'll hosting service in applicat...

javascript - How to define modules or classes in ExpressJS -

i need define modules/class have list of methods. each of methods have instance of kind of service, loggers, promises... etc. how can clean code? in code have next logger definition, cannot add more methods because it's not large pile of it. logger/ticket.js var log4js = require('log4js'); module.exports = function(){ var _getticketlogger = function(){ var logger = null; log4js.loadappender('file'); log4js.addappender(log4js.appenders.file(__dirname + '/../log/ticket.log'), 'ticket-log'); logger = log4js.getlogger('ticket-log'); logger.setlevel('debug'); return logger; } return { getticketlogger: _getticketlogger }; }; you can use exports , module.exports can either export method or function. const test = exports = module.exports = {} and add many methods like test.method1 = function () { ... } test.method2 = function () { ... }

java - How to make a word triangle with spaces where next characters will appear -

i'm having trouble creating spaces before string. want this na ana nana anana banana here code now public static void main(string[] args){ string str = "banana"; for(int y = str.length() - 1; y >= 0 ; y--) { system.out.println(str.substring(y)); } } na ana nana anana banana i need characters shifted right many characters string. system.out.format("%"+str.length()+"s%n", str.substring(y)); definitely better if store length first, suggested in comment string str = "banana"; string formatstring = "%"+str.length()+"s%n"; for(int y = str.length() - 1; y >= 0 ; y--) { system.out.format(formatstring , str.substring(y)); }

sql - Extra column on table vs size on disc -

simple question ya'll. i want add float column data table has 1 million rows. how more storage on server drive chew 1 column? thanks in advance. the default size of float, according documentation 8 bytes, gives million rows x 8 bytes added, 8mb + space used indexes, if need that.