Posts

Showing posts from June, 2013

php - Integrating CodeIgniter libraries (like tank auth) -

i've done quite bit of research , haven't found satisfying answer. how should use codeigniter libraries such tank auth? i've found handful of ways, seem sort of lackluster: do use controller is, adding controller functions/including styles needed? do use controller example model own after, relying on calls $this->tank_auth , views included tank auth? or extend my_controller tank-auth controller, extend particular controller needs authentication, , call parent::login() (or register(), activate(), etc )? the first option seems best, seems difficult avoid copying lot of code (what happens if want login form, don't want redirect /auth/login?) the second option has same problem, worse. need include logic of tank auth controller's login function each time wanted use login_form view, correct? the last seems hacky , seems anti-mvc me, maybe i'm wrong. check out http://philsturgeon.co.uk/blog/2010/02/codeigniter-base-classes-keeping-it-dry ...

regex - get all lines NOT end with 'rpms' in sed -

i want append following line lines. if have tips, please let me know. lot. i have tried sed -e '/?!(rpms$)/{n;s/\n//}' filename but failed. i think looking put lines don't end rpms on single line: sed -e ':a;/rpms$/!{n;s/\n//;ba}' instead of trying negate pattern, can negate test putting negation operator ! after pattern. to handle case there more 2 lines without rpms @ end, added label :a , unconditional jump ba label.

Scheme using modulo operator on a list -

i found max value of list , want return numbers except numbers have modulo equal 0 max value , im not quite sure how use modulo operator on whole list numbers need can lead me in right direction have far (define (findlargest a_list) (if (null? a_list) ;if empty list #f ;its false (let loop ((a_list (cdr a_list)) ;binds loop variable a_list value of cdr a_list(second , subsequent items in list) (maxval (car a_list))) ;maxval set car of a_list (first item of list) (cond ((null? a_list) maxval) ;if list empty return max ((> (car a_list) maxval) ;checks see if current element > max (loop (cdr a_list) (car a_list))) ;find new max (else (loop (cdr a_list) maxval)));keeps same max you're reinventing wheel findlargest , there's built-in procedure that: (define (findlargest lst) (apply max lst)) now, regarding question - looks perfect job filter : (define (filter-max-mo...

c# - IIS: Unexpected behavior in case of unhandled exception in Application_Start -

i'm using windows 7, iis 7.5.7600.16385 , .net 4.6.1 installed , have mvc application. some days ago had strange behavior @ our application. unfortunately service called inside application_start not available , unhandled exception thrown inside. expected behavior application_start() called again next request or the next request starting directly application_beginrequest() mentioned in what happens if unhandled exception thrown in application_start? . unfortunately following result: in case of exception inside application_start() error 500 @ first request. that's ok. after other requests returning exception thrown @ first request. verified throwing exception timestamp inside @ local environment. each response contains exception timestamp first request , http answer still 500. has no dependency url called. @ our code no breakpoint hit iis log show requests. seems answer cached somewhere. personally behavior because application doesn't respond requests undefined ...

Redirecting all queries to secondary in sharded cluster in mongodb -

how redirect queries secondary in sharded cluster rather setting readpreference variable while making connection mongo router. in short, mongo router redirect read queries secondary primary default. you readpreference connection string option, or query option (if driver supports this). connection mongos router readpreference set gets honoured, when selecting member of each shard's replicaset gets queried, if there no mongos router in way.

java - Call "addkeylistener" on JPanel object or JFrame object -

all. i got confused how event handling stuff works. can give me hints, thank! here understand, in order event handling, there 3 steps: (1) implement listener (action, key, ...) (2) provide event handler (actionperformed ...) (3) register listener source (this step got confused) i had see people doing addkeylistener on jpanel object, , doing on jframe object. personally, try both, , event can handle, , can not be, depend on either jpanel obj. or jframe obj choose addkeylistener. so, in kind of situation can determine either jpanel or jpanel should used, , other object have similar issue? thank you! below practice code of trying make snake game. not done yet, has issue described, calling addkeylistener work on jframe, fail on jpanel. snake.java package com.snake; import javax.swing.*; import java.awt.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.awt.event.keyevent; import java.awt.event.keylistener; import java.util.arrayl...

arrays - Validating a Barcode in C -

i beginner c coder working on program validate bar codes. far have code reads in 12 digit bar code. however, having trouble on attaching 12 digit input functions odd_value , even_value. need theses values validate bar code. #include <stdio.h> #define array_size 12 int print_values(int* x) { printf("\nstep 1: sum of odds times 3 \n" ); printf("step 2: sum of digits \n"); printf("step 3: total sum \n" ); printf("step 4: calculated check digit \n" ); printf("step 5: check digit , last digit \n" ); return 0; } int odd_value() { int sum_odd = (x[0] + x[2] + x[4] + x[6] + x[8] + x[10])*3; return sum_odd; } int even_value() { int sum_even = (x[1] + x[3] + x[5] + x[7] + x[9] + x[11]); return sum_even; } int fill_array(){ int i; printf("enter barcode check. separate digits space >\n"); for(i=0; i<array_size; i++){ if(scanf("%d:", &x[i]) != 1) return 0; } return 1; } int main()...

.htaccess - Codeigniter htaccess for multiple applications -

hello guys can me how set proper url in codeigniter using multiple applications , proper .htaccess folder structure -application -api -cms -system -api.php -cms.php its works when use this http://localhost/kitkat_funs/cms.php/ http://localhost/kitkat_funs/api.php/ but want this http://localhost/kitkat_funs/cms/ http://localhost/kitkat_funs/api/ my htaccess rewriteengine on rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l] please try following steps: in config=>config.php, replace following. $config['index_page'] = 'index.php'; to $config['index_page'] = ''; please put following code .htaccess file, might achieve result. write project folder name rewritebase rewritebase /yourprojname/ rewriteengine on rewritecond %{request_uri} ^/system.* rewriterule ^(.*) index.php?/$1 ...

java - Bean and Dependency Injection configuration from Database Instead XML -

currently have service class configuration defined in application-context.xml file. application context initialized during application startup beans defined in context file , spring handles dependency injection. i looking solution has load particular service class during run time based on specific parameter database. for example, there 2 classes exist in code base such fooservice1.java , fooservice2.java. each class have dependency appropriate dao class such foodao1.java , foodao2.java. instead of defining these in applciation-context.xml file, run time parameter decide service needs loaded , corresponding dao needs injected. trying achieve here db oriented dependency injection keep application context information in database instead of xml. tables like: service_beans, dao_beans , intermediate table have dependency information. i saw jdbcbeandefinitionreader class in spring. can use implement db oriented di? don't see example on this. please let me know if has example...

excel - How to Identify to check if Another workbook is already open -

currently opening workbook using task manager, time previous task not completed i.e. still macro running of workbook, here wan check if other workbook open or running macro; close current opened workbook task manager, have simple code per below want try else: if thisworkbook.name <> activeworkbook.name call sendemail ' don't need code else call run_dashboard end if dim wb workbook on error resume next '//this vba way of saying "try"' set wb = application.workbooks(wbookname) if err.number = 9 '//this vba way of saying "catch"' 'the file not opened...' end if

arduino - Contiki sky-shell-exec symbols.o error (symbols.o):(.rodata.symbols+0x6): warning: internal error: out of range error -

i trying run sky-shell-exec example in arduino yun. i have finished defining platform details , cfs-coffee-arch . when try run sky-shell-exec . ger error. when make sky-shell-exec.arduino-yun. ok. try make sky-shell-exec.arduino-yun core=sky-shell-exec.arduino yun , same options tmote-sky . error. error: contiki-arduino-yun.a(symbols.o):(.rodata.symbols+0x6): warning: internal error: out of range error contiki-arduino-yun.a(symbols.o):(.rodata.symbols+0x4a): warning: internal error: out of range error contiki-arduino-yun.a(symbols.o):(.rodata.symbols+0x56): warning: internal error: out of range error contiki-arduino-yun.a(symbols.o):(.rodata.symbols+0x132): warning: internal error: out of range error contiki-arduino-yun.a(symbols.o):(.rodata.symbols+0x13a): warning: internal error: out of range error contiki-arduino-yun.a(symbols.o):(.rodata.symbols+0x21e): warning: internal error: out of range error contiki-arduino-yun.a(symbols.o):(.rodata.symbols+0x22e): warning: internal...

Azure CDN versioning is not showing updates -

i trying clear cache of cdn. i have enabled query strings on cdn endpoint allow fresh content. i have updated headers of blob force download rather display in browser. when visit blob directly image downloads. if visit through cdn different version numbers @ end ?v=2 headers not present , image not download. take time query string change take effect? or there more steps have missed?

javascript - how to get separate id for same input type while creating dynamic input filed? -

js file in below javascript file how can create different id input types whenever new input type being created. $(document).ready(function(){ $(".template_charge:first").hide(); //hide template var charge_count =0; // total charge types. var charge_id_no =0; // assign id , name charge component /* add new item based on hidden template */ $(".add_charge").click(function() { charge_id_no ++; charge_count ++; $('#charge_count').val(charge_count); var newitem = $(".template_charge:first").clone(); newitem.find("input").attr("id", "chargetype_" + charge_id_no); //rewrite id's avoid duplicates newitem.find("input").attr("name", "chargetype_" +charge_id_no); newitem.find("input").attr("id", "charge_" +charge_id_no); //rewrite id's avoid dupli...

java - How to inject different dependencies for parent/child activities from multiple independent components using Dagger 2? -

i'm relatively new dagger 2, , kept running compiler error dagger 2 says missing @provide or @produces . i'm trying inject common components in base class, child class has own component. checked out several examples online , saw people using sub-component; still don't why can have multiple independent components each class? don't see why imagecomponent has sub-component of apicomponent , doesn't make sense. i'm wondering what's right approach regarding issue, or there alternative approach i'm not aware of? thanks. api component public interface userapi { int getuser(); } public interface searchapi { int search(); } @singleton @module public class apimodule { public apimodule() { } @singleton @provides public searchapi providesearchapi() { return new searchapi() { @override public int search() { return 0; } }; } @singleton @provides...

clear - Completely forget a single domain in Chrome -

how remove data single domain in google chrome? (in 1 action) use case: i developing offline web application, , need 'start fresh' while testing chrome's "clear browsing data" can limited time, not domains removing domain's pages in history not remove service workers app cache doesn't work in chrome's incognito mode ideally, ui button or keyboard shortcut best. extensions fine, if work. please don't submit answer unless service workers removed (i know there many solutions cookies/cache etc). thanks chrome includes 'clear storage' function in 'application' tab of dev tools (using v52). chrome!

Javascript OOP can't get property -

i'm trying rewrite code oop approach, stuck in something. there example : var counter = { column: { estimation: "tr td:nth-child(3)", worked: "tr td:nth-child(4)", ratio: "tr td:nth-child(5)", difference: "tr td:nth-child(6)" }, columnlength : function display(){ return $(this.column.estimation).length; }, ok, works! if write same, not in function though: var counter = { column: { estimation: "tr td:nth-child(3)", worked: "tr td:nth-child(4)", ratio: "tr td:nth-child(5)", difference: "tr td:nth-child(6)" }, columnlength : $(this.column.estimation).length }, it doesn't, there error : column isn't declared. why must in function? thx in advance. the problem when you're using this inside jquery selector $(...) value of global object window instead of object counter . so...

http - swift uploadTaskWithRequest with didReceiveData -

i pretty new swift have following code var data : anyobject let dict = jsonobject nsdictionary { data = try nsjsonserialization.datawithjsonobject(dict, options:.prettyprinted) let strdata = nsstring(data: data as! nsdata, encoding: nsutf8stringencoding)! string data = strdata.datausingencoding(nsutf8stringencoding)! let task = defaultsession.uploadtaskwithrequest(request, fromdata: data as? nsdata, completionhandler: {(data,response,error) in guard let _:nsdata = data, let _:nsurlresponse = response error == nil else { return } }); task.resume() }catch{ return resultjson } the resultjson object returns empty array there more date downloaded , takes time.i wondering weather can use didreceivedata option return data after downloaded. searched code online couldn't find any. code appreciated. thanks you...

php - CSS clickb-able box that links to another page -

i have been creating website in html5, php, sql , css. can guess quite basic im trying last part , ui working. wondering how can create box in top left of screen has words "admin login" , when anywhere in box clicked links me new page (the admin login page). basic problem dont on css well. if has tips great. have far. 1 problem can still click on words "admin login not entire region. <h5 style = "text-align:center;display:inline-block;width:100px;height:35px;background-color:#ccc;border:1px solid #ff0000;"> <a href = "http://127.0.0.1/loginscreen_ui.html">admin login </a> </h5> yours sincerely gsg try this: <a href = "http://127.0.0.1/loginscreen_ui.html"> <h5 style = "text-align:center;display:inline-block;width:100px;height:35px;background-color:#ccc;border:1px solid #ff0000;">admin login </h5> </a>

inno setup - How to determin if folder already exists in innosetup -

Image
can give me instructions how check if folder exists (right after user selected folder), , if - prompt him similar message attached one? thank you to force warning popup (even when application installed , you're going install new version of same folder), can set direxistswarning yes : [setup] ... direxistswarning=yes

enums - Scala Enumeration giving error -

i defining scala enum object object logtype extends enumeration{ val value1,value2=value } but getting error : object enumeration not member of package scala note: class enumeration exists, has no companion object. what might reason? try example scaladocs . looks have define type. object main extends app { object weekday extends enumeration { type weekday = value val mon, tue, wed, thu, fri, sat, sun = value } import weekday._ def isworkingday(d: weekday) = ! (d == sat || d == sun) weekday.values filter isworkingday foreach println }

c# - Define maximum for NumerictUpDown in a dictionary -

so have dictionary few controls called controldict . if want set maximum numericupdown control this: controldict.add("amountnum" + i.tostring(), new numericupdown()); controldict["amountnum" + i.tostring()].location = new point(60, 42); controldict["amountnum" + i.tostring()].maximum = new decimal(new int[] { -1, -1, -1, 0}); it gives me error: 'control' not contain definition 'maximum' , no extension method 'maximum' accepting first argument of type 'control' found (are missing using directive or assembly reference?) how can solve this? you should cast control numericupdown assign values properties: var numeric = (numericupdown)controldict["amountnum" + i.tostring()]; numeric.maximum = 100; why controldict["amountnum" + i.tostring()].location works without casting? because result control , control class ha...

git - Versioned Settings Teamcity -

recently enabled versioned settings in teamcity ( https://confluence.jetbrains.com/display/tcd9/storing+project+settings+in+version+control ) git. the first synchronisation failed since user setup did not have write privileges. caused builds have red error message against status. i amended vcs root enable write privileges , commits red errors lines still remain! idea how refresh status since errors weeks old build status successful. thanks this due user not having privileges such being able list remotes

sql server - SQL Query : Update from a select result -

here's sql query update dbo.td_total_accounts set total_accounts = total select annee, mois,[group], ( select sum(accounts_number) olap.td_all_accounts eomonth(cast( cast(mois nvarchar(2))+ '/' + '01' + '/' + cast(annee nvarchar(4)) datetime)) <= eomonth(cast( cast(t2.mois nvarchar(2))+ '/' + '01' + '/' + cast(t2.annee nvarchar(4)) datetime)) , [group] = t2.[group] ) total olap.td_all_accounts t2 the "total" column not recognized. can't manage name table resulting select t3 , use in set "total_accounts = t3.total" thank in advance. something should trick (change idcolumn row identifier), though urge take lad2025 comment consideration. update t set total_accounts = total dbo.td_total_accounts t inner join ( select idcolumn, annee, mois,[group], ( select sum(accounts_number) olap.td_all_accounts eomonth(cast( cast(mois nvarchar(2))+ '/' + '01' + '/' + ...

lua - Why luci can not execute dispatcher target for entry -

Image
i new in luci/lua,work on luci 15.05-154-gb81a22b , lua 5.1 face problem execute view show me bellow error controller syntax bellow e=entry({"admin","network","macclone"},arcombine(template("admin_network/mac_clone")),_("macclone"),14) e.leaf=true controller call view page. view <%# copyright 2008-2009 steven barth <steven@midlink.org> copyright 2008-2015 jo-philipp wich <jow@openwrt.org> licensed public under apache license 2.0. -%> <%-+header-%> <div id="cbi-network"> <h2>hello</h2> </div> <%-+footer-%> view execute error why error appear?how solve error? note: header load necessary css files like:bootstrap it says cant find template admin_network/mac_clone. need add model page mac_clone. change arcombine(template("admin_network/mac_clone")) cbi("mac_clone")

Spring security 4 custom jdbc authentication -

i'm using spring boot, spring mvc 4, spring security 4 , mysql data store new web app , have 2 questions i've never used spring security before, after seeing it, have question regarding queries used find users' authorities: why use username instead of user id. mean searching authorities based on user id faster , gives ability change username in future. tried overload usersbyusernamequery , authoritiesbyusernamequery use user id didn't work (and if works, name of method bugging me) .. please can explain me why used username? in previous php web apps worked on, used store salt in db along password if want use bcrypt .. notice not required have column in spring .. salt part of encryption , spring internally knows how use shouldn't worry number of iterations, cost , salt storing? 1) not understand question since if have find authorities of user called "quentin", how know id of "quentin" ? please have @ query use retrieve user @ lo...

c# - WebClient DownloadString not getting all the information -

i'm trying following: string url = @"https://picasaweb.google.com/data/feed/api/user/bladibla?thumbsize=206c"; webclient myclient = new webclient(); string picasaxml = myclient.downloadstring(url); when go url (which not real url ofcourse, "bladibla" not actual username), see information. when @ picasaxml, i'm missing parts of information. xml-sections missing in document. can me? -- update -- real url : https://picasaweb.google.com/data/feed/api/user/tim@boerenbond.be?thumbsize=206c if go url, should lot of information, including names of photoalbums created there. when run code displayed higher, i'm not getting information. ok, noticed when go page on machine, i'm not getting info either.

Using RoutingHTTPServer to redirect iOS mdm configuration profile? -

using native ios app setup mdm device takes user out of app load safari initiate mdm configuration profile installation , returns safari. what do, return application. i know can done routinghttpserver documented here can't seem mdm configuration profile post request work it. any help, appreciated. using code in other post @xaphod, got working below it's still not good. basically need safari load profile, user installs profile clicks done , when safari re-opens direct user app. i don't think can done, maybe best workaround hosting webpage redirection app. start server , setup routes self.firsttime = true; self.httpserver = [[routinghttpserver alloc] init]; [self.httpserver setport:8000]; [self.httpserver handlemethod:@"get" withpath:@"/start" target:self selector:@selector(handlemobileconfigrootrequest:withresponse:)]; [self.httpserver handlemethod:@"get" withpath:@"/load" target:self selector:@selector(h...

java - Modified classes are not picked by Tomcat -

i have modified few classes (like hiveconnection.class, hivedatabasemetadata.class, hiveresultsetmetadata.class, hivestatement.class) in hive-jdbc-0.13.1-cdh5.3.3.jar , , created new jar contains modified classes , named 0_modified_hive_jdbc.jar . those classes has overriden methods throwing method not supported exception. instead created class in same name, logged message, , not throwing exception. placed hive-jdbc-0.13.1-cdh5.3.3.jar inside tomcat/lib (because org.apache.hive.jdbc.hivedriver referred driver name jndi in server.xml) i have placed external jars this, /home/nages/external_jar/0_override/0_modified_hive_jdbc.jar /home/nages/external_jar/hive/hive-jdbc-0.13.1-cdh5.3.3.jar /home/nages/external_jar/others/commons-lang-2.5.jar /home/nages/external_jar/others/spring-beans-2.5.3.jar /home/nages/external_jar/others/spring-context-2.5.3.jar /home/nages/external_jar/others/spring-core-2.5.3.jar /home/nages/external_jar/others/spring-jdbc-2.5.3.jar /home/nages/extern...

javascript - How to Retrieve Cookie Value using Jquery JS Cookie -

i using jquery cookie plugin called js cookie , happens unable retrieve data or value in cookie. store value of cookie inputted on text box , retrieve in text field when page visited again. $(document).ready(function() { var cookie_email = cookies.get('user_email'); $('#email_address').val(cookie_email); $('#test_button').click(function() { cookies.set('user_email', email_address, { expires: 365 }); }); }); https://jsfiddle.net/mue1amcm/ your code doesn't work don't assign email_address variable anywhere. should change value use $('#email_address').val() . also note jsfiddle isn't setup correctly; url external cookie script goes github page. need use cdn link instead. try this: var cookie_email = cookies.get('user_email'); $('#email_address').val(cookie_email); $('#test_button').click(function() { cookies.set('user_email', $('#...

c# - Is there a way to create javascript prototype from json? -

i have webapi expose successfull json formed response. i have found more , more code use services javascript , return generic json object. i convert json object javascript prototyped object , before of that, create (one time) prototype code directly json response. so, there way achive target? (i have server side .net objects , access code, wouln't use time write dto objects manually). the single json isn't relevant, example: {"menu": { "id": "file", "value": "file", "popup": { "menuitem": [ {"value": "new", "onclick": "createnewdoc()"}, {"value": "open", "onclick": "opendoc()"}, {"value": "close", "onclick": "closedoc()"} ] } }} i generate it's prototype, as function menu() { this.id= ''; this.value= ''; th...

.net - How to update absolute expiration of existing cache items in MemoryCache.Default -

i using c# , .net , have cacheitem stored in memorycache.default. all want update absolute expiration without reinserting it. i want cacheitem , update expiration. any appreciated. i have found it. there 'set' method in memorycache object. thank all.

javascript - trigger a spacebar click on a textarea programatically -

this textarea <textarea id="areadata" ng-model="mydata">{{data}}</textarea> please how can add spacebar event on textarea click/trigger button <button type="button" class="btn btn-danger" ng-click="spaceevent">add space bar event</button> i trying use not getting right $timeout(function() { angular.element('#areadata').triggerhandler('click'); }, 100); if understood add space char textarea data when hit button: app.controller('dummy', function($scope) { $scope.spaceevent = function () { $scope.mydata += " "; }; }); <div ng-app="app" ng-controller="dummy"> <textarea id="areadata" ng-model="mydata"></textarea> <button type="button" class="btn btn-danger" ng-click="spaceevent()">add space bar event</button> </div> jsfiddle remembe...

caching - Varnish: purge cache every time user hits "like" button -

i need implement like/dislike functionality (for anonymous users there no need sign up). problem content served varnish , need display actual number of likes. i'm wondering how it's done on website stackoverflow. assuming pages cached in varnish (for anonymous users only), every time user votes on answer/question, page needs purged cache. right? current number of votes needs visible other users. what approach in situation? should send purge varnish every time user hits "like" button? a common way of implementing button , display client side in javascript instead. avoids issue slightly. assuming pressing leads post request hitting single varnish server, can make object invalidated/replaced in different ways. using purge , vcl restart better way this. of course there slight race here, other clients served old page while ongoing.

xaml - Wait for binding update, then lose focus on ListViewItem -

Image
so have listview . has itemsource , selecteditem . the selecteditem has bool property toggles visibility of button , textbox . when press in listviewitem want able toggle visibility on , off, if spam row. the solution partly working, except selecteditem fired when item don't have focus. when have toggled 1 time, have item toggle first again. i have thought code-behind , add gotfocus -method, can't think of have there. suggestions ? xaml: <listview scrollviewer.verticalscrollmode="disabled" scrollviewer.verticalscrollbarvisibility="disabled" scrollviewer.isverticalrailenabled="false" background="white" itemssource="{binding activities}" selecteditem="{binding selectedactivity, mode=twoway}"> <listview.itemcontainerstyle> <style targettype="listviewitem...

ios - No Matching provisioning profile found in Xcode continuous integration (Xcode 7.2) -

Image
issue : have setup continuous integration of xcode server in app when integrate bot got above error. i have seen lots of post on , find out need setup provisioning profile in /library/developer/xcodeserver/provisioningprofiles not able find out location. please see also in have setup xcode server following http://useyourloaf.com/blog/continuous-integration-with-xcode-server/ link. i have seen provisioning profile here , reset , downloaded them again still no luck. checked path showing provisioning profile folder in red. why ? thanks.

.htaccess - Removing public form laravel url? -

i removing public laravel url using .htaccess writing code on htaceess file <ifmodule mod_rewrite.c> rewriteengine on rewriterule ^(.*)$ public/$1 [l] </ifmodule> htacces file in root of laravel , mode_rewrite enable after getting error sorry, page looking not found. can still welcome page http://localhost/laravel/public/ please solve issue your web server configuration wrong. should point web server public directory. for example, if you're using apache, should set this: <virtualhost *:80> servername myapp.localhost.com documentroot "/home/vagrant/projects/myapp/public" <directory "/home/vagrant/projects/myapp/public"> allowoverride </directory> </virtualhost> in xammp, mamp, openserver etc. need change root directory laravel's public directory. also, don't forget restart web server make work.

php - October CMS backend list's column get array key value -

hi i'm new october cms . have defined below shown method in model class. method used show select options in backend form. method returns array key value similar field value in db. have defined method static because recommended in front end function , process db record , iterate show value of array matches key. works fine. thing in columns.yaml file, how list method's array value matches db record did in front end. public static function getsampleoptions() { return[ '1'=>'sample1', '2'=>'sample2' ]; } hello friends found answer october cms help/support http://octobercms.com/index.php/forum/post/dropdown-shows-its-value-than-key-name-in-list-controller , referred few concepts of laravel. model class method public static function getsampleoptions() { return[ '1'=>'mobile app', '2'=>'web app' ]; } columns.yaml file sample: ...

ios - Disable the Auto selection of text on UITextView by keyboard's auto correction -

Image
i'm trying disable auto selection of text in uitextview, auto selection automatically collects text keyboard's auto correction. whereas want keep auto correct on keyboard too, auto correction text should applied uitextview , if selects tapping on on auto correction tool bar. here, can see in above image, 'paulm' automatically selected , shown related auto correction 'palm' on keyboard. i'm selecting @paulmkarcher above resultant filtered tableview unfortunately ends '@palm karcher' in uitextview. it's automatically fetching 'palm ' value auto correction, should selected tap only. thanks in advance. i'd guess have make smart implementation delegate metod textview:shouldchangetextinrange:replacementtext: this documented in apple docs the description method following: asks delegate whether specified text should replaced in text view. an example of simple implementation be; if word editing begins ...

javascript - How to add a method to module express() with using util? -

i trying expand express module, , add method. use util module piece of code: var expressapplication = require('express'); var util = require('util'); function application() { expressapplication.apply(this, arguments); this.handlers = {}; } util.inherits(application, expressapplication); //add method application.prototype.write = function(data) { console.log(data) }; then call it: var app = new application(); //check inheritance console.log(app instanceof expressapplication); // true console.log(application.super_ === expressapplication); // true //and check work method console.log(app.write('test')); console.log(app.use) /// ---> error!!! but when want call method of express - not available me, console.log(app.use) has error app.use not function please tell me wrong, fix problem? alternatively, instead auditioned express koa, there practiced. thanks! the function exported require('express') merely factory f...

Wordpress php issue with creating custom filter -

i'm new working filters, keen make plugin building extensible. in main plugin have following class , function: class skizzar_admin_theme_pages { // return (array) properties of skizzar admin theme admin pages static function get_pages( $page_slug = '' ) { $pages = array(); // default page properties $default_args = array( 'menu-title' => '', 'tab-title' => '', 'parent' => 'admin.php', 'in-menu' => false, 'has-tab' => true, 'tab-side' => false, 'top-level' => false, ); $pages['sat-options-general'] = array_merge( $default_args, array( 'slug' => 'sat-options-general', 'menu-title' => _x( 'admin theme', 'page title in menu', 'skizzar_admin_theme' ), 'tab-title' => _x( ...

java - How to make Rest API call to application when i deploy in Websphere server? -

i able deploy jax-rs jersey application websphere server when make sample rest rest api call , giving follow error . url : http://:9080//hello/santhosh web.xml <servlet> <servlet-name>jersey-serlvet</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>com.mkyong.rest</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jersey-serlvet</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> error : error 404: java.io.filenotfoundexception: srve0190e: file not found: /hello/santhosh. how can fix issue? when deploy application on server have name (at least name of war file). let assume application d...

oracle - Date format while importing table in sql developer -

i trying import details csv file creating through bi publisher query table. in query , have date formatted column: effective_start_date 1951-01-01t00:00:00.000+00:00 1901-01-01t00:00:00.000+00:00 now when importing entire table in excel. how should import in sql developer in such way date format comes 'dd-mon-yyyy' right few records date getting imprted in table null ! also targer column format not editable screen in sql devleoper oracle setup : create table test_load ( id int, effective_start_date date ); csv : id,effective_start_date 1,1951-01-01t00:00:00.000+00:00 2,1901-01-01t00:00:00.000+00:00 import (sql developer 4.1.0.19) : in connections panel, right-click on table name , choose "import data..." browse csv file click "next >". select "insert script" insert method , click "next >". click "next >" accept default selected columns. in column definitions, effective_start_date...

c# - Adding an Existing Solution that was Previously a NuGet Package into a Single Solution -

i'm working on stabilizing rather old website development can resume on adding new features. previous implementers had rather strange approach modularity - heart in right place, execution was... off. there's 1 "main" solution, - front end guy, typically work with. includes web project served iis. lot of (pretty all) end stuff however, brought in via nuget package private nuget server (teamcity) now. seems kind of nice , modular until have make backend change. previously, if backend change required, team make change in backend solution, , commit , republish entire package. front end solution must update nuget package on it's end in order receive changes. this nightmare... i won't start on version control situation. lets branching hasn't been known concept here number of years. i'm here put on straight , narrow. i wondering if has had experience adding , existing project solution nuget package. added entire backend solution , removed nuget...

how to write properly terminal command in objective c -

i have run command kill process , command kill pgrep -f /dev ,i know run command nstask used how run above command these special arguments , pgrep -f /dev in `` have tried code nstask *task = [[nstask alloc]init]; [task setlaunchpath:@"/bin/kill"]; [task setarguments:@[@"`",@"pgrep",@"-f",@"/dev",@"`" ]; [task launch]; please tell how write properly,i know have given arguments wrong. thanks, highly appreciated. your problem appears lie in misunderstanding how command line handled. when type line: kill `pgrep -f /dev` you typing shell , bash tcsh etc. quotes (`) shell feature; shell arrange run both commands , take output of pgrep , pass arguments kill . in code attempting execute kill , pass arguments quoted pgrep command. won't work, kill knows nothing quotes, shell feature... so read shell documentation ( man sh ) , discover can pass shell command line single argument shell command - ...

php - mysql query to fetch these results -

i have 3 tables 1. project_ref_table columns project_id(pk) project_name client_id(fk) project_description and 2. client_ref_table column client_id(pk) client_name client_email client_address 3. emp_ref_table emp_id(pk) emp_name emp_address project_id(fk) dept_id suppose user login emp_id manager , need fetch client list project this client_name|client_email|client_address|project_name you have join 3 tables emp_ref_table, project_ref_table , client_ref_table. select c.client_name, c.client_email, c.address,p.project_name emp_ref_table e, project_ref_table p, client_ref_table c e.project_id= p.project_id , p.client_id = c.client_id , e.id = current_user_id current_user_id = current manager user id.

A fast RSS Feed for twitter? -

i'm trying rss feed twitter implement in rss reader desktop , website. tried queryfeed.net , twitrss.me updates veery slow. on queryfeed takes 3 hours , twitrss it's 30min-1hour. the problem twitter deals, , deals have 20 or 30min duration. thank you!

ios - Named capture groups in NSRegularExpression - get a range's group's name -

apple says nsregularexpression based on icu regular expression library: https://developer.apple.com/library/ios/documentation/foundation/reference/nsregularexpression_class/ the pattern syntax supported specified icu. icu regular expressions described @ http://userguide.icu-project.org/strings/regexp . that page (on icu-project.org) claims named capture groups supported, using same syntax .net regular expressions: (?<name>...) named capture group. <angle brackets> literal - appear in pattern. i have written program gets single match multiple ranges seem correct - though each range returned twice (for reasons unknown) - information have range's index , text range. for example, regex: ^(?<foo>foo)\.(?<bar>bar)\.(?<bar2>baz)$ test string foo.bar.baz gives me these results: idx start length text 0 0 11 foo.bar.baz 1 0 3 foo 2 4 3 bar 3 8 3 ...