text:
Q: Dropdown elements in html doesn't link i'm just a beginner in html and css. I'm currently working on my activity which I have added navigation bar to it that I got from a tutorial. My problem is the link inside the dropdown isn't working. This is my code:
HTML code
<!DOCTYPE html>

        <title> CWP - 111 HW1</title>
        <link href = "style.css" rel = "stylesheet">

           <image src = "ue.jpg" style = "width: 1300px; height: 200px" >

Home

Assignments

test 1
<!doesn work>

test 2
<!doesn work>

Activities

                                     <!Link testing>

test 3
<!doesn work>

test 4
<!doesn't work>

About

CSS
#container {
    margin: auto;
    width: 1300px;
}
header,nav,div,footer{
    display: block;
}
.nav-main{

    width: 100%;
    background-color: #660000;
    padding: 0px;
    margin-top: 10px;
    height: 70px;

}
.nav-main > ul{

        margin: 0;
        padding: 0;
        float: left;
        list-style-type: none;

}
.nav-main > ul > li{

        float: left;
}
.dropdown{
    display: inline-block;
    padding: 15px 20px ;
    height: 40px;
    line-height: 40px;
    color: white;
    text-decoration: none;
}

.dropdown:hover{
    background-color: #A80000;

}

.content{

    position: absolute;
    max-height: 0px;
    overflow: hidden;
    background-color: #660000;

}
.content a{

    color: white;
    text-decoration: none;
}

.content a:hover{

    text-decoration: underline;
}

.content-sub{
    padding: 20px;
}
.content-sub ul{
    padding: 0px;
    margin: 0px;
    list-style-type: none;
}

.content-sub ul li a{
    padding: 5px 0px;
    display: inline-block;
}

.dropdown:focus{

    background-color: #A80000;
}

.dropdown:focus ~ .content{

    max-height: 400px;
    -webkit-transition: max-height 0.4s ease-in;
    -moz-transition: max-height 0.4s ease-in;
    transition: max-height 0.4s ease-in;
}

body{

     background: linear-gradient(rgba(255,0,0,0), rgba(255,0,0,1));
}

.section{
    background-image: url("years.jpg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-color: white;
    padding: 10px 10px 10px 10px;
    margin: 10px;

    overflow: auto;
}
footer{
    background-color: black;
    padding: 5px;
    margin-top: 10px;

}
h1{
    text-align: center;
    color: White;
}

.divide2{

background-color: #11233b;
    margin-top: 10px;
    margin-left: auto;
    margin-right: auto;
    padding: 5px;

    width: 600px;

}

.lyrics{
    background-image: url("years1.jpg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
background-color: white;
text-align: left;
margin: 10px 10px 10px 10px;
padding: 10px 10px;
white-space: nowrap;

}
p{

color: white;
}
    #title{
    color: White;

}

JSfiddle
https://jsfiddle.net/smurf16/x74Lobgt/

A: Try this. Plz change the code as follows
.content-sub {
    /*padding: 20px;*/
}
.content{
    position: absolute;
    /*max-height: 0px;
    overflow: hidden;*/
    background-color: #660000;
}
ul li .content ul{
    min-width: 125px;
    display: none;
    position: absolute;
    z-index: 999;
    left: 0;
}
ul li:hover .content ul{
    display: block;
}
ul li .content ul li{
    display: block;
    background: #660000;
}
ul li .content ul li a{
    padding: 10px;
    width: 100px;
}
ul li .content ul li a:hover{
    background: #A80000;
    text-decoration: none;
}

Demo Link jsfiddle


text:
Q: Camel Iterator or How to use Camel Splitter but keep body unchanged I want to iterate String with a delimiter "," and then send message to several endpoint. The problem is if I use Splitter, it would replace the body content of my message.
from("switchyard://ICamelServiceProcess")
.process(new Processor() {
String recipients = "abc";
recipients += "," + "bcd";
exchange.getIn().setHeader("recipients", recipients);
}
.to("switchyard://ICamelServiceRoute");

In Service ICamelServiceRoute, I want to iterate through header.recipients value with delimiter "," and then create a file with a named of each iteration.
Could you please tell me some solution.
Thank you.

A: You can save the original body in a exchange property before the splitter, and restore it from the property when finish splitter. With Camel 2.15 or latter
<setProperty propertyName="originalBody">
    <simple>${body}</simple>
</setPropery>
<split>
    <!-- Splitter function -->
</split>
<setBody>
    <simple>${exchageProperty[originalBody]}</simple>
</setBody>

All exchange properties will be deleted when finish the camel context execution. Note that you can save Java Object in exchange properties, but only until the camel context ending

redpajama_set_name: RedPajamaStackExchange


text:
Q: React Router v4 - Redirect I'm trying to get React-Router v4 up but i'm running into some difficulty. I can create routes and test them in the browser and they resolve correctly, however if i try to direct someone to a route programatically i run into problems.
The redirect should happen after the user has clicked on a row in a table, i can see the onClick works fine (so i know the callback is working) but the redirect doesn't work...any ideas?
import { Redirect } from 'react-router-dom';
export default class Table extends Component {
...
...

  onClick(foo) {
    // let path = `/booking/${foo.bar}`;
    // console.log(path);
    // <Route path="/booking" render={() => <BookingForm />}/>;
    <Redirect to='/booking' />;
  }

...
...
}

My Routes are:
const Routes = () => (
    <main>
        <Switch>
            <Route exact path='/' component={HomePage} />
            <Route exact path='/cruises' component={Cruises} />
            <Route exact path='/booking' component={BookingForm} />
        </Switch>
    </main>
);

Thanks

A: I think below code should solve your problem.
import { withRouter } from 'react-router-dom';
class Table extends Component {
...
...

  onClick(foo) {
    let path = `/booking/${foo.bar}`;
    this.props.history.push(path);
  }

...
...
}

export default withRouter(Table);


text:
Q: Loop wregex always return false and high cpu usage around 50% I have a bunch keyword need to loop to match a wchar_t string.
the string is

5698@#$%notepad^&343235/ chrome $56&6556firefox$%#$23

and the keyword is

notepad, chrome, firefox

I try to loop it always return FALSE and when i see cpu usage. it so extensive around 50%.
this the code.
            unsigned int i;

            wchar_t * keyword[] = {L"chrome", L"notepad", L"firefox");

            for (i = 0; i < 3; i++)
            {
                wchar_t * s = L"5698@#$%notepad^&343235/ chrome $56&6556firefox$%#$23";

                wcmatch m;

                wchar_t regex[MAX_PATH];

                swprintf(regex, MAX_PATH, L"%s%s", L".+", keyword[i]);

                wregex r(regex);

                if (regex_search(s, m, r))
                {
                    cout << "It's found" << endl;
                }

                else
                {
                    cout << "It's not found" << endl;
                }

thsi my real project code. enumerate process and match the process and return bool value.
#include "stdafx.h"
#include <iostream>
#include <Windows.h>
#include <Psapi.h>
#include <string>
#include <regex>

using namespace std;

int main()
{
    FILE *pFile;
    wchar_t *file = L"d:\\a.txt";
    wchar_t line[100][MAX_PATH];
    unsigned int a = 0;
    if (_wfopen_s(&pFile, file, L"r, ccs = UNICODE") == 0)
    {
        while (fgetws(line[a], 100, pFile))
        {
            a++;
        }
    }

    DWORD aProcesses[1024], cbNeeded, cProcesses;
    unsigned int i;

    if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded))
    {
        return 1;
    }

    cProcesses = cbNeeded / sizeof(DWORD);

    wchar_t jszProcessName[4096] = { 0 };

    for (i = 0; i < cProcesses; i++)
    {
        if (aProcesses[i] != 0)
        {
            wchar_t szProcessName[MAX_PATH] = TEXT("Unknown");
            DWORD processID = aProcesses[i];

            HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION |
                                        PROCESS_VM_READ,
                                        FALSE, processID);

            if (NULL != hProcess)
            {
                HMODULE hMod;
                DWORD cbNeeded;

                if (EnumProcessModules(hProcess, &hMod, sizeof(hMod),
                    &cbNeeded))
                {
                    GetModuleBaseName(hProcess, hMod, szProcessName,
                        sizeof(szProcessName) / sizeof(TCHAR));

                    wcsncat_s(jszProcessName,szProcessName , 1000);

                }
            }
        }
    }

    unsigned int c;

        for (c = 0; c < a; c++)
        {
            wchar_t * s = jszProcessName;

            wcmatch m;

            wchar_t regex[MAX_PATH];

            swprintf(regex, MAX_PATH, L"%s%s", L".+", line[c]);

            wregex r(regex);

            if (regex_search(s, m, r))
            {
                cout << "It's found" << endl;
            }

            else
            {
                cout << "It's not found" << endl;
            }

        }

    return 0;
}

A: have your regex keywords separated by | characters:
(notepad|chrome|firefox)

https://regex101.com/r/PAZBbx/1


text:
Q: Update IEnumerable with new object in extension method I would like to add new iEnumerable object to original one. Can I do this updating original object in extenstion method like following?
public static void AddItems<TSource>(this IEnumerable<TSource> orginalColl,
IEnumerable<TSource> collectionToAdd)
{
foreach (var item in collectionToAdd)
{
    orginalColl.ToList<TSource>().Add(item);
}
}

I am calling  like this: OrgCollecation.AddItems(newCollection).
But this does not seems to work. Any idea?

A: No you can not.
In your code you are cloning the source enumerable into list, then adding elements to it and forgetting, because you are not returning anything.
Try
var result = orginalColl.Concat(collectionToAdd);

Take a look at http://msdn.microsoft.com/en-us/library/bb302894.aspx for more information and examples.

A: An IEnumerable[<T>] is not intended for adding. You can concatenate (generating a new sequence), but that doesn't change the original sequence (/list/array/etc). You can do that with Enumerable.Concat, i.e. return orginalColl.Concat(...). But emphasis: this does not update the original collection.
What you could do would be to cast to IList[<T>] or similar, but that would be abusive (and will only work for some scenarios, not all). It won't work, for example, for anything that is based on an iterator block (or any other IEnumerable<T> that is not also an IList<T>) - for example it won't work on someSource.Where(predicte).
If you expect to change the source, then you should be passing in something like IList[<T>]. For example:
public static void AddItems<TSource>(this IList<TSource> orginalColl,
    IEnumerable<TSource> collectionToAdd)
{
    foreach (var item in collectionToAdd)
    {
        orginalColl.Add(item);
    }
}

(btw, AddRange would be an alternative name for the above, to match List<T>.AddRange)

A: In short, an IEnumerable<T> should be considered immutable, and you can't add to it. You don't know what kind of collection is implementing it, it may for example be a serial port input or a read only file in the file system you're enumerating from.
What you're trying to do to the collection matches the use case of ICollection<T> better; it's implemented by generic (mutable) collections in the framework.
public static void AddItems<TSource>(this ICollection<TSource> orginalColl,
        IEnumerable<TSource> collectionToAdd)
{
    foreach (var item in collectionToAdd)
    {
        orginalColl.Add(item);
    }
}


text:
Q: Getting error when validating picture presence Rails 4 This is my Gig model
class Gig < ActiveRecord::Base
  has_attached_file :image, :styles => { :medium => "360x170>", :bigger => "650x459>" }
  validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
  validate :image_size_validation

  def image_size_validation
    if image.size > 2.megabytes
      errors.add(:base, "Image should be less than 2MB")
    end
  end
end

Everything works great,i can not upload a picture greater than 2Mb as i wanted,and it gives a notice about that(written by me).

Question: When I save the form(of a new product),without selecting any picture,it throws an error saying undefined method >
  for nil:NilClass. Instead of just saying to the user,that he should
  upload a picture,so the form can be saved.

Gig controller for create is this
def create
    @gig = current_user.gigs.build(gig_params)

    if @gig.save
      redirect_to @gig, notice: "Gig successfully created"
    else
      render "new"
    end
  end

A: That error is clearly thrown by this line:
if image.size > 2.megabytes

obviously, if there isn't an image... it won't have a size.
How about you check for nil there:
def image_size_validation
  return if image.blank?
  if image.size > 2.megabytes


text:
Q: Programming with Dyslexia I have very severe Dyslexia along with Dysnomia and Dysgraphia. I have known about it since I was a child. My reading and writing skills are pretty crippled, but I have learned to deal with it.
However, with today's IDEs, I find it very easy to stay focused and in the zone when I code. But when I write text (like this post) I find it much harder to stay focused.
In general, do dyslexics find it easier to read and write code compared to general reading and writing? What types of tricks and tools do dyslexics use to help them master programming better than normal reading and writing?

A: I have a severely dyslexic friend who reads quite well when she's reading through a sheet of yellow plastic. Or when she highlights the hell out of each page. For some reason, coloring the text somehow helps her brain grok the glyphs it's seeing.
So maybe syntax-highlighting and code coloring helps?

A: "I've tutored a number of dyslexic programmers and it has always surprised me that they find it easier to write/type when using an IDE as opposed to say a text doc."
I'm dyslexic and have been programming since 1972: I was surprised that it was impossible for me to learn python without an IDE. I didn't have difficulty using Visual Studio for .Net etc.
The problems with all print:

dyslexics find it extremely difficult to follow a long line of text all the way to the end and to easily follow the next line in sequence.
  Their eye movements while reading make it harder to scan the text smoothly (saccade)
  http://www.optomotorik.de/dyslex/index-e.htm

The errors that result from not being able to scan a page as accurately as most others do have to be noticed, understood, thought about in the context used, and finally corrected.
Dyslexics are not aware of mis reading. Programming languages require syntax that is correct.
IDE's provide a visual structure that assists the dyslexic to read and code with fewer errors.
A single window with sub windows for different tasks prevents the dyslexic coder from becoming lost on the page. It reduces visual stress, like having rails on a bridge does for drivers.
Similar symbols that appear to be the same to a dyslexic are difficult to find and fix. Automatic syntax highlighting saves a ton of time looking over the error codes.
Code completion is a workaround for typing in the wrong character, looking up functions is a great help.
I don't know how people can code in an environment that allows the eye to wander and does not mark wrong syntax.
Having the right IDE allows a dyslexic to program without losing time. A familiar IDE is comfortable to work in, similar to using a tool that feels right in your hand.
Dyslexic programmers tend to think visually in design blocks of code function rather than in lines of characters. Each functional block has to be translated into code.
The benefit of thinking in functional blocks rather than code is that one does not become confused by large systems because a visual of the system can be used to map the code.

A: I've recently discovered that I'm dyslexic (at age 26) and am starting out in programming, studying a software engineering degree at university (after previously dropping out of a civil engineering degree at the same university in the final year when the course became assignment/report heavy - I now understand why).
I've been reading a lot (at my slow pace) as to what dyslexia is and why/how/where it affects us and I believe I can explain why we can still program well, despite how text heavy it is.
Dyslexic process their thoughts in pictures (well not pictures like on the wall, more like 3d video where you can move the camera and thus it's point of view around, I think of it as an internal world where I have the powers of 'god' (geez that sounds egotistical but I don't mean it that way) ie; I can instantly change everything about it with my thoughts.
Anyway, we can process words just fine, so long as we can firmly anchor/tether those words to an 'image', words like cat, hat, hit, run, jump, vertical, fluffy, hard etc are no problem at all, we can easily 'picture' what that is, the words we trip over are things like 'are' 'to' 'the' 'a' things where if someone asked you to draw that word (not write the word, actually draw a picture of it) you wouldn't know where to start.
In programming there are no such words, they all refer to either a process or an object, once we've learnt what the object or process is and our minds have formed a visualisation of it we're away. This site does a good job of explaining what I'm on about:
http://www.davisdyslexia.com/disorientation.html#tricky
BTW if trying to read the bold text in the middle of the page BEFORE running the mouse over it makes you dizzy or feel weird and you have trouble getting threw it, you might well be dyslexic. I've gotta push forwards threw the sentences to their end before i can make any sense of what's being described, i feel dizzy when reading it too.
One thing I'm struggling with is explaining to my math lecturer that I need real examples and not general solutions to learn, when he talks about a n by n matrix I can't picture a thing, I need to work with a 3x3 or 4x4 and then I can transfer the learnings/processes to all sizes of matrices. He remains adamant that general solutions are the only way for what he calls 'true' learning sigh.

A: I feel that coding provides a wider context than general reading/writing so it doesn't rely so heavily on text parsing alone. [Speaking mainly mechanics here, not the intellectual merits.] Another point is that it's possible to be dyslexic in one language and not in another. Significantly different languages are processed in different areas of the brain and dyslexia in Chinese is quite different physiologically. May sound silly but maybe some other people are "dyslexic" in programming.
My own dyslexia is rather mild but I still avoid variable names like "bdp". I also prefer fairly short chunks of code, even if the constructs are more complex or less "readable". Of course, I try to keep the code maintainable but I lean towards terse end of the spectrum.
Having an IDE for color-coding, auto-indent and other visual cues is of course wonderful (I use emacs). Best I having for writing normal text is spell-checking and the occasional use of outline mode.

A: When I was younger I had dyslexia (or at least that is what they said - I essentially couldn't spell worth anything and typically wrote letters or words backwards, although I was able to read and everything else just fine - or so I thought).  I have always enjoyed working with computers.  We had a Commodore Vic20 when I was in grade school and I programmed on it all the time.  My mom once commented that she would have thought that my dyslexia would make it more difficult for me to work on the computer, but the opposite seemed to be the case.  I could spell and read much pretty much without incident when working with the computer.
I don't recall it being a matter of interest (i.e. that I was able to work with the computer because it was interesting.)  I worked really hard to be able to do well with spelling and writing at other times too, but I just never really had any trouble working with the computer.
Of course at the time I did not work with an IDE or anything on the Commodore

A: I can see many benefits to programming for dyslexia over other careers.
The rules of programming have fewer exceptions than spelling. You can rely on repeated patterns; prose is just all over the place.
Intellisense has to be a huge benefit. Nice to know a variable you just declared has not been used when you 'think' you just did. Other than spell & some grammar check, writing applications can provide the checks a compiler will.
Short-term memory is an issuer for me. Doing almost everything on a computer comes pretty frickin' handy.
Motivation is a factor as well. It's easier for me to read about subjects I enjoy; that doesn't make me lazy which many students get labeled as if a learning problem has not been identified.


text:
Q: EF Core: how to load releated data with only having a FK of the related data First of all apologies, this is a rookie question.
I have an existing EF Core 6 model I can't change, unfortunately. Part of this model are the following Wiring and Location classes.
// cannot change this entity
public class Wiring
{
    public int Id {get; set;}
    public string Name {get; set;}
    public int? LocationAId {get; set;}
    public int? LocationBId {get; set;}
}

// cannot change this entity
public class Location
{
    public int Id {get; set;}
    public string Name {get; set;}
}

In my business logic layer, I have a DTO which contains the names of the wiring and the two locations it connects. While a wiring always hase a name, the name of the locations may be null or empty.
public class WiringDto
{
    public string Name {get; set;}
    public string? LocationAId {get; set;}
    public string? LocationBId {get; set;}
}

What is the proper way of loading the releated location data when loading wirings?
I have a working solution, which gives me the following warning:

Captured variable is disposed in the outer scope

My actual code loading the wirings with related data which produces this warning:
var wiringDtos = await context.Wirings
.AsNoTracking()
.Select(w => new WiringDto
{
    w.Name,
    context.Locations.FirstOrDefault(l => l.Id == w.LocationAId) != null ? context.Locations.FirstOrDefault(l => l.Id == w.LocationAId).Name : null,
    context.Locations.FirstOrDefault(l => l.Id == w.LocationBId) != null ? context.Locations.FirstOrDefault(l => l.Id == w.LocationBId).Name : null,
})
.ToListAsync();

A: You can manually join entities like this :

var result = await (from w in context.Wirings
join la in context.Locations on w.LocationAId equals la.Id into lax
from la in lax.DefaultIfEmpty()
join lb in context.Locations on w.LocationBId equals lb.Id into lbx
from lb in lbx.DefaultIfEmpty()
select new WiringDto {
Name = w.Name,
LocationAId = la.Name,
LocationBId = lb.Name
}).ToArrayAsync();

You can also do this with Extension methods but I preferred this syntax for readability reasons. DefaultIfEmpty() usage is to make joins left joins.

A: Use the following query:
var wiringDtos = await context.Wirings
    .Select(w => new WiringDto
    {
        Name = w.Name,
        LocationAId = context.Locations.Where(l => l.Id == w.LocationAId).Select(l => l.Name).FirstOrDefault(),
        LocationBId = context.Locations.Where(l => l.Id == w.LocationBId).Select(l => l.Name).FirstOrDefault(),
    })
    .ToListAsync();

Note that AsNoTracking() is not needed if you have Select


text:
Q: Spark streaming not picking the new files from cloud storage source The spark structured streaming job is not picking the new files from google cloud storage source bucket when the checkpoint is default checkpoint.
If I provide new checkpoint location, the streaming does well without issues. Not sure where I am missing?


text:
Q: Graphing a function using derivatives, how do I compute the relationship? Here is the question I am stuck on:
Suppose $f(3)=2$, $f'(3)=1/2$, and $f'(x)>0$ and $f''(x)<0$ for all x?
a) How many solutions does the equation $f(x)=0$ have? Why?
b) Is it possible that $f'(2)=1/3?$ why?
I know that the function is increasing only, but also concaving down. I'm not sure how to graph this function. I'm thinking there would be only one solution for $f(x) = 0 $ because it will pass through the graph once. For b, I don't think this would be possible as $f'(2)$ > $f'(3)$.

A: HINTS
Do you really need to graph it in order to answer the two questions?
For the first since $f'\gt0$ $\forall x$ we have that $f$ is strictly increasing so the equation $f(x)=0$ can have at most one solution.
Concerning the second question you seem to be on to something-again no need for a graph!-but can you elaborate?


text:
Q: Import CSV into Excel without text wrapping This code pulls in a CSV file but it causes problems down the line as it WRAPS the text, how do I stop text wrapping as part of the import process?
Extract below:
Sub CSV_Import()
Dim ws As Worksheet, strFile As String

On Error GoTo ErrorHandler

Application.ScreenUpdating = False
Sheets("Import").Visible = True

Set ws = ActiveWorkbook.Sheets("Import") 'destination sheet

strFile = Application.GetOpenFilename("Text Files (*.csv),*.csv", , "Please select text file...")

With ws.QueryTables.Add(Connection:="TEXT;" & strFile, Destination:=ws.Range("A1"))
     .TextFileParseType = xlDelimited
     .TextFileCommaDelimiter = True
     .Refresh
End With

See pics below - Someone has put in comments in column N in the CSV file (See Orange pic wrapped text) and these have been split over 3 rows (Yellow pic) after import but into column A (which is for name not comments) instead of just one row (Green pic this is how col N should look like) once import complete. Blue pic is col N after the import is complete (3 blank rows as those comments split into col A).
The import is not doing the wrapping, the CSV itself has wrapped that cell (Can see that when I open CSV on its own), so I want to know how to unwrap that cell as part of the import procedure is that possible? or turn text wrapping off altogether as part of the import of the data in the CSV, is that an option?

Any help will be appreciated.

A: If you don't want Excel to intervene into the formatting process of a CSV import, and make sure the content will stay in the cells even when the imported text file is moved or deleted later, it is better to do the CSV parsing completely by some  VBA parsing routine instead of the QueryTable approach.
This will require more code, but you find a lot of existing solutions on the Web, like these here:

*

*https://sitestory.dk/excel_vba/csv-file-import.htm

*http://www.homeandlearn.org/open_a_text_file_in_vba.html
As a bonus, you get full control over the specific delimiters and encoding of any special characters in the CSV.
Another approach is to implement some code which opens the CSV as a separate workbook (using the Workbook.Open method), then use some loops and formatting code to copy the content into the places where you want it. See here for an example:

*

*http://www.vbaexpress.com/forum/showthread.php?62448-Import-csv-file

A: Found a workaround for this. Because of the text wrap in the source CSV file,
QueryTables will not work because it creates a link/connection to the source file, tried to edit the connection to fix the wrapped text and also tried to put "ws.Columns("N:N").WrapText = False" as the last line in my code, but that did not work either.
There was no issue in the target file, its the source CSV file that had the issue with the wrapped text.
So used good old Text to Columns. This all works fine now, thanks all for your comments and help. Sometimes its good to take all this in, take a break, think about it and I remembered I used CSV converters a while ago (Before Power Query) and just redid some of that code. Code copies the data from the CSV file including the wrapped text, pastes this to a sheet called "Import", I then unwrap text for that entire sheet, then paste that onto a target sheet and then wrap the text again! (Makes it easier for user to read comments) but AFTER formulas have read off the unwrapped text. The problem with QueryTables is that it was taking the wrapped text and splitting it over 4 rows causing errors on the Target sheet with formulas. I could find no way to fix this other than getting the data from the source CSV file and massaging per above.
Here is all the code:
Sub CSV_Import()

Dim FileType As String, Title As String, CSVWkBkName As String, EEWkBkName As String
Dim CurrentBook As Variant, FileLoc_OpenCSV As Variant

On Error GoTo ErrorHandler

Application.DisplayAlerts = False
Application.ScreenUpdating = False

Call ClearData

Set CurrentBook = Application.ActiveWorkbook
EEWkBkName = Application.ActiveWorkbook.Name

FileType = "CSV Files (*.csv),*.csv,"
Title = "Please select CSV file:"
FileLoc_OpenCSV = Application.GetOpenFilename(fileFilter:=FileType, Title:=Title)

If Not FileLoc_OpenCSV = False Then
Workbooks.Open(Filename:=FileLoc_OpenCSV).RunAutoMacros Which:=xlAutoOpen
Set CurrentBook = Application.ActiveWorkbook
CSVWkBkName = Application.ActiveWorkbook.Name

Windows(CSVWkBkName).Activate 'move to CSV file
Sheets(1).Select
Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
    Semicolon:=True, Comma:=False, Space:=False, Other:=False, FieldInfo _
    :=Array(Array(1, 2), Array(2, 2), Array(3, 2), Array(4, 2), Array(5, 2), Array(6, 2), _
    Array(7, 2), Array(8, 2), Array(9, 2), Array(10, 2), Array(11, 2), Array(12, 1), Array(13, 1), Array(14, 2)), _
    TrailingMinusNumbers:=True

Range("A1:N1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows(EEWkBkName).Activate
Sheets("Import").Select
Range("A1").Select
ActiveSheet.Paste
Range("A2").Select
Windows(CSVWkBkName).Activate
ActiveWindow.Close 'close CSV file

Else
Msg = "No file selected, you must select a file for program to run"
Style = vbCritical
Title = "Need to Select File"
Response = MsgBox(Msg, Style, Title)
End If

'copy and paste data from Import sheet to WalkData sheet after massage Import sheet data
Sheets("Import").Activate
Cells.Select
With Selection
    .HorizontalAlignment = xlGeneral
    .VerticalAlignment = xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = True
    .ReadingOrder = xlContext
    .MergeCells = False
End With

'paste data to WalkData sheet
Range("A1").Select
LRow_Master = Range("A1").End(xlDown).Row
Range("A2:N" & LRow_Master).Select
Selection.Copy
Range("A1").Select
Sheets("WalkData").Activate
Range("E2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("J:J").Select
Selection.NumberFormat = "[$-x-systime]h:mm:ss AM/PM"
Columns("R:R").Select
Selection.WrapText = True
Selection.HorizontalAlignment = xlLeft
Selection.VerticalAlignment = xlCenter
Range("R1").Select
Selection.HorizontalAlignment = xlCenter
Selection.VerticalAlignment = xlCenter
Columns("C:Q").Select
 With Selection
    .HorizontalAlignment = xlCenter
    .VerticalAlignment = xlCenter
    .ShrinkToFit = True
    .ReadingOrder = xlContext
    .MergeCells = False
 End With

Range("A2").Select

'populate formulas on WalkData sheet
Sheets("WalkData").Select
Range("A2").Select
LRow_Master = Range("E2").End(xlDown).Row
NameConcatFormula = "=CONCATENATE(ROW()-1,""."","" "",E2,"" "",F2)"
Range("A2").Select
Range("A2").Value = NameConcatFormula
Selection.AutoFill Destination:=Range("A2:A" & LRow_Master) 'fill formulas down
NeedLiftFormula = "=IFERROR(IFS(AND(N2=""Yes"",O2=""Yes""),""No"",N2=""No"",""Yes"",AND(N2=""Yes"",O2=""No""),""Yes""),""Error"")"
Range("C2").Select
Range("C2").Value = NeedLiftFormula
Selection.AutoFill Destination:=Range("C2:C" & LRow_Master) 'fill formulas down
Range("A2").Select

'populate the sign in sheet by linking in to Import sheet
Sheets("SignIn").Select
Range("A9").Select
ActiveCell.FormulaR1C1 = "=WalkData!R[-7]C"
Selection.AutoFill Destination:=Range("A9:A" & LRow_Master + 7)

Sheets("SignIn").Select
Range("A9").Select
ActiveCell.FormulaR1C1 = "=WalkData!R[-7]C[4]"
Selection.AutoFill Destination:=Range("A9:A" & LRow_Master + 7)

Range("B9").Select
ActiveCell.FormulaR1C1 = "=WalkData!R[-7]C[4]"
Selection.AutoFill Destination:=Range("B9:B" & LRow_Master + 7)

Range("D9").Select
ActiveCell.FormulaR1C1 = "=WalkData!R[-7]C[4]"
Selection.AutoFill Destination:=Range("D9:D" & LRow_Master + 7)

Range("E9").Select
ActiveCell.FormulaR1C1 = "=WalkData!R[-7]C[6]"
Selection.AutoFill Destination:=Range("E9:E" & LRow_Master + 7)

Range("F9").Select
ActiveCell.FormulaR1C1 = "=WalkData!R[-7]C[6]"
Selection.AutoFill Destination:=Range("F9:F" & LRow_Master + 7)

Range("G9").Select
ActiveCell.FormulaR1C1 = "=WalkData!R[-7]C[6]"
Selection.AutoFill Destination:=Range("G9:G" & LRow_Master + 7)

Range("H9").Select
ActiveCell.FormulaR1C1 = "=WalkData!R[-7]C[9]"
Selection.AutoFill Destination:=Range("H9:H" & LRow_Master + 7)

'format the Sign In sheet
Range("A1").Select
LRow_Master = Range("A1").End(xlDown).Row
Range("A9:H" & LRow_Master).Select
Selection.HorizontalAlignment = xlCenter
Selection.VerticalAlignment = xlCenter

Sheets("Import").Visible = False 'user does not need to see this

Range("A9").Select
Msg = "Walk Data Imported"
Style = vbInformation
Title = "Import Complete"
Response = MsgBox(Msg, Style, Title)

Exit Sub
ErrorHandler:
Msg = "Problem with file format or data please check and rerun!"
Style = vbError
Title = "File Error!"
Response = MsgBox(Msg, Style, Title)
Range("A1").Select

End Sub
Sub ClearData()

On Error Resume Next

Sheets("Import").Visible = True
Sheets("Import").Activate
Cells.Select
Selection.Clear
Range("A1").Select

Sheets("WalkData").Activate
Range("E2").Select
LRow_Master = Range("E2").End(xlDown).Row
Range("A2:R" & LRow_Master).Select
Selection.Clear
Range("A2").Select

Sheets("SignIn").Activate
Range("A9").Select
LRow_Master = Range("A9").End(xlDown).Row
Range("A9:I" & LRow_Master).Select
Selection.Clear
Range("A9").Select

End Sub


text:
Q: Project files can't see library There are many libraries I use every day from pub and they work. But today I run into a problem with qr_code_scanner. After installing it with flutter pub add qr_code_scanner and running flutter pub get, I get in code:

Same with auto import for classes from this file like QRViewController. What I also did is running flutter upgrade, flutter clean and everything else that came to my mind - still getting this error with that package.

Any other thoughts how can I solve it?

A: Some of the packages you are using are upgraded to flutter3 and some are still Flutter version < 3. Which is why you might be facing an issue. If you are trying to build an older project I would recommend you to downgrade your package versions which is compatible with flutter < 3 and use flutter version < 3. If you are adding any packages through pub add you might get an error if the pub get is not resolved. Please check the same in terminal.

A: For anyone who will have the same issue, I found a workaround. I've also tried few other libraries that beside the fact was installed couldn't access them from anywhere in code.
So after all every pub.dev lib is just the code right? You can download the source file and add it into your lib folder. Well, you have to upgrade it manually if needed but at the end it works and that's the main goal!
EDIT:
Another possible solution, as I found out, I did reset my Mac, upgraded environment (VS Code), done flutter clean and flutter pub get and looks like it's working as it should without mentioned workaround so probably the issue was around the coding environment rather than with Flutter and fetched libraries.


text:
Q: iReport - Concatenating two variables with different evaluation time I have two variables
$V{from} has evaluation value set to Now and
$V{to} has evaluation value set to Group.
Both seems to be working fine.
Now I need to append them. Currently I have $V{fromTo} which has expression $V{from} + "-" + $V{to}. Its evaluation time value is Group. What I want is just to simply append the current values of the two first mentioned variables. The current expression gives me the result (e.g. from = 1, to = 45)
45-45
Seems like the expression is taking the value of $V{from} evaluated during group execution time also. Any idea how to do this?
(Note, requirement does not allow me to just simply drag the two fields, i badly needed to store it in one variable)

A: I had the same problem. I solved setting Evaluation Time to Auto in my Text Field.


text:
Q: What is a "Break Rotator" and "Make Rotator" in Unreal Engine 4? So, I am beginner in Unreal Engine 4. I am having trouble understanding "Make Rotator" and "Break Rotator" on Movement Input of the character blueprint class. The original definition UE4 documentation has made me even more confused. Can anyone explain this in a simple way?

A: A FRotator (or just Rotator in BP) is Unreal's way of storing rotations.
Usually, there are two main ways rotations are represented in programs:

*

*As three separate rotation values per-axis, which is called Euler rotation: one for how much you rotate on X, one for Y, one for Z. This is the "older" approach, and has its issues, mainly gimbal lock. Also, there's no standard, and different programs apply them in different orders (some programs do ZXY: Z first, X second, Y third, but other do XYZ etc).

*To solve the issues with Euler rotations, another option is used, with four separate values: three values denote the axis of rotation, and another one denotes the angle. This axis-and-angle value is called a quaternion (beacuse it has four values, quat is four in latin). Since any unique rotation mathematically can be expressed as an axis and angle, quaternion rotations are free of gimbal lock, and aren't dependent on any order.

Unreal internally uses quaternions (FQuat), but they're a bit harder to explain and understand, than just three X Y Z rotations. Because of that, FQuat is only for C++, and on the Blueprint level the editor simply shows the rotation as three axis. That's what the Rotator is for.
When you break a rotator, you just separate out the three float values for the XYZ rotations. When you make a rotator out of three float values, it makes the rotation that would result from them.
These break and make nodes exist for many other types, like FVector (shown in BP as just Vector), FLinearColor (Linear Color), to easily make a more complicated thing, like a color or rotation, out of simple float values.
Having said this, since the Rotator really represents an axis and angle, it's better not to use the make Rotator node, but the rotator from axis and angle node.
Rotators are quite convenient, because there are many functions in Unreal to work with them, such as Lerp (Rotator) and others.

A: Break Rotator : allows access to the elements of the rotator.
Make Rotator : Make a rotator with three values.


text:
Q: How to avoid order by in group by query result Below is my query with output:
   select  max(urlid) urlid,tbid from  cr.tbdimurl where TBID in(9000493,9000255,9000582,9000341,9000424,9000243,9000257) group by tbid
    urlid   tbid
    ----------------
    23229   9000243
    8792    9000255
    8800    9000257
    20756   9000341
    25431   9000424
    23797   9000493
    33458   9000582

I want the query result sorted in the order of  list of TBID's as mentioned in subquery . Column urlid have clustered index define on it and there is no index defined on column TBID.
As the values in subquery are dynamic i cannot use case expression for sorting.
Is there any way I can avoid the default sorting?


text:
Q: SDL2: How do I move an image along a square-like path? I'm trying to make a program that will run a simulation. I want the simulation to be able to move a small image, or sprite, along a set path, like moving from corner to corner of a square, as if it were drawing it. I would also like the simulation to be triggered on pressing a key on the keyboard, but I'm having some difficulties with refreshing the image after moving it.
For example, I would like the image to move 50 pixels to the left, then 50 up, then 50 right, then 50 down, refreshing the image on the screen after each movement, after just one press of the '1' key on the keyboard.
This is the code I have so far, which is largely pulled from a tutorial, and currently simply moves the image by 4 pixels on each press, and I'm unsure of how to progress from here:
int main(int argc, char ** argv)
{
// variables

bool quit = false;
SDL_Event event;
int x = 360;
int y = 240;

// init SDL

SDL_Init(SDL_INIT_VIDEO);
SDL_Window * window = SDL_CreateWindow("SDL2 Keyboard/Mouse events", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, 0);
SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, 0);

SDL_Surface * image = SDL_LoadBMP("Star.bmp");
SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, image);
SDL_FreeSurface(image);

SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);

// handle events

while (!quit)
{

    switch (event.type)
    {
    case SDL_QUIT:
        quit = true;
        break;

    case SDL_KEYDOWN:
        switch (event.key.keysym.sym)
        {

        case SDLK_1:

            x-=4;

            break;

        case SDLK_2:

            x+=4;

            break;

        case SDLK_3:

            y-=4;

            break;

        case SDLK_4:

            y+=4;

            break;

        }
        break;
    }

   SDL_Rect dstrect = {x, y, 75, 75};

   SDL_RenderClear(renderer);
   SDL_RenderCopy(renderer, texture, NULL, &dstrect);
   SDL_RenderPresent(renderer);
}

// cleanup SDL

SDL_DestroyTexture(texture);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();

return 0;
}

A: A good place to start would be to track delta time for each while loop, (try using gettimeofday())
Linear interpolation could then be used to transition the object between locations.
On key press: (move right)
if(doTransition == false)
{
    doTransition = true;
    startX = x;
    startY = y;
    endX = x + 50;
    endY = Y;
}

Every loop:
if(doTransition == true)
{
    tick += deltaTime;
    float tval = MIN(tick / duration, 1);
    x = startX + (endX - startX) * tval;
    y = startY + (endY - startY) * tval;
    if(tval == 1)
    {
        //finished transition
        doTransition = false;
    }
}

startX is the x location of image when the key was pressed
endX is the desired x position at the end of the transition


text:
Q: Registered WMI providers are failing after upgrade This is a followup question to this question.
I am developing a c# windows service.
All requests to the service are done using WMI.
I am installing the service using InstallUtils. and then I am registering the WMI schema using InstalUtils:

InstallUtils.exe /f assemblyPath.dll

we are getting the path to installUtils using:
System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + "InstallUtil.exe";

And in the app.config we are setting:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v2.0.50727"></supportedRuntime>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>

I installed my application on windows 7 and then upgraded the OS to windows 8.
The service is running OK, only that all the "WMI pieces" I have don't work.
I get the error:  System.Management.ManagementException: Provider is not capable of the attempted operation  for every WMI operation (getInstances, query, invoke method etc.)
this error also occurs when I install te application on Win8 and then upgrade to 8.1
also the WMI works ok on both Windows 7 and Windows 8 when I am not trying to upgrade.
if I rerun InstallUtils with /f assemplyPath.dll, after upgrade it fixes the issue.
Also if Visual Studio was installed on Win7 before the upgrade the issue is not reproduced.
I thought that maybe the issue is that in Windows 7 the available InstallUtils version is from

C:\Windows\Microsoft.NET\Framework\v2.0.50727\

While in windows 8 we are using

C:\Windows\Microsoft.NET\Framework\v4.0.30319

But since I got this issue again when upgrading from Windows 8 to Windows 8.1 it doesn't make sence anymore.
but this is just a guess, and I still cannot understand the issue , what this error means? What might be the root cause of this issue?


text:
Q: Encoding array byte to string I cloned the project from GitHub:https://github.com/xamarin/monodroid-samples/tree/master/CardReader
The project works, but at the output it gives a string in the form "o2�\a�\0\0\0�'PVISA_-ruen�8\f�f��7_*�\f\b�Z`CC" instead of information about a bank card. We tried to change encodings, it does not help. Maybe someone came across this problem and there is a solution?


text:
Q: How to pass XML from C# to a stored procedure in SQL Server 2008? I want to pass xml document to sql server stored procedure such as this:
CREATE PROCEDURE BookDetails_Insert (@xml xml)

I want compare some field data with other table data and if it is matching that records has to inserted in to the table.
Requirements:

*

*How do I pass XML to the stored procedure? I tried this, but it doesn't work:[Working]
command.Parameters.Add(
    new SqlParameter("@xml", SqlDbType.Xml)
    {
        Value = new SqlXml(new XmlTextReader(xmlToSave.InnerXml,
                           XmlNodeType.Document, null))
    });

*How do I access the XML data within the stored procedure?
Edit: [Working]
 String sql = "BookDetails_Insert";
        XmlDocument xmlToSave = new XmlDocument();
        xmlToSave.Load("C:\\Documents and Settings\\Desktop\\XML_Report\\Books_1.xml");

        SqlConnection sqlCon = new SqlConnection("...");
        using (DbCommand command = sqlCon.CreateCommand())
        {
            **command.CommandType = CommandType.StoredProcedure;**
            command.CommandText = sql;
            command.Parameters.Add(
              new SqlParameter("@xml", SqlDbType.Xml)
              {
                  Value = new SqlXml(new XmlTextReader(xmlToSave.InnerXml
                             , XmlNodeType.Document, null))
              });

            sqlCon.Open();
            DbTransaction trans = sqlCon.BeginTransaction();
            command.Transaction = trans;

            try
            {
                command.ExecuteNonQuery();
                trans.Commit();
                sqlCon.Close();
            }
            catch (Exception)
            {
                trans.Rollback();
                sqlCon.Close();
                throw;
            }

Edit 2: How to create a select query to select pages, description based on some conditions.
  <booksdetail> <isn_13>700001048</isbn_13> <isn_10>01048B</isbn_10>
    <Image_URL>http://www.landt.com/Books/large/00/7010000048.jpg</Image_URL>
    <title>QUICK AND FLUPKE</title> <Description> PRANKS AND JOKES QUICK AND FLUPKE </Description> </booksdetail>

A: As stated in http://support.microsoft.com/kb/555266, you need to pass xml data as NText.
You can query an XML variable as follows:
DECLARE @PeopleXml XML
    SET @PeopleXml = '<People>
    <Person>
    <Name>James</Name>
    <Age>28</Age>
    </Person>
    <Person>
    <Name>Jane</Name>
    <Age>24</Age>
    </Person>
    </People>'
--  put [1] at the end to ensure the path expression returns a singleton.
SELECT p.c.value('Person[1]/Name[1]', 'varchar(50)')
FROM @PeopleXml.nodes('People') p(c) -- table and column aliases

A: For part 2 of your question, see my answer to Stored procedure: pass XML as an argument and INSERT (key/value pairs) for an example of how to use XML within a stored procedure.
EDIT: Sample code below is based on the specific example given in the comments.
declare @MyXML xml

set @MyXML = '<booksdetail>
                  <isbn_13>700001048</isbn_13>
                  <isbn_10>01048B</isbn_10>
                  <Image_URL>http://www.landt.com/Books/large/00/70100048.jpg</Image_URL>
                  <title>QUICK AND FLUPKE</title>
                  <Description> PRANKS AND JOKES QUICK AND FLUPKE - CATASTROPHE QUICK AND FLUPKE </Description>
              </booksdetail>'

select Book.detail.value('(isbn_13/text())[1]','varchar(100)') as isbn_13,
       Book.detail.value('(isbn_10/text())[1]','varchar(100)') as isbn_10,
       Book.detail.value('(Image_URL/text())[1]','varchar(100)') as Image_URL,
       Book.detail.value('(title/text())[1]','varchar(100)') as title,
       Book.detail.value('(Description/text())[1]','varchar(100)') as Description
    from @MyXML.nodes('/booksdetail') as Book(detail)

A: public static string UpdateStaticCertificateFormateNo1Data(StaticCertificateFormatNo1LogicLayer StaticFormat1Detail)
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
    con.Open();
    string strXMLRegistrationDetails, strXMLQutPut = "<root></root>";
    System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(StaticFormat1Detail.GetType());
    System.IO.MemoryStream stream = new System.IO.MemoryStream();
    x.Serialize(stream, StaticFormat1Detail);
    stream.Position = 0;
    XmlDocument xd = new XmlDocument();
    xd.Load(stream);
    strXMLRegistrationDetails = xd.InnerXml;
    SqlTransaction trn = con.BeginTransaction();
    try
    {
        SqlParameter[] paramsToStore = new SqlParameter[2];
        paramsToStore[0] = ControllersHelper.GetSqlParameter("@StaticFormat1Detail", strXMLRegistrationDetails, SqlDbType.VarChar);
        paramsToStore[1] = ControllersHelper.GetSqlParameter("@OutPut", strXMLQutPut, SqlDbType.VarChar);
        SqlHelper.ExecuteNonQuery(trn, CommandType.StoredProcedure, "UPS_UpdateStaticCertificateFormateNo1Detail", paramsToStore);
        trn.Commit();
    }
    catch (Exception ex)
    {
        trn.Rollback();
        con.Close();
        if (ex.Message.Contains("UNIQUE KEY constrastring"))
        { return "Details already in  List"; }
        else { return ex.Message; }
    }
    con.Close();
    return "Details successfully Added...";
}

A: You will be using xPath and XQuery mostly to query and modify XML data.
Here is a good starting point http://msdn.microsoft.com/en-us/library/ms190798.aspx.
I can't really get any more specific because your question is extremely vague.  Please ask specific questions on how to do something if you want help with how to use XPath and XQuery.

A: var MainXML = new XElement("DocumentElement");
            foreach (GridViewRow gvr in gvStudent.Rows)
            {
                DropDownList ddl = (DropDownList)gvr.FindControl("ddlStudent");
                if (ddl.SelectedValue != "Select")
                {
                    string StuId = ((HiddenField)gvr.FindControl("hfStudentId")).Value;
                    var datacontent =
                                    new XElement("StudentStatus",
                                    new XElement("Status", ddl.SelectedValue),
                                    new XElement("StudentId", StuId)
                                    );
                    MainXML.Add(datacontent);
                }
            }
            if (MainXML.ToString() == "<DocumentElement />")
            {
                return;
            }
            string msg = obj.UpdateStudentProjectStatus(MainXML.ToString());

            --------------------------Sql--------------------------
            DECLARE
            @XMLData XML
                IF OBJECT_ID('tempdb..#tmpSelectionParameters') IS NOT NULL     --Remove dbo here
                         DROP TABLE #tmpSelectionParameters   -- Remove "tempdb.dbo"

                SELECT
                CAST(colx.query('data(Status)') AS varchar(500)) AS Status,
                CAST(colx.query('data(StudentId)') AS varchar(500)) AS StudentId
                INTO    #tmpSelectionParameters
                FROM    @XMLData.nodes('DocumentElement/StudentStatus') AS Tabx ( Colx )


text:
Q: Separation of Spring logs and User - defined logs I am building a Spring boot project with Tomcat server where in Spring automatically takes care of all the logging mechanism, all the logs are present in "catalina.out" file.
Now that, I have a requirement where I need to log only specific information to a separate log file.
I have done the below configuration, but now all the logs including the main logs are appending in the same file.
I need only specific logs into a separate log file.
Can anyone suggest me a solution for this?
My pom.xml looks like this.
 <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-log4j</artifactId>
    </dependency>

My log4j.properties look like this.
# Root logger option
log4j.rootLogger=INFO,file

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender

#Redirect to Tomcat logs folder
#log4j.appender.file.File=${catalina.home}/logs/logging.log

log4j.appender.file.File=/my_log.log
log4j.appender.file.Append=true
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

The java file looks like this.
static org.apache.log4j.Logger log4jLogger = org.apache.log4j.Logger.getLogger(MyClass.class.getName());

log4jLogger.info("My specific logs here");

A: According to FAQ Logging, the CATALINA_BASE/logs/catalina.out contains the output of System.out and System.err.
Therefore, you need to redirect the output of Spring
to System.out. That can be done using org.apache.log4j.ConsoleAppender.
Using this appender, your configuration file may be similar:
# Root logger option
log4j.rootLogger=info, stdout

# Direct log messages to the console
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/my_log.log
log4j.appender.file.Append=true
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

# Output to the file only from certain packages (e.g. your application)
log4j.logger.com.foo=trace, file
log4j.logger.org.company=trace, file

If you do not want that your application also log to stdout 1, use:
# Output to the file only from certain packages (e.g. your application)
log4j.logger.com.foo=trace, file
log4j.additivity.com.foo=false
log4j.logger.org.company=trace, file
log4j.additivity.org.company=false

See more in Short introduction to log4j on Apache log4j 1.2 webpage.

Notes

*

*Log4j Tutorial: Additivity – what and why?

A: You should create multiple loggers that point to different files (now you have just one, that why all ends in one file). Then you can distinguish the loggers with some prefix to the package. Something like
log4j.logger.file1.com.spring.something=.../define the logger
log4j.logger.file2.com.spring.somethingelse=.../second logger

and then when obtaining the logger use something like
org.apache.log4j.Logger.getLogger("file1" + MyClass.class.getName());


text:
Q: unable to install firebase tools cli on macOS I've tried to install firebase tools on my macOS several times .
I used npm , the auto install script and standalone binary, but nothing have worked .
When I write on my terminal commands like firebase login it shows me

"killed : 9"

None of the firebase commands work . Even if I tried commands like firebase help or firebase -v , the terminal always show me the same "killed : 9" message .
What can I do?

A: This error is typically caused by another process that has a memory leak, check the usage of your device and look for any apps that have extremely high usages and end the process. This should allow you to run a fresh command window for CLI commands.
Similar:

*

*https://apple.stackexchange.com/questions/258623/how-to-fix-killed-9-error-in-mac-os

*What is Killed:9 and how to fix in macOS Terminal?


text:
Q: finding Julia in R I installed Julia 0.6.0 (release x86_64-w64-mingw32) on my acer 64 bit. Operative system: Windows 7 Home Premium (which is a supported platform).
I wanted to use julia via XRJulia.
First, I matched R working directory and Julia homedir. See this post
Now, I checked whether R can find Julia:
library(XRJulia)
findJulia(test = TRUE)
[1] FALSE

But it can't. What am I missing?


text:
Q: How do I move the Long Gui? I'm on the Archylte Steppe in ???AF, and I'm supposed to defeat some dragon-like monster that's causing storms, but it's being blocked by a Long Gui. Noel suggested going back to the village to ask how to move it, but no one seems to want to talk except the lady that's offering to explain the weather device again. How am I supposed to do this? I tried fighting it, but that went very, very poorly.

A: First you set the weather to make the Long Gui and Faeryl appear (Sunny no wind).
Next move the dial on the right once (this will cause lightning but no wind): Long Gui will be gone but Faeryl will stay.

A: If your at a high level like max crystal lvl 99, everything you can, beat it or change weather to stormy to make it go away.


text:
Q: PowerShell: Exchange Management Shell: Unable to execute the variable to modify the multivalued variable EmailAddresses Function Get-GmailAlias ($ID) {
    $a = (Get-RemoteMailbox $ID |
             Select-Object DisplayName,PrimarySmtpAddress, @{ Name="EmailAddresses"; Expression={$_.EmailAddresses | Where-Object { $_.PrefixString -ceq "smtp" } | ForEach-Object { $_.SmtpAddress }}}).EmailAddresses |
             Where-Object { $_ -like '*gmail*' }

    $b=@()
    foreach ($mem in $a) {
        $b += "'$mem'"
    }
    $c= $b -join ', '
    return $c
}

When you call the function with a UPN the result would be as follows:
'kiran.kumar@gmail.com', 'kiran_kumar@gmail.com'

I'm trying to call the function in below cmdlet.
Set-RemoteMailbox kpv@gmail.com -EmailAddresses @{Remove=Get-GmailAlias('kpv@gmail.com')}

I get the following output:
WARNING: The command completed successfully but no settings of 'XXX/XXX/XXX/XXX/XXX/XXX/Kiran Kumar' have been modified.

I tried below methods:
>@{Remove=$(Get-GmailAlias('kpv@gmail.com'))} # Alternative-1
>$c = Get-GmailAlias('kpv@gmail.com')
@{Remove="$c"} # Alternative-2
>$c = "@{Remove = $(Get-GmailAlias('kpv@gmail.com'))}"
Set-RemoteMailbox kpv@gmail.com -EmailAddresses $c # Alternative-3

None of the above worked and also alternative-3 gave me below error:
Cannot process argument transformation on parameter 'EmailAddresses'. Cannot convert value "@{Remove = 'kiran.kumar@gmail.com', 'kiran_kumar@gmail.com'}" to type "Microsoft.Exchange.Data.ProxyAddressCollection".

Kindly assist me find out why I'm unable to execute the variable/function in -EmailAddresses.


text:
Q: Using jQuery to turn an input button into a submit button is firing a submit event I'm working on a Carousel Form and would like to multipurpose the control buttons when bounds are reached. The original state has the expected operations of Previous and Next. When the final view is reached by clicking the next button I am checking the current position of the viewport and using this bit of code to turn the button into a submit,
Here is the HTML that I am manipulating, it is simply an input button,
<input type="button" id="next" value="Next">

And the accompanying jQuery which is firing off from the EventHandler for the input.
if (trigger == "next") {
  console.log("Current: " + currentPosition);
  if (currentPosition > MIN_BOUND) {
    currentPosition -= FORM_WIDTH;
    if (currentPosition == MIN_BOUND) {
      $("#next").attr("type", "submit");
      $("#next").val("Submit");
    }
  }
}

This action is doing what I expected, but additionally it is also submitting the form, which is something I did not expect. I'm curious as to why this might be happening.
Edit: As an aside. Using a carousel as a form isn't something I've thought of doing, my supervisor suggested I develop this. My original intent was a long form or just using ajax calls to dynamically store information and swap content. Is a 'Carousel Form' even a good idea? I can't recall running into them myself. I do having everything pre-loaded as it feels very fast, and a progress bar helps from a UX standpoint as I know what is expected of me.

A: Let the click finish before changing the button type:
if (currentPosition == MIN_BOUND) {
  setTimeout(function(){
    $("#next").attr("type", "submit");
    $("#next").val("Submit");
  }, 10);
}

A: Preventing the default behavior was all that was required. A simple solution but one that I did not think would work because I believed to would also prevent the default behavior of the submit button, but this was not the case.
    if (currentPosition == MIN_BOUND) {
      event.preventDefault();
      $("#next").attr("type", "submit");
      $("#next").val("Submit");
    }

Allowed me to prevent the default submission during the state transition but also retained the submit button functionality during the next click since the default behavior would only be prevented during the change.
I couldn't find a similar question to compare this sequence of events to, so hopefully this solution, as simple as it is, will benefit someone other than myself.


text:
Q: How to make a global error handler in Redux and override it when needed? Imagine a situation of handling form submit which can return different errors: 400, 401, 500.
When 400 is returned, I want to show a message in top of the form (override the default behavior).
For other (unhandled) error codes, the default (global) error handler should be invoked (which shows notification toast). Just don't want to duplicate this code for every single action
I dispatch async actions using redux-thunk middleware
// Pseudo code
const action = (dispatch) => {

    const onSuccess = (result) => dispatch({type: 'OPERATION_SUCCESS', payload: result});
    const onError = (error) => dispatch({type: 'OPERATION_ERROR', error: true, payload: error});

    return promise.then(onSuccess, onError);

};
dispatch(action);

I can create a reducer which handles all {error: true} actions and show some popup-notification (probably without using redux state, directly invoking some toast.show() method)
But how to determine if this special error was already handled by some other reducer?

A: By the time an action reaches a reducer, it is a fact. It reflects something that has already happened. There is no sense in asking "has other reducer handled this action?" because reducers are supposed to be passive and, in general sense, unaware of each other's existence. They should strive to be independent, where possible.
There is no one "true" way to accomplish what you wanted, but since you already use the convention of treating any object with an error property as a global error, you might as well introduce another convention like "if the action has a suppressGlobalErrorNotification flag then the global error reducer should not care about it".
// utilities

function checkStatus(response) {
  if (response.status >= 200 && response.status < 300) {
    return response
  } else {
    const error = new Error(response.statusText)
    error.response = response
    throw error
  }
}

function parseJSON(response) {
  return response.json()
}

export function post(url, data) {
  const options = {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
  }
  return fetch(url, options)
    .then(checkStatus)
    .then(parseJSON)
}

// action creators

import { post } from './utils'

export function submitForm(data) {
  return dispatch => post('/myform', data).then(
    response => dispatch({
      type: 'SUBMIT_FORM_SUCCESS',
      payload: response
    }),
    error => dispatch({
      type: 'SUBMIT_FORM_FAILURE',
      error: error,
      suppressGlobalErrorNotification: (
        error.response &&
        error.response.status === 400
      )
    })
  )
}

// reducers

export function error(state = null, action) {
  if (!action.error || action.suppressGlobalErrorNotification) {
    return state
  }
  if (action.type === 'RESET_ERROR') {
    return null
  }
  return action.error
}

export function form(state = {}, action) {
  switch (action.type) {
  case 'SUBMIT_FORM_FAILURE':
    return Object.assign({}, state, { isFormError: true })
  // ...
  default:
    return state
  }
}

A: Same things for me, I didn't find any working solution than can handle it.
@Dan Abramov showed the example but the issue here is when you have tens of forms things becomes more complicated. Each time you need to handle same things, duplicate code starts to be annoying.
For example:
form => client validation => CLIENT_VALIDATION_ERROR => reducer

                       FETCH_STARTED
form => form submit => SERVER_SIDE_SUCCESS  => reducers
                       SERVER_SIDE_ERROR

There can be an exception where we need to handle such behaviour manually but in most cases it's not.


text:
Q: Parse string to object i have created a table in javascript :
var global = [];
            function GetValues() {
                debugger;
                var myList = $("#multiSelect");
                var yy = $("#article").val();

                var Selectedelement = $("#quantiCommande").val();
                myList.append('<option value=' + Selectedelement + '>' + Selectedelement + " " + yy + '</option>');
                global.push({ "id": yy, "qte": Selectedelement });

            }

i want now to send table global to the controller and this the code of method javasript that send table glabal to the controller:
and this is the form of  my table in javascript:enter image description here
 function Test() {

                var NumCommande = $("#NumCommande").val();
                var client = $("#clientc").val();
                debugger;
                $.ajax({
                    url: "/Commande/Ajoutercommande?NumCommande=" + NumCommande + "&client=" + client + "&global=" + global,   //          /Controlleur/Action
                    type: "POST",
                    dataType: 'text',
                    //data : {Nom: nom},
                    success: function (responseText) {
                        debugger;
                        if (responseText == "True") {
                            alert("Succes");
                        }
                        else {
                            alert("error");
                        }
                    }
                });

            }

and this is my controller methode i need to display the element of my table global
 public Boolean Ajoutercommande(string NumCommande, int client, Object global)
    {

        CRUDEntities db = new CRUDEntities();
        Commande c = new Commande();
        c.NumCommande = NumCommande;
        c.Quantité = client;
        Console.Write(global);
        db.Commande.Add(c);
        db.SaveChanges();
        return true;

        return true;
    }

can someone help me to fix this code and thank you.

A: I would recommend to create one single object parameter.
Define your datacontract
public class TableContent
{
     public int id { get; set; }
     public string qte { get; set; }
}

public class AjourtercommandParam
{
     public string NumCommande { get; set; }
     public int client { get; set; }
     public TableContent[] global { get; set; }
}

then, in your controller (WebApi controller, right?)
[HttpPost]
[Route("Commande/Ajoutercommande")]
public async Task<IHttpActionResult> Ajoutercommand(AjoutercommandParam param)
{
     if(ModelState.IsValid == false)
     {
          return BadRequest(ModelState);
     }
     try
     {
         var result = await DataLayerService.AjouterCommand(param);
         return Ok(result);
     }
     catch (Exception ex)
     {
         return BadRequest(ex.Message);
     }
}

Post your data in the data section of the ajax call.
$.ajax({
                    url: "/Commande/Ajoutercommande",
                    type: "POST",
                    dataType: 'json',
                    data : {
                       "NumCommande": NummCommande,
                       "client" : client,
                       "global" : global
                    },
                    success: function (responseText) {
                        debugger;
                        if (responseText == "True") {
                            alert("Succes");
                        }
                        else {
                            alert("error");
                        }
                    }
                });


text:
Q: Running a R script from rterm and eclipse gives an out of memory error When I run a R script from eclipse statET, I get an out of memory error. However, I have no problem running the script in a console. Is it because the Eclipse puts a memory limit layer on top of the R process? If so, would other R GUIs have the same problem, say RStudio/JGR?
EDIT: per gsk3 suggestions

*

*32 bit windows-xp with R 2.12.1.

*memory.limit  = 2048.

My question is whether Rterm is better than other GUIs in terms of memory usage, not how to solve the out of memory problem.

A: On my 4GB machine 64bit windows 7, eclipse with takes up 250-300MB + the R server java process 100MB.
If I run just Rgui its only 25MB.  So you could be running into machine memory limits with eclipse versus just R.
Also eclipse can run two ways, interactive server mode and terminal mode, I think terminal mode uses less memory.


text:
Q: Key use case differences of using AWS security group and Network ACL I know the stateful/stateless nature of Network ACL and Security Group; and I also know Network ACL is associated to subnet(s) whereas Security Group is associated to instance(s).
The above two are most noticeable difference where we should encode our security policy in.
However, are there any use cases that we can clearly see one is better than the other?
For example, right now, I am thinking of lock-down the bastion host's network security. I can encode it into a security group sg_A {only allow 22 from a set of know IP ranges for the ingress traffic} and associate sg_A to the bastion instance. I can also encode it into a network ACL net_acl_B {only allow 22 from a set of know IP ranges for the ingress traffic} and associate net_acl_B to the subnet that the bastion instance is located.

A:
I can also encode it into a network ACL net_acl_B {only allow 22 from a set of know IP ranges for the ingress traffic} and associate net_acl_B to the subnet that the bastion instance is located.

Not quite.
The default network ACL already allows all traffic in and out.  Explicitly allowing specific traffic there doesn't change anything, since everything is allowed out of the box.
Security groups, conversely, allow nothing inbound by default.
You'd still have to also allow bastion host access in the security group, because both entities have to allow all traffic you want to pass.  Neither one overrides the rules of the other for "allow" -- they have to agree.
Network ACLs, being stateless, also have to allow the response traffic, while security groups, being Stateful, don't.
Rule 1: Use security groups for access control.  There is essentially never a reason to open a security group wide open and then turn around and use and network ACL as the sole firewall layer.
Rule 2 Option A: Only use network ACLs to only implement restrictions that are not possible with security groups, such as blocking traffic from a small subnet carved out of a larger subnet that is allowed.
Rule 2 Option B: Use network ACLs to duplicate the logic of the rules in the security groups, as a physically-first, logically-second layer of defense against unintentionally-permissive security group misconfiguration.


text:
Q: Continuing support for iOS5 I recently uploaded a test version of my app to iTunes Connect and the next day got this email:

We have discovered one or more issues with your recent delivery for
  "MyApp". Your delivery was successful, but you may wish to correct the
  following issues in your next delivery:
  Missing 64-bit support -
  Beginning on February 1, 2015 new iOS apps submitted to the App Store
  must include 64-bit support and be built with the iOS 8 SDK. Beginning
  June 1, 2015 app updates will also need to follow the same
  requirements. To enable 64-bit in your project, we recommend using the
  default Xcode build setting of "Standard architectures" to build a
  single binary with both 32-bit and 64-bit code.
  After you've corrected the issues, you can use Xcode or Application Loader
  to upload a new binary to iTunes Connect.

The last time I did a release I couldn't upload the app until I fixed the 64-bit build so I know that's okay, but I'm still building against the iOS 5 SDK because our app still supports it. If I change to build for the iOS 8 SDK will this stop my app working for older versions of iOS? How can I tell if new functionality will still work on iOS 5?

A: You should always compile against the latest SDK, which is currently (3/2015) the iOS 8 SDK.
What you want to set is the "Deployment target". The deployment target specifies the lowest iOS version that you app claims to run on. The deployment target corresponds to the __IPHONE_OS_VERSION_MIN_REQUIRED  macro, btw.
So, you can compile against the iOS 8 SDK, and at the same time set the deployment target of the project to "5.0" (or "5.1", or whatever). You have to be careful though that you don't use iOS 8 functions when running on an iOS 5 device, because it would crash the app. I use the -respondsToSelector: method often to test for the availability of functions. +lots of looking into the docs. +lots of testing on older devices.

A: Well when you update to iOS8 SDK, some of the functions will not work like Push Notification and Location Service. So you need to manage that part accordingly.


text:
Q: Getting the ultrametric distance from clusterfck library I am using this library:
http://harthur.github.io/clusterfck/
I get the following extract from hierarchical clustering:
[
  {"canonical":[20,120,102],
   "size":1
  },
  {"canonical":[250,255,253],
   "left":{
      "canonical":[250,255,253],
      "size":1
    },
   "right":{
      "canonical":[255,255,240],
      "size":1
    },
   "size":2
  },
  {"canonical":[100,54,300],
   "size":1
  }
]

As you can see it does not state the ultrametric distance. Is there a way of getting the ultrametric distance data from the clustering? Or if there are any other libraries which can supply that value?

A: https://github.com/harthur/clusterfck/pull/8
Has a pull request on the library, but the author seems to not care implementing it.


text:
Q: Unable to copy file from docker-compose mount to host I am unable to copy a file generated by my Selenium tests in a folder inside docker container mounted to host machine.
Here is how my compose file look like
  selenium:
    image: 'selenium/standalone-chrome'
    expose:
      - "4444"
  tests:
    build:
      context: ./tests
      dockerfile: Dockerfile
    depends_on:
      - selenium
      - web
    volumes:
      - /testResultsReport:/testResultsReport

This is how my directory structure looks like.
\
 - docker-compose.yml
 - build scripts
 - tests
   - testResultsReport
   - Test scripts

Name of the file generated inside testResultsReport folder when running docker-compose is TestResultsReport.HTML
As my tests are running inside selenium server on port 4444, should I mount my volume there? I tried doing that to but still not getting my html file copied to host machine?
I confirmed that my html file is generated when i run my tests outside compose.
I also tried ./testResultsReport however it added a folder in root with name of testResultsReport and did nothing. So I used ./tests/testResultsReport but still not getting file.

A: Worked by using right folder and absolute path. Thanks @chrisz
selenium:
    image: 'selenium/standalone-chrome'
    expose:
      - "4444"
  tests:
    build:
      context: ./tests
      dockerfile: Dockerfile
    depends_on:
      - selenium
      - web
    volumes:
      - ./tests/testResultsReport:/tests/testResultsReport


text:
Q: Applying downward force to an object using RealityKit Here is my previous question about in general apply force for a certain point of an AR object which had a perfect answer.
I have managed to apply force to a given point with a little bit of tinkering to have a perfect effect for me. Let me show also some code.
I get the AR object from Experience like:
if let skateAnchor = try? Experience.loadSkateboard(),
   let skateEntity = skateAnchor.skateboard {

    guard let entity = skateEntity as? HasPhysicsBody else { return }
    skateAnchor.generateCollisionShapes(recursive: true)
    entity.collision?.filter.mask = [.sceneUnderstanding]
    skateboard = entity
}

Afterwards I set up the plane and the LiDAR scanner and add some gestures to it like:
let arViewTap = UITapGestureRecognizer(target: self,
                                       action: #selector(tapped(sender:)))
arView.addGestureRecognizer(arViewTap)
let arViewLongPress = UILongPressGestureRecognizer(target: self,
                                                   action: #selector(longPressed(sender:)))
arView.addGestureRecognizer(arViewLongPress)

So far so good, on tap gesture I apply the logic from the previously linked answer and apply force impulse like:
if  let sk8 = skateboard as? HasPhysics {
    sk8.applyImpulse(direction, at: position, relativeTo: nil)
}

My issue comes with my "catching" logic, where I do want to use the long press, and apply downward force to my skateboard AR object like this:
@objc func longPressed(sender: UILongPressGestureRecognizer) {
    if sender.state == .began || sender.state == .changed {
        let location =  sender.location(in:arView)

        if arView.entity(at: location) is HasPhysics {

            if let ray = arView.ray(through: location) {

                let results = arView.scene.raycast(origin: ray.origin,
                                                direction: ray.direction,
                                                   length: 100.0,
                                                    query: .nearest,
                                                     mask: .all,
                                               relativeTo: nil)

                if let _ = results.first,
                   let position = results.first?.position,
                   let normal = results.first?.normal {

                    // test different kind of forces
                    let direction = SIMD3<Float>(0, -20, 0)

                    if let sk8 = skateboard as? HasPhysics {
                        sk8.addForce(direction, at: position, relativeTo: nil)
                    }
                }
            }
        }
    }
}

Right now I know that I am ignoring the raycast results, but this is in pure development state, my issue is that when I apply positive/negative x/z the object responds well, it either slides back and forth or left or right, the positive y is also working by draging the board in the air, the only error prone force direction is the one I am striving to achieve is the downward facing negative y. The object just sits there with no effect at all.
Let also share how my object is defined inside the Reality Composer:

A: Ollie trick
In real life, if you shift your entire body's weight to the nose of the skateboard's deck (like doing the Ollie Maneuver), the skateboard's center of mass shifts from the middle towards the point where the force is being applied. In RealityKit, if you need to tear the rear (front) wheels of the skateboard off the floor,  move the model's center of mass towards the slope.

The repositioning of the center of mass occurs in a local coordinate system.
import SwiftUI
import RealityKit

struct ContentView : View {
    var body: some View {
        ARViewContainer().ignoresSafeArea()
    }
}

struct ARViewContainer: UIViewRepresentable {

    func makeUIView(context: Context) -> ARView {

        let arView = ARView(frame: .zero)
        arView.debugOptions = .showPhysics         // shape visualization

        let scene = try! Experience.loadScene()
        let name = "skateboard_01_base_stylized_lod0"
        typealias ModelPack = ModelEntity & HasPhysicsBody & HasCollision

        let model = scene.findEntity(named: name) as! ModelPack
        model.physicsBody = .init()
        model.generateCollisionShapes(recursive: true)
        model.physicsBody?.massProperties.centerOfMass.position = [0, 0,-27]

        arView.scene.anchors.append(scene)
        return arView
    }

    func updateUIView(_ uiView: ARView, context: Context) { }
}

Physics shape
The second problem that you need to solve is to replace the model's box shape of the physical body (RealityKit and Reality Composer generate this type of shape by default). Its shape cannot be in the form of a monolithic box, it's quite obvious, because the box-shaped form does not allow the force to be applied appropriately. You need a shape similar to the outline of the model.

So, you can use the following code to create a custom shape:
(four spheres for wheels and box for deck)
let shapes: [ShapeResource] = [
                                .generateBox(size: [ 20, 4, 78])
                                    .offsetBy(translation: [ 0.0, 11, 0.0]),
                                .generateSphere(radius: 3.1)
                                    .offsetBy(translation: [ 7.5, 3, 21.4]),
                                .generateSphere(radius: 3.1)
                                    .offsetBy(translation: [ 7.5, 3,-21.4]),
                                .generateSphere(radius: 3.1)
                                    .offsetBy(translation: [-7.5, 3, 21.4]),
                                .generateSphere(radius: 3.1)
                                    .offsetBy(translation: [-7.5, 3,-21.4])
                              ]

// model.physicsBody = PhysicsBodyComponent(shapes: shapes, mass: 4.5)

model.collision = CollisionComponent(shapes: shapes)

P.S.
Reality Composer model's settings (I used Xcode 14.0 RC 1).


text:
Q: How to turn a Sakai instance open access I am currently working with a Sakai 11 instance in a project, and I need to somehow "publish" the contents of the CMS to make it an open access platform.
Registered users would accept that contents will be publicly accessible (open access) during register. No problem with that.
Is there any easy way to achieve this? Which are the correct steps?
Thanks in advance.

A: To allow users to view or even edit things without logging in, grant those permissions to .anon:

*

*Log in as admin.

*Copy the site's ID (part of its URL).

*Open the Realms tool.

*Open the site's realm. Its name is /site/ followed by the site ID.

*Add a new role named .role.

*Give it the permissions you want non-logged-in users to have. (Yes, their names are fairly cryptic and poorly documented. Try them out on a test site.)

*Log out, or use a different browser, to test.

These steps are from the Sakai wiki, which has a bit more detail.
The University of Oxford uses this for MOOC-like sites.
This doesn't require any programming, so it's off-topic for this site ...


text:
Q: Any way to generate 'ed instead of inline stylesheets from Webpack? If I have the following code in a webpack project with css-loader and style-loader plugins:
import 'index.css'

It generates an inline style in a <style> tag. Is there any way to leverage browser caching feature by having it generate a <link rel="stylesheet" href="index.css"> instead? I know I can put CSS files in the public folder, but then it won't be in the Webpack build pipeline. Is there some existing CSS loader plugin that does this? Or are there strong arguments for abandoning this approach altogether (ofc. not putting them render-blockingly in the document <head>)?

A: There are no arguments against this. I would even say this is more common than to leave the css in the chunks. But you need to use a plugin for this.
Until recently the go to here was extract-text-webpack-plugin, but now if you are using webpack 4 I would suggest mini-css-extract-plugin.
You might want to turn this off for local development. It gets in the way of HMR.


text:
Q: How to properly do http request in Python with headers and data I am trying to fetch something according to the documentation written here:
This is my code:
import requests
import json

post_data = {"exchange": "NSE",
        "tradingsymbol": "INFY",
        "transaction_type": "BUY",
        "variety": "regular",
        "product": "CNC",
        "order_type": "MARKET",
        "quantity": 1,
        "price": 0,
        "trigger_price": 0
            }

header_data = {
     'X-Kite-Version': '3',
    'Authorization': 'token '+str(api_key)+":"+str(access_token),
    'Content-Type': 'application/json'
}

r = requests.post('https://api.kite.trade/margins/orders',
                   data= post_data,
                   headers=header_data)

print(r.text)

But I am getting this response

{"status":"error","message":"invalid json","data":{},"error_type":"InputException"}

I wonder, what I am doing wrong.

A: I haven't tried it but it looks like the input data should be a list/array, rather than a dict/object. So try this for the data:
post_data = [
    {
        "exchange": "NSE",
        "tradingsymbol": "INFY",
        "transaction_type": "BUY",
        "variety": "regular",
        "product": "CNC",
        "order_type": "MARKET",
        "quantity": 1,
        "price": 0,
        "trigger_price": 0
    }
]


text:
Q: WebView page not available - Android I have a basic WebView application that should display www.google.com. Though the website can be accessed through the in-built browser, I am not able to do so from the WebView. I have gone through a large number of questions on various forums and incorporated all suggestions, but nothing seems to have worked. I have ensured:
1. The uses-permission tag for allowing internet access is a child of the manifest tag.
2. Enabled javascript for the WebView.
The manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.sriram.hellowebview"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="15" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".helloWebview"
            android:label="@string/title_activity_hello_webview" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Layout:
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

   <WebView
       android:id="@+id/helloWebview"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
     />
</LinearLayout>

Code:
/* Program to create sample webview.
 * Steps:
 * 1. Create webview.
 * 2. Show some website in it.
 * 3. Show some transitions as well.
 */

package com.sriram.hellowebview;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.webkit.WebView;

public class helloWebview extends Activity {

    WebView myWebview;
    String url = "www.google.com";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hello_webview);

        Log.v(this.toString(), "Starting activity.");

        myWebview = (WebView) findViewById(R.id.helloWebview);

        Log.v(this.toString(), "Getting settings.");
        myWebview.getSettings().setJavaScriptEnabled(true);

        Log.v(this.toString(), "Loading URL now.");
        myWebview.loadUrl(url);
        Log.v(this.toString(), "Loaded URL.");

        //open all links within the same webview.
        //myWebview.setWebViewClient(new WebViewClient());
        //Log.v(this.toString(), "All done here.");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_hello_webview, menu);
        return true;
    }
}

A: String url = "https://www.google.co.in/";

or else
super.loadUrl("https://www.google.co.in//");

A: Try adding http:// in front of your link

A: WebView wt;

wt.loadUrl("http://www.google.com/");

and sometimes in android 4.0 it will be blank, use android:hardwareAccelerated="true" in manifest file.

A: You need to add http:// in the url string...the url must look like this
String url = "http://www.google.com/";
now do
webview.loadurl(url);


text:
Q: Magento doesn't send autogenerated password I've noticed that when I clic on "send auto-generated password" to a customer it sends an email but it doesn't displays the new password, it appears like:

Dear customer,
Your new password is:

And doesn't displays the password, is in blank. Anyone knows why this can happen?
In the backend/System/transactional emails I have this:

Your new password is: {{htmlescape var=$password}}

instead of the password (Is the code OK?).
My magento version is 1.7.0.
Thanks.

A: The password section in the template should look like this:

Your new password is: {{htmlescape var=$customer.password}}

A: I'm not sure with which version the process was changed against a secure url to not send the password via email.
But 1.7 sends a password link instead of a plaintext password
Check against the template of the 1.7.0: https://github.com/LokeyCoding/magento-mirror/blob/7aa9a6fce611cfaf79b9c8f1934942f58ce4f7c6/app/locale/en_US/template/email/account_password_reset_confirmation.html


text:
Q: Accessing Local Static Resources from a Managed Package I keep seeing conflicting information about whether this is possible, so hoping the supreme court of StackEx can definitively rule!
I have a managed package that queries a field on the campaign object containing the name of a Static Resource. It then uses a dynamic reference on a VF page to display that SR as an image. In the packaging org, it works great, and in an installed org, it works for any static resource I have include in the package (so is in same namespace). But if I directly load a new SR into my installed org, and add that name, I get an error saying the resource is not found. I can see why a package wouldn't be allowed to access a local SR, but I keep seeing posts suggesting it is possible, so hoping I am just missing a step...
The code is similar to this though I get the resource name from a field on a campaign via a query. If I include KWLogo in the package, I can reference it this way, but if I install the package, upload a local resource called something like KWLogo1 into the target org, and try and reference it on the page, I get a resource not found error:
<apex:page controller="StaticRTest" >

  <apex:image rendered="{!NOT(ISNULL(sImageSource))}" url="{!$Resource[sImageSource]}"/>

Congratulations

  This is your new Page

</apex:page>

public with sharing class StaticRTest {

public String sImageSource {get;set;}

public StaticRTest () {
    sImageSource = 'KWLogo';
}

}

e.g.
This link suggests it can be done (though not how), but this link suggests otherwise?

A: Yes you can! It is possible to access the resource using a static URL of this pattern
/resource[/timestamp]/YourStaticResourceName
How it will look like exactly in the end depends much on what kind of resource it is (js, css, image and even zipped resources will work) and where you use it.

*

*in your given use case and for an image it should be

*to include a js in a custom button you go with {!REQUIRESCRIPT("/resource/1402932484000/YourStaticResourceName")}

*or in a visualforce page you can add a script like that

*or for a css it is <link href="/resource/1402932484000/YourStaticResourceName" type="text/css" rel="stylesheet" />

*and if you have a zipped resource you can use the path /resource/1395393292000/jquerymobile130/images/ajax-loader.gif
The numbers in the examples above are optional timestamps. You can also omit them and just go with only /resource/YourStaticResourceName instead of /resource/1402932484000/YourStaticResourceName. If you use the timestamp and create it dynamically (e.g. via JS) you can prevent old versions from being used out of the browser's cache. This is useful if you update the resource and want to make sure that everyone immediately get the most recent version without clearing the browser cache.
This approach is not perfect, since Salesforce may change the URL-pattern at some point in the future. But it's stable for years now and even if it would be changed, it's very easy to fix.
In my opinion there is a bunch of use cases, where this approach could bring you a great flexibility and additional value - even if the platform-architects may have had a more separatistic philosophy in their minds.
But unless someone comes up with a URLFOR()-or-similar solution, you have to ponder the tradeoffs.


text:
Q: Check if string exists in meta key string using meta_query check in wordpress get_posts function OK you would think this is a fairly trivial piece of code, but it is not working.
The code below is not broken, it is just not working as it should.

Ok, in wordpress I have a custom field in my custom post-type: individual, this custom field has a meta_key of: login_email
The contents of this meta_key is simply email addresses.
Here are some examples of the contents..
bob.dougal@gmail.com, bob.dougal@company.com, bob.dougal@hotmail.com

or..
bob.dougal@gmail.com, bob.dougal@hotmail.com

or even just a single email string..
bob.dougal@hotmail.com

OK, so now you seen the string contents of the custom field. I can explain what I am trying to achieve.
I have this variable... $current_user_email = $current_user->user_login;
Which is a single email address string.
I then need to find if this email address exists within the meta_key contents. So this how I've done it...
$lastposts = get_posts(array(
    'posts_per_page'    => 1,
    'post_type'         => 'individual',
    'post_status'       => 'private',
    'meta_query'        => array(
        array(
            'key' => 'login_email',
            'value' => $current_user_email,
            'compare' => 'IN'
        )
    )
));

In my example above, if I echo $current_user_email it outputs bob.dougal@company.com
But even though bob.dougal@company.com exists in one of the custom fields like this... bob.dougal@gmail.com, bob.dougal@company.com, bob.dougal@hotmail.com, my get_post returns nothing.
If I then go to the post editor and remove all the other emails from the custom field so bob.dougal@company.com is the only text in the custom field, then the above query works!
My question is, how can I get meta_query to find bob.dougal@company.com within a meta_key which contains this string: bob.dougal@gmail.com, bob.dougal@company.com, bob.dougal@hotmail.com
Because 'IN' is not doing what it is meant to.

Code taken from http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

Thanks

A: I believe this may be happening because you are storing multiple email addresses in one key, as opposed to having multiple keys with one email address each.
Because of this, IN will not work as it checks if a given value exists within a set of possibilities (similar to how the PHP in_array() works).
What you need to do is replace IN with LIKE. This will check the whole string for occurrences of your email address and return matches.
You should be careful though, as this can lead to inconstant results. For example, if $current_user_email = bob.dougal@company.com; then all of the following will be true -
bob.dougal@gmail.com, 1bob.dougal@company.com, bob.dougal@hotmail.com
bob.dougal@gmail.com, 12bob.dougal@company.com, bob.dougal@hotmail.com
bob.dougal@gmail.com, 123bob.dougal@company.com, bob.dougal@hotmail.com

I'll grant you that it is unlikely, but that's why you should not use strings to store multiple values. I'd strongly suggest using multiple keys (you can have many with the same name) and then you can use IN in your query. This would also guarentee only exact matches.

A: $current_user_email is a string. So transform this string into an array:
$current_user_email = explode(", ", $current_user_email);

$lastposts = get_posts(array(
    'posts_per_page' => 1,
    'post_type' => 'individual',
    'post_status' => 'private',
    'meta_query' => array(
         array(
             'key' => 'login_email',
             'value' => $current_user_email,
             'compare' => 'IN'
         )
    )
));