text:
Q: Getting columns in a text file using powershell I have a text file, which contains 10 columns.
Now my question is: I need to search for a string and get output with required columns.
Ex: My text file contains:
#Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Referer) cs-host sc-status sc-win32-status sc-bytes cs-bytes time-taken
2014-06-01 00:00:00 W3SVC1 abc814 121.30.83.14 POST /ASP1/WebServices/cloud.asmx - 80 - 70.27.127.10 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+5.1;+Trident/4.0;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729;+.NET4.0C;+.NET4.0E) http://cloud.each.com/ASP1/cloud/Operator.swf cloud.each.com 200 0 3889 5054 46
2014-06-01 00:00:00 W3SVC1 abc814 121.30.83.14 POST /ASP1/WebServices/range.asmx - 80 - 70.27.127.10 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+5.1;+Trident/4.0;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729;+.NET4.0C;+.NET4.0E) http://cloud.each.com/ASP1/cloud/Operator.swf cloud.each.com 200 0 3889 5054 46

Now, i need to search range.asmx and get only limited columns (time, server name, IP) to a different excel file.
Thanks,
Kalyan

A: That #Fields line isn't going to parse properly as the header, so you'll need to massage that a bit to get it to work in Powershell:
$search = 'range.asmx'

$header = (Get-Content data.csv -TotalCount 1).Replace('#Fields: ','').split()
Get-Content data.csv |
select -Skip 1 |
ConvertFrom-Csv  -Delimiter ' ' -Header $header |
where { $_.'cs-uri-stem' -like "*$search*" }|
select time,'s-ip','cs-host','sc-status'

A: Remove #Fields to make it CSV format, space delimited. Then:
$search = 'range.asmx'
$data = Import-Csv data.csv -Separator ' '
$data | ? cs-uri-stem -like "*$search*" | select time,'s-ip','cs-host','sc-status'


text:
Q: Doctrine2 immutable entities and append only data structures I like the technique described by the Marco Pivetta at PHP UK Conference 2016 (https://youtu.be/rzGeNYC3oz0?t=2011), he recommends to favour immutable entities and instead of changing data structures - appending them. History of changes as a bonus is a nice thing to have for many different reasons, so I would like to apply this approach on my projects. Let's have a look at the following use case:
class Task {
    protected $id;
    /**
     * Status[]
     */
    protected $statusChanges;

    public function __construct()
    {
        $this->id = Uuid::uuid4();
        $this->statusChange = new ArrayCollection();
    }

    public function changeStatus($status, $user){
        $this->statusChange->add(new Status($status, $user, $this);
    }

    public function getStatus()
    {
        return $this->statusChange->last();
    }
}

class Status {
    protected $id;
    protected $value;
    protected $changedBy;
    protected $created;

    const DONE = 'Done';

    public function __construct($value, User $changedBy, Task $task)
    {
        $this->id = Uuid::uuid4();
        $this->value = $value;
        $this->changedBy = $changedBy;
        $this->task = $task;
        $this->created = new \DateTime();
    }
}

$user = $this->getUser();
$task = new Task();
$task->changeStatus(Status::DONE, $user);
$taskRepository->add($task, $persistChanges = true);

All status changes I'm planning to persist in the MySQL database. So the association will be One(Task)-To-Many(Status).
1) What is the recommended way of gettings tasks by current status? Ie. all currently opened, finished, pending tasks.
$taskRepository->getByStatus(Status::DONE);

2) What is your opinion on this technique, are there some disadvantages which may appear in the future, as the project will grow?
3) Where it is more practical to save status changes (as a serialized array in a Task field, or in a separate table?
Thanks for opinions!

A: I imagine this is going to get closed to some of it being based on opinion, just so you're aware.
That being said, I've been quite interested in the idea of this but I've not really looked into it a huge amount, but here's my thinking...
1. Find By Status
I think you would need to do some sort of sub query in the join to get the latest state for each task and match that. (I would like to point out that this is just guesswork from looking at SO rather than actual knowledge so it could be well off).
SELECT t, s
FROM t Task
LEFT JOIN t.status s WITH s.id = (
    SELECT s2.id
    FROM Status s2
    WHERE s2.created = (
        SELECT MAX(s3.created)
        FROM Status s3
        WHERE s3.task = t
    )
)
WHERE s.value = :status

Or maybe just (provided the combined id & created fields are unique)...
SELECT t, s
FROM t Task
LEFT JOIN t.status s WITH s.created = (
    SELECT MAX(s2.created)
    FROM Status s2
    WHERE s2.task = t
)
WHERE s.value = :status

2 Disadvantages
I would imagine that having to use the above type of queries for each repository call would require more work and would, therefore, be easier to get wrong. As you are only ever appending to the database it will only get bigger so storage/cache space may be an issue depending on how much data you have.
3 Where To Save Status
The main benefit of immutable entities is that they can be cached forever as they will never change. If you saved any state changes in a serialized field then the entity would need to be mutable which would defeat the purpose.

A: Here's what I do:
All the types of tables involved in my business
I organize my database in 4 types of tables:

*

*Log_xxx

*Data_xxx

*Document_xxx

*Cache_xxx

Any data I store falls in one of those 4 types of tables.
Document_xxx and Data_xxx are just for storing binary files (like PDFs of tariffs the providers send to me), and static data or super-slow-changing data (like the airports or countries or currencies in the world). They are not involved in the "main" of this explanation but worth mentioning them.
Log tables
All my "domain events" and also the "application events" go to a Log_xxx table.
Log tables are write-once, never deleteable, and I must do backups of them. This is where the "history of the business" is stored.
For example, for a "task" domain object as you mention in your question, say that the task can be "created" and then altered later, I'd use:

*

*Log_Task_CreatedEvents

*Log_Task_ChangedEvents

Also I save all the "application events": Each HTTP request with some contextual data. Each command-run... They go to:

*

*Log_Application_Events

Never the domain can change unless there is an application that changes it (a command line, a cron, a controller attending an HTTP request, etc.). All the "domain events" have a reference to the application event that created them.
All the events, either domain events (like TaskChangedEvent) or the application events are absolutely immutable and carry several standard things like the timestamp at creation.
The "Doctrine Entities" have no setters so they can only be created and read. Never changed.
In the database I only have one relevant field. It is of type TEXT and represents the event in JSON. I have another field: WriteIndex which is autonumeric, is the primary key and is NEVER used by my software as a key. It is only used for backups and database control. When you have GBs of data sometimes you need to dump only "events starting at index XX".
Then for easiness, I have an extra field which I call "cachedEventId" which contains the very same "id" of the event, redundant to the JSON. This is why the field is named after "cached..." as it does not contain original data, it could be rebuilt from the event field. This is only for simplicity.
Although doctrine calls them "entities" those are not domain entities, they are domain value objects.
So, Log tables look like this:
INT      writeIndex;    // Never used by my program.
TEXT     event;         // Stores te event as Json
CHAR(40) cachedEventId; // Unique key, it acts really as the primary key from the point of view of my program. Rebuildable from the event field.

Sometimes I opt-in for having more cached fields, like the creation time-stamp. All those are not needed and only set there for convenience. All that should be extractable from the event.
The Cache tables

*

*Then in the Cache_xxx I have the "accumulated data" data that can be "rebuilt" from the logs.

For example if I have a "task" domain object that has a "title" field, and a "creator", and a "due date", and the creator cannot be overwritten, by definition, and the title and due date can be re-set... then I'd have a table that looks like:
Cache_Tasks
    * CHAR(40) taskId
    * VARCHAR(255) title
    * VARCHAR(255) creatorName
    * DATE dueDate

Write model
Then, when I create an task, it writes to 2 tables:
* Log_Task_CreatedEvents // Store the creation event here as JSON
* Cache_Tasks // Store the creation event as one field per column

Then, when I modify a task, it also writes to 2 tables:
* Log_Task_ChangedEvents // Store the event of change here as JSON
* Cache_Tasks // Read the entity, change its property, flush.

Read model
To read the tasks, use the Cache_Tasks always.
They always represent the "latest state" of the object.
Deleteability
All the Cache_xxx tables are deleteable and do not need to be backed up. Just replay the events in date order and you'll get the cached entities again.
Sample code
I wrote this answer as "Task" as this was the question, but today for instance I've been working in assigning an "state" to the client's form-submissions. The clients just ask something via web and now I want to be able to "mark" this request as "new" or "processed" or "answered" or "mailValidated", etc...
I just created a new change() method to my FormSubmissionManager. It looks like this:
public function change( Id $formSubmissionId, array $arrayOfPropertiesToSet ) : ChangedEvent
{
    $eventId = $this->idGenerator->generateNewId();
    $applicationExecutionId = $this->application->getExecutionId();
    $timeStamp = $this->systemClock->getNow();

    $changedEvent = new ChangedEvent( $eventId, $applicationExecutionId, $timeStamp, $formSubmissionId, $arrayOfPropertiesToSet );

    $this->entityManager->persist( $changedEvent );
    $this->entityManager->flush();

    $this->cacheManager->applyEventToCachedEntity( $changedEvent );
    $this->entityManager->flush();

    return $changedEvent;
}

Note that I do 2 flushes. This is on purpose. In the case the "write-to-the-cache" fails I don't want to loose the changedEvent.
So I "store" the event, then I cache it to the entity.
The Log_FormSubmission_ChangeEvent.event field looks like this:
{
    "id":"5093ecd53d5cca81d477c845973add91e31a1dd9",
    "type":"hellotrip.formSubmission.change",
    "applicationExecutionId":"ff7ad4bd5ec6cebacc048650c866812ac0127ac2",
    "timeStamp":"2018-04-04T02:03:11.637266Z",
    "formSubmissionId":"758d3b3cf864d711d330c4e0d5c679cbf9370d9e",
    "set":
    {
        "state":"quotationSent"
    }
}

In the "row" of the cache I'll have the "quotationSent" in the column state so it can be queried normally from Doctrine even without the need of any Join.

I sell trips. You can see there many de-normalized data coming from several sources, like for example the number of adults, kids and infants travelling (coming from the creation of the form submission itself), the name of the trip he requests (coming from a repository of trips) and others.
You can also see the latest-added field "state" at the right of the image. There may be like 20 de-mapped fields in the cached row.
Answers to your questions
Q1) What is the recommended way of gettings tasks by current status? Ie. all currently opened, finished, pending tasks.
Query the cached table.
Q2) Are there some disadvantages which may appear in the future, as the project will grow?
When the project grows, intead of rebuilding the cache at the time of write, chich may be slow, you setup a queue system (for example a RabbitMq or AWS-SNS) and you just send to the queue a signal of "hey, this entity needs to be re-cached". Then you can return very quickly as saving a JSON and sending a signal to the queue is effort-less.
Then a listener to the queue will process all and every changes you make, and if re-caching is slow, you don't matter.
Q3) Where it is more practical to save status changes (as a serialized array in a Task field, or in a separate table?
Separate tables: A table for "status changes" (=log =events =value_objects, not entities), and another table for "tasks" (=cache =domain_entities).
When you make backups, place in super-secure place the backups of the logs.
Upon a critical failure, restore the logs=events and replay them to re-build the cache.
In symfony I use to create a hellotrip:cache:rebuild command that accepts as a parameter the cache I need to reconstruct. It truncates the table (deletes all cached data for that table) and re-builds it over again.
This is costly, so you only need to rebuild "all" when necessary. In normal conditions, your app should take care of having the caches up to date when there is a new event.
Documents and Data
At the very beginning I mentioned the Documents and Data tables.
Time for it, now: You can use that information when rebuilding the caches. For example, you can "de-map" the airport name into the cached entity while in the events you may only have the airport code.
You can rather safely change the cache format as your business has more complex queries, having pre-calculated data. Just change the schema, drop it, re-build the cache.
The change-events, instead, will remain "exactly the same" so the code that gets the data and saves the event has not changed, reducing the risk of regression bugs.
Hope to help!

redpajama_set_name: RedPajamaStackExchange


text:
Q: Higher reputation Area 51 committers not showing site icons I've recently noticed that some users with significant reputation who have committed to Area 51 proposals do not have the usual site icons in their user details. This is despite the fact that the accounts tab in their Area 51 profiles shows that they have 200+ reputation on at least one other site which is what I understood the threshold to be.
I noticed this first with 3 users on the Libraries proposal but checked a few other proposals and found similar cases on Writing, Databases, and Personal Productivity.
Here are some examples (at the time of posting all appeared on the first "most recent" page of commitments for the referenced proposals).

*

*Writing: John Gardeniers with 12k across sites (10,691 on Server Fault)

*Databases: Vivek Bernard with 861 across sites (710 on Stack Overflow)

*Productivity: David Antaramian with 576 across sites (425 on Stack Overflow)

*Libraries: Nicholas Piasecki with 4599 across sites (4,478 on Stack Overflow)

Update: All of the users I saw with missing icons now appear to have the site icons in their user details block.

A: All of the users mentioned in the question created and associated their accounts within the last day or so.
We just a fixed a couple bugs in which a) new users' multi-site flair didn't show up correctly until they gained additional rep/badges on one of their associated sites, and b) multi-site flair wasn't being reliably updated, particularly for beta site stats.
We just re-synced each user's multi-site flair with their associated account info, which fixed the flair issues for users mentioned in your question (and hopefully any other problematic flairs as well).


text:
Q: symfony2 forms: custom form element not referenced to doctrine2 object field I'm trying to place a custom checkbox to form. This checkbox is not referenced to any doctrine2 object field. The checkbox is like "remember me" on signin form.
public function buildForm(FormBuilder $builder, array $options)
{
    $builder->add('login');
    $builder->add('password');
    $builder->add('remember_me');
}

No mapping found for field 'remember_me' in class ...
How should I solve this?
Thank you!

A: Use property_path option as :

$builder->add('remember_me', 'checkbox', array('property_path' =>
  false))


text:
Q: I have the following string '3,45,543,6,89'. Need output like table thorugh function. Pl help me get output through postgresql function CREATE OR REPLACE FUNCTION public.SplitToTable(
iv_datalist  varchar,iv_Separator varchar)
    RETURNS TABLE(out_param varchar)
    LANGUAGE 'plpgsql'

    COST 100
    VOLATILE
    ROWS 1000
AS $BODY$
BEGIN

RETURN query select (select regexp_split_to_table(iv_datalist, iv_Separator) as out_param );

END
$BODY$;

When I run
select * from splitToTable('3,34,4,545,35,3',',');

I get this error:
ERROR:  structure of query does not match function result type
DETAIL:  Returned type text does not match expected type character varying in column 1.
CONTEXT:  PL/pgSQL function splittotable1(character varying,character varying) line 4 at RETURN QUERY
SQL state: 42804

A: You'd have to declare the function as RETURNS text rather than RETURNS varchar. Use text everywhere, as that is the preferred string type in PostgreSQL. That way, you have no problems with type conversions.
The function could be written simpler as
CREATE OR REPLACE FUNCTION public.SplitToTable(
   iv_datalist text,
   iv_Separator text
) RETURNS TABLE(out_param text)
    LANGUAGE sql
    IMMUTABLE
AS
$BODY$SELECT * FROM regexp_split_to_table(iv_datalist, iv_Separator);$BODY$;

Essentially, the function is useless; you could just use regexp_split_to_table directly.


text:
Q: React-Navigation with Onboarding not playing well thanks for reading this!
I'm trying to add an Onboarding flow to my app, but whenever I add the AppOnboardingNavigation as the ReduxNavigation Root component my app crashes saying:

i really can't understand why this is happening, any ideas?
Thanks!
AppNavigation.js:
import {
  createAppContainer,
  createStackNavigator,
  createSwitchNavigator
} from 'react-navigation'

import styles from './Styles/NavigationStyles'

import MainTabNavigation from "./MainTabNavigation";
import DrinkCheckinNavigation from "./DrinkCheckinNavigation";

// Manifest of possible screens
const PrimaryNav = createStackNavigator({
  MainScreen: {
    screen: MainTabNavigation,
    navigationOptions: {
      header: null
    }
  },
  DrinkDetailScreen: {
    screen: DrinkCheckinNavigation,
    navigationOptions: {
      title: 'Drink selecionado'
    }
  },
}, {
  initialRouteName: 'MainScreen',
  navigationOptions: {
    headerStyle: styles.header
  },
})

export default createAppContainer(PrimaryNav)

MainTabNavigation.js:
import React from 'react'
import { createAppContainer, createBottomTabNavigator } from 'react-navigation'
import HistoryScreen from '../Containers/CustomerHistory'
import { Icon } from 'react-native-elements'

import SwitchNav from './LoginSwitchNavigation'
import PlacesNav from "./PlaceStackNavigation";
import styles from './Styles/NavigationStyles'

// Manifest of possible screens
const PrimaryNav = createBottomTabNavigator({
  PlacesScreen: { screen: PlacesNav, },
  HistoryScreen: { screen: HistoryScreen },
  LoginScreen: { screen: SwitchNav },
}, {
    headerMode: 'none',
    initialRouteName: 'PlacesScreen',
    navigationOptions: {
      headerStyle: styles.header
    },
    defaultNavigationOptions: ({ navigation }) => ({
      tabBarIcon: ({ tintColor }) => {
        const { routeName } = navigation.state;
        let iconName;

        switch (routeName) {
          case 'PlacesScreen':
            iconName = 'local-drink'
            break;
          case 'HistoryScreen':
            iconName = 'history'
            break;
          case 'LoginScreen':
            iconName = 'person'
            break;
        }

        return <Icon name={iconName} size={25} color={tintColor} />;
      },
    }),
  })

export default createAppContainer(PrimaryNav)

AppOnboardingNavigation.js:
import {
  createSwitchNavigator,
  createAppContainer
} from 'react-navigation'

import OnboardingScreen from "../Containers/OnboardingScreen";
import AppNavigation from "./AppNavigation";
import LaunchOnboardingScreen from "../Containers/LaunchOnboardingScreen";

export default createAppContainer(createSwitchNavigator({
  OnboardingScreen: OnboardingScreen,
  LaunchOnboardingScreen: LaunchOnboardingScreen,
  AppNavigationScreen: AppNavigation,
}, {
  initialRouteName: 'LaunchOnboardingScreen'
}))

ReduxNavigation.js:
import AppNavigation from './AppOnboardingNavigation' <-- Here is the problem, if I change to AppNavigation it works...

createReactNavigationReduxMiddleware(
  (state) => state.nav,
  'root',
)

const ReduxAppNavigator = createReduxContainer(AppNavigation, 'root')

const ReduxNavigation = (props) => {

  return <ReduxAppNavigator dispatch={props.dispatch} state={props.nav} />
}

Versioning:
"react": "16.8.3",
"react-native": "0.59.4",
"react-navigation": "3.8.1",
"react-navigation-redux-helpers": "^3.0.2",
"react-redux": "^6.0.0",
"redux": "^4.0.1"

Thank you :)

A: Actually I solved it like this:
Removing completely the AppOnboardingNavigation.js.
New file LaunchOnboardingScreen.js:
import React, { useEffect } from "react";
import { useAsyncStorage } from "@react-native-community/async-storage";
import { View, ActivityIndicator } from 'react-native'
import { shouldShowOnboarding } from "../Utils/OnboardingUtils";
import { withNavigation } from "react-navigation";

const LaunchOnboardingScreen = (props) => {
    checkIfShouldShowOnboarding = async () => {
        const showOnboarding = await shouldShowOnboarding()

        if (showOnboarding) {
            props.navigation.replace('OnboardingScreen')
        } else {
            props.navigation.replace('MainScreen')
        }
    }

    checkIfShouldShowOnboarding()

    return (
        <View style={{ flex: 1 }}>
            <ActivityIndicator animating={true} size="large" />
        </View>
    )
}

export default withNavigation(LaunchOnboardingScreen)

Final AppNavigation.js:
import {
  createAppContainer,
  createStackNavigator,
  createSwitchNavigator
} from 'react-navigation'

import styles from './Styles/NavigationStyles'

import MainTabNavigation from "./MainTabNavigation";
import DrinkCheckinNavigation from "./DrinkCheckinNavigation";
import OnboardingScreen from "../Containers/OnboardingScreen";
import LaunchOnboardingScreen from "../Containers/LaunchOnboardingScreen";

// Manifest of possible screens
export default createStackNavigator({
  MainScreen: {
    screen: MainTabNavigation,
    navigationOptions: {
      header: null
    }
  },
  DrinkDetailScreen: {
    screen: DrinkCheckinNavigation,
    navigationOptions: {
      title: 'Drink selecionado'
    }
  },
  OnboardingScreen: {
    screen: OnboardingScreen,
    navigationOptions: {
      header: null
    }
  },
  LaunchOnboardingScreen: {
    screen: LaunchOnboardingScreen,
    navigationOptions: {
      header: null
    }
  }
}, {
  initialRouteName: 'LaunchOnboardingScreen',
  navigationOptions: {
    headerStyle: styles.header
  },
})

I think this way I can scale the app easier if some new screen pops-up (like a maintenance screen or something like that).
Thanks!


text:
Q: How to fit VERY long condition in conditional formatting I have a very long condition, about 3,000 characters. Access has only space for about one tenth of that.
Is there some other way to set conditional formatting on a textbox besides through the dialogue, or can I do it in VBA and, if so, HOW?
I have conditional formatting on a bunch of textboxes that trigger when the report is opened.

A: According to Access' Help topic, the FormatConditions Collection has methods (Add, Delete, Modify) which should allow you to adjust your FormatConditions with VBA code.  I've never tried, so offer no opinion as to whether this would be a practical approach for you.
I also tried to find out if there is a capacity limit for the number of characters FormatConditions can accept.  I didn't find anything there.

A: Yes, you can manipulate Format Conditions in VBA. There's a full detailed article knowledgebase article at http://support.microsoft.com/kb/304104.
Code snippet here showing a basic example. Refer to the above link to get the VBA for AddFormats:
Public Function HighLightForeignKeys(argFieldName As String, argFieldValue As Integer)
    Dim FormatCondition As String
    Dim CodeReception As Integer
    FormatCondition = "[" & argFieldName & "] = " & ArgFieldValue
    With Me.ID
        .FormatConditions.Delete
        .FormatConditions.Add acExpression, , FormatCondition
        .FormatConditions(0).BackColor = 16510422
        AddFormats Me.ID, Me
    End With

End Function

A: Would be curious to know if the VBA approach worked?
Another idea: create a hidden field on the form and set it's value based on your 3000-character condition. If you are just trying to have 1 conditional expression, you could give this hidden field a false/true or 0/1 value; if you want mulitple conditions, you could give it a value of 0, 1, 2, or 3 corresponding to the conditions you want applied. In either case, your conditional expression test(s) is(are) now trivial: [HiddenFieldName]=ConditionValue

A: I dont know if this is what you were after, since you mentioned there was only a tiny box to enter all of your conditional text.  Others have shown you VBA solutions - since you asked if that was one way to achieve it.
I have always resorted to using the "zoom" feature which is accessible via the SHIFT-F2 keystroke.  Is that what you were after?  I think it goes back several Access versions too.
A good set of Access shortcut keystrokes is here:
http://www.joyedaniels.com/keys_access.htm


text:
Q: lightning:isUrlAddressable pageReference returns null I'm trying to use the new lightning:isUrlAddressable interface to pass a few variables into a lightning component that is inside a lightning tab.  In the init function I try to get the pageRefernce with the code
var myPageRef = component.get("v.pageReference");
console.log(myPageRef);

myPageRef will only return null right now and I'm not sure why.  I have made sure the api version is 43.  I am loading some other scripts into the page as well and I have tried getting the pageReference before and after loading the scripts. with no change.
<ltng:require styles="{!join(',',
                            $Resource.FSL__FontAwesome44 + '/css/font-awesome.min.css')}"
              scripts="{!join(',',
                            $Resource.jquery_3_1_0_min,
                            $Resource.bootstrapNew + '/bootstrap-3.3.7-dist/js/moment.js',
                            $Resource.bootstrapNew + '/bootstrap-3.3.7-dist/js/bootstrap.datepicker.js')}"
              afterScriptsLoaded="{!c.jsLoaded}" />

I have also tried including
<lightning:workspaceAPI aura:id="workspace"/>
<lightning:navigation aura:id="navService"/>

but neither seems to have any effect and I don't think they should from what I know about them.
Has anyone else had any problems with this interface?

A: I had a similar issue, it constantly returns null if the component is being used on a flexipage (this isn't supported, see documentation https://developer.salesforce.com/docs/component-library/bundle/lightning:hasPageReference/documentation).

A: I've found some issues with caching of the PageReference object that have been solved by using a handler - they might help you too.
I would run the init routine first on script load, with a check for the validity of the PageReference object. ie:
var pageReference = component.get('v.pageReference');
console.log(JSON.stringify(pageReference));
if ($A.util.isEmpty(pageReference) || $A.util.isEmpty(pageReference.state) || $A.util.isEmpty(pageReference.state.id)) {
  return;
}
var recordId = pageReference.state.id;

The init routine will abort if the PageReference is null or has no params.
Then, use a handler to listen for changes to the pageReference attribute. It seems that it gets refreshed AFTER the initial load of the component, which could be causing all your problems:
<aura:handler name="change" value="{!v.pageReference}" action="{!c.init}" />

You may want to pull the parsing of the url params into a separate routine or use a flag to indicate that the component has loaded if you want to avoid running the init routine twice.


text:
Q: Getting NullPointerException in Seam when trying to get ResponseWriter from FacesContext I am working on a Seam app. I am trying to get the ResponseWriter from the FacesContext, but I get a NullPointerException.
I can get a FacesContext by calling
FacesContext context = FacesContext.getCurrentInstance();

According to the debugger, the responseWriter variable in the FacesContext object is null, so calling
ResponseWriter writer = context.getResponseWriter();

gives a NullPointerException.
Why would the ResponseWriter be null? Is it null by default? We can get it from a FacesContext in plenty of other places in our code.
Is there a way I can set it manually?

A: I think this is similar to the problem I was getting recently. I tried to use the Excel-writing api within Seam to programmatically generate an Excel file, rather than using an xhtml template with specific tags.
While this worked in older versions of Seam, using the 2.2.0 meant that I couldn't get a Writer from the context to pass to the constructor of the Workbook.
Sadly, I never found a solution, so I'm not sure there is a solution to this.


text:
Q: JavaScriptCore get API console.log messages I have a simple web app that prints streaming data to the console.log. This works just fine in a web page.
I would like to print the log messages directly onto the Xcode console as they come across the stream without using a web view.
Prefer everything to be in Swift if possible but Objective-C solution is ok.
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <title>Barchart Market Data API Example</title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

    <script src="../dist/barchart-marketdata-api-1.0.js"></script>

    <script type="text/javascript">

        $(function() {
            var onMarketUpdate = function(message) {
                if (message.type == "TRADE") {

                    var q = client.getMarketState().getQuote(message.symbol);
                    if (q)
                    console.log('Symbol: ' + q.symbol +
                            '\nLast:' + q.lastPrice +
                            '\nVolume:' + q.volume +
                            '\nTime:' + q.time);
                }
            };

            var client = new Barchart.RealtimeData.Connection();

            client.connect('qsws-us-e-01.aws.barchart.com', 'user', 'password');

            client.on('marketUpdate', onMarketUpdate, 'ESZ6');

        });
    </script>
    <body>
    </body>
    </html>

I have been able to load the script above (everything in the script text/javascript tag into a file called myLib.js) as well as the required libraries
    let fileLocation1 = NSBundle.mainBundle().pathForResource("jquery", ofType: "js")!

    let jsSource1 : String
    do {
        jsSource1 = try String(contentsOfFile: fileLocation1)
    } catch {
        jsSource1 = "Contents of JavaScript not loaded."
    }

    let fileLocation2 = NSBundle.mainBundle().pathForResource("barchart-marketdata-api", ofType: "js")!

    let jsSource2 : String
    do {
        jsSource2 = try String(contentsOfFile: fileLocation2)
    } catch {
        jsSource2 = "Contents of JavaScript not loaded."
    }

    let fileLocation3 = NSBundle.mainBundle().pathForResource("myLib", ofType: "js")!

    let jsSource3 : String
    do {
        jsSource3 = try String(contentsOfFile: fileLocation3)
    } catch {
        jsSource3 = "Contents of JavaScript not loaded."
    }

    let context = JSContext()
    context.evaluateScript(jsSource1)
    context.evaluateScript(jsSource2)
    context.evaluateScript(jsSource3)

I am not sure how to get the output from the console.log into the context as it is inside a Jquery anonymous function.
It really does not have to come from the console.log, I could just return the string to the mac/iOS app.


text:
Q: How do I upgrade the BIOS to boot the motherboard when the CPU is not suported? So I have a Tyan S8225 motherboard with a Valencia (Opteron 4200) CPU.
Two of us have tried everything.  We have even swapped the whole motherboard, Power supply, memory, even a different CPU (still Valencia).  We even tried it without any memory installed and with only a single CPU.  There are no beep codes as I suspect even those are controlled by the BIOS boot process. We put the whole thing on the bench with just the power supply, VGA, keyboard and network (for IPMI) connected.
The IPMI is not even showing the BIOS starting, but the IPMI is working.
After some hunting around, I discovered the claim on the website is that the Valencia CPU's are not supported on older BIOS revisions.  For a start, I don't know what the bios revision is and if it's older but it's the only thing left.
Could the BIOS be causing a board not to boot at all?
If that's the case, then is there any other way to update the BIOS without buying an old CPU only to be put back in a box just to update the BIOS?  Yes, we even tried updating the BIOS through IPMI but you can't do that either.

A: SImply sad  with a VERY modern motherboard. I have ONE here - damn new ASUS LGA 2011 board - that can read the Bios from a USB stick WITHOUT processor.
For everything older - get a processor that works, sorry.


text:
Q: Unable to get GA data for Adwords by dateHour I am trying to get Google Analytics data for this specific query with these dimensions and metrics:
metrics=['adClicks', 'adCost', 'transactions', 'transactionRevenue', 'RPC', 'CPC']
dimensions=['date', 'adwordsCampaignID']

I verified from the GA Dim/Metrics explorer:
https://developers.google.com/analytics/devguides/reporting/core/dimsmets
This query work. However, when I changed the dimension to dataHour, instead of date, the results for adClicks, adCost are 0s, and transactionRevenue are different.
Any idea why I might be seeing these differences when dimensions is date compared to dateHour?

A: Are you a victim of sampling? Whenever you query for non-standard dimensions (e.g. dateHour vs. date) you risk running into sampling which might badly affect the accuracy of your data (I've seen e-commerce revenue go to $0 because of it).
Check your query results for the containsSampledData flag:
https://developers.google.com/analytics/devguides/reporting/core/v3/reference#sampling
Several ways to work-around sampling:

*

*Play with samplingLevel and see if that helps

*Break your query down into several smaller queries each querying for a shorter date range and re-combine the data on your server


text:
Q: Using WindowBuilder Pro the design tab is missing several components I'm doing a project using WindowBuilder Pro and all has been fine up until now. When I am in the "design" tab the preview of the GUI and the components view do are missing a lot of the components from my code.
Here my interface when compiled:

As you can see there are several components
And here is the design tab:

All that is shown in the Components section and the Preview section is the Main Tabs component and the components it contains. Just a couple of days ago the components section was fine, it showed all the components that you can see in the first image. What is the problem?
Edit: Just in case anyone's interested, I did some messing around and I have an if-else conditional in my constructor which seems to mess things up - without it everything works ok


text:
Q: Add 90 degrees to a Quaternion in Away3d I'm attempting to rotate a Quaternion up 90 degrees on the Y axis in Away3d.  I'm using an ANE to get Quaternion values from device motion, to set the camera view.
This rotates the angle up,
            qu.fromAxisAngle(Vector3D.X_AXIS,Math.PI/2);
            q.multiply(q, qu );

But then seems to switch the other angles, i.e. now panning the device rolls the view.

A: Changing the order worked
q.multiply(qu, q );


text:
Q: Attempting to make a Move object in R - NA timestamp records I'm trying to use my own animal tracking data (.csv) through the 'move' package but as I'm importing/projecting it, R gives me an error. Code below.
 df <- read.csv("Tracking_Data_CSV.csv")

N17042_move<-move(df$location.long, df$location.lat, time=as.POSIXct(df$timestamp,format="%m-%d-%Y %H:%M:%S",tz="UTC"),
               proj=CRS("+init=epsg:32615"))

**Error in validityMethod(as(object, superClass)): There are NA timestamps records

I have made sure that there are no NA time stamps within my data. I have no clue whether the problem lies within the data or within the code itself. I will appreciate any help with this. I include a snippet of the data below just to get a sense of the format.
  individual.local.identifier       timestamp location.long location.lat
1                      N17042  1/10/2017 0:57      373986.9      4426785
2                      N17042  1/10/2017 4:01      374027.8      4427036
3                      N17042  1/10/2017 9:01      373866.7      4427156
4                      N17042 1/10/2017 14:01      373878.0      4427167
5                      N17042 1/10/2017 19:01      373878.7      4427161
6                      N17042  1/11/2017 0:01      374010.6      4427233

A: There are NA timestamps in your data, because your transformation into POSIXct is wrong.
Try this:
as.POSIXct(1/10/2017 0:57,format="%m-%d-%Y %H:%M:%S",tz="UTC")

The output will be NA. Why? Because your format includes / not - and there are no seconds in your timestamp
Try this:
N17042_move<-move(df$location.long, df$location.lat, time=as.POSIXct(df$timestamp,format="%m/%d/%Y %H:%M",tz="UTC"),
               proj=CRS("+init=epsg:32615"))


text:
Q: Mac Catalina Xcode 12.0.1 IOS Build Error Urbanairship Facing build issue with Urbanairship package, recently updated to Catalina and xcode12.
Works fine with Xcode11 and Mojave. Any suggestions, please? I am using react native 0.61.1 version.

A: Updating the Urbanairsip version fixed the issue for me.


text:
Q: Perl parsing config file with regex to key, value I have come up with the following, to first read the file and then put it into hash. = sign used as a delimiter.
sub get_config_value_by_key {
    my ( $module, $key ) = @_;

    my $config = &read_file_contents(
        $config_directory . '/' . $module . '/config' );
    my %config = $config =~ /(.*)=(.*)/g;

    return $config{$key};
}

It works fine, except that, if I have equal sign in the value (which I use as delimiter), then it doesn't parse it correctly.
How to fix my regex to make it work properly, escaping = signs in the value?
Example of config lines:

key_1=Some value
key_2=Some value with = sign which breaks it.

A: You can use non greedy quantifier,
my %config = $config =~ /(.*?)=(.*)/g;
                          # ^_________ match smallest possible amount of chars

A: I would use something like this:
use warnings;
use strict;
use Data::Dumper;

open my $in, '<', 'in.txt' or die $!;

my %data;
while(<$in>){
    my($key, $val) = split(/=/, $_, 2);
    $data{$key} = $val;
}

print Dumper \%data;

This will read in a file - here in.txt, split each line on = into a maximum of two parts, and then assign them to a hash key/value pair.
However your approach could be tweaked to allow non-greedy matching (.*?):
while(<$in>){
    my ($key, $val) = $_ =~ /(.*?)=(.*)/;
    $data{$key} = $val;
    }


text:
Q: Meaning of curly braces in array.map() I have a .map() function that changes isActive property value of objects in data array. However wraps it with curly braces returns me undefined whereas wrapping it with parenthesis or no wrap returns the updated value. Curly braces are used as a wrapper in an arrow function but does it work differently for .map()?
    const newData = data.map((data) => {
      data.label === label ? { ...data, isActive: !data.isActive } : data,
    });
    console.log(newData)
    //undefined

    const newData = data.map((data) =>
      data.label === label ? { ...data, isActive: !data.isActive } : data,
    );
    console.log(newData)
    //returns updated newData

A: That's the behavior of arrow function. Arrow function syntax is designed to be terse.
(arg) => [single expression]

If what follows the arrow is one single expression without curly braces, it implies returning the value of that expression. The return keyword is omitted.
If wrapping curly braces follows the arrow, then what goes inside the braces are treated as normal function body, and return keyword must be used if you mean to return a value.
So (x) => x + 1 is translated to:
function (x) {
  return x + 1;
}

And (x) => { x + 1 } is translated to:
function (x) {
  x + 1;
}

I must also add that (x) => ({ x }) is translated to:
function (x) {
  return { x: x };
}

Curly brace {...} can mean an object literal, a function body or a code block.
In order to disambiguate, you need to put parenthesis around the braces to tell the parser to interpret {...} as an "object literal expression".


text:
Q: Button method suddenly stopped working So I have a spinner, a button and edittext, and according to which item is selected on spinner and which value is in edittext something happens on button click. It used to work perfectly and now it suddenly crashes every time I click the button. I have no idea what I have done to ruin it so I am kindly asking you for some help. I've been stuck like this for hours and I just can't point a finger to what ruined the code.
Button click method (As you can see in case 1, I added shared preferences to a comment just to make sure this isn't what's runing the code):
public void submitQuantityButton (View v){
    Button submitButton = (Button)findViewById(R.id.submitButton);
    final Spinner sItems = (Spinner)findViewById(R.id.spinner1);
    final Context context = this;
    final CheckBox cb4 = (CheckBox) findViewById(R.id.checkBox4);

    submitButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            final int position = sItems.getSelectedItemPosition();
            EditText quantityEditText = (EditText)findViewById(R.id.editText1);

            switch (position){
            case 0:
                AlertDialog.Builder spinnerErrorBuilder = new AlertDialog.Builder(context);
                spinnerErrorBuilder.setTitle("Warning");
                spinnerErrorBuilder.setMessage("Please choose an item from the list");
                spinnerErrorBuilder.setPositiveButton("OK", new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int id) {
                        dialog.cancel();
                    }
                });
                AlertDialog spinnerError = spinnerErrorBuilder.create();
                spinnerError.show();
                break;
            case 1:
                String items = quantityEditText.getText().toString();
                cb4.setText("Elaborate Totem (" + items + "/250)");
                //saveItemQuantity("cb4", cb4.getText().toString());
                break;
            }
        }
    });
}

Button XML:
<Button
    android:id="@+id/submitButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/editText1"
    android:layout_alignBottom="@+id/editText1"
    android:layout_alignLeft="@+id/checkBox25"
    android:text="@string/addMaterial"
    android:onClick="submitQuantityButton" />

Logcat file:
06-23 15:05:29.276: E/AndroidRuntime(22681): FATAL EXCEPTION: main
06-23 15:05:29.276: E/AndroidRuntime(22681): java.lang.IllegalStateException: Could not execute method of the activity
06-23 15:05:29.276: E/AndroidRuntime(22681):    at android.view.View$1.onClick(View.java:3599)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at android.view.View.performClick(View.java:4204)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at android.view.View$PerformClick.run(View.java:17355)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at android.os.Handler.handleCallback(Handler.java:725)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at android.os.Handler.dispatchMessage(Handler.java:92)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at android.os.Looper.loop(Looper.java:137)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at android.app.ActivityThread.main(ActivityThread.java:5041)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at java.lang.reflect.Method.invokeNative(Native Method)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at java.lang.reflect.Method.invoke(Method.java:511)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at dalvik.system.NativeStart.main(Native Method)
06-23 15:05:29.276: E/AndroidRuntime(22681): Caused by: java.lang.reflect.InvocationTargetException
06-23 15:05:29.276: E/AndroidRuntime(22681):    at java.lang.reflect.Method.invokeNative(Native Method)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at java.lang.reflect.Method.invoke(Method.java:511)
06-23 15:05:29.276: E/AndroidRuntime(22681):    at android.view.View$1.onClick(View.java:3594)
06-23 15:05:29.276: E/AndroidRuntime(22681):    ... 11 more
06-23 15:05:29.276: E/AndroidRuntime(22681): Caused by: java.lang.ClassCastException: android.widget.Spinner cannot be cast to android.widget.Button
06-23 15:05:29.276: E/AndroidRuntime(22681):    at com.example.gw2legendary.Bifrost.submitQuantityButton(Bifrost.java:967)
06-23 15:05:29.276: E/AndroidRuntime(22681):    ... 14 more

A: These kinds of errors normally happen when you have moved two elements inside your layout (switched their places). A Project --> Clean in Eclipse normally resolves this, which makes Android rebuild the R-class.


text:
Q: Return Integer as AnyVal in Scala I'm a newbie to Scala. I'm still trying to understand how method return types work in Scala. I have a base class as follows:
abstract class CustomNumber {
  def value: AnyVal
  override def toString = value.toString
}

And a subclass which looks like:
class CustomInteger(val input: Integer) extends CustomNumber {
  def value = input
}

But when I try to run this code, I get the error:
the result type of an implicit conversion must be more specific than AnyVal
  def value = input

type mismatch;
 found   : Integer
 required: AnyVal
  def value = input

Why would it be an error to return Integer as AnyVal if it is just a subclass?

A:
AnyVal is the root class of all value types, which describe values not implemented as objects in the underlying host system. Value classes are specified in Scala Language Specification, section 12.2.
  https://www.scala-lang.org/api/current/scala/AnyVal.html

Just like it says, AnyVal is a root class of value types specified in Scala.
And I assume you are using Java's Integer. Use Int instead fixes the issue.
PS It looks like you are trying to create a wrapper class of primitive types, That's where you should use value type using AnyVal.

A: I think just change it to:
class CustomInteger(val input: Int) extends CustomNumber {
  def value = input
}

Int is the scala type/class for integer. Have a look here for more details


text:
Q: Chartjs - display radarchart lines from center to corner value Is there a way to achieve for radarchart from chartjs to display line from center (value 0) to value of the corner? It would looks something like this:
radarchart_image

A: This is possible by writing a custom inline plugin like so:

var options = {
  type: 'radar',
  data: {
    labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
    datasets: [{
        label: '# of Votes',
        data: [12, 19, 3, 5, 2, 3],
        borderWidth: 1
      },
      {
        label: '# of Points',
        data: [7, 11, 5, 8, 3, 7],
        borderWidth: 1
      }
    ]
  },
  options: {
    plugins: {
      customLine: {
        //specify line color
        lineColor: 'red'
      }
    }
  },
  plugins: [{
    id: 'customLine',
    afterDatasetDraw: (chart, args, options) => {
      const {
        ctx,
        chartArea
      } = chart;
      const {
        meta
      } = args;

      // only do the first dataset lines, if you remove this if it will draw lines for all datasets
      if (meta.index > 0) {
        return;
      }

      meta.data.forEach((dataPoint) => {
        //default line color black as fallback if no color is specified
        ctx.strokeStyle = options.lineColor || 'black';
        ctx.beginPath();
        ctx.moveTo(chartArea.width / 2, chartArea.height / 2 + chartArea.top);
        ctx.lineTo(dataPoint.x, dataPoint.y);
        ctx.stroke();
      })

    }
  }]
}

var ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
<body>
  <canvas id="chartJSContainer" width="600" height="400"></canvas>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.1.0/chart.js" integrity="sha512-LlFvdZpYhQdASf4aZfSpmyHD6+waYVfJRwfJrBgki7/Uh+TXMLFYcKMRim65+o3lFsfk20vrK9sJDute7BUAUw==" crossorigin="anonymous"></script>
</body>


text:
Q: Crear una entrada personalizada para Ion-Select Estoy trabajando con ion-select y requiero agregar un elemento nuevo en caso de no existir dicho elemento en la lista, habia pensado en seleccionar un elemento espesifico del  select y con ayuda de un alert ingresar un nuevo campo pero tengo algun tipo de error, mi codigo es el siguiente

import { Component, OnInit } from '@angular/core';
import { AlertController } from '@ionic/angular';
@Component({
  selector: 'app-index',
  templateUrl: './index.page.html',
  styleUrls: ['./index.page.scss'],
})
export class IndexPage implements OnInit {
  public currentColor: string;
  public colors: Array<string>;
  constructor(public alertController: AlertController) { }

  ngOnInit() {
    this.colors = ['Custom', 'Brown', 'Dark'];
    this.currentColor = 'Brown';
  }

  selectChanged(selectedColor) {
    if (selectedColor === 'Custom') {
      this.inputCustomColorValue();
    } else {
      this.currentColor = selectedColor;
    }
  }

  async inputCustomColorValue() {
    const inputAlert = await this.alertController.create({
      header: 'Enter your custom color:',
      inputs: [ { type: 'text', placeholder: 'type in' } ],
      buttons: [ { text: 'Cancel' }, { text: 'Ok' } ]
    });
    inputAlert.onDidDismiss((data) => {
        const customColorName: string = data.data.values[0];
        if (customColorName) {
          const indexFound = this.colors.findIndex(color => color === customColorName);
          if (indexFound === -1) {
            this.colors.push(customColorName);
            this.currentColor = customColorName;
          } else {
            this.currentColor = this.colors[indexFound];
          }
        }
      });
    await inputAlert.present();

  }
}


text:
Q: Issue with BOOL type DynamoDB Item I am trying to create a BOOL type attribute to a table as follows:
resource "aws_dynamodb_table_item" "items" {
    table_name = aws_dynamodb_table.dynamodb-table.name
    hash_key = aws_dynamodb_table.dynamodb-table.hash_key
    range_key = aws_dynamodb_table.dynamodb-table.range_key

    for_each = {
        "0" = {
            location = "Madrid",
            coordinates = ["40.49", "-3.56"],
            visible = "false",
            destinations = ["0", "4"]
        },
        "1" = {
            location = "Mexico City",
            coordinates = ["52.36", "13.51"],
            visible = "true",
            destinations = ["1", "4"]
        },

    }

    item = <<EOF
    {
        "id": { "N": "${each.key}"},
        "location": {"S" : "${each.value.location}"},
        "coordinates": {"NS": ${jsonencode(each.value.coordinates)}},
        "destinations": {"NS": ${jsonencode(each.value.destinations)}},
        "visible": {"BOOL": "${each.value.visible}"}
    }
    EOF
}

But I get the following error:

Error: Invalid format of "item": Decoding failed: json: cannot
unmarshal string into Go struct field AttributeValue.BOOL of type bool

According to the AWS documentation the attribute value seems right:

BOOL
An attribute of type Boolean. For example:
"BOOL": true
Type: Boolean
Required: No

If try to save as S (String), it works.
What am I doing wrong in this example?

A: "visible": {"BOOL": ${each.value.visible}}

without quotes! :-p

A: This sort of unexpected behavior is a common result of trying to build JSON strings by string concatenation. You included quotes in the template and so Terraform retained the quotes, making the boolean value appear in the result as if it were a string.
To make this more readable and to reduce the chances of that sort of mistake, you should construct the entire JSON value using jsonencode, rather than just small portions of it:
  item = jsonencode({
    id           = { N = each.key }
    location     = { S = each.value.location }
    coordinates  = { NS = each.value.coordinates }
    destinations = { NS = each.value.destinations }
    visible      = { BOOL = each.value.visible }
  })

This pattern makes it Terraform's job to convert the entire value to valid JSON, using the type-mapping rules described in the jsonencode documentation. In particular, that function knows to convert a Terraform bool value into a JSON Bool value, getting the result you needed here without the errant extra quotes. It will also ensure that the id and location values are properly escaped to be JSON strings, whereas your original example would've failed if either of those contained any characters that JSON considers to be "special".


text:
Q: convertToFusionCharts second parameter not working? I having problems with the second parameter in convertToFusionCharts(). I'm trying to set caption, useLabels, major or anything, but without results, in the site eg. also seem to have problems.
It's set to show a caption ("Units sold for last 2 years") but it's not working.
http://www.fusioncharts.com/dev/using-with-javascript-libraries/jquery/rendering-charts-from-html-tables.html
I'm trying:
jQuery("#myHTMLTable").convertToFusionCharts(

{
   type: 'MSColumn2D',
   width: "100%",
   height: "500",
   dataFormat: "htmltable",
   renderAt: "myChartContainer"

},
{

   hideTable: true,

   useLabels: 0,

   useLegend: 0,

   showLegend: false,

   showLabels: false,

   major: "row"

}
);

Anyone know what's happing?

A: try setting them within chartattributes like this:
jQuery("#myHTMLTable").convertToFusionCharts({
type: "pie2d",
width: "100%",
height: "650",
dataFormat: "htmltable",
renderAt: "chart-testhtmlid"}, {
"chartAttributes": {
    caption: "Current Db Sizes:",
    xAxisName: "Size (MB)",
    yAxisName: "DB Name",
    exportEnabled : "1",
    exportAtClientSide: "1",
    exportFileName: Instance + " Db Sizes " + ReportDate,
    defaultNumberScale: "MB",
    numberScaleValue: "1000,1000",
    numberScaleUnit: "GB,TB",
        bgColor: "FFFFFF",
        theme: "fint"
},
"ignoreCols": [1,2,3,4,5,6,8]
});


text:
Q: How is state shared between nunit tests? There are some configuration settings that most of the tests in an integration test suite will need to share. These include database connection strings and similar items. It's very slow to fetch these from the system where they are stored. I'm planning to create a Fixture class with the SetUpFixture attribute that's in the root namespace of the assembly and use the OneTimeSetup attribute for the method that gets the config data. That will ensure it only runs one time before any of the tests start.
I can use a static property on the same Fixture class and then individual tests can read the config items with Fixture.ConfigSettings. This seems to work fine in some preliminary testing. Since the tests only read these settings there shouldn't be any cross test interference.
Is an arrangement like this a common way to handle this situation with NUnit? Are there other built in NUnit features or recommended pattern that may be helpful?

A: Yes, this will work. You should be clear, however that a SetUpFixture and a TestFixture serve different purposes. Do not use both attributes on the same class. Do not inherit one from the other.
As you noted, only static properties will work in this situation and the values should not change once set.


text:
Q: Увеличение картинки как на Алиэкспресс Пытался найти такой эффект в Гугле но все результаты сходятся к тому что нахожу обычное увеличение при наведении с помощью css. Если кто знает как и где найти такой эффект для реакта или урок на эту тему буду очень благодарен!

A: Ricco381, на сайт АлиЭкспресс заходить не хочу, там в Китае сейчас короновирус, опасно. Поэтому могу предложить такой вариант увеличения картинки:

$(document).ready(function() {
  var zoomMargin = 15;

  function startZoom(e) {
    $('.zoomer .large').css('left', $(this).width() + zoomMargin).show(); // Контейнер у большим изображением становится видимым.
  }

  function moveZoom(e) {
    var offset = $(this).offset(), // В переменной offset хранятся координаты блока с миниатюрой
      x = (e.pageX - offset.left), // В переменной хранится координата X курсора мыши относительно блока с миниатюрой
      y = (e.pageY - offset.top); // Координата Y курсора мыши.
    w = $(this).width(), // Ширина миниатюры
      h = $(this).height(), // Высота миниатюры
      // Позиционирование фона большого изображения относительно того, куда указывает курсор на миниатюре.
      $('.large').css({
        'background-position': (x / w * 100) + '% ' + (y / h * 100) + '%'
      });
  }

  function endZoom(e) {
    $('.zoomer .large').hide(); // Контейнер с большим изображением скрывается
  }
  $('.small').on({
    'mouseenter': startZoom, // При наведении мыши на миниатюру срабатывает функция startZoom
    'mousemove': moveZoom, // Когда курсор мыши перемещается внутри миниатюры срабатывает функция moveZoom
    'mouseleave': endZoom // Когда мышь уходит из области миниатюры срабатывает функция endZoom
  });
})
.zoomer {
  width: 300px;
  height: 200px;
  position: relative;
}

.zoomer .small {
  width: 300px;
  height: 200px;
  background: url(https://storage.yandexcloud.net/incrussia-prod/wp-content/uploads/2017/09/Jack-Ma.jpg) no-repeat;
  background-size: cover;
  /* Масштабирует изображение с сохранением пропорций так, чтобы его ширина или высота равнялась ширине или высоте блока. */
  position: absolute;
}

.zoomer .large {
  background: url(https://storage.yandexcloud.net/incrussia-prod/wp-content/uploads/2017/09/Jack-Ma.jpg) no-repeat;
  position: absolute;
  display: none;
  width: 600px;
  height: 400px;
}

Знаете, кто это?


text:
Q: How to replicate CSS layout example

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  margin: 0 auto;
}

.header {
  padding: 2.5rem 0;
  margin-bottom: 1rem;
  background-color: #c8bfbf;
}
.content {
  display: flex;
  flex-direction: row;
}

.navbar-list {
  display: flex;
  flex-direction: row;
  list-style: none;
}

.list-item {
  margin-left: 1rem;
}

.footer-list {
  display: flex;
  flex-direction: row;
  list-style: none;
}

.footer-content {
  display: flex;
  flex-direction: row;
  list-style: none;
  justify-content: space-between;
}

.main-container {
  width: 1200px;
}
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./style.css">
    <title>CSS Assignment</title>

Home

About

Service

Contact

We Provide the best IT Services

Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum, assumenda distinctio. Fugit, quam veritatis
            officia mollitia ex fugiat beatae temporibus.

        Know more...

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet ex itaque voluptates facilis earum quis
            similique, quasi quisquam nesciunt nulla ab esse veritatis molestias. Sapiente dolore molestiae error, quos
            pariatur minima omnis, ipsa quis et a porro dignissimos totam officiis ad quo eos quae natus dicta ullam
            cupiditate tempore? Omnis labore exercitationem eaque asperiores illum praesentium nobis, a velit molestias?

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet ex itaque voluptates facilis earum quis
            similique, quasi quisquam nesciunt nulla ab esse veritatis molestias. Sapiente dolore molestiae error, quos
            pariatur minima omnis, ipsa quis et a porro dignissimos totam officiis ad quo eos quae natus dicta ullam
            cupiditate tempore? Omnis labore exercitationem eaque asperiores illum praesentium nobis, a velit molestias?

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet ex itaque voluptates facilis earum quis
            similique, quasi quisquam nesciunt nulla ab esse veritatis molestias. Sapiente dolore molestiae error, quos
            pariatur minima omnis, ipsa quis et a porro dignissimos totam officiis ad quo eos quae natus dicta ullam
            cupiditate tempore? Omnis labore exercitationem eaque asperiores illum praesentium nobis, a velit molestias?

Home

About

Contact

Facebook

Twitter

Viemo

Can someone help me with this layout?
https://imgur.com/a/Dq5WNOz
I am using CSS flexbox to style it but I have a question. How is the header text and the content's width lined up / same width. But also their background extends the full page. Is the content lined up with the same padding? At first I tried using the same margin but my example ended up looking like this.
Mine : https://imgur.com/5PxvMKs

A: I just made certain changes and did CSS and here is the layout you were looking for.
-user container to wrap

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.container {
  max-width: 1024px;
  margin: auto;
}

nav {
  background: #000;
}

.navbar-list {
  padding: 0;
  margin: 0;
  display: flex;
  list-style: none;
}

.navbar-list>.list-item {
  margin-right: 15px;
}

.navbar-list>.list-item a {
  color: #fff;
  text-decoration: none;
  line-height: 50px;
}

.header {
  background: #aaaaaa;
  padding: 30px 0;
}

.header h2 {
  padding: 0 0 15px;
}

.content p {
  display: inline-block;
  width: calc(100% / 3 - 30px);
  text-align: justify;
  margin: 0 15px;
}

.content {
  padding: 30px 0;
}

.content p:first-child {
  margin-left: 0;
}

.content p:last-child {
  margin-right: 0;
}

footer.footer-content {
  background: green;
  padding: 15px 0;
}

.footer-lists {
  display: flex;
  justify-content: space-between;
}

.footer-list {
  list-style: none;
  display: flex;
}

.footer-list>li a {
  color: #fff;
  text-decoration: none;
  margin-right: 15px;
}

.footer-list>li:last-child a {
  margin-right: 0;
}
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="./style.css">
  <title>CSS Assignment</title>

Home

About

Service

Contact

We Provide the best IT Services

Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum, assumenda distinctio. Fugit, quam veritatis officia mollitia ex fugiat beatae temporibus.

      Know more...

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet ex itaque voluptates facilis earum quis similique, quasi quisquam nesciunt nulla ab esse veritatis molestias. Sapiente dolore molestiae error, quos pariatur minima omnis, ipsa quis et
        a porro dignissimos totam officiis ad quo eos quae natus dicta ullam cupiditate tempore? Omnis labore exercitationem eaque asperiores illum praesentium nobis, a velit molestias?

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet ex itaque voluptates facilis earum quis similique, quasi quisquam nesciunt nulla ab esse veritatis molestias. Sapiente dolore molestiae error, quos pariatur minima omnis, ipsa quis et
        a porro dignissimos totam officiis ad quo eos quae natus dicta ullam cupiditate tempore? Omnis labore exercitationem eaque asperiores illum praesentium nobis, a velit molestias?

Lorem ipsum dolor, sit amet consectetur adipisicing elit. Amet ex itaque voluptates facilis earum quis similique, quasi quisquam nesciunt nulla ab esse veritatis molestias. Sapiente dolore molestiae error, quos pariatur minima omnis, ipsa quis et
        a porro dignissimos totam officiis ad quo eos quae natus dicta ullam cupiditate tempore? Omnis labore exercitationem eaque asperiores illum praesentium nobis, a velit molestias?

Home

About

Contact

Facebook

Twitter

Viemo


text:
Q: Can C# use Firefox instead of IE for Webforms? I have a bit of a problem.  I use a front end application written in C# for my companies order entry, quotes, contracts, and to control printing.  It also uses a built in web browser to access ColdFusion (8) web forms.  The latest IE patch is leaving users who updated their IE to be unable to click links from within the application.
I can either:

*

*Reinstall an older version of IE which works

*Re-write the web-browser to possibly use another browser as it's base. I've                       never done this so I'm clueless.

Am I on the correct path? What I have them doing now is just opening the application from Chrome and it works great; however, there are some fuctons that call back to the C# application that do not work when using an external browser.

A: If the underlying cause isn't immediately obvious you could attempt to specify for internet explorer to use its older version via the x-ua header.

  <meta http-equiv="x-ua-compatible" content="IE=9">
  <title>My webpage</title>

Content goes here.

https://msdn.microsoft.com/library/jj676915.aspx
If this works it can be a good fix to buy time to resolve the underlying cause of the problem but don't stay on the old version of internet explorer if you can. These problems will only get worse going forward and you'll miss out on the improvements to internet explorer if you do.


text:
Q: Fetch data from Oracle Database on hourly and daily basis using timestamp and current date I have written query to get data for a particular day, but need a query to get the data on hourly and daily basis
My Query:
SELECT
TRAN_USERTRANSACTIONS.APPLICATIONNUMBER
FROM
TRAN_USERTRANSACTION
WHERE TRAN_USERTRANSACTIONS.CREATEDAT
LIKE '%19-09-19%'
GROUP BY
TRAN_USERGTRANSACTION.APPLICATIONNUMBER;

CREATEDAT is Timestampin in format as follows :DD-MM-YY hh.mm.ss.ssss AM/PM

A: By hour(hope this helps):
Select TRAN_USERTRANSACTIONS.APPLICATIONNUMBER
       , TO_CHAR(TRAN_USERTRANSACTIONS.CREATEDAT ,'HH AM')
from TRAN_USERTRANSACTION
WHERE TRAN_USERTRANSACTIONS.CREATEDAT LIKE '%19-09-19%'
group by TRAN_USERTRANSACTIONS.APPLICATIONNUMBER
         , TO_CHAR(TRAN_USERTRANSACTIONS.CREATEDAT ,'HH AM')
order by TO_CHAR(dat_azu,'HH AM') asc;

A: I assume you want a summary by hour and not by application.  If so, the hour should be in the GROUP BY:
SELECT TO_CHAR(t.CREATEDAT, 'YYYY-MM-DD HH24') as dh,
       COUNT(*)
FROM TRAN_USERTRANSACTION t
WHERE t.CREATEDAT >= DATE '2019-09-19' AND
      t.CREATEDAT < DATE '2019-09-20'
GROUP BY TO_CHAR(t.CREATEDAT, 'YYYY-MM-DD HH24')
ORDER BY dh;


text:
Q: Sales Force Integration I'm trying to integrate sales force with my application,I'm using oauth2.0 authorization for getting refresh token.I'm redirecting to salesforce login page.I dnt want to show this page in my app.Is there any way for that.

A: The key concept behind using the OAuth 2.0 Web Server Authentication Flow or the OAuth 2.0 User-Agent Flow is that the users authentication details only go to Salesforce. Your application doesn't need to handle their username or password. This, combined with the authorization of your app in Salesforce gives the user a greater level of security.
You can't store the username/password details and they can revoke authorization access for the app.
If you don't want to redirect via the Salesforce login page you can use the OAuth 2.0 Username-Password Flow. Here you will handle the username and password (plus potentially the security token). This is less secure from the users perspective, but bypasses the redirect to the Salesforce login page.
Incidentally, there is a dedicated StackExchange site for Salesforce that is a great place to ask these sort of questions.


text:
Q: Spring Web- replacing web.xml with WebApplicationInitializer gives me 404 I'm trying to rewrite configuration of my webapp from xml oriented into Java based one. Annotated configuration files combined with web.xml works just fine but once I replace web.xml with WebApplicationInitializer class all i get is 404 - The requested resource (/WebApp/) is not available.
web.xml
<?xml version="1.0" encoding="UTF-8"?>

<web-app
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                        http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    version="3.0">

    <display-name>Servlet 3.0 Web Application</display-name>

    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextClass</param-name>
            <param-value>
                org.springframework.web.context.support.AnnotationConfigWebApplicationContext
            </param-value>
        </init-param>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                webapp.config.AppConfig
            </param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <context-param>
        <param-name>contextClass</param-name>
        <param-value>
            org.springframework.web.context.support.AnnotationConfigWebApplicationContext
        </param-value>
    </context-param>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>webapp.config.PersistenceConfig</param-value>
    </context-param>

    <listener>
        <listener-class>
            org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>

    <filter>
        <filter-name>encoding-filter</filter-name>
        <filter-class>
            org.springframework.web.filter.CharacterEncodingFilter
        </filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encoding-filter</filter-name>
        <url-pattern>/</url-pattern>
    </filter-mapping>

</web-app>

and my WebApplicationInitializer correspondig to web.xml
package webapp.init;
import webapp.config.*;

import javax.servlet.ServletContext;
import javax.servlet.ServletRegistration;

import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;

public class AppInitializer implements WebApplicationInitializer{

    @Override
    public void onStartup(ServletContext servletContext) {

        AnnotationConfigWebApplicationContext PeristenceContext = new AnnotationConfigWebApplicationContext();
        PeristenceContext.register(PersistenceConfig.class);

        servletContext.addListener(new ContextLoaderListener(PeristenceContext));

        AnnotationConfigWebApplicationContext dispatcherContext = new AnnotationConfigWebApplicationContext();
        dispatcherContext.register(AppConfig.class);

        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(dispatcherContext));
        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping("/");
    }
}

I also found out that if i replace dispatcher.addMapping("/"); with dispatcher.addMapping("/*"); i don't get 404 , my app will load up but all the jsp pages are wrapped by browser into another <html> and <body> tag - don't know if this indicates something, but if someone can explain this too i'd be very thankful
and my pom.xml which I suspect might be also wrong
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.judge</groupId>
    <artifactId>CarWebApp</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>CarWebApp Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <properties>
        <!-- Build Properties -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Dependency Versions -->
        <spring.version>3.2.10.RELEASE</spring.version>
        <hibernate.version>4.3.5.Final</hibernate.version>
    </properties>

    <dependencies>

        <!-- Servlet & JSTL -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>

        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <!-- MySQL -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.31</version>
        </dependency>

        <!-- hibernate 4 and all it takes -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.2.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.2.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <version>1.0.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.1.0.Final</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.5</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>3.1.0.CR2</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.5</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-dbcp</artifactId>
            <version>7.0.52</version>
        </dependency>

    </dependencies>

    <build>
        <finalName>CarWebApp</finalName>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>

        </plugins>
    </build>
</project>

A: By default, tomcat affect its internal default servlet to URL /. First versions of tomcat 7.0.x are knowned to not allow programmatic overriding of it.
Maybe you should upgrade your tomcat to a more recent version.


text:
Q: How do Traits in Scala avoid the "diamond error"? (Note: I used 'error' instead of 'problem' in the title for obvious reasons.. ;) ).
I did some basic reading on Traits in Scala. They're similar to Interfaces in Java or C#, but they do allow for default implementation of a method.
I was wondering: can't this cause a case of the "diamond problem", which is why many languages avoid multiple inheritance in the first place?
If so, how does Scala handle this?

A: The diamond problem is the inability to decide which implementation of the method to choose. Scala solves this by defining which implementation to choose as part of the language specifications(read the part about Scala in this Wikipedia article).
Ofcourse, same order definition could also be used in class multiple inheritance, so why bother with traits?
The reason IMO is constructors. Constructors have several limitations that regular methods don't have - they can only be called once per object, they have to be called for each new object, and a child class' constructor must call it's parent's constructor as it's first instruction(most languages will do it implicitly for you if you don't need to pass parameters).
If B and C inherit A, and D inherits B and C, and both B and C's constructors call A's constructor, then D's constructor will call A's constructor twice. Defining which implementations to choose like Scala did with methods won't work here because both B's and C's constructors must be called.
Traits avoid this problem since they don't have constructors.

A: Scala avoids the diamond problem by something called "trait linearization". Basically, it looks up the method implementation in the traits you extend from right to left. Simple example:
trait Base {
   def op: String
}

trait Foo extends Base {
   override def op = "foo"
}

trait Bar extends Base {
   override def op = "bar"
}

class A extends Foo with Bar
class B extends Bar with Foo

(new A).op
// res0: String = bar

(new B).op
// res1: String = foo

Having said that, the list of traits it looks up might contain more than the ones you explicitly gave, since they might extend other traits. A detailed explanation is given here:
Traits as stackable modifications
and a more complete example of the linearization here:
Why not multiple inheritance?
I believe in other programming languages this behavior is sometimes referred to as "Method resolution order" or "MRO".


text:
Q: Ionic card background color not changing on click event Im Using Ionic3.I want to change my ion-card background color whenever the click function fires, i have some problem it does not work for me, any help on this would be great.Thank You
Thanks
html
<ion-card  [color]="buttonColor" (click)="someAction()" tappable>

          <ion-card-content >

01.Account Creation Success

          </ion-card-content>

        </ion-card>

.ts
export class WelcomePage {
    private buttonColor: string = "primary";

    someAction() {
        this.buttonColor = "light";
    }
}

A: you need to use ngStyle or style.background. ion-card doesn't have direct color attribute.
<ion-card  [ngStyle]="{'background':buttonColor}" (click)="someAction()" tappable>
          <ion-card-content >

01.Account Creation Success

          </ion-card-content>

        </ion-card>

Using style:
<ion-card  [style.background]="buttonColor" (click)="someAction()" tappable>
          <ion-card-content >

01.Account Creation Success

          </ion-card-content>

        </ion-card>


text:
Q: Trying to create a multipart/form-data body and then printing it out but it gives nil as output I have a function that is supposed to generate a multipart/form-data body for post requests so that I can send an image along with form parameters.
class HttpService {

    // https://stackoverflow.com/questions/26162616/upload-image-with-parameters-in-swift
    static func createMultipartBody(parameters: [String: String], boundary: String, data: Data, mimeType: String, filename: String) throws -> Data {

        var body = Data()

        for (key, value) in parameters {
            body.append("--\(boundary)\r\n")
            body.append("Content-Disposition: form-data; name=\"\(key)\"\r\n\r\n")
            body.append("\(value)\r\n")
        }

        body.append("--\(boundary)\r\n")
        body.append("Content-Disposition: form-data; name=\"file\"; filename=\"\(filename)\"\r\n")
        body.append("Content-Type: \(mimeType)\r\n\r\n")
        body.append(data)
        body.append("\r\n")
        body.append("--\(boundary)--\r\n")

        return body
    }

}

extension Data {
    mutating func append(_ string: String) {
        if let data = string.data(using: .utf8) {
            append(data)
        }
    }
}

I use this function like this:
let urlString = baseUrl + "/api/user"
let url = URL(string: urlString)
var urlRequest = URLRequest(url: url!)
urlRequest.httpMethod = "POST"

let boundary = "Boundary-\(UUID().uuidString)"
urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")

let parameters: [String: String] = ["email": email, "username": username, "password": password]

do {
    let multipartBody = try HttpService.createMultipartBody(parameters: parameters, boundary: boundary, data: imageData, mimeType: "image/jpg", filename: "photo.jpg")
    urlRequest.httpBody = multipartBody

    print(multipartBody)
    print(String(data: multipartBody, encoding: String.Encoding.utf8))
} catch let error {
    print(error)
    return
}

This outputs:
51551 bytes
nil

So it looks like the data is being generated, but I can't output it as string to see how the format looks like.

A: What's printing nil is not the data; it's this:
print(String(data: multipartBody, encoding: String.Encoding.utf8))

The data isn't nil; the String is. The problem is that you are pretending this is thing is a UTF8-encoded string. It isn't! It's a bunch of random data bytes. Okay, they're not random, but they are nothing whatever like a UTF8 string. So when you try to convert it to a UTF-8 string, you get nil.
If what you wanted was to see the bytes, then look at the bytes. They are a sequence of small integers. (For example, you might print Array(multipartBody) or iterate over the bytes and print each one.) Don't try to treat it as something that it isn't.
(Though, to be honest, I do not at all see what good you think looking at the bytes will do you either; you likely won't understand them in any case.)


text:
Q: loop through a for statement using an if/else with nunjucks and json I'm trying to loop through a nested json file with nunjucks, give each object type a specific layout and sort all based on date.
So in my case I have two collections events and videos. Both collections will have an array of events and videos.
My file is named /content.json and structured as followed:
{
    media: {
        events: [
            {
            content_id: "1",
            content_type: "event",
            date: "01-11-2019",
            etc: "etc"
            },
            {
            content_id: "2",
            content_type: "event",
            date: "01-08-2019",
            etc: "etc"
            }
        ],
        videos: [
            {
            content_id: "3",
            content_type: "video",
            date: "01-12-2019",
            etc: "etc"
            },
            {
            content_id: "4",
            content_type: "video",
            date: "01-09-2019",
            etc: "etc"
            }
        ]
    }
}

I have tried to get the different object assigned with an if/else statement and then use a for loop to cycle through the array, but that has failed, see below:
{% for item in content.media %}
    {% if item == events %}
        {% for item in content.media.events %}
                {% include "components/event.njk" %}
        {% endfor %}
    {% elif item ==  video %}
        {% for item in content.media.videos %}
                {% include "components/video.njk" %}
        {% endfor %}
    {% endif %}
{% endfor %}

I never got to try and sort all the content by date, but I have found:
{% for item in items|sort(attribute='date')%}

Can anyone guide me in right direction?
Thanks in advance.
AENM

A: This code outputs separated feeds by type of elements (event or video).
{% for event in content.media.events | sort(attribute = 'date') %}
    {% include "components/event.njk" %}
{% endfor %}

{% for video in content.media.videos | sort(attribute = 'date') %}
    {% include "components/video.njk" %}
{% endfor %}

If you need to output a mixed feed, you should join arrays to one and run trought it (fortunately each elements already have the type):
{% for item in [].concat(content.media.events, content.media.videos) | sort(attribute = 'date') %}
    {% include "components/" + item.content_type + ".njk" %}
{% endfor %}

A: Aikon,
I got it now!!
It was another typo, you switched the media and events. (did you try to keep me sharp?! :-))
But that's why the concat didn't work!!
So this is the final working result:
{% for item in [].concat(media.content.events, media.content.videos) | sort(attribute = 'date') %}
     {% include "components/" + item.type + ".njk" %}
{% endfor %}

Only the date is not in the correct order, but I think that has to with my grid setup.
Thanks for helping me out......


text:
Q: ConvertTo-Json flattens arrays over 3 levels deep In powershell, the following produces correct results.
$foo = @{}
$foo.bar = @{}
$foo.bar.buzz = @("herp","derp")
ConvertTo-Json $foo

{
  "bar":  {
    "buzz":  [
      "herp",
      "derp"
    ]
  }
}

However if I add one more level, then the array "buzz" is flattened into a string
$foo = @{}
$foo.bar = @{}
$foo.bar.buzz = @{}
$foo.bar.buzz.bazz = @("herp","derp")
ConvertTo-Json $foo

{
  "bar":  {
    "buzz":  {
      "bazz": "herp derp"
    }
  }
}

Why does powershell flatten Arrays into strings?
This issue feels similar to the following SO questions, but none of the purposed solutions solves it.
why-does-powershell-silently-convert-a-string-array-with-one-item-to-a-string
what-determines-whether-the-powershell-pipeline-will-unroll-a-collection

A: From ConvertTo-Json documentation

-Depth
Specifies how many levels of contained objects are included in the
  JSON representation. The default value is 2.

Adding -Depth 9 option to ConvertTo-Json fixes the issue
ConvertTo-Json -Depth 9 $foo

Also, there is a difference between ConvertTo-Json $foo and $foo | ConvertTo-Json. Use ConvertTo-Json $foo whenever possible.
convertto-json-an-array-with-a-single-item


text:
Q: how to solve the net beans check out error org.apache.subversion.javahl.ClientException? As i  checkout my  project in net beans 7.3.1,i got the following error
"org.apache.subversion.javahl.ClientException: E175002: Processing REPORT request response failed: XML document structures must start and end within the same entity"
if you know how to solve this kindly help me out.Since i am new to Ubuntu,also some please help me how to set the environmental variables for Java in Ubuntu?


text:
Q: Unable to run VueJS SPA with Spring Boot I have VueJS single page appication which I want to move to the Spring Boot project and run it in the production environment. With npm run build I genereted these files:
Hash: 0e5605ab6a3adbae5bc3
Version: webpack 3.10.0
Time: 34203ms
                                                  Asset       Size  Chunks                    Chunk Names
                  static/js/app.a8c2e3befee9add63a47.js    67.9 kB       1  [emitted]         app
                             static/img/bg3.7e9308f.jpg     191 kB          [emitted]
    static/img/glyphicons-halflings-regular.8988968.svg     109 kB          [emitted]
static/fonts/glyphicons-halflings-regular.448c34a.woff2      18 kB          [emitted]
  static/fonts/glyphicons-halflings-regular.f4769f9.eot    20.1 kB          [emitted]
  static/fonts/glyphicons-halflings-regular.e18bbf6.ttf    45.4 kB          [emitted]
                 static/fonts/element-icons.6f0a763.ttf      11 kB          [emitted]
               static/js/vendor.b870d414939280bd7c3a.js     1.1 MB       0  [emitted]  [big]  vendor
 static/fonts/glyphicons-halflings-regular.fa27723.woff    23.4 kB          [emitted]
             static/js/manifest.58a976c7eeb4e639b033.js    1.49 kB       2  [emitted]         manifest
    static/css/app.8dfb1913ee552ff55ff81ea142c3f782.css     443 kB       1  [emitted]  [big]  app
static/css/app.8dfb1913ee552ff55ff81ea142c3f782.css.map     623 kB          [emitted]
           static/js/vendor.b870d414939280bd7c3a.js.map    3.99 MB       0  [emitted]         vendor
              static/js/app.a8c2e3befee9add63a47.js.map     267 kB       1  [emitted]         app
         static/js/manifest.58a976c7eeb4e639b033.js.map     7.8 kB       2  [emitted]         manifest
                                             index.html  704 bytes          [emitted]

  Build complete.

And I copied them to /resources/static folder. When I run Spring Boot project I'm able to open index.html file, but all of the related resources like js, css and img files returns 404 Not Found Exception. I can't even load them with direct link in the browser.
This is very strange, because when I copy and paste, for example, static/css/app.8dfb1913ee552ff55ff81ea142c3f782.css file and change only one digit in the name, I'm able to load it with the browser.
How is that possible?

A: Looks like the coping files to the resource folder is very fragile in Spring Boot. With those exactly steps I was able to run my project:

*

*Stop application (the embeded Tomcat)

*Delete all files in /resources/static folder

*Copy new html/css/js/img files

*Clean and Build the project

*Run the application


text:
Q: Create automatic tag wikis for the automatic tags on per-site metas In an answer to Which tags are automatically added to per-site metas?, I received a list of 53 tags, plus required and moderator-only tags, which are automatically added to every per-site meta when the site is created.
I don't know how many, if any, of these also get automatically generated tag wikis. My guess would be that the required and moderator-only tags do, but probably not any of the others. Even on reasonably large meta sites, many of these tags are missing their tag wikis. So my proposal is:
automatically generate tag wikis for all the automatically generated tags.

This would make it much easier to administer these tags. As it is, some of them have been synonymised and merged, others have never been used, and the vast majority of them have no usage guidance (in the form of tag wikis and tag wiki excerpts) whatsoever.


text:
Q: get_theme_mod is returning a number rather than my image file This is my first time attempting at implementing a custom panel into the customizer so bare with me please... In short, I am child-theming my site and want to make a basic modification to the parent theme for my blog posts. The way it works now is when you hover over a blog post, there is a font awesome icon which shows up in the middle of the overlay... what I plan to do is replace the font awesome icon with my custom uploaded image that Im scripting for the customizer.
I have successfully added the section to the customizer and it allows me to upload my logo, but when I attempt to output the uploaded image into the theme with:
<?php echo get_theme_mod( 'hbps_blog_overlay_logo' ); ?>

...it just displays a number - Im not even sure what the number is in reference to yet?
This is my complete markup in my child theme's functions.php:
// Register Hotbox Customizer Options
function hbps_customize_register( $wp_customize ) {

    $wp_customize->add_panel( 'hbps_custom_panel',
        array(
            'title' => __( 'Extra Options' ),
            'description' => esc_html__( 'Additional options for the Flexia theme.' ),
            'priority' => 90,
        )
    );

    $wp_customize->add_section( 'hbps_blog_section',
        array(
            'title' => __( 'Blog Extras' ),
            'description' => esc_html__( 'Additional options for the blog section.' ),
            'panel' => 'hbps_custom_panel',
            'priority' => 160,
        )
    );

    $wp_customize->add_setting( 'hbps_blog_overlay_logo',
        array(
            'default' => '',
            'transport' => 'refresh',
            'sanitize_callback' => 'absint',
        )
    );

    $wp_customize->add_control( new WP_Customize_Cropped_Image_Control( $wp_customize, 'hbps_blog_overlay_logo',
        array(
            'label' => __( 'Post Overlay Logo' ),
            'description' => esc_html__( 'Upload a custom logo for the masonry layout that will appear when hovering over a blog post. - Recommended Size: 60x60 px' ),
            'section' => 'hbps_blog_section',
            'width' => 60,
            'height' => 60,
            'button_labels' => array(
                'select' => __( 'Select Logo' ),
                'change' => __( 'Change Logo' ),
                'default' => __( 'Default' ),
                'remove' => __( 'Remove' ),
                'placeholder' => __( 'No logo selected' ),
                'frame_title' => __( 'Select Logo' ),
                'frame_button' => __( 'Choose Logo' ),
            )
        )
    ) );

}
add_action( 'customize_register', 'hbps_customize_register' );

Example of blog post in "hover state":

Example of new Customizer section:

Extra Question:
Not sure if theres a way around this, but the code Im attempting to
  amend is contained within a plugin, not the parent theme
  unfortunately. The dev that made the theme offered the pro version by
  adding the plugin which aggregately adds the extra features... is
  there any way to do this from my child theme? I cant seem to find a
  way that doesnt involve directly editing the plugins code which Id
  prefer not doing.

Thank you for your help,
Shaun

A: get_theme_mod is not returning the HTML code for an image and it's not returning URL of that image. So what is that number? It's the ID of selected attachment.
This way you can decide how to use the selected value. So how to display the image?
If you want to print the image, you can do this:
if ( get_theme_mod( 'hbps_blog_overlay_logo' ) > 0 ) {
    echo wp_get_attachment_image( get_theme_mod( 'hbps_blog_overlay_logo' ), 'full' );
}

And to display only the URL of that file:
if ( get_theme_mod( 'hbps_blog_overlay_logo' ) > 0 ) {
    echo wp_get_attachment_image_url( get_theme_mod( 'hbps_blog_overlay_logo' ), 'full' );
}


text:
Q: Create launcher icon for Navicat How can I get the application Navicat into my launcher menu & sidebar 'dock'?
It runs in wine and has its own wine directory as part of the download. I've created .desktop files before to create launcher icons but I cannot figure out how to do it with Navicat & the tutorials I've found online for wine applications don't seem to work. I think it's because Navicat has it's own wine directory and doesn't use the one that comes with Ubuntu?
It was suggested that this is a duplicate of "How does one create a custom application launcher for Wine installed apps?" which I've tried and it hasn't worked. I'm not sure what makes my case different though, I think it's related to Navicat using a wine directory that is downloaded with the application.

A: I used to start Navicat from Bash till I figured out the solution.
To add Navicat to the menu, create a Launcher item in /usr/share/applications. Change the Exec line to match the path where you unzipped navicat.
 The solution has nothing to do with wine.
[Desktop Entry]
Name=Navicat
Comment=Database Admin Tool
Exec=/bin/sh  "/opt/navicat/start_navicat"
Icon=/path/to/icon
Terminal=false
Type=Application
Categories=Wine;
StartupNotify=true


text:
Q: Email is not sending in django after deploy in Cpanel I just deploy a Django web app in Cpanel. But SMTP email is not working in Cpanel. It works only on my local machine. I don't have much knowledge about Cpanel.
Here is my code for setting.py:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = 'my gmail'
EMAIL_HOST_PASSWORD = 'password'

A: solved!! changed EMAIL_HOST_USER to cpnael hosting email.


text:
Q: AngularJS page hopping around with semanticUI Tabs I have built an app that utilizes semantic UI tabs and ui-router. Every time I switch tabs, the page 'snaps' to the div where the tabs are being held, instead of maintaining its position. I do not have any idea where to even begin looking.
Note I faced another similar issue earlier on in the build, where angularUI grid was causing the page to hop around and snap to the view. For the sake of trying to fix the current issue, I have commented out any angularUI grid line that could have caused the issue, leading me to believe it has something to do with semantic.
Has anyone faced an issue like this? Where do I even begin troubleshooting?
*please note, I am scrolling back up in the gif, then clicking a tab, where it snaps back down