jimmck

Experience

61,815

52 Best Reply Awards

  • Member Since 4 Years Ago
  • 7 Lessons Completed
  • 1 Favorite

7th May, 2018

jimmck left a reply on Putting Model Data Into More Than One Tables • 1 month ago

@saadaan The proper way to describe that matrix is 8x250. Its important to use proper terms. No real reason why this would be in a database. If its a fixed dimension randomly accessed file should suffice. Floating point numbers don't index or search in a database.

6th May, 2018

jimmck left a reply on Putting Model Data Into More Than One Tables • 1 month ago

@saadaan Describe the data arrangement of the matrix. Its 250 columns by 8 rows? What do the 8 rows represent? And columns? Are the 8 rows distinct? There are many ways to represent a matrix in a database schema.

25th April, 2018

jimmck left a reply on Can't Turn An Object Into An Array. • 1 month ago

This object has private, protected or public data members only a constructor which takes an array and a method to iterate the array.

19th April, 2018

jimmck left a reply on Slow MySQL Query With Laravel Eloquent • 1 month ago

@rafito Your query is doing a count and checking if 2 other selects have any rows? Since I don't know your data sets why are you doing the exists at all? Either the count result will be zero or > 0. The 2 exist selects seem to filter a result set? What is the main driving table in relation to these 2 exist sub-queries? Just creating indexes to speed up a query can hurt the overall performance of your database. Proper indexes will help the optimizer limit the table scan, too many indexes can force a full table scan. Do SQL Explain plan on this query to see what the optimizer will do.

17th April, 2018

jimmck left a reply on PHP Fatal Error Says Exception\Handler Does Not Exist In An Essentially New Laravel Build • 2 months ago

What is the name of the class in $concrete? composer.json file is not shown. No stack trace? As already stated debugger or put a dd in Container.php ( you can clean it later).

16th April, 2018

jimmck left a reply on Laravel 5.2 -> Laravel 5.6 Framework Upgrade • 2 months ago

@joshuabedford I use many libraries from the collective and they run fine in 7.1. Main issues I have is PHP code written for 4.x or early 5. Code written in a less (OOP) style in older PHP naming conventions will generate many warnings and will fail silently in certain situations (like pass by ref vs. pass by value) and packages not using Use causing namespace collisions.

jimmck left a reply on MCrypt Deprecation Warning Breaks File Upload - PHP7.1 MCrypt Laravel 5.2 • 2 months ago

@joshuabedford Glad you got it going. The "Composer Fire Dance" is very important to understand. When I first started using this it was frustrating and seemed stupid. Learning the tool saved time, help find problems and fix them. You should do the upgrade to 5.6 yourself to learn the Laravel environment. What are your deprecated features you depend on (Laravel deprecated they die hard and FAST)? If you are using 7.13 already good. Otherwise you have PHP remediation to do in order to move PHP 7.13.

5th April, 2018

jimmck left a reply on MCrypt Deprecation Warning Breaks File Upload - PHP7.1 MCrypt Laravel 5.2 • 2 months ago

@joshuabedford You cannot use mcrypt. A link in the article I posted when to another report. Did you read that? What is the OpenSSL version in your installation. I had many such incidents when moving to 7.x You have look at the code and the 7.x release notes and mitigate it.

https://github.com/phpseclib/phpseclib/issues/1134

There are no magic solutions.

Dont publish the whole stack trace, the first 25 lines will work. What versioin of phpspec are you using same with OpenSSL.

27th December, 2017

jimmck left a reply on Extending A Vendor Package • 5 months ago

Well you can fork it. Put it into your own repository and reference that instance in your. Remove the original package.

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/jimmck/MyUtils"
        }

14th December, 2017

jimmck left a reply on Setting Up The Command Line In PHPStorm / Windows / Homestead • 6 months ago

https://confluence.jetbrains.com/display/PhpStorm/Laravel+Development+using+PhpStorm

If things don't seem synced, remember to 'Synchronize your project after updates.

Right click on the top of the project tree in the project pane on the left side to get menu and select Synchronize name.

jimmck left a reply on Phpstorm Command Line Tools And Vagrant / Homestead(SSH) • 6 months ago

https://confluence.jetbrains.com/display/PhpStorm/Laravel+Development+using+PhpStorm

If things don't seem synced, remember to 'Synchronize your project after updates.

Right click on the top of the project tree in the project pane on the left side to get menu and select Synchronize name.

12th December, 2017

jimmck left a reply on Adding 0.000005 To 0.000005? • 6 months ago

@13en Are you trying to update all of the rows in your DB where the cost is > .0000005 + .000005 ? Using a formula as a part of a where clause? My initial thought was/is can't work. But apparently in MySQL there is way. Which looking at the solution with an alias and HAVING seems interesting. Note I have not tried this yet, going to to so as its interesting. Remember Eloquent is an ORM not an extension to SQL. All Eloquent code turns into SQL and may further process the returned result sets. Of course any searches apply to result sets. But interesting question! I will be check this further. Good Luck.

https://stackoverflow.com/questions/21353959/sql-query-by-adding-two-columns-in-where-clause

Here is search URL

https://www.google.com/search?q=mysql+where+clause+with+formula&oq=mysql+where+clause+with+formula&aqs=chrome..69i57.20663j0j7&sourceid=chrome&ie=UTF-8

10th December, 2017

jimmck left a reply on Will Laravel Have A Official Implementation Of Websockets (real-time)? • 6 months ago

Check out ZMQ works great with Rachet/PHP/Java/JS.

Not sure what you mean by official Laravel. You can many things.

http://zeromq.org/

6th December, 2017

jimmck left a reply on How To Render A Component When You Ajax The Html? • 6 months ago

@check202 Also check out Sue Drasner's excellent series on Vue.

https://css-tricks.com/intro-to-vue-1-rendering-directives-events

jimmck left a reply on How To Render A Component When You Ajax The Html? • 6 months ago

@check202 Hi. You don't really seem to understand Vue. Dynamic rendering is what it does. Jeff has a free and excellent video series on Vue. I suggest you start there. nextTick events by the way are part of the regular update cycle in Vue when it renders parts of the DOM which have changed.

28th November, 2017

jimmck left a reply on How To Mix Multiple Js In One? • 6 months ago

Jeff has a great Free video series on Webpack and laravel mix.

6th November, 2017

jimmck left a reply on Composer Help • 7 months ago

Now that we understand the problem. Here is how I pull my GIT packages. The projects composer.json

   },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/jimmck/MyUtils"
        },
        {
            "type": "vcs",
            "url": "https://github.com/jimmck/MyMongoDB"
        }
    ]
}

@Cronix !!!

jimmck left a reply on Composer Help • 7 months ago

Lookup the package on packagist.org and follow the install instructions. If there is no install for it don't put in the vendor directory.

5th November, 2017

jimmck left a reply on Adding A Space.... • 7 months ago

In sql

select first_name || ' ' || last_name as name ...

Double Pipe

||

Is the ANSI standard for concatenation in SQL.

1st November, 2017

jimmck left a reply on Laravel Frequently Showing 'Undefined Variable: _SERVER' • 7 months ago

Are you all working in the same shared laravel directory? I assume you are running one actual server instance not 4 off the shared directory?

30th October, 2017

jimmck left a reply on How Can I CONCATENATE. • 7 months ago

In SQL || "Pipe Pipe" concats separate DB columns.

select first_name || last_name as Name, age, city ...

27th October, 2017

jimmck left a reply on Pi (π) Button • 7 months ago

Prime number sieve function?

jimmck left a reply on Check For Duplicate Entry And Skip During Import? • 7 months ago

As @Snapey is asking, How many records to import? The database will be do this check for you with the constraint violation on import as shown (When fail next record from input is read). But as the master table table grows the time to insert will increase as each insert will take time to scan THE constraints. You can of course maintain an array of inserted records from the source and have the loader check this array before insert. Shorter list to check and in memory.

13th October, 2017

jimmck left a reply on Change Imported File Encoding In Laravel • 8 months ago

You cannot just change the encoding of a whole file. You have to parse the content. And Excel files are a Binary format you cannot try to convert a binary file like this. There is no "magic" way to do this.

12th October, 2017

jimmck left a reply on Combine Two Tables Into One Result Set. Merge/append/join • 8 months ago

@patrykszady Can you list the 2 table columns? If you want one result set you will need to join the 2 tables. Eloquent ORM will not solve this problem efficiently you will end up passing in a raw query. A SQL query will do the merge/append/join that you require that is what SQL is for. Are you using MySQL? This is probably a great use off a Group By with Rollup. You will get a result set with expected results. The ORM will be break this up into many queries and then attempt to merge data or worse leave you with a bunch on collections to manually combine. I know of only one reader of this forum who may be able to show an Eloquent way, but I have not seen him in a long time.

jimmck left a reply on Combine Two Tables Into One Result Set. Merge/append/join • 8 months ago

Hi, What are the columns for each table ? Is expense_splits.expense_id related to expenses.id meaning the splits table has many instances? What is the purpose for each table?

6th October, 2017

jimmck started a new conversation Fractional Units CSS GRIDS Video Is Not Free? • 8 months ago

In the CSS Grids series Fractional Units is not free? The others can be viewed?

30th September, 2017

jimmck left a reply on Vue Refs • 8 months ago

$refs point to Vue components. clockpicker is dependent on JQuery. If you want to port it you have to make it an actual Vue component. Or just use JQuery in your Vue app, its easily done. But JQuery components will not show up in your $refs array unless it is wrapped into Vue component.

29th September, 2017

jimmck left a reply on Vue Refs • 8 months ago

ref is used in creating a component. So your input needs to be wrapped in a Vue component.

<script type="text/x-template" class="mylistbox" id="listbox-template">
  <div class="complist">
    <div class="title-list_box">{{header}}</div>
    <select class="mylistbox" v-model="selected" v-on:change="onListSelect" v-on:keydown="onKeyDown"
      v-on:keyup="onKeyUp" id="list_box" :size="size" :multiple="multi ? '' : null">
      <option v-for="opt in selectOptions"
      v-bind:value="opt">{{opt.text}}</option>
  </select>
  </div>
</script>

<template id="my-listbox-proxy">
    <mylistbox :id="id" :group="group" :size="size" :doselect="doselect" :parent="parent" :multi="multi" ref="'id'">
</template>

This lets me dynamically set the ref for a Vue component. Once you have a ref you gain access to the Vue components instance (vars, methods). Classes are dynamically manipulated differently in Vue. See the reference guide.

21st September, 2017

jimmck left a reply on Install Laravel Project In Linux Mint • 8 months ago

@afoysal Virtualhost is not a requirement. You need to configure your Webserver and Network files. UNIX/Linux/Windows you will need to understand how to setup the environment. Its part of the process. Might I recommend a fine reference Servers For Hackers.

https://serversforhackers.com/?series=show

18th September, 2017

jimmck left a reply on Future Of Laravel? • 9 months ago

You sure can and Python, C, C++, Java, Go blah-blah-blah!!!!!! Its not a Laravel thing, there is no baked in magic. Read your language guides.

jimmck left a reply on Only The Second AND Condition Is Executing Not Executing The First AND Condition In If Statement • 9 months ago

You are using triple-equals. You are testing the Type of the return. You are also testing against a result set which can return more than one value. If statements need to resolve to a True or False condition. Follow what @Snapey is advising.

16th September, 2017

jimmck left a reply on Will I Notice A Performance Improvement Manually Writing Query For Large Inserts? • 9 months ago

I would recommend using a SQL tool like DBVisualizer (dbvis.com). You need to bulk load this data. What is the format of the input file? You need to drop all indexes and foreign key definitions. Multi threading will not make thing faster as the database has to manage the inserts.

13th September, 2017

jimmck left a reply on Attempting To Load A Vue Component And Populate It With Ajax Json Content • 9 months ago

features is an array. features in the components data section has no relation to the features in the app. The template refers to the components data..

Jeff has great free series introducing Vue 2. Great place to start.

2nd September, 2017

jimmck left a reply on Install Php Mongodb Extension In Mac Osx Sierra • 9 months ago

Oh and do a php -v and then which php

jimmck left a reply on Install Php Mongodb Extension In Mac Osx Sierra • 9 months ago

Hi,

do brew list | grep php71 or php70 whichever you are at or just brew list

Next do php -m | grep mongo

Next do php -i | grep mongo

lets see what ya got???

1st September, 2017

jimmck left a reply on Best Way To Make Things Extendable • 9 months ago

Create an Interface which will be the contract a Garage Scraper would implement in order for the website to support that Garbage Collector.

jimmck left a reply on Parent-child Communication In VueJS • 9 months ago

animals need to be in a template inside the parent-component. The instance HTML should just reference the parent-component. Then they share a relationship.

For instance...

Vue.component('my-radio', {
  template: '#my-radio-proxy',
  props: ['id', 'value', 'label', 'group', 'selected'],
  data() {
    return {
      parent: this.$parent
    }
  },
  created() {
    this.parent = this.$parent;
    //debugger;
  },
  mounted() {
    fyi("Proxy " + this.id);
    debugger;
  },
  computed: {
  },
  methods: {
    set() {
      this.$children[0].set();
    }
  }
});

Vue.component('myradio', {
  template: '#my-radio',
  props: ['id', 'value', 'label', 'group', 'selected', 'parent'],
  data() {
    return {
      picked: "",
    }
  },
  created() {
    //this.ref = this.refid;
    debugger;
  },
  mounted() {
    fyi("Proxy " + this.id);
  },
  methods: {
    set() {
      fyi("Set...");
      this.picked = this.value;
      //alert(this.picked + " " + this.value)
      this.checkMe();
    },
    clear() {      
      this.picked = "";
      this.checkMe();
    },
    checkMe() {
      fyi("Changed...");
      if (typeof this.selected === "function") {
        this.selected(this.group, this.value);
      } else {
        this.parent[this.selected].apply(this.parent, [this.group, this.picked]);
      }

    }
...
<template id="my-radio-proxy">
    <myradio :value="value" :label="label" :id="id" :group="group" :selected="selected" :parent="parent" ref="'id'">
</template>

<template id="my-radio">
  <div>
    <label for="id"> {{ label }}
      <input type="radio" id="id" :value="value" :name="group" v-model="picked" @change="checkMe">
    </label>
    <br />
    {{id}}--- {{picked}} --- {{value}}
  </div>
</template>

<div id="app">
  <h1>
    Test! -- {{radio}}
  </h1>
  <div>
    <my-radio value="radio-1" label="Radio One" id="r1" group="test" selected="onSelect">
    </my-radio>
   ...

30th August, 2017

jimmck left a reply on Laravel 5.5 Install Still Confused • 9 months ago

The composer command in the doc creates a fresh project with the current preferred version. Which is 5.5. The server seems busy so the install may be slow in some cases. Hmm also go 3 errors for script errors with artisan.

27th August, 2017

jimmck left a reply on How Is JavaScript Set Up In Laravel? • 9 months ago

Jeff has a great video series on Webpack. It covers modules and how the overall JS framework fits together for Laravel. Worth watching even if you don't use Laravel as the backend framework.

jimmck left a reply on Build A Subquery • 9 months ago

Queries are written in SQL. Laravel Eloquent generates queries. Perhaps this will guide your questions.

https://hashnode.com/post/a-little-trick-with-eloquent-query-scopes-that-makes-them-super-reusable-ciylr4k0r001os453wuvd4t8w

25th August, 2017

jimmck left a reply on Get Unique Values From Database Column (each Cell Has Comma Separated Value) • 9 months ago

This is not how a database was designed to be used. If anything investigate using MongoDB or create a proper database structure. Database columns usually (as in normally) contain discrete values. Either that or put in a spreadsheet which seems to be your model. Not trying to sound harsh but this design will prove a nightmare to implement IMHO.

21st August, 2017

jimmck left a reply on Replace HTML Elements With Vue Components • 9 months ago

Vue components have their own HTML element identifier. You need to review the Vue documentation.

Nice intro:

https://css-tricks.com/guides/vue/

16th August, 2017

jimmck left a reply on How Use Exec And Redirect()->away At The Same Time? • 10 months ago

There are many things wrong with this approach. Starting with the manual may help.

http://php.net/manual/en/function.exec.php

In short how many node processes do you wish to spwan? And how many do you think it will be before you swamp the server?

8th August, 2017

jimmck left a reply on Is There Any Technical Reason That Eloquent Doesn't Support Oracle Database ? • 10 months ago

Eloquent is an ORM. It generates SQL code and executes it. Oracle fully supports ANSI SQL. There should be no issues unless Eloquent is generating some non-standard code? Can you provide the specific issues with the generated code? The only area that springs to mind are identity columns, not sure how Eloquent handles that. It seems 12 makes reference to them, perhaps earlier. Sequences in Oracle are more robust implementations.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.