Categories
Ask

Opening closing out of ledger data

I have ledger data in which I have three columns Item, Posting date, Qty How can I return Opening, In, Out, Closing using dax of each item for 30 days? SQL code in which I am doing as on date case when Sum(ILE.Quantity) over (order by ILE.[Item No_]) < 0 and ILE.[Posting Date] = @DateTo […]

Categories
Ask

Can I save a PDO connection to $GLOBALS and use it later to ensure that connection is created once?

I just want to make sure that PDO connection is created once in order to give some optimization to the script. The code below can become much more pretty and maintainable but here I just want to keep it as simple as possible. (i.e. using classes and constructors) Does this code ensure that PDO connection […]

Categories
Ask MySQL

How to boost query performance with MySQL and Laravel in a nested set

I am using this package https://github.com/lazychaser/laravel-nestedset in Laravel to query my nested set which is a database of files and directories. However with 1,0000 records the queries are very slow. For example I am fetching all directories and files (with pagination): Directory::with(‘ancestors’)->where(‘name’, ‘like’, ‘%sample%’)->orderBy(‘created_at’, ‘desc’)->orderBy(‘name’)->paginate(10); This eloquent method resolves to the following RAW Sql Statements: […]

Categories
Ask Plugins

Using Select2 multi-checkboxes JS Plugin to show-hide table data

I’m trying to use Wasikuss’s Select2 multi-checkbox (https://github.com/wasikuss/select2-multi-checkboxes/) to hide the table column’s basis the options that are unchecked from the dropdown. The ‘class’ of each option in the dropdown corresponds to the class of the ‘td’ of the column to be hidden. The JQuery that I’m using to do this is basically identifying the […]

Categories
Ask

How do I load balance received udp packets over multiple threads?

I’m creating an application with will send and receive vast amount of data via udp packets. I want to have the ability to scale the processing of these requests by adding or diminishing more worker threads. However when I add a second thread and start waiting for data I get the following error. “Only one […]

Categories
Ask

Convert array of objects to array of values in Laravel

I have below code in my laravel application controller: $levels = $request->level; return $levels; and it returns like this: { 1: [ “9226” ], 2: [ “166” ] } which I need is return just values (9226,166) as array like below: { “9226”, “166” } How to get just values?

Categories
Ask

Split single row into multiple rows based on week of the month in date

I have a table like this Id Valid_From Valid_To 9744 24/06/2019 07/07/2019 9745 12/08/2019 31/12/9999 I would like to split this table into multiple rows based on the week like this by joining to the date table Id Valid_from Valid_To Month Week 9744 24/06/2019 07/07/2019 June 4 9744 24/06/2019 07/07/2019 July 1 9744 24/06/2019 07/07/2019 […]

Categories
Ask

Deserialize XML by walking into the tree: There was an error reflecting type

I have this XML as a result of an API. Using DotNetXmlDeserializer as deserializer. <results> <result inum=\”802469000014312\”> <field name=\”startedat\”>2019-09-04T15:59:56.372</field> <field name=\”duration\”>8</field> <field name=\”otherparties\”>1043 (DEMO BLA BLA), 0519331839</field> <field name=\”switchcallid\”>00001000081567605580</field> <field name=\”udfs\”></field> </result> <result inum=\”802469000014313\”> <field name=\”startedat\”>2019-09-04T16:00:31.414</field> <field name=\”duration\”>6</field> <field name=\”otherparties\”>1043 (DEMO BLA BLA), 0519331839</field> <field name=\”switchcallid\”>00001000091567605608</field> <field name=\”udfs\”></field> </result> I’m using this classes for deserialization […]

Categories
Ask

i am not able find dynamic element in android app

i have dynamic elements in my android app and there is nothing to find it out .Please check screen shot of my app and attributes and let me how can we do it. I have tried with the given attributes I just want ti find these elements and send keys

Categories
Ask

scatter plot filter legend on zoom

I have a scatter plot.. i would like to filter the series legend when a zoom-in operation is performed .. So the series whose datapoints fall into the zoom area should only appear in the legend. this should reset when the reset zoom button is clicked.I started to try here on this fiddle http://jsfiddle.net/ps1myxtk/ but […]