Skip to main content

Notes on old CI 2

 https://stackoverflow.com/questions/41789659/only-variables-should-be-assigned-by-reference-with-function

From DotENV

$quote        = $value[0];
            $regexPattern = sprintf(

                    '/^
                    %1$s          # match a quote at the start of the value
                    (             # capturing sub-pattern used
                                  (?:          # we do not need to capture this
                                   [^%1$s\\\\] # any character other than a quote or backslash
                                   |\\\\\\\\   # or two backslashes together
                                   |\\\\%1$s   # or an escaped quote e.g \"
                                  )*           # as many characters that match the previous rules
                    )             # end of the capturing sub-pattern
                    %1$s          # and the closing quote
                    .*$           # and discard any string after the closing quote
                    /mx', $quote
            );
            $value        = preg_replace($regexPattern, '$1', $value);
            $value        = str_replace("\\$quote", $quote, $value);
            $value        = str_replace('\\\\', '\\', $value);

Word processing or regex (in Compiler computing science) always look compact but powerful and require much of evolution work. 


https://stackoverflow.com/questions/4197976/codeigniter-disallowed-key-characters

https://perspectives.mvdirona.com/2008/06/facebook-needle-in-a-haystack-efficient-storage-of-billions-of-photos/
http://highscalability.com/flickr-architecture

Some CI convention and naming suggest along with subfolder creation.

https://stackoverflow.com/questions/16970803/correct-naming-structure-for-codeigniter

https://stackoverflow.com/questions/42043193/codeigniter-loading-model-from-different-subfolder

https://stackoverflow.com/questions/13955335/routing-controllers-in-subfolders-using-codeigniter


https://serverfault.com/questions/150249/best-way-to-troubleshoot-apache-not-starting

wth

I forgot turn off php7.0 before a2enmod php5.6 and then Apache failed to start.

Too dump on me ! But I think when I enable php5.6 via a2enmod I guest Apache will auto disable others but it is not.

Anyway, I remember ls /etc/apache2/mods-enabled/ to double check.

https://betterembsw.blogspot.com/2010/05/only-10-lines-of-code-per-day-really.html#:~:text=It's%20pretty%20typical%20for%20solid,LOC%20per%20day%20per%20developer.


Only 10 lines of code per day. Really??

If you want to estimate how long it's going to take to create a piece of embedded software (and how much it will cost), it's useful to have an idea of how productive you're going to be. Lines of code written per day is a reasonable starting point for this. It's a crude metric to be sure. If you have enough experience that you can criticize this metric you probably don't need to read further. But if you are just starting to keep count, this is a reasonable way to go. For tallying purposes we just consider executable code, and ignore comments as well as blank lines.


It's pretty typical for solid embedded software to come in at between 1 and 2 lines of code (LOC) per developer-hour. That's 8 to 16 LOC per developer each day, or about 2000-4000 LOC per year.


If you want just a single rough number, call it 10 LOC per day per developer. This is relatively language independent, and is for experienced developers producing code that is reasonably reliable, but not intended to be safety critical.


Wow, that's not much code, is it? Heck, most of us can recall cranking out a couple hundred lines in an evening when we were taking programming courses. So what's the deal with such low numbers?


First of all, we're talking about real code that goes into real products, that actually works. (Not kind-of sort-of works like student homework. This stuff actually has to work!)


More importantly, this is the total cost for everything, including requirements, design, testing, meetings, and so on. So to get this number, divide total code by the total person-hours for the whole development project. Generally you should leave out beta testing and marketing, but include all in-house testers and first-level technical managers.


It's unusual to see a number less than 1 LOC/hour unless you're developing safety critical code. Up to 3 LOC/hour might be reasonable for an agile development team. BUT, that 3 LOC tends to have little supporting design documentation, which is a problem in some circumstances (agile+embedded is a discussion for another time). It's worth mentioning that any metric can be gamed, and that there are situations in which metrics are misleading or useless. But, it's worth knowing the rules of thumb and applying them when they make sense.


Generally teams with a higher LOC/day number are cutting corners somewhere. Or they are teams composed entirely of the world's most amazing programmers. Or both. Think about it. If your LOC/day number is high, ask yourself what's really going on.

double check teamvw https://www.programmersought.com/article/24703132590/

it seem show error msg but still work.


https://softwareengineering.stackexchange.com/questions/329738/questions-to-ask-a-developer-about-legacy-code-before-they-leave


https://martinfowler.com/ieeeSoftware/coffeeShop.pdf

https://itrevolution.com/commitment-engagement-is-not-enough/


Load library in __construct() ?

https://www.quora.com/In-CodeIgniter-if-I-load-a-library-with-this-load-library-x-is-that-library-available-only-in-the-current-controller-instance-or-everywhere

I think if library only used once then it should be load in function(), in controller then load in __construct() and if whole or used in many controller => autoload.


https://stackoverflow.com/questions/6805426/how-to-move-columns-in-a-mysql-table/6805436


https://stackoverflow.com/questions/21988581/write-utf-8-characters-to-file-with-fputcsv-in-php


=> Grab some new config in this post then noted it.
https://stackoverflow.com/questions/38538859/xampp-virtual-hosts-not-working

Comments

Popular posts from this blog

AWS Elasticache Memcached connection

https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/accessing-elasticache.html#access-from-outside-aws http://hourlyapps.blogspot.com/2010/06/examples-of-memcached-commands.html Access memcached https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/GettingStarted.AuthorizeAccess.html Zip include hidden file https://stackoverflow.com/questions/12493206/zip-including-hidden-files phpmemcachedadmin ~ phpMyAdmin or phpPgAdmin ... telnet mycachecluster.eaogs8.0001.usw2.cache.amazonaws.com 11211 stats items stats cachedump 27 100 https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/VPCs.EC.html https://lzone.de/cheat-sheet/memcached VPC ID Security Group ID (sg-...) Cluster: The identifier for the cluster memcached1 Creation Time: The time (UTC) when the cluster was created January 9, 2019 at 11:47:16 AM UTC+7 Configuration Endpoint: The configuration endpoint of the cluster memcached1.ahgofe.cfg.usw1.cache.amazonaws.com:11211 St...

Notes Windows 10 Virtualbox config, PHP Storm Japanese, custom PHP, Apache build, Postgresql

 cmd => Ctrl + Shift + Enter mklink "C:\Users\HauNT\Videos\host3" "C:\Windows\System32\drivers\etc\hosts" https://www.quora.com/How-to-create-a-router-in-php https://serverfault.com/questions/225155/virtualbox-how-to-set-up-networking-so-both-host-and-guest-can-access-internet 1 NAT + 1 host only config https://unix.stackexchange.com/questions/115464/how-to-properly-set-up-2-network-interfaces-in-centos-running-in-virtualbox DEVICE=eth0 TYPE=Ethernet #BOOTPROTO=dhcp BOOTPROTO=none #IPADDR=10.9.11.246 #PREFIX=24 #GATEWAY=10.9.11.1 #IPV4_FAILURE_FATAL=yes #HWADDR=08:00:27:CC:AC:AC ONBOOT=yes NAME="System eth0" [root@localhost www]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 # Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth1 IPADDR=192.168.56.28 <= no eff => auto like DHCP #GATEWAY=192.168.56.1 #BOOTPROTO=dhcp BOOTPROTO=static <= no eff ONBOOT=yes HWADDR=08:00:27:b4:20:10 [root@localhost www]# ...

Rocket.Chat DB schema

_raix_push_notifications avatars.chunks avatars.files instances meteor_accounts_loginServiceConfiguration meteor_oauth_pendingCredentials meteor_oauth_pendingRequestTokens migrations rocketchat__trash rocketchat_cron_history rocketchat_custom_emoji rocketchat_custom_sounds rocketchat_import rocketchat_integration_history rocketchat_integrations rocketchat_livechat_custom_field rocketchat_livechat_department rocketchat_livechat_department_agents rocketchat_livechat_external_message rocketchat_livechat_inquiry rocketchat_livechat_office_hour rocketchat_livechat_page_visited rocketchat_livechat_trigger rocketchat_message rocketchat_oauth_apps rocketchat_oembed_cache rocketchat_permissions rocketchat_raw_imports rocketchat_reports rocketchat_roles rocketchat_room rocketchat_settings rocketchat_smarsh_history rocketchat_statistics rocketchat_subscription rocketchat_uploads system.indexes users usersSessions https://rocket.chat/docs/developer-guides/sc...