Jump to content

sen5241b

Members
  • Posts

    28
  • Joined

  • Last visited

  • Days Won

    1

sen5241b last won the day on May 30 2021

sen5241b had the most liked content!

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sen5241b's Achievements

Member

Member (2/5)

1

Reputation

  1. Yes the engine should’ve been the Focus on the post. There is nothing new about the idea of a data agnostic processing engine that takes only metadata and a few snippets of code to produce the same output that a dedicated app would otherwise produce. ServiceNow has a feature called Workflows, that requires only data definitions and a few snippets of code to produce the same output that a dedicated App would produce.
  2. The problem? I'm writing a lightweight data agnostic processing engine (engine doesn't care what kind of data its proccessing). It enables user to get items from a data catalog and add to it by simply adding new catalog items. I want to pass local vars from the agnostic engine controller to the engine processor which sort of goes against the whole concept. Its a work in progess..
  3. sorrry my previous code was not enough PSEUDO CODE: get all vars noth local and global get them all again right before you need an array of local vars compare 2 arrays -- what vars are new?pseudo logic: An easier way? <?php /* get all vars local and global get them all a 2nd time -- compare 2 arrays -- what vars are new? */ error_reporting(E_ALL); ini_set('display_errors', '1'); $varY = 4433449; // should NOT diplay s local var $InitialGLOBALS = get_defined_vars(); unset($InitialGLOBALS['GLOBALS']); // unsetting these avoids recursion, true? unset($InitialGLOBALS['_GET']); // these too? unset($InitialGLOBALS['_POST']); unset($InitialGLOBALS['_FILES']); unset($InitialGLOBALS['_COOKIE']); $ALocalVar = 'WASSUP!'; DefineVars(); $LocalAndGlobalVars = get_defined_vars(); unset($LocalAndGlobalVars['GLOBALS']); // avoids recursion unset($LocalAndGlobalVars['_GET']); unset($LocalAndGlobalVars['_POST']); unset($LocalAndGlobalVars['_FILES']); unset($LocalAndGlobalVars['_COOKIE']); unset($LocalAndGlobalVars['InitialGLOBALS']); $LocalVars = array_diff_key($LocalAndGlobalVars, $InitialGLOBALS); echo '<br>'; echo '<br> local vars='; echo '<br>'; print_r($LocalVars); echo '<br>'; exit('fin'); function DefineVars() { $NotALocalVar = 5569.6666234; // should never display } ?>
  4. Tried $LocalAndGlobalVars = get_defined_vars(); $LocalVarsOnly = return array_diff_key($LocalAndGlobalVars, $GLOBALS); var_dump($LocalVarsOnly); no dice.
  5. Yes, I meant without ArrayIterator it won't work. Also for loop works for ($x = 0; $x < 10; $x++) { if ($x == 5) array_push($arr, "fred"); }
  6. For makes copy of array and works off of the copy. Appended elements are added to array but not to the time copy. You cannot process the appended elements in the initial for loop. <!DOCTYPE html> <html> <body> <?php $ptr = 0; $colors = array("red", "green", "blue", "yellow"); $colors[] = 'pink'; foreach ($colors as $key => $value) { echo "$key <br>"; echo "$value <br>"; if ($key == 1) { $colors[] = 'purple'; } } echo '<br>'; print_r($colors); ?> </body> </html>
  7. <!DOCTYPE html> <html> <body> <?php $colors = array("red", "green", "blue", "yellow"); foreach($colors as $x => $value): echo "$value <br>"; if ($x == 1) $colors[] = "pink"; endforeach; ?> </body> </html> Getting error PHP Parse error: syntax error, unexpected '$colors' (T_VARIABLE) in /home/KhtmoB/prog.php on line 10
  8. Did a little research. A ServiceNow sys_id is a 32 character universally unique ID (UUID). The Servicenow sys_id Is however a little bit different than a typical UUID. The sys_id must be combined with the table name to uniquely identify a specific record in any Servicenow database anywhere in the world. i’ve never written a UUID generator but I can tell you that none of them are perfect. GUID and UUID are the same thing. They’re are plenty of PHP algorithms to generate UUIDs out there.
  9. I worked with ServiceNow for many years. They have a very interesting database. Every record in the entire data base has a field called the sysid. This number combined with a table name makes that record unique amongst all the ServiceNow databases in the entire world. if you transfer a data record from your ServiceNow database into any other ServiceNow database in the world that sysid will remain the same. i’m trying to create a function to do this with PHP. how would you even do that?
  10. If you are asking for citations and you don't think efficient CPU usage has higher priority these days you don't understand the issue. A list of inefficient PHP functions is a reasonable request. PHP can't measure CPU accurately. Google apparently has cumulative CPU usage at org and project level. . I've not looked at all cloud provider tools. My cloud provider doesn't provide tools to measure CPU at at a granular level. Citations https://blog.tomilkieway.com/72k-1/ https://www.electropages.com/blog/2021/01/how-start-received-75000-bill-2-hours-google-cloud-services https://medium.com/milkie-way/we-burnt-72k-testing-firebase-cloud-run-and-almost-went-bankrupt-part-1-703bb3052fae https://www.reddit.com/r/aws/comments/g1ve18/i_am_charged_60k_on_aws_without_using_anything/ Other on topic links: https://feedback.azure.com/forums/170030-signup-and-billing/suggestions/3238796-spending-limit-or-maximum-cost-cap-for-azure https://feedback.azure.com/forums/170030-signup-and-billing/suggestions/3238796-spending-limit-or-maximum-cost-cap-for-azure https://cloud.google.com/billing/docs/how-to/view-linked
  11. I have questions but I also have some good info to share about putting your software in the cloud. The situation: Some of you may have read about the nightmare stories. A developer had a infinite loop in his code that ran all night. This code did things inefficiently that devoured CPU in each iteration. This developer, greatly skilled, opened his email the next morning and saw a email bill from his cloud provider totaling for $75K. True story. Most cloud providers let you define CPU usage thresholds that, when breached, send you a warning but these thresholds, if I understand them, are per account. It would seem the claim that cloud resources are available in whatever amounts you need, CPU, disk space, enough RAM to never have to wait on a page faults, etc... the claim that the cloud provides you with infinitely elastic resources in an "all you can eat for one price" contract smells just a like a little like 💩 I did cloud development for many years with ServiceNow starting when it was a help desk and I watched it evolve into one of the best cloud development platforms out there. At one customer site I installed and managed it it out of the cloud and saw its insides and I can tell you its core code is not so terribly efficient. IMHO the cloud DOES take away 90% of a developer's worries about app performance.. If you call ServiceNow tech support and your problem is diagnosed as a performance issue with your code the first thing they will ask you is "did you follow the developer best practices"? They will politely say "sorry. Here's a link to them implying "fix your code". Questions: PHP Functions that devour CPU and where there is a better way? What PHP functions or code techniques waste CPU? I am using similar_text and it does the job but it is slow. Better way? What is the best way to measure CPU used by a PHP script or by a particular code module, defined as a set of related functions that fulfill a common purpose or by a single line of code? The purpose being to identify inefficient modules of code and improve them and even if the code is damn near perfect then at least can know what code modules are the most expensive. CPU killin users (and developers too), how can they be identified? I need to store data on cumulative CPU usage for any of the above and compare it with the free amount they give you and warn CPU hogs before they breach a threshold and generate $75K bills that were not in the plan. Any info you have on avoiding surprise $75K CPU bills from a cloud provider are welcome It would seem the
  12. Downloaded and glanced at Firefox developer edition. It did not seem to have unique features that. Did I miss something? Are there PHP plugins that make it magic?
  13. Chrome? Edge? Other? Had a bad experience with Edge. If development tools make one better than the other - what tools? And if you are using PHPStorm maybe the choice of browser is less important? No?
  14. I am trying to develop a UI using PHP., html, css and javascript. I have an app with a lot of HTML tables. I'd like to be able to reduce the size of the HTML tables and have one table come into focus at larger size when selected the same way windows task view works. Have you seen a web UI like this? Is there a template for it?
  15. Do you use the OS userids or do you keep them separate in MYSQL? Must users login to a website and request a token to use for REST API requests? Did you use a framework provided method? I need something ultra-simple
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.