text:
Q: Beyond Compare command line script for folder comparison to generate results for both folder and files inside the folder Here is what i am trying to do:
Use beyond compare command line script to compare 2 folders and i need result both at folder level and also individual file report(html)
I used following command.
load "D:\Reporting\Report1" "D:\Reporting\Report2"
expand all
select all
#compare binary
folder-report layout:side-by-side output-to:"D:\Reporting\Results\compare1.html" output-options:html-color

The above script is saved as bcscriptFolderComparison.txt
Then i execute below command
"D:\Tools\BeyondCompare\Beyond Compare 4\BCompare.exe" @D:\Tools\BeyondCompare\Commands\bcscriptFolderComparison.txt

This give a folder comparison html report with side-by-side layout.
This is okay.
What i also need is html reports for individual files comparison as well.
(So that if i click on any file in folder view it takes to the file comparison details. As it happens on Beyond Compare UI)
I tried changing the script to :
load "D:\Reporting\Report1" "D:\Reporting\Report2"
    expand all
    select all.files
    #compare binary
    file-report layout:side-by-side output-to:"D:\Reporting\Results\compare1.html" output-options:html-color

But then this does not create folder level view.
One of the options i have is to write a script that first passes the folder locations and do folder level comparison as above and then goes inside both folders and take up file name one by one and run this command :
text-report layout:side-by-side  options:line-numbers &
output-to:"%3" &
output-options:html-color "%1" "%2"

This will be saves bcscript.txt
Then execute:
BCompare.exe @bcscript.txt  f:\file1.csv  f:\file2.csv f:\file1and2compare.html

Here file1 and file2 will be sequentially replaced by a custom script to give all available files inside the folders one-by-one.
Is there a direct/better way to do this by Beyond Compare command line.

A: Use the folder-report option include-file-links to generate an HTML folder report with a link to a file report for each pair of files.
Script for Beyond Compare 4:
criteria rules-based
load "D:\Reporting\Report1" "D:\Reporting\Report2"
expand all
folder-report layout:side-by-side options:include-file-links output-to:"D:\Reporting\Results\compare1.html" output-options:html-color

Note: include-file-links was added in Beyond Compare 4. If you're running an older version, you'll have to generate two separate reports using the folder-report and file-report commands.


text:
Q: Backend in folder and frontend in another folder simple question how to separate backend and frontend files in asp.net core
i want backend and frontend folders to keep things organized
my project uses asp.net core with blazor
the structure right now is like this

A: Well, based on your current scenario and project structure you could follow the below structure to make a cleaner project architecture.
Blazor Project Structure:

Note:
You have to take a solution under that solution you should take one client project and one server project and it will help to distinguish your front-end and backend code. If you want to share common stuff between them you could add an additional class library as well. You could refer to this example for more details

redpajama_set_name: RedPajamaStackExchange


text:
Q: Ray Tracing in object space, transforming normals I've got a working ray tracer (written in Node using gl-matrix)
It's working great with spheres but now I'm adding general purpose matrix transforms (translate, rotate, scale) in order to support other object types.
I have two transformation matrices per object, an inverse one for world to object called trans and one back again transFwd, set up with fromRotationTranslationScale
// Here pos is center of sphere and r is radius
mat4.fromRotationTranslationScale(this.transFwd, rotation, [pos[0], pos[1], pos[2]], [r, r, r]);
mat4.invert(this.trans, this.transFwd);

I'm transforming all rays using the trans transform into object space calculating my ray-object intersection (value of t) about the origin, with spheres of  radius of 1.
The challenge is after calculating t, working with my intersection & normals. When I add any sort of rotation to my transform they all get distorted
// ray has already been transformed to object space
// getPoint simply returns ray.pos + t * ray.dir
let intersect: vec4 = ray.getPoint(t);

let normal: vec4 = vec4.sub(vec4.create(), i, [0, 0, 0, 1]);
vec4.normalize(n, n);

// move intersect back to world space
vec4.transformMat4(intersect, intersect, this.transFwd);

What is the correct way to deal with normals when using transformation matrixes for your objects? I've tried transforming back to world space afterwards, I've tried calculating the normal after moving intersection back, but nothing works!

A: I have managed to solve this. I was on the right path just I wasn't transforming both my normals and reflected rays so it was still looking strange. The difficult thing with ray tracing is the only testing you can do is by "visual inspection"
Here's a summary of my working intersection code for a sphere in object space
// Intersection in object space
let intersect: vec4 = ray.getPoint(t);

// Normal is pointing from center of sphere (0,0,0) to intersect (i)
// Divide by sphere radius
vec4.div(normal, intersect, [radius, radius, radius, 1]);
n[3] = 0;

// Move i back to world space
vec4.transformMat4(intersect, intersect, transFwd);

// Reflected ray about the normal, & move to world
let reflect: vec4 = ray.reflect(normal);
vec4.transformMat4(reflect, r, transFwd);
vec4.normalize(reflect, reflect);

// Move normal into world & normalize
vec4.transformMat4(normal, normal, transFwd);
vec4.normalize(normal, normal);


text:
Q: Is there another way to determine object in a image beside objectmarker? I'm using OpenCV for python. I want create a description file about positive image that seems like this
person01103-60-60.bmp 1 186 116 173 169
person01105-60-30.bmp 1 184 111 157 170
person01106-60-15.bmp 1 179 136 146 144
...

Most resource told using objectmarker, but since I use thousands image database, marking the object one by one would be quite challenging. is there other way that I can use? thank you.


text:
Q: Teamcity pass kubernetes service account key with configuration parameter not working I want to authenticate Kubernetes service account from Teamcity parameter passing.
I have configured teamcity configuration parameter like this:

I am trying to pass it through the echo command:

but it only dump the file to terminal instead of writing inside the file:

A: $%gcloudkey% tries to search for bash variable with the name that equals to the value of %gcloudkey% TeamCity variable. That's what the bad substitution message is about. Try "%gcouldkey%" instead


text:
Q: gcc cannot find _start When compiling the code below with
gcc -nostdlib main.cpp

I get the following error
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000001000

I don't understand why the linker can find my _start function. I've seen examples online where people seem to be defining _start like below or defining it in assembly. What am I missing?
main.cpp:
int main() {
   return 0;
}

void _start()
{
   main();
}


text:
Q: Angular Material Pagination Not Showing but is working im using the material Pagination i have imported module i put th material-pagination's tag inside the table and i notice that if i change the pageSizeOptions inside the tag the number of element displayed change but the paginator itself is not showing at all
i have alredy tried to set the paginator to static, use a setter function to it in ngOnInit and AfterInit, try to get the size of data that i retrive using a service but not work
Table.components.html

    <ng-container matColumnDef="n_conto">
         N conto
         {{row.n_conto}}
      </ng-container>

    <ng-container matColumnDef="data">
       Data Operazione
       {{row.data}}
    </ng-container>

    <ng-container matColumnDef="tipo">
       Tipo Operazione
       {{row.tipo}}
    </ng-container>

    <ng-container matColumnDef="dettagli">
       Dettagli

          {{row.dettagli}}

    </ng-container>

    <ng-container matColumnDef="totale">
         Totale

            {{((row.tipo==='Prelievo')?'-':'+')+row.totale}}

      </ng-container>

    <mat-paginator [length]="len"  [pageSizeOptions]="[5,10,20]"></mat-paginator>

Table.component.ts
import { AfterViewChecked, AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { AuthenticationService } from 'src/app/Services/authentication.service';
import { Conto, Movimento } from 'src/app/Services/models/conto';
import { UserService } from 'src/app/Services/user.service';

@Component({
  selector: 'app-lista-movimenti',
  templateUrl: './lista-movimenti.component.html',
  styleUrls: ['./lista-movimenti.component.css']
})
export class ListaMovimentiComponent implements AfterViewInit {
  table1h: string[] = ['n_conto','data', 'tipo', 'dettagli','totale'];
  dataSource!:MatTableDataSource<Movimento>;
  public len:number=0

  @ViewChild(MatPaginator) paginator!:MatPaginator
  @ViewChild(MatSort) sort!: MatSort;

  constructor(private auth:AuthenticationService,private user:UserService) {

    this.refresh()

  }

  refresh(){
    console.log('Movimento')
    let data1:Movimento[]=[]
    this.len=0
    this.user.GetConti(this.auth.utente.codice_fiscale).subscribe({

      next:data=>{
        data.forEach((e,i)=>{
          this.len++;
          e.Movimenti.forEach(el=>{
            el.n_conto=e.n_conto
            data1.push(el)
          })
        })
        this.dataSource=new MatTableDataSource<Movimento>(data1)
        this.dataSource.paginator=this.paginator
        this.dataSource.sort=this.sort
      }
    })
  }

  ngOnInit(): void {
  }

  ngAfterViewInit(){
  }

}

module.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { NavBarComponent } from './nav-bar/nav-bar.component';
import { routing } from './cliente-routing.module';
import { MaterialModule } from '../Utils/material/material.module';
import { ClienteComponent } from './cliente.component';
import { ListaContiComponent } from './lista-conti/lista-conti.component';
import { ProfileComponent } from './profile/profile.component';
import { HomeComponent } from './home/home.component';
import { PinComponent } from './dialogs/pin/pin.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ContoComponent } from './conto/conto.component';
import { Router, RouterModule } from '@angular/router';
import { BrowserModule } from '@angular/platform-browser';
import { ListaContiComponent as lt } from './home/lista-conti/lista-conti.component';
import { TabAzioniComponent } from './home/tab-azioni/tab-azioni.component';
import { ListaMovimentiComponent } from './home/lista-movimenti/lista-movimenti.component';
import { ConfirmComponent } from './dialogs/confirm/confirm.component';
import { PrelevaComponent } from './dialogs/preleva/preleva.component';
import { DepositaComponent } from './dialogs/deposita/deposita.component';

@NgModule({
  declarations: [
    ClienteComponent,
    NavBarComponent,
    ListaContiComponent,
    lt,
    ProfileComponent,
    HomeComponent,
    PinComponent,
    ContoComponent,
    TabAzioniComponent,
    ListaMovimentiComponent,
    ConfirmComponent,
    PrelevaComponent,
    DepositaComponent
  ],
  imports: [

    CommonModule,

    routing,
    MaterialModule,
    FormsModule,
    ReactiveFormsModule
  ]

})
export class ClienteModule { }

MaterialModule
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
// Material Form Controls
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatRadioModule } from '@angular/material/radio';
import { MatSelectModule } from '@angular/material/select';
import { MatSliderModule } from '@angular/material/slider';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
// Material Navigation
import { MatMenuModule } from '@angular/material/menu';
import { MatSidenavModule } from '@angular/material/sidenav';
import { MatToolbarModule } from '@angular/material/toolbar';
// Material Layout
import { MatCardModule } from '@angular/material/card';
import { MatDividerModule } from '@angular/material/divider';
import { MatExpansionModule } from '@angular/material/expansion';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatListModule } from '@angular/material/list';
import { MatStepperModule } from '@angular/material/stepper';
import { MatTabsModule } from '@angular/material/tabs';
import { MatTreeModule } from '@angular/material/tree';
// Material Buttons & Indicators
import { MatButtonModule } from '@angular/material/button';
import { MatButtonToggleModule } from '@angular/material/button-toggle';
import { MatBadgeModule } from '@angular/material/badge';
import { MatChipsModule } from '@angular/material/chips';
import { MatIconModule } from '@angular/material/icon';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatRippleModule } from '@angular/material/core';
// Material Popups & Modals
import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
import { MatDialogModule } from '@angular/material/dialog';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatTooltipModule } from '@angular/material/tooltip';
// Material Data tables
import { MatPaginatorModule } from '@angular/material/paginator';
import { MatSortModule } from '@angular/material/sort';
import { MatTableModule } from '@angular/material/table';

@NgModule({
  declarations: [],
  imports: [
    CommonModule,
    MatAutocompleteModule,
    MatCheckboxModule,
    MatDatepickerModule,
    MatFormFieldModule,
    MatInputModule,
    MatRadioModule,
    MatSelectModule,
    MatSliderModule,
    MatSlideToggleModule,
    MatMenuModule,
    MatSidenavModule,
    MatToolbarModule,
    MatCardModule,
    MatDividerModule,
    MatExpansionModule,
    MatGridListModule,
    MatListModule,
    MatStepperModule,
    MatTabsModule,
    MatTreeModule,
    MatButtonModule,
    MatButtonToggleModule,
    MatBadgeModule,
    MatChipsModule,
    MatIconModule,
    MatProgressSpinnerModule,
    MatProgressBarModule,
    MatRippleModule,
    MatBottomSheetModule,
    MatDialogModule,
    MatSnackBarModule,
    MatTooltipModule,
    MatPaginatorModule,
    MatSortModule,
    MatTableModule,
  ],
  exports: [
    MatAutocompleteModule,
    MatCheckboxModule,
    MatDatepickerModule,
    MatFormFieldModule,
    MatInputModule,
    MatRadioModule,
    MatSelectModule,
    MatSliderModule,
    MatSlideToggleModule,
    MatMenuModule,
    MatSidenavModule,
    MatToolbarModule,
    MatCardModule,
    MatDividerModule,
    MatExpansionModule,
    MatGridListModule,
    MatListModule,
    MatStepperModule,
    MatTabsModule,
    MatTreeModule,
    MatButtonModule,
    MatButtonToggleModule,
    MatBadgeModule,
    MatChipsModule,
    MatIconModule,
    MatProgressSpinnerModule,
    MatProgressBarModule,
    MatRippleModule,
    MatBottomSheetModule,
    MatDialogModule,
    MatSnackBarModule,
    MatTooltipModule,
    MatPaginatorModule,
    MatSortModule,
    MatTableModule
  ]
})
export class MaterialModule { }

that the paginator displyng on the screen and not works only

A: i resolve by puttting the table inside a div with "mat-elevation-z8" class and than i put the paginator inside that div but outside the table

      <ng-container matColumnDef="n_conto">
           N conto
           {{row.n_conto}}
      </ng-container>

      <ng-container matColumnDef="data">
         Data Operazione
         {{row.data}}
      </ng-container>

      <ng-container matColumnDef="tipo">
         Tipo Operazione
         {{row.tipo}}
      </ng-container>

      <ng-container matColumnDef="dettagli">
         Dettagli

            {{row.dettagli}}

      </ng-container>

      <ng-container matColumnDef="totale">
           Totale

              {{((row.tipo==='Prelievo')?'-':'+')+row.totale}}

      </ng-container>

  <mat-paginator [length]="dataSource.data.length" [pageSize]="10" [pageSizeOptions]="[5, 10, 25, 100]" aria-label="Select page"></mat-paginator>


text:
Q: routing to a named outlet from named outlet, angular 4 app's routes are:
{path: 'profile', component: ProfilePageComponent, outlet: 'bodyOutlet'
, children: [
{path: 'profile-personal-information', component: ProfilePersonalInformationComponent, outlet: 'profileOutlet'},
{path: 'profile-license-details', component: ProfileLicenseDetailsComponent, outlet: 'profileOutlet'}

]
}
so, I am able to navigate to the profilePageComponent:
this.router.navigate([{ outlets: { bodyOutlet: ['profile'] } }]);

but to navigate to profileOutlet from ProfilePageComponent isn't working with the following code:
this.router.navigate([{ outlets:  { 'bodyOutlet': [ 'profileOutlet', 'profile-personal-information']}}]);

or
this.router.navigate([{outlets: {profileOutlet: ['profile-personal-information']}}]);

so, I needed help on navigating from one named router outlet to another named router outlet


text:
Q: How do I get 1 week data from year 2018 based on 7 days based on this year in oracle? I am trying to dynamically retrieve data based on dates. For example I want data from 7 days before today and same 7 days from 2020 dynamically.
I tried
SELECT *
  FROM table_1
 WHERE  insert_date > TRUNC(SYSDATE) - 7 or ((insert_date< trunc(sysdate)-365) and (insert_date> trunc(sysdate)-372))
 order by insert_date

The problem with this query is if I were to run this query now, this will give me correct data for 2020 and 2021. However if I were to run this same query in 2022, it will give me data from 2022 and 2021 when I want is data based on 2022 and 2020. I was hoping if someone could help me with this issue. I was able to figure out if I want to compare month to month but not week..
Thank you,
Sam

A: Presume that

*

*today is (yyyy-mm-dd) 2021-04-08 which means that you'd want to return rows whose insert_date is

*

*if you run the query "today", between

*

*2021-04-01 and 2021-04-08

*2020-04-01 and 2020-04-08

*if you run the query "today next year" (i.e. 2022-04-08)

*

*2022-04-01 and 2022-04-08

*2020-04-01 and 2020-04-08

*this is contents of your table:
SQL> select * from table_1 order by id;

        ID INSERT_DAT     Return in
---------- ----------
         1 2021-04-08  -- 2021
         2 2021-04-03  -- 2021
         3 2021-04-02  -- 2021
         4 2021-03-31
         5 2020-04-05  -- 2021 and 2022
         6 2020-04-04  -- 2021 and 2022
         7 2020-04-12
         8 2022-04-08  -- 2022
         9 2022-03-30

9 rows selected.

Query; lines #4 and 5 make sure that query returns rows in year 2020:
SQL> select sysdate from dual;

SYSDATE
----------
2021-04-08

SQL> select a.*
  2  from table_1 a
  3  where a.insert_date between trunc(sysdate) - 7 and trunc(sysdate)
  4     or a.insert_date between add_months(trunc(sysdate), -12 * (extract(year from sysdate) - 2020)) - 7
  5                          and add_months(trunc(sysdate), -12 * (extract(year from sysdate) - 2020))
  6  order by a.insert_date desc;

        ID INSERT_DAT
---------- ----------
         1 2021-04-08
         2 2021-04-03
         3 2021-04-02
         5 2020-04-05
         6 2020-04-04

SQL>

Next year, on 2022-04-08, query would return
SQL> select sysdate from dual;

SYSDATE
----------
2022-04-08

SQL> select a.*
  2  from table_1 a
  3  where a.insert_date between trunc(sysdate) - 7 and trunc(sysdate)
  4     or a.insert_date between add_months(trunc(sysdate), -12 * (extract(year from sysdate) - 2020)) - 7
  5                          and add_months(trunc(sysdate), -12 * (extract(year from sysdate) - 2020))
  6  order by a.insert_date desc;

        ID INSERT_DAT
---------- ----------
         8 2022-04-08
         5 2020-04-05
         6 2020-04-04

SQL>

A: Didn't quite got the requirement. But, assuming you want to take 2020 as a standard date and get 7 days of data from today and the same 7 days from 2020.
I had used the substr to remove the year part and replace it with the standard year. As I had difficulty testing with 2022 date, took 2019 as my standard date.
 select distinct cast(to_date(p.insert_date, 'DD-MON-YYYY') as timestamp) as insert_date,
 cast(to_date(SYSDATE-7, 'DD-MON-YYYY')   as timestamp) as tst_date
 from table_1 p
    where 1=1 and  ( (to_date(p.insert_date, 'DD-MON-YYYY') > to_date(SYSDATE-7, 'DD-MON-YYYY') )
                  or (to_date(p.insert_date, 'DD-MON-YYYY')> trunc(to_date(substr(to_date(SYSDATE, 'DD-MON-YYYY'),1,7)||'19', 'DD-MON-YYYY')-7)
                        and to_date(p.insert_date, 'DD-MON-YYYY') <= trunc(to_date(substr(to_date(SYSDATE, 'DD-MON-YYYY'),1,7)||'19', 'DD-MON-YYYY')))
                  )
     order by create_date desc;

  -- Standard date for 2020
  select substr(to_date(SYSDATE, 'DD-MON-YYYY'),1,7)||'20' from dual;


text:
Q: How to set a selected image to multiple UIImageViews Hey guys so I'm creating an iOS application and I am successful at taking a picture in the application either from the camera or the photos and storing it in my database and retrieving it.
I have about 30 different screens (viewcotrollers) on my storyboard, that will all eventually display the users profile picture after the successfully log in. I am wondering how do I go about setting the selected/specific image to all UIImageViews on each screen, do I need to add the same code to each view controller or what.
Sorry if the question is a little vague, I am simply trying to display one image that corresponds to the specific users entry in the database and display it on each of the screen/Viewcontroller's UIImageView.
Any help would be appreciated,
Steven

A: If I understood your question.. yes you need to do the same code on every view controller if you want all of them to show the specific image. but in order to decrease the code quantity you can create an extension (separate swift file):
extension UIImageView {
   func setChosenImage {
      let image = // get your image from database
      self.image = image
   }
}

If it doesn't help then I may be didn't get your question, sorry :)
Also there might be a better solution but we need to know more. Why do you need to display same image on 30 ViewControllers ? May be you can create 1 View Controller and then subclass from it.

A: I would subclass UIImageView to something like UIPortraitImageView which then will setup itself with the image from whereever it can be found, maybe statically:
class UIPortraitImageView : UIImageView {
    static var thePortraitImage = UIImage()

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }

    override init(image img:UIImage?) {
        super.init(image:img)
    }

    convenience init() {
        self.init(image:UIPortraitImageView.thePortraitImage)
    }
}

// Initialize it somewhere:
UIPortraitImageView.thePortraitImage = UIImage(named:"D70_4966.JPG")!

// Use it anywhere
var p = UIPortraitImageView()

You could also use the UIPortraitView in storyboards / .xib-Files by specifying the custom class, as shown here:

A: If your goal is to not have to use custom code in your view controllers at all, you could use the approach @AndreasOetjen describes in his answer: Create a custom subclass of UIImageView.
Rather than making it the custom image view look for a static file, however, I would write it to see the image in memory. One way to do that is to set up a singleton data container class that holds an optional UIImage:
static userImageLoadedNotice: String = "userImageLoaded"

public class DataSingleton {
  static let sharedDataSingleton = DataSingleton()

  public var userImage: UIImage? {
    didSet{
      NotificationCenter.post(name: userImageLoadedNotice, object: nil)
    }
}

The above class will broadcast a notification when the user image is loaded/changed.
Then set up your image view to try to load the user image when it's initialized, and also register for a notification if the image is changed:
UIPortraitImageView : UIImageView {
  static var thePortraitImage = UIImage()

  var observer: Any?

  required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
    observer = NotificationCenter.addObserver(forName: userImageLoadedNotice,
      obj: nil, queue: nil) {
        self.image = DataSingleton.sharedDataSingleton.userImage
    }
    self.image = DataSingleton.sharedDataSingleton.userImage

  }

  override init(image img:UIImage?) {
    super.init(image:img)
    observer = NotificationCenter.addObserver(forName: userImageLoadedNotice,
      obj: nil, queue: nil) {
        self.image = DataSingleton.sharedDataSingleton.userImage
    }
    self.image = DataSingleton.sharedDataSingleton.userImage
  }
  deinit {
    NotificationCenter.removeObjserver(observer)
  }
}

I banged out the code above in the SO editor. It is not perfect, and will need to be cleaned up before it will compile. It's not meant to be copy-paste ready.


text:
Q: check history of OpenShift / Kubernetes deployments We have constantly issues with our OpenShift Deployments. Credentials are missing suddenly (or suddenly we have the wrong credentials configured), deployments are scaled up and down suddenly etc.
Nobody of the team is aware of anything he did. However I am quite sure that this happens unknowingly from my recent experiences.
Is there any way to check the history of modifications to a resource? E.g. the last "oc/kubectl apply -f" - optimally with the contents that were modified and the user?

A: For a one off issue, you can also look at the replicaSets present in that namespace and examine them for differences.  Depending on how much history you keep it may have already been lost, if it was present to begin with.
Try:
kubectl get rs -n my-namespace

Or, dealing with DeploymentConfigs, replicaControllers:
oc get rc -n my-namespace

For credentials, assuming those are in a secret and not the deployment itself, you wouldn't have that history without going to audit logs.

A: You need to configure and enable audit log, checkout the oc manual here.

In addition to logging metadata for all requests, logs request bodies
for every read and write request to the API servers...

A: K8s offers only scant functionality regarding tracking changes. Most prominently, I would look at kubectl rollout history for Deployments, Daemonsets and StatefulSets. Still, this will only tell you when and what was changes, but not who did it.
Openshift does not seem to offer much on top, since audit logging is cumbersome to configure and analyze.
With a problem like yours, the best remedy I see would be to revoke direct production access to K8s by the team and mandate changes to be rolled out via pipeline. That way you can use Git to track who did what.


text:
Q: How to add items to the following lists? I have a following list and I want to add new items to that list when I click a button. How to achieve it?
List<dynamic> list = [
    {
      'id': 0,
      'leading': 'Payment Application',
      'trailing': 'System',
    },
    {
      'id': 1,
      'leading': 'Reference Number',
      'trailing': 'SYM12113OI',
    },
    {
      'id': 2,
      'leading': 'Total',
      'trailing': '\$15.00',
    },
    {
      'id': 3,
      'leading': 'Details',
      'trailing': 'Civil Employment',
    },
  ];

A: Try the following code:
TextButton(
  child: Text("child"),
  onPressed: () {
    list.add(value);
  }
),

A: 1st create a Model for Your List Object :
Example:
// To parse this JSON data, do
//
//     final listModel = listModelFromJson(jsonString);

import 'dart:convert';

List<ListModel> listModelFromJson(String str) => List<ListModel>.from(json.decode(str).map((x) => ListModel.fromJson(x)));

String listModelToJson(List<ListModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));

class ListModel {
    ListModel({
        this.id,
        this.leading,
        this.trailing,
    });

    int id;
    String leading;
    String trailing;

    factory ListModel.fromJson(Map<String, dynamic> json) => ListModel(
        id: json["id"],
        leading: json["leading"],
        trailing: json["trailing"],
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "leading": leading,
        "trailing": trailing,
    };
}

Now You can define your List Like this:
List<ListModel> _list = [];

For Add Data In your List you can do :
_list.add(ListModel(id:1022,leading:"leading name",trailing:"training part "));


text:
Q: Starting of speech recognition takes a long time I'm using the SpeechRecognizer class from Android to implement a continues speech recognition in android.
My problem is that sometimes the starting of the recognition (time between fireing the intent and getting the onReadyForSpeech callback) takes a long long time. In a few cases more than 1 minute!
Do anybody know this problem?
Starting the recognition:
    Intent recognizerIntent = new Intent(
            RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
            RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);

    SpeechRecognitionUtil.recognizeSpeechDirectly(context,
            recognizerIntent, this, getSpeechRecognizer());

private SpeechRecognizer getSpeechRecognizer() {
    if (recognizer == null) {
        recognizer = SpeechRecognizer.createSpeechRecognizer(context);
    }
    return recognizer;
}

public static void recognizeSpeechDirectly(Context context,
        Intent recognizerIntent, RecognitionListener listener,
        SpeechRecognizer recognizer) {
    // need to have a calling package for it to work
    if (!recognizerIntent.hasExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE)) {
        recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
                "com.dummy");
    }

    recognizer.setRecognitionListener(listener);
    recognizer.startListening(recognizerIntent);
}

Sometimes the following callback is called about a minute after starting recognition!
@Override
public void onReadyForSpeech(Bundle params) {}

LOG
06-24 20:18:28.266: I/WordActivator(26139): recognizeSpeechDirectly
06-24 20:18:51.091: D/WordActivator(26139): ready for speech Bundle[mParcelledData.dataSize=4]


text:
Q: Descargar o guardar archivo en el cliente desde ASP C# En ASP.NET con el lenguaje C#.
Necesito de alguna manera hacer que mi aplicación descargue o preferiblemente que guarde en el lado del cliente un XML que se genera en mi aplicación.

En otras palabras que en un boton "Descargar" o "Guardar" pueda descargar el XML en su equipo.

De antemano muchas gracias.

A: Buen días, aquí te dejo el código de atrás (Code Behind), en la parte del .ASPX debes agregar un botón que diga descarga y al evento click le agregas este código.
private void ButtonDescargar_click(object sender, System.EventArgs e)
{
    Response.ContentType = "text/xml";
    Response.ContentEncoding = System.Text.Encoding.UTF8;
    Response.AppendHeader("NombreCabecera", "MensajeCabecera");
    Response.TransmitFile(Server.MapPath("~/tuRuta/TuArchivo.xml"));
    Response.End();
}

Además también puedes usar la función en otros eventos, sí lo deseas, no tienes que limitarte a un botón

A: <Triggers>
    <asp:PostBackTrigger ControlID="btn_Exc" />
</Triggers>

protected void btn_Exc_Click(object sender, EventArgs e)
{
    string ruta;
    ruta = Server.MapPath("~/Archivos/DOCUMENTOS_ADJUNTOS/Formato_Programacion/Formato_Programacion.xlsx");
    DescargarDocumento(ruta);
}
private void DescargarDocumento(String ruta)
{
    try
    {
        String prueba;
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.ContentType = "xlsx";
        prueba = Path.GetFileName(ruta).ToString();
        HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + prueba);
        HttpContext.Current.Response.TransmitFile(ruta);
        HttpContext.Current.Response.End();
    }
    catch (Exception ex)
    {
        ControlarExcepcion(ex);
    }
}

A: Hola esto los hago en un procedimiento que es llamado por un botón, tomo una lista de clientes y la exporto a un xml para así poder después cargarlos, en realidad para hacer una exportación e importación entre sistemas a través de xml´s
if (listaClientes.Count>0)
        {
            try
            {

                string xml;
                xml = XmlUtilidades.Serializer(typeof(List<Cliente>), listaClientes);
                Response.ContentType = "text/xml";
                Response.ContentEncoding = System.Text.Encoding.UTF8;
                Response.AddHeader("Content-Disposition", string.Format("attachment; filename = \"{0}\"", System.IO.Path.GetFileName("clixml.xml")));
                Response.TransmitFile(Server.MapPath("~/Imagenes/TuArchivo.xml"));
                Response.Flush();
                Response.End();
                //ShowMessage("Exportación realizada correctamente.", "Correcto");
            }
            catch (Exception)
            {

            }

        }
        else
        {
            ShowMessage("Debe escoger que Clientes desea Exportar.", "Error");
        }

A: Añade también a la cabecera de la respuesta el siguiente atributo:
// Establecer atributos de cabecera
response.AddHeader("Content-Disposition",
string.Format("attachment; filename = \"{0}\"", System.IO.Path.GetFileName(userFileName)));

El atributo "Content-Disposition" con valor "attachment" hará más seguro que el navegador interprete la respuesta como un documento adjunto a guardar.
Internet Explorer 11 cargará el xml como un string en una nueva pestaña del navegador si no añades el atributo "attachment".


text:
Q: File can be compiled, but won't run I can compile a file by pointing it to the library folder it uses for it using the command javac -cp "path\to\lib\file.jar" FileName.java but when I try to run it with java FileName, I receive the following stacktrace:
java SecureFileSample
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/voltage/securedata/enterprise/VeException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.voltage.securedata.enterprise.VeException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

That means that this software can't be used or integrated with other software until I figure this out (adding this here because somehow Stack Overflow thinks "Can compile but won't run isn't clear enough" as a description). The expected behavior is the class to run (to execute the instructions it's given) but the regular commands for this, say java FileName won't work.
I've googled around, and the only answer I found (relate to the builder in the main class) matches exactly on how my builder is.
There is no package declaration in this file.

A: You can provide the same classpath (which, presumably, contains the VeException class) with the java command. Additionally (to capture the discussion from the comments) don't forget to add the directory containing the compiled class:
java -cp "path\to\lib\file.jar;path\to\lib\" SecureFileSample


text:
Q: Using Eve's DB layer without HTTP In my application, the MongoDB collections need to be updated by a server-side script job (IE: a cron job that scrapes/pulls from other APIs every 30minutes). What I really want to do is make updates to the MongoDB collections, but have the data be validated against the schema and include metadata (updated, created, etc).
The two ways that come to mind to solve this is:

*

*Have a fake client to do HTTP POST/PUT/PATCHES. However, this means this fake client would have to deal with things like authentication/authorization/last-modified-since.

*Use PyMongo to interact with the DB directly. However, this means I wouldn't have the data validation, or the metadata stored.

Does Eve have hooks for the database so that I can do Eve-rich database updates without HTTP?

A: I was able to run this in a separate script that can be run periodically by jenkins. The app in run.py that I'm importing is the one I had by the end of the eve quickstart.
from run import app
from eve.methods.post import post_internal

payload = {
    "firstname": "Ray",
    "lastname": "LaMontagne",
    "role": ["contributor"]
}

with app.test_request_context():
    x = post_internal('people', payload)
    print(x)

post_internal runs eve.utils.parse_request, which relies on flask.request, so with app.test_request_context() is required. app.app_context() isn't sufficient for this method.
Read the docs for appcontext and reqcontext if you're new to flask (like me).

A: As of v0.5 (currently on the development branch but you can pull and use it right away) you can use post_internal for adding data:
   Intended for internal post calls, this method is not rate limited,
   authentication is not checked and pre-request events are not raised.
   Adds one or more documents to a resource. Each document is validated
   against the domain schema. If validation passes the document is inserted
   and ID_FIELD, LAST_UPDATED and DATE_CREATED along with a link to the
   document are returned. If validation fails, a list of validation issues
   is returned.

It would probably make sense to add more internal methods to cover all CRUD operation which are now available via HTTP. You can still invoke them right away, though.
Update: v0.5 has been released with _internal methods available for all CRUD operations.

A: In case you wanted to do the following in a custom endpoint...

*

*accept some POSTed data

*manipulate the data in some way

*perform a post_internal()

*return the result as a response

...you'd do it something like this:
from eve.methods.post import post_internal
from eve.render import send_response

def my_custom_endpoint(**kwargs):

    data = json.loads(request.data.decode())

    # <manipulate data here>

    resp = post_internal('crew', data)
    return send_response('crew', resp)

In reality you're probably better off to use Eve's Event Hooks to do this sort of thing. But in case there were some situation that Event Hooks didn't cover, this approach might be useful.


text:
Q: Why does a retrieve request end up calling `get_queryset( )`? The DRF helps you make a simple API that exposes an endpoint for listings of an object and the details for a specific object.
My viewset looks like this:
class UserViewSet(ModelViewSet):
  serializer_class = someSerializer
  queryset = User.objects.all()

  def get_queryset(self):
    if self.request.user.has_perm('some.custom_permission'):
      return (
        super()
         .get_queryset()
         .filter(<some_custom_filtering>)
      )
    return super().get_queryset().filter(id=self.request.user.id)

Say my API is accessible from '<some_domain>/api/' (after registering my router appropriately). To get a listing of all my users I will call
<some_domain>/api/users/
And for a specific user (Michael Jordan)
<some_domain>/api/users/23
Both endpoints work as expected.
Just wondering why the call to retrieve a particular user still ends up going through the get_queryset() function.
Internally, the ModelViewSet class inherits functionality from the mixins.RetrieveModelMixin and the mixins.ListModelMixin. And if one goes even deeper, at least in djangorestframework==3.12.4, the RetrieveModelMixin gets a specific object, serializes it and returns the serialized data. While the ListModelMixin, calls the get_queryset() function.
I know that overriding the get_object() function in my UserViewSet view will make sure my retrieve object calls end up there (calling get_object instead of get_queryset(), but in its absence I don't get how or why the get_queryset() function is involved.

A: Queryset is the way to bind view to a specific model.
You can create entire api with retrieve, list, update, create and delete actions simply by extending a few mixins and specifying queryset and serializer class, without actual method implementation.
Whatever you do, it eventualy ends up as ModelClass.objects.some_method.
As @Brian said, get_object also uses get_queryset, and also filter_queryset so retrieve/delete will raise 404 if you use filter and object does not pass it even if it actually exists.


text:
Q: how to report a Ubuntu Touch bug Since yesterday I'm the proud owner of a Meizu MX4 Ubuntu Edition. As expected Ubuntu Touch isn't perfectly working jet, therefore I would like to report some bugs (from the phone if possible). Where and how should I submit bug reports for the OS or Unity 8 on the phone?

A: You can find a list of exiting bugs and a link to report new bugs on the Avengers page of the Ubuntu Wiki.
However I am not sure what the most easy way is to report bugs directly from the phone.


text:
Q: QWebview, HTTP proxy, html5 video does not work I'm using QWebView to show chat log.
webView = new QWebView(this);
QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
webView->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
webView->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
webView->settings()->setMaximumPagesInCache(0);
webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);

If the proxy for QWebView is not set the HTML code like this works fine.
<iframe width=\"100%\" height=\"315\" frameborder=\"0\" allowfullscreen src=\"http://www.youtube.com/embed/" + rxYouTube.cap(11) + "\" ></iframe>

But when I do something like this
QNetworkProxy proxy;
proxy.setType(QNetworkProxy::HttpProxy);
proxy.setHostName("_ip_");
proxy.setPort(_port_);
proxy.setUser("_login_");
proxy.setPassword("_passsword_");
QNetworkProxy::setApplicationProxy(proxy);

YouTube tells me that my browser does not supports HTML5.
How I can solve this problem?
PS Platform: Qt 4.8, Windows, VC

A: I haven't tested going through a proxy yet, although my LAN uses a transparent auto-proxy so at least that much works, but I have worked out how to get general HTML5 Video support in a QWebView on Windows.  I've written a blog post about that you can read here: http://blog.enthought.com/open-source/fun-with-qtwebkit-html5-video/  It involves building Qt + qt-mobility, and also a bug fix in qt-mobility.


text:
Q: Understanding Haskell's `map` - Stack or Heap? Given the following function:
f :: [String]
f = map integerToWord [1..999999999]

integerToWord :: Integer -> String

Let's ignore the implementation. Here's a sample output:
ghci> integerToWord 123999
"onehundredtwentythreethousandandninehundredninetynine"

When I execute f, do all results, i.e. f(0) through f(999999999) get stored on the stack or heap?
Note - I'm assuming that Haskell has a stack and heap.
After running this function for ~1 minute, I don't see the RAM increasing from its original usage.

A: To be precise - when you "just execute" f it's not evaluated unless you use its result somehow. And when you do - it's stored according to how it's required to fulfill the caller requirements.
As of this example - it's not stored anywhere: the function is applied to every number, the result is output to your terminal and is discarded. So at a given moment in time you only allocate enough memory to store the current value and the result (which is an approximation, but for the case it's precise enough).
References:

*

*https://wiki.haskell.org/Non-strict_semantics

*https://wiki.haskell.org/Lazy_vs._non-strict

A: First: To split hairs, the following answer applies to GHC. A different Haskell compiler could plausibly implement things differently.
There is indeed a heap and a stack. Almost everything goes on the heap, and hardly anything goes on the stack.
Consider, for example, the expression
let x = foo 17 in ...

Let's assume that the optimiser doesn't transform this into something completely different. The call to foo doesn't appear on the stack at all; instead, we create a note on the heap saying that we need to do foo 17 at some point, and x becomes a pointer to this note.
So, to answer your question: when you call f, a note that says "we need to execute map integerToWord [1..999999999] someday" gets stored on the heap, and you get a pointer to that. What happens next depends on what you do with that result.
If, for example, you try to print the entire thing, then yes, the result of every call to f ends up on the heap. At any given moment, only a single call to f is on the stack.
Alternatively, if you just try to access the 8th element of the result, then a bunch of "call f 5 someday" notes end up on the heap, plus the result of f 8, plus a note for the rest of the list.
Incidentally, there's a package out there ("vacuum"?) which lets you print out the actual object graphs for what you're executing. You might find it interesting.

A: GHC programs use a stack and a heap... but it doesn't work at all like the eager language stack machines you're familiar with.  Somebody else is gonna have to explain this, because I can't.
The other challenge in answering your question is that GHC uses the following two techniques:

*

*Lazy evaluation

*List fusion
Lazy evaluation in Haskell means that (as the default rule) expressions are only evaluated when their value is demanded, and even then they may only be partially evaluated—only far enough as needed to resolve a pattern match that requires the value.  So we can't say what your map example does without knowing what is demanding its value.
List fusion is a set of rewrite rules built into GHC, that recognize a number of situations where the output of a "good" list producer is only ever consumed as the input of a "good" list consumer.  In these cases, Haskell can fuse the producer and the consumer into an object-code loop without ever allocating list cells.
In your case:

*

*[1..999999999] is a good producer

*map is both a good consumer and a good producer

*But you seem to be using ghci, which doesn't do fusion.  You need to compile your program with -O for fusion to happen.

*You haven't told us what would be consuming the output of the map.  If it's a good consumer it will fuse with the map.

But there's a good chance that GHC would eliminate most or all of the list cell allocations if you compiled (with -O) a program that just prints the result of that code.  In that case, the list would not exist as a data structure in memory at all—the compiler would generate object code that does something roughly equivalent to this:
for (int i = 1; i <= 999999999; i++) {
    print(integerToWord(i));
}


text:
Q: Crop image with OpenCV I have a problem with cropping image using OpenCV library on iPhone. I have an image with selected area and I'd like to crop image with this area. But the new image isn't map to rectangle and the new image has also blue color of text.
I use that code to crop image:
    IplImage *src = [OpenCV CreateIplImageFromUIImage:image];

NSValue *val = [corners objectAtIndex:0];
CGPoint p1 = [val CGPointValue];
val = [corners objectAtIndex:1];
CGPoint p2 = [val CGPointValue];
val = [corners objectAtIndex:2];
CGPoint p3 = [val CGPointValue];
val = [corners objectAtIndex:3];
CGPoint p4 = [val CGPointValue];

float minX = fmin(fmin(p1.x, p2.x), fmin(p3.x, p4.x));
float minY = fmin(fmin(p1.y, p2.y), fmin(p3.y, p4.y));
float maxX = fmax(fmax(p1.x, p2.x), fmax(p3.x, p4.x));
float maxY = fmax(fmax(p1.y, p2.y), fmax(p3.y, p4.y));

CGFloat width = maxX - minX;
CGFloat height = maxY - minY;

IplImage *dst = cvCreateImage(cvSize(width, height), 8, 3);

p1 = CGPointMake(p1.x - minX, p1.y - minY);
p2 = CGPointMake(p2.x - minX, p2.y - minY);
p3 = CGPointMake(p3.x - minX, p3.y - minY);
p4 = CGPointMake(p4.x - minX, p4.y - minY);

IplImage* cropped = cvCreateImage(cvSize(width, height), src->depth, src->nChannels);

cvSetImageROI(src, cvRect(minX, minY, width, height));

cvCopy(src, cropped, NULL);
cvResetImageROI(src);
cvReleaseImage(&src);

CvMat* mmat = cvCreateMat(3, 3, CV_32FC1);

CvPoint2D32f *c1 = (CvPoint2D32f *)malloc(4 * sizeof(CvPoint2D32f));
CvPoint2D32f *c2 = (CvPoint2D32f *)malloc(4 * sizeof(CvPoint2D32f));

c1[0].x = p1.x;   c1[0].y = p1.y;
c1[1].x = p4.x;   c1[1].y = p4.y;
c1[2].x = p2.x;   c1[2].y = p2.y;
c1[3].x = p3.y;   c1[3].y = p3.y;

c2[0].x = 0;   c2[0].y = 0;
c2[1].x = width;   c2[1].y = 0;
c2[2].x = 0;   c2[2].y = height;
c2[3].x = width;   c2[3].y = height;

    mmat = cvGetPerspectiveTransform(c1, c2, mmat);
cvWarpPerspective(cropped, dst, mmat, CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, cvScalarAll(0));

I will be grateful for any help.

A: I had an error in my code. If someone is interested here is working code:
IplImage *src = [OpenCV CreateIplImageFromUIImage:image];

IplImage *dst = cvCloneImage(src);
dst->origin = src->origin;
dst->nChannels = src->nChannels;
dst->depth = src->depth;

cvZero(dst);

NSValue *val = [corners objectAtIndex:0];
CGPoint p1 = [val CGPointValue];
val = [corners objectAtIndex:1];
CGPoint p2 = [val CGPointValue];
val = [corners objectAtIndex:2];
CGPoint p3 = [val CGPointValue];
val = [corners objectAtIndex:3];
CGPoint p4 = [val CGPointValue];

CGFloat width = src->width;
CGFloat height = src->height;

CvMat* mmat = cvCreateMat(3, 3, CV_32FC1);

CvPoint2D32f *c1 = (CvPoint2D32f *)malloc(4 * sizeof(CvPoint2D32f));
CvPoint2D32f *c2 = (CvPoint2D32f *)malloc(4 * sizeof(CvPoint2D32f));

c1[0].x = round(p1.x);   c1[0].y = round(p1.y);
c1[1].x = round(p4.x);   c1[1].y = round(p4.y);
c1[2].x = round(p2.x);   c1[2].y = round(p2.y);
c1[3].x = round(p3.x);   c1[3].y = round(p3.y);

c2[0].x = 0;            c2[0].y = 0;
c2[1].x = width -1;     c2[1].y = 0;
c2[2].x = 0;            c2[2].y = height - 1;
c2[3].x = width - 1;    c2[3].y = height - 1;

mmat = cvGetPerspectiveTransform(c1, c2, mmat);
free(c1);
free(c2);

cvWarpPerspective(src, dst, mmat, CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, cvScalarAll(0));

cvReleaseImage(&src);
cvReleaseMat(&mmat);

UIImage *newImage = [OpenCV UIImageFromIplImage:dst];
cvReleaseImage(&dst);


text:
Q: Windows Vista malware changed my admin password I accidentally installed malware on my computer and it changed the admin user account password.  Is there any way to bypass putting in the password, so I can run anti-malware?

A: You do have a few options when it comes to getting back into your account.  This assumes, however, that it is not tied to a Microsoft Live account.

*

*You can use SAM RESET to remove the password on the account.  You'll need another computer to download SAM RESET, and to load it onto a CD/DVD or USB drive.

http://pogostick.net/~pnh/ntpasswd/
Then you'll boot into said device, select the proper drive your account is on (it will most likely be an NTFS drive), and select the default directory for registry files (Windows/system32/config).  Next, select option 1 for Password reset, and then choose the account for the password you want to clear.
You'll then quit out, saving changes that you have made.

*You can also try using Windows repair.  You'll need your installation media (CD/DVD/USB), and boot to that.

Next, you'll use the Repair your computer link, Command Prompt, and enter the following:

copy c:\windows\system32\sethc.exe c:\

Enter

copy /y c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe

Enter
Exit Command Prompt.  Restart your computer.  When you get to the login screen, hit SHIFT 5 times, and you'll get command prompt.  Type in:

net user [username here] [new password here]

Then you'll be set.

A: My first thought would be to disconnect from the internet, create a new administrator account, and run your malware scanner using that new account. Assuming you are able to get rid of the malware, you could then purchase a SATA/USB adapter and possibly copy your personal files onto another computer's hard drive. In my experience, when copying files from hard drive using this method, the system receiving the files tends to treat the original hard drive as an external hard drive with no credentials required.
After copying the files to another hard drive, log in to your new administrator account, reset the password to the old one (which would delete all of the personal files if they were still on that account), and copy your files onto the new hard drive.
My wife had a similar problem last year. I thought that I would be prompted for her credentials (which she had forgotten) when trying to access her files, but surprisingly, I was able to do this with no problem at all.


text:
Q: Libserial read serial port I am using libserial library to interact with a modem using C++. The C++ code sends an AT command:
my_serial_stream << "AT+CSQ" << '\r' ;

The modem responds with a response, either ERROR or OK,
The c++ code to read the response:
while( serial_port.rdbuf()->in_avail() > 0  )
{
    char next_byte;
    serial_port.get(next_byte);
    std::cerr << std::hex << (int)next_byte << " ";
}
std::cerr << std::endl;

I would like to handle the response such that if the response is OK, the modem sends another command and if the response is ERROR, the modem resends the first command.


text:
Q: How can I modify an InDesign's document textFrame created from InCopy? I have an InDesign file that I'm trying to script through but I'm running into an issue.  I believe a portion of the document's content was created from InCopy because when I try to modify that text frame after scripting through the pages I get a:

I do not have access to InCopy and I've tried overriding the InCopy frames by exporting the INDD file to an IDML file then bringing it back in but I'm unable to bypass InCopy.  When I research the site the closest question I was able to find was How to script InDesign/InCopy to "Check In" and "Check Out" textFrames? but when I try to implement checkOut() onto the selection I get an error so I researched and ran across:

*

*How to use app.selection[0] for scripts in Adobe InDesign

*Indesign script (Javascript) to return/select words around insertion point

*SELECTED TEXT FORMATTING
but I am still unable to insert on the selection text frame.
Trimmed down code
function run() {
    throw new Error( "Script has run into an error" );
}
run.error = null;

try {
    app.doScript( somePages );
    if ( run.error ) {
        throw run.error;
    }
}  catch(e) {
    alert( e );
}

function somePages() {
    var allPages = app.documents[0].pages.everyItem().getElements(),
        items = app.activeDocument.allPageItems,
        pageCount = allPages.length;

    for ( var x = allPages.length-1; x >= 0; x-- ) {
        if ( allPages[x].textFrames.length != 0  && items[x].locked == false ) {
            app.activeDocument.pageItems.everyItem().locked = false;
            app.select(allPages[x].textFrames[0].insertionPoints[0]);
            app.selection[0].contents= "foobar" + allPages[x].name;
        }
    }
}

How can I script against a textframe to add text created from InCopy that will allow me to run through the document?

A: That's because in a case of a text frame, what has to be checked out is the story.

function run() {
    throw new Error( "Script has run into an error" );
}
run.error = null;

try {
    app.doScript( somePages );
    if ( run.error ) {
        throw run.error;
    }
}  catch(e) {
    alert( e );
}

function somePages() {
    var allPages = app.documents[0].pages.everyItem().getElements(),
        items = app.activeDocument.allPageItems,
        pageCount = allPages.length;

    for ( var x = allPages.length-1; x >= 0; x-- ) {
        if ( allPages[x].textFrames.length != 0  && items[x].locked == false ) {
   app.activeDocument.stories.everyItem().checkOut();
            app.activeDocument.pageItems.everyItem().locked = false;
            app.select(allPages[x].textFrames[0].insertionPoints[0]);
            app.selection[0].contents= "foobar" + allPages[x].name;
        }
    }
}

app.activeDocument.stories.everyItem().checkOut();


text:
Q: Bootstrap nested Toggleble tabs Show and active function not working I'm new to Bootstrap.
I have made a simple toogle tab section with 3 menu item, where each item is a list of tabs. The content will be show below.
My problem is, i can seem get the "activate" function to work properly. I want one of the tabs to be active and the content within shown at default. I hope you can help!
Here is my markup :

Studiestart

skema

Bachelor

Tilvalg

Merit

Bøger

Medie- og kulturhistorie I

Medieteori og -analyse I

 Metode og undersøgelsesdesign

Videnskabsteori

Fag

Medie- og kulturhistorie I

Medieteori og -analyse I

 Metode og undersøgelsesdesign

Videnskabsteori

  The Content her is what i want to be shown here as default

Table content her

Table content her

   Content her

   Content her

   Content her

   Content her

   Content her

   Content her

METODE OG UNDERSØGELSESDESIGN I

- V. KIM SKJOLDBORG JØRGENSEN

   Content her

   Content her


text:
Q: Transformations of random variables in the form of polynomials I am trying to find the probability density function (pdf) of $F$. $F$ is the polynomial of three independent random variables $X, Y, Z$ , where $$F = aX+bY+cZ+dX^2+eY^2+fZ^2+gXY+hYZ+iXZ, $$ and $a, b, c, d, e, f, g, h, i$ are constants. We know that the random variables $X, Y, Z$ are independent and each of them satisfies Gaussian distribution. I do not know how to derive the pdf of $F$. If there are general solutions to this kind of problem? Any kind of help would be appreciated.

A: If your polynomial was  $p(x,y,z)= a_{11}x^2 + a_{22}y^2 + a_{33}z^2 + (2a_{12})xy + (2a_{13})xz + (2a_{23})yz$, then
$$ p(x,y,z) = (X,Y,Z) A(X,Y,Z)^T $$
where $A=((a_{ij})_{1\leq i,j\leq 3})$. Since $A$ is symmetric, its eigenvalues are real and the eigenvectors are orthogonal, i.e.
$$ A = V\Lambda V^T $$
where $\Lambda$ is diagonal, and $V\in O(3)$. Let $(X,Y,Z)^T = V (\xi,\eta,\zeta)^T $, then
$$ (X,Y,Z)A(X,Y,Z)^T= (\xi,\eta,\zeta) V^T  A V (\xi,\eta,\zeta)^T = (\xi,\eta,\zeta) \Lambda (\xi,\eta,\zeta)^T = \lambda_1 \xi^2 + \lambda_2\eta^2 + \lambda_3 \zeta^2 . $$
Now since $V$ is orthogonal $(\xi,\eta,\zeta)\sim N(0,I)$. Hence the distribution of $p(X,Y,Z)$ is some generalized version of $\chi^2$.
Now if $p(x,y,z)$ is a general bivariate polynomial of degree $2$, then it is possible to write it in the form
$$ p(x,y,z)= (x-a,y-b,z-c) A (x-a,x-b,z-c)^T +d  $$
where $a,b,c,d$ are appropriate constants and $A$ is an appropriate $3\times 3$ symmetric matrix. Since $(X-a,Y-b,Z-c)\sim N((-a,-b,-c), I) $ the closest one can say about the distribution of $p(X,Y,Z)$ is that it is some generalized version of $\chi^2$ with shift $d$.
Update: The above derivation assumed that $(X,Y,Z)$ is a standard Gaussian vector, i.e. its mean is the zero vector and its covariance matrix is $I$, the identity matrix. In case $(X,Y,Z)\sim N(\mu, diag(\sigma_1^2,\sigma_2^2,\sigma_3^2))$ then $diag(1/\sigma_1,1/\sigma_2,1/\sigma_3)\cdot (X-\mu_1,Y-\mu_2,Z-\mu_3) \sim N(0,I) $.


text:
Q: Low pass filter to remove noise from signal I am working with an inductive proximity sensor. In the ideal condition, it gives 5V as a high signal when metal is sensed and gives 0 as a low signal when metal is not in proximity. But due to electrical noise low signal is not exactly at 0. It contains noise which makes low voltage level around 0.9V. I want to make this 0.9V to exact 0V so that my microcontroller can perfectly detect 0 or 1. I have tried RC low pass filter but still noise level is the same. Any other method to remove noise from the signal?

A: (Things in italics are easy to look up)
The low pass filter is not what you want, you want to compare your voltage to some threshold (e.g. 2.5 V) and decide whether it's high or low.
A comparator does that.
Your low-pass filter is still a very good idea, because it still removes noise, and especially at the point where the signal crosses the threshold voltage, you don't want it "jumping" around, but go as smooth as possible.
In fact, wouldn't it be nicest if your sensor detect "ON" when the voltage was low before, but then crosses the say, 4 V boundary (in a rising edge), and "OFF" if was high before and then crosses the 1 V boundary (in a falling edge)? That way, the thing is even more immune to toggling around.
We call that kind of mechanism a Schmitt trigger.

A: An inductive proximity switch would, in any case, have an inbuilt Schmitt trigger.
Your problem of noise on the common line would be solved by grounding the negative of the power supply.


text:
Q: Cannot make dynamic two column table I want to have a table with headers and data dynamically loaded from object of two arrays. Unfortunately, these rows aren't displayed.
http://jsfiddle.net/x7ur9u07/4/

        Input
        Output

        {{ inout.input_vector[$index] }}
        {{ inout.output_vector[$index] }}

          Foo

          Bar

var myApp = angular.module('myApp',[]);

//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});

function MyCtrl($scope) {
    window.alert('hello');
        $scope.inoutContainer = {input_vector: ["0.0","0.0"], output_vector: ["0.0","0.0"]};
    $scope.name = 'Superhero';
}

A: I managed to figure out a way to make it work -- you had a number of syntax errors that angularJS didn't understand
http://jsfiddle.net/x71jm9r8/
Basically I simplified the angularJS code

*

*then added the ng-app directive to the container div

*removed the track by $index part of the ng-repeat directive,

*and finally added the myApp.controller()  declaration.


text:
Q: Get the element that triggered focusout event How can i find, what element triggerd focusout event ?
I mean, if i'm focused on some text box, and i click on some element for example div with name (results)), i wan't to get that div attributes.

A: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title></title>

    <input type="text" id="tbTest" data-id="3" data-test="88" />

        Test


text:
Q: Interface is not being called android I have used a interface to determine weather the async task is finish or not.But when i use the interface,the 2 methods of that interface is not being called.
The Custom Adapter Class
public class MyResourceCustomAdaper extends BaseAdapter {

    static GetMatchingJobsArray getMatchingJobsArray;

    public MyResourceCustomAdaper(Context context, ArrayList<HashMap<String, String>> data) {
        this.context = context;
        this.data = data;

    }

    public static void setInterface(GetMatchingJobsArray getMatchingJobsArray) {
        MyResourceCustomAdaper.getMatchingJobsArray = getMatchingJobsArray;
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int i) {
        return data.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(final int i, View view, ViewGroup viewGroup) {

        doing stuffs here

        return view;
    }
}

public static class GetMatchingJobsAsync extends AsyncTask<String, String, String> {
    String response;
    Context c;

    public GetMatchingJobsAsync(Context c) {

        this.c = c;

    }

    @Override
    protected String doInBackground(String... strings) {

        calling web method here

    }

    @Override
    protected void onPostExecute(String s) {
        super.onPostExecute(s);
        arrayMatchingJobs = new ArrayList<HashMap<String, String>>();

                getMatchingJobsArray.getMatchingJobs(true, arrayMatchingJobs);// here i am passing my array to the interface

                getMatchingJobsArray.hasCompleted(true);

                Intent i = new Intent(c, MyResourceMatchingJobs.class);
                c.startActivity(i);

        }
    }

}

public interface GetMatchingJobsArray {

    public void getMatchingJobs(boolean value, ArrayList<HashMap<String, String>> arrayMatchingJobs);

    public void hasCompleted(boolean value);

}

}

Class where i am implementing the interface
public class MyResourceMatchingJobs extends Activity implements MyResourceCustomAdaper.GetMatchingJobsArray {
    private ListView listView;
    private MyResourceMatchingJobsCustomList adapter;
    private static ProgressDialog pDialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_resource_matching_jobs_list);
        listView = (ListView) findViewById(R.id.lv_my_resource_matching_jobs);
        MyResourceCustomAdaper.setInterface(this);//use for initailizing the interface

    }

    @Override
    public void getMatchingJobs(boolean value, ArrayList<HashMap<String, String>> arrayMatchingJobs) {

adapter = new MyResourceMatchingJobsCustomList(MyResourceMatchingJobs.this, arrayMatchingJobs);
            listView.setAdapter(adapter);

    }

    @Override
    public void hasCompleted(boolean value) {
        Toast.makeText(this, "Hello", Toast.LENGTH_SHORT).show();

    }

Here in this activity why my interface is not being called???

A:
Here in this activity why my interface is not being called???

Because Calling getMatchingJobs  when  MyResourceMatchingJobs Activity is not running.
So try to call both methods after starting MyResourceMatchingJobs Activity from onPostExecute.
Suggestion: becuase sending arrayMatchingJobs and one boolean value so use i.putExtra(KEY,VALUE) for getting both values in MyResourceMatchingJobs Activity


text:
Q: Problem with Scanner and a letter "Ł" in text - JAVA I have a problem with Scanner. In doc.txt there is a letter "Ł" (its from polish alphabet). Scanner skips the part with this letter and scans only the part before. There is probably a solution, but I'm a newby in coding… Can you help? Fragment of the code is below.
File file = new File("doc.txt");
String tempTest = "";
Scanner sc = new Scanner(file);
while(sc.hasNext()) {
    tempTest = tempTest.concat(sc.nextLine() + "\n");
}
sc.close();

A: Make sure that your file is encoding in UTF-8. If you use for example Notepad to create your file the default encoder is ANSI which do not support Polish letters.
To change the encoding of a file created in Notepad:

*

*Open your file in Notepad

*Under tab File press save as

*Press the drop down list just left of the Save button in the lower left corner

*Choose UTF-8 as your encoder in the drop down list

*Save your file


text:
Q: How to enable copy-and-paste of a Ubuntu VirtualMachine running on MacOS host? I am running a VirtualMachine (6.0.14) on MacOS 14.10.6, with Ubuntu 20.04 installed in the VM. I think I have installed the Guest Additions, and under Settings -> General -> Advanced I did select Bidirectional for Shared Clipboard and Drag'n'Drop.
However, when I copy some text in the host system (MacOS) by using CTRL-C or mouse right click -> copy, I am not able to paste that text into the Terminal on the client system (Ubuntu) running in the Virtualbox (neither right-mouse click is working, nor CTRL-V).
I also tried to run (see here):
sudo VBoxClient --clipboard

but this did not solve my problem.
The kernel module seems to be loaded, as I get some output from this command
lsmod | grep vboxguest

So what else can I try?

A: It looks like there was a bug with version 6.0.14 of VirtualBox.
Upgrading to 6.1.22 did solve this problem.
Now I can either paste with right-mouse click or with CTRL-Shift-V.


text:
Q: Programmatically setting content to fill screen between tab bar and nav controller I have a UIwebview that I want to fill the screen between the navigation bar at the top and the tab bar at the bottom. My web view is being defined programmatically and I was initializing it with a frame as below.
I have been able to get the desired behavior by hard coding in some values, but I have seen that this does not work across all devices. Specifically, it seems that different OS's might consider (0,0) as different points on the screen (the top left corner of the screen for some, and the top left most corner under the nav bar for others).
My question is, how do I set the web view position and size to fill the screen across all devices? And can anyone explain why this doesn't behave as I think it ought to?
//iphone 5s running iOS 8
webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight+20)];
//iphone 5 running iOS 7
webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, screenWidth, screenHeight-93)];
//what i thought would work for all, but doesnt fill the height of the screen...
webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight)];


text:
Q: Merging text files line for line batch file I began with an excel spreadsheet with a couple of columns (a Date of Birth, and a Last Name column). I extrapolated and used a batch file to modify just the date of birth column so that I now have a text file with the following (to be used in a SQL query):
BirthDateTime = '01/01/2017' AND Name LIKE '
BirthDateTime = '01/01/2016' AND Name LIKE '

I now want to take the second column (by creating a separate lastname.txt file) and concatonate it into the output file above line for line so that my last name file, which looks like:
SMITH
JONES

Will merge to a new output file that will look like:
(BirthDateTime = '01/01/2017' AND Name LIKE '%SMITH%') OR
(BirthDateTime = '01/01/2016' AND Name LIKE '%JONES%') OR

Unfortunately I'm a newbie on batch files and I just don't know where to start. I'm including the batch file I used to create the first part below.
Batch File:
@echo off
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in (input.txt) do (
set /a N+=1
echo BirthDateTime = '%%a' AND Name LIKE '>>output.txt
)

A: Per @Stephan's comment I just set out to do this in Excel and used the following formula:
="(BirthDateTime = '"&A2&"' AND Name LIKE '%"&B2&"%') OR" which worked fine. Since I asked specifically about batch files I'm not sure it's appropriate for me to accept this as an answer. If somebody has some code, or if Stephan wants to post his link as an answer with some explanation into his code I will accept that, otherwise I will accept this as the answer in 2 days.

A: Your question is a bit confusing. You show two textfiles, but your code seems to use some other files (Dates only). Anyway - I covered both possibilities; just use the right echo line.
To read and merge two files use a little trick (using two different methods to read a file):
@echo off
setlocal enabledelayedexpansion
<t2.txt (
  for /f "delims=" %%a in (t1.txt) do (
    set /p name=
    echo (%%a!name!'^) OR
    REM echo (BirthDateTime = '%%a' AND Name LIKE '!name!'^) OR
  )
)>out.txt
type out.txt

The other trick is escaping the closing paranthese in the echo statement with a ^. If you don't, the parser takes it for the loop end, which will result in a crippled output and an errormessage "OR" is not recognized as a valid command ...


text:
Q: Font not found, vuejs build I have in my config/index.js:
...
build: {
    index: path.resolve(__dirname, 'dist/client.html'),
    assetsRoot: path.resolve(__dirname, 'dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '',
...

My App.vue:
<style lang="scss">
  /* Import Font Awesome Icons Set */
  $fa-font-path: '~font-awesome/fonts/';
  @import '~font-awesome/scss/font-awesome.scss';
  ...
</style>

When in dev mode it's all right, no missing assets etc..., everything is fine.
But when I build the project the fonts path becomes:

dist/static/css/static/fonts/font

And this results in a 404 error for the given asset, since I have no folders inside ths css and I have no idea why is doing this.
Please note that I don't want this to be in the root, e.g:
assetsPublicPath: '/', // <-- don't want this since the project it's going to be in a subfolder

If you guys think that are some scripts missing for a better/less
equivocating answer please tell me and I edit it to include them.

A: Remove whatever you have posted in App.vue pertaining to Font Awesome.
Inside of main.js or app.js, do the following. It should start to build nicely.
main.js / app.js
require('font-awesome/scss/font-awesome.scss')


text:
Q: how to define getter so, that based on error code I can show error message instead of having multiple `if` statement We are calling API and handling the exception.
class Failure with _$Failure  implements Exception  {

  factory Failure({
    required FetchError fetchError,
    required ServerError? errorCodeFromServer,
  }) = _Failure;

}

And, based on the exception type We are passing an error code when We are  throwing Failure based on catching an error. Now, that error code is passed on to the bloc. And, in then UI screen We are trying to show the error message in bloc listener like this
        if (state.loginStatus == LoginStatus.error) {
          simpleSnackbarMessage(
            context,
            l10n.[state.error],
            MessageType.failed,
          );
        }

now, We have app_en.arb file in that I have all the possible error messages. But, when We are trying to access like l10n.[state.error], it show an error.
The getter '[' isn't defined for the type 'AppLocalizations'.

So, my question
how to define getter so, that based on error code I can show error message instead of having multiple if statement.

Thanks :pray:


text:
Q: Causation implication I recently read an article about how you can increase longevity by sleeping less. This article, like many others I've read, references a statistical study and implies that causation was found between two events(sleeping less and living longer). Well I'm not a statistician, but I'm aware of the common fallacies about causation and I find it very hard to accept the information given in this article and other similar ones. Even further, I can almost never know from an article if the original study found causation or not, without taking the time and digging into it.
Although I'd really like to, I'm not going to go into any depth bringing examples of how the causation might be wrong in the given article, because I would most likely be preaching to the choir. Luckily though, to my relief, the original article in NY Times only talks about correlation and even has a disclaimer in the end that basically says that the study doesn't imply causation.
Also, I now read that, in accordance with my intuition, it is actually really hard to find and/or test for causation. Reading through the wiki page on the subject I saw two models which seemed to be the most common ones used to find actual links in causation: Granger causality test and convergent cross mapping. But I see, that both of these have some gaps in them.
Now, I have a few questions regarding all this.
Q1: Are there any models that can, with high accuracy, find actual causation in such widespread studies? If so what are the most common ones?
Q2: How often do these widespread studies actually test for causation? E.g. if I read somewhere that a very broad study implies that A causes B, do I have any reason whatsoever to believe that there's something more than correlation behind those claims.
Q3: Is there a good technique that can be used by a non-statistician to filter out good statistics from the bad ones in everyday life.

A: Starting with Q2: convincing readers that a causal effect has been found is often the overriding concern of research articles in social sciences, psychology and medicine. However this usually cannot be done through a simple test but by proposing a causal theory, presenting evidence consistent with the theory in the form of correlations and other statistical patterns, pre-empting alternative explanations, and presenting evidence that is not consistent with the alternative explanations.
(Q1) Regression analysis allowing the researcher to examine the conditional correlation between an explanatory variable and a dependent variable while controlling for other possible explanatory variables is still probably the most common method. This does not by itself demonstrate causation between the variables of interest, but helps to isolate and reject competing causal explanations. In particular, it is difficult to argue that there is a causal relationship when there is no correlation after controlling for other variables (although when the explanatory variables are strongly correlated with each other, even this can be questioned).
Some other common methods that try to improve on basic regression analysis for eliminating competing explanations of hypothesised causal effects include

*

*'natural experiments', for instance where one region of a country has benefited from a new policy but another, otherwise similar, region has not

*matching techniques such as propensity score matching, which try to control specifically for the fact that the 'treatment' group (e.g. people who sleep less) in an observational study may differ systematically from the 'control' group (people who sleep more) in ways that affect the outcome of interest (longevity)

(Q3) Arguably there is no simple technique for filtering out good statistics; it depends as much on knowledge of the field as knowledge of the statistical methods. Assuming an article  shows a correlation between two variables, consider what the alternative explanations for that correlation could be (e.g. an unobserved variable influencing both, or reverse causation) and whether the article at least tries to eliminate those alternative explanations. There will nearly always be some form of regression or matching analysis to control for other variables; if nothing like that is mentioned in the abstract then a causal conclusion is likely to be unsound (but such articles would rarely get published in academic journals).
Also consider the level of generality claimed for the causal effect. E.g. the claim that less sleep leads to more longevity in abstract terms sounds like it is suggesting a universal effect, applicable to humans in all places and times. To make a general claim like that plausible would depend on subject knowledge (e.g. prior evidence that the determinants of longevity are similar across countries) and a strong argument that the sample is representative (e.g. the article describes how they were selected and discusses how potential sample bias was avoided).
For me the most convincing evidence from observational studies is when a series of studies by different researchers, using different datasets and techniques, have consistently found evidence that does not contradict the proffered causal explanation, and progressively eliminated alternative explanations.

A: Q2: As far as I know there are 2 good ways to test for causality. It is done by the design of the study. Two designs work here:

*

*In a situation where you can control ALL independent variables
(usually in experiments). This makes sure that A is causing B, and there is no C causing the effect (and also not the reverse effect; B causing A).

*In longitudinal studies.

Q1: Rubin's Causal Model: http://en.wikipedia.org/wiki/Rubin_causal_model
Q3: There is no "trick" to seeing whether the statistics of one single article are good. I find the most important questions you should ask yourself:

*

*Who did the research?

*What is to be gained by the researcher with a favorable outcome?


text:
Q: This image slider starts with nothing why? So Ii made an image slider for a school project and this is happening when I start up the page or when I reload it. The page only shows the arrows and the dots.
Screenshot of the problem
Here is my code:

showSlides(slideIndex);

// Next/previous controls
function plusSlides(n) {
  showSlides(slideIndex += n);
}

// Thumbnail image controls
function currentSlide(n) {
  showSlides(slideIndex = n);
}

function showSlides(n) {
  var i;
  var slides = document.getElementsByClassName("mySlides");
  var dots = document.getElementsByClassName("dot");
  if (n > slides.length) {
    slideIndex = 1
  }
  if (n < 1) {
    slideIndex = slides.length
  }
  for (i = 0; i < slides.length; i++) {
    slides[i].style.display = "block";
  }
  for (i = 0; i < dots.length; i++) {
    dots[i].className = dots[i].className.replace(" active", "");
  }
  slides[slideIndex - 1].style.display = "block";
  dots[slideIndex - 1].className += "active";
}
margin-top: -8px;
margin-left: -8px;

}
.header {
  margin-top: 25px;
}
.headerimg {
  width: 2047px;
  margin-bottom: -168px;
}
.toDHL {
  color: red;
  margin-left: 81px;
}
.menu-bar {
  color: black;
  text-decoration: none;
  font-size: 35px;
  font-family: Arial;
  font-weight: bold;
}
.linkimg {
  width: 537px;
  height: 150px;
  margin-top: -89px;
  margin-left: 17px;
}
#toHome {
  margin-left: 50px;
  border-bottom: 3px solid red;
}
#toRooster {
  margin-left: 200px;
}
#toSmoelenboek {
  margin-left: 200px;
}
#toSuccesverhaal {
  margin-left: 200px;
  position: absolute;
}
.slideshow-container {
  float: left;
}
* {
  box-sizing: border-box
}

/* Slideshow container */
.slideshow-container {
  max-width: 1000px;
  position: relative;
  margin-top: 60px;
}

/* Hide the images by default */
.mySlides {
  display: none;
}

/* Next & previous buttons */
.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  margin-top: -22px;
  padding: 16px;
  color: black;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
}

/* Position the "next button" to the right */
.next {
  right: 0;
  border-radius: 3px 0 0 3px;
  margin-right: 0px;
}

/* On hover, add a black background color with a little bit see-through */
.prev:hover,
.next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Caption text */
.text {
  color: #f2f2f2;
  font-size: 50px;
  padding: 8px 5px;
  position: absolute;
  bottom: 8px;
  width: 100%;
  text-align: center;
  text-shadow: 2px 2px #000000;
}

/* The dots/bullets/indicators */
.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
  margin-top: 660px;
}
.active,
.dot:hover {
  background-color: #717171;
}

/* Fading animation */
.fade {
  -webkit-animation-name: fade;
  -webkit-animation-duration: 1.5s;
  animation-name: fade;
  animation-duration: 1.5s;
}
@-webkit-keyframes fade {
  from {
    opacity: .4
  }

  to {
    opacity: 1
  }
}
@keyframes fade {
  from {
    opacity: .4
  }

  to {
    opacity: 1
  }
}
.Succesverhalen_Sidebar {
  float: right;
  margin-left: 15px;
  margin-top: 30px;
}
.Succesverhalen_Sidebar_text {
  position: absolute;
  margin-left: 1900px;
  margin-top: 91px;
}
<!DOCTYPE html>

  <meta charset="utf-8">
  <link rel="stylesheet" href="css/home.css">

  <title>DHL Nieuws</title>

  <meta name="viewport" content="width=device-width, initial-scale=1">

    Home
    Rooster
    Smoelenboek
    Succesverhalen

Sinterklaas is weer in het land!

Het is binnen kort Black Friday!

Santa Claus is coming to town!

    ❮
    ❯

.........................
.........................
.........................

.........................
......Lees verder

.........................
.........................
.........................

.........................
......Lees verder

.........................
.........................
.........................

.........................
......Lees verder

.........................
.........................
.........................

.........................
......Lees verder

.........................
.........................
.........................

.........................
......Lees verder

.........................
.........................
.........................

.........................
......Lees verder

.........................
.........................
.........................

.........................
......Lees verder

I would like to receive an answer really fast because the deadline for the project ends in a few days. Thanks.

A: you just have to define slideIndex like var slideIndex=0; or =1 so it wil be var slideIndex = 1;
showSlides(slideIndex); and the javascript is not loading correctly because its in the head so the put the script tag at the bottom of body

A: There are some semantic issues in your code.
Taking for granted that that is your whole javascript code I see this problems:
showSlides(slideIndex); // --> Here you are calling showSlides function with slideIndex that is undefined,
                        //     maybe you are missing something like "var slideIndex = 0" or similar

function plusSlides(n) {
   showSlides(slideIndex += n);
}

function currentSlide(n) {
   showSlides(slideIndex = n);
}

function showSlides(n) {
   var i;
   var slides = document.getElementsByClassName("mySlides");
   var dots = document.getElementsByClassName("dot");
   if (n > slides.length) {
   slideIndex = 1 // --> here slideIndex is not yet declared, is it global?
                  //     if it's not the case you have to declare it on top, like after "var i;" declaration.
   }
   if (n < 1) {
      slideIndex = slides.length
   }
   for (i = 0; i < slides.length; i++) {
      slides[i].style.display = "block";
   }
   for (i = 0; i < dots.length; i++) {
      dots[i].className = dots[i].className.replace(" active", "");
   }
   slides[slideIndex - 1].style.display = "block";
   dots[slideIndex - 1].className += "active";
}

fix these, give it a try and let me know
Last but not least if you want to load your javascript code inside the head tag you have to wrap it in a function that fires only after the DOM is fully loaded,
something like this:
document.addEventListener("DOMContentLoaded", function(event) {
    //your code
});

Or eventually you can put your script tag immediately before the body closing tag


text:
Q: circular references among javascript functions How can one define a pair of functions that call each other in Javascript so that JS-lint does not complain that 'factorial' is being used before it is defined?
function factorial1(n) { return factorial(n); }
function factorial(n) { return n === 0 ? 1 : n * factorial1(n - 1); }

It seems there is no valid ordering that will satisfy JSlint.
(One can be embedded in the other, but this would be a nightmare for a collection of functions that all call each other).
Surely this is handled by the language right?
Is this just a bug in JSlint?
(This question must have been answered somewhere, but I cannot find it!)

A: The references inside the functions is not resolved until they are executed. As long as both functions has been defined by the time one of them executes, they will find each other.
If you want to get rid of the JSLint warning, you could define the name of the function, just before:
var factorial;
function factorial1(n) { return factorial(n); }
function factorial(n) { return n === 0 ? 1 : n * factorial1(n - 1); }

A: I prefer this syntax to functions:
var factorial1 = function(n) { return factorial(n); }
var factorial = function(n) { return n === 0 ? 1 : n * factorial1(n - 1); }

Will not be able to forget to "declare" function with this syntax.

A: Another approach to this problem, is to pass it as a callback function, like this:
const factorial1 = (n, callback) => { return callback(n); }
const factorial = (n) => { return n === 0 ? 1 : n * factorial1(n - 1, factorial ); }


text:
Q: How can I run ALL my Apps "as administrator" in windows 10 I know about the suggestions of http://www.tenforums.com/tutorials/3436-run-administrator-windows-10-a.html. However not one option provides an answer to my question. I want to run as admin all applications without executing an action for each one of them.

A: Run Powershell as admin:
run: Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLUA" -Value "0"
restart PC


text:
Q: Choosing a Enum Class based on user input I have a package with a list of enum classes

I want to be able to select a particular Enum class based on user selection in a constructor of a different class.
Since one can not create instance of enums by using new operator in Java because constructor of Enum is private, is there any way around to choose a particular enum class?
Basically I want to do someting like this.
 public class A{
           Enum e;
           A(Enum e){
               e=new abcEnum();
            }
    }


text:
Q: Length of bicycle frame according to the graph Problem reads:

Aditya is riding a bicycle on a road filled with mud patches. When it is passing through one of those patch, one of the wheels of bicycle traces part of curve $y=\sin (x)$ and the other wheel traces curve with a vertical inflection point as shown in the figure.
To remove the possible effects due to the bicycle's geometry, wheel size and its tilting, take the bicycle to have vanishingly thin tires with its front axle always positioned dircetly below a vertical headset. Also, assume that its both wheels were in a mud patch when the inflection point is traversed.Determine the distance $\ell$ between its axles.

What I considered was at point of inflection the bike tyres would be in a straightline and tangential to the bottom curve which is of forward track but how to find length from it ? (I know one fact that curve of both will be sinusoidal but length part I am not able to understand how to calculate)


text:
Q: How can I display an image inside SVG circle in html5? Is there a way to  display an image inside SVG Circle ?
I tried adding the image inside Svg element but the image does not appear in the circle.
<svg width="100" height="100">
<circle cx="50" cy="50" r="40"stroke="green" stroke-width="4" fill="yellow" />

 </svg>

Can you help me?

A: Here is an example elaborating on Havenard's comment above:

<svg width="500" height="250">
    <defs>
        <clipPath id="circleView">
            <circle cx="250" cy="125" r="125" fill="#FFFFFF" />
        </clipPath>
    </defs>
    <image
      width="500"
      height="250"
      xlink:href="https://www.amrita.edu/sites/default/files/news-images/new/news-events/images/l-nov/grass.jpg"
      clip-path="url(#circleView)"
    />
 </svg>

You don't actually draw a <circle> element with an image inside - instead, define a circular clip path, and set it as the 'clip-path' attribute on the <image> tag.

A: It is maybe not the best way to do it. but it works very good. The thing you can do it place it to a relative position and edit top and left properties so you image is in the center of your svg image. Also important is to place it outside your svg-tag.

img {
  position: relative;
  top: -30px;
  left: -70px;
}
<svg width="100" height="100">
<circle cx="50" cy="50" r="40"stroke="green" stroke-width="4" fill="yellow" />
 </svg>


text:
Q: Is it possible to disable previous dates of a datetimepicker according to selected date in other datetimepicker I am using two datetimepickers for startdate and enddate.I want to disable all the previous date in endadate when i select date in startdate.For example if i select 29/04/2020 in startdate than in enddate all dates before 29/04/2020 must be disabled.
below is the code:
$(function(){
    $('#startDate').datetimepicker({
        format: 'dd-mm-yyyy  hh:ii',
        endDate: '+0d',
        autoclose: true,

    });
    $('#endDate').datetimepicker({
        format: 'dd-mm-yyyy hh:ii',
        endDate: '+0d',
        autoclose: true
    });
});

How do i modify the code to get the expected result.

A: Please try following code, it is working.

<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Testing Date Time Picker</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script>
  <link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.css" rel="stylesheet" />
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.full.js"></script>
</head>
<body>
 <label>Start Date: </label>
 <input id="startDate" type="text" />
 <label>End Date: </label>
 <input id="endDate" type="text" />
 <script>
  $(document).ready(function(){
   $('#startDate').datetimepicker({
    format: 'd-m-Y H:i',
    closeOnDateSelect:true,
    onChangeDateTime:function(dp,$input){
     //need to convert date to format yyyy/m/d
     var val = $input.val();
     $('#endDate').datetimepicker({minDate: val, formatDate:'d-m-Y H:i'});
    }
   });
   $('#endDate').datetimepicker({
    format: 'd-m-Y H:i',
    closeOnDateSelect:true,
   });
  });
 </script>
</body>
</html>


text:
Q: How to create hive table with date format 'dd-MMM-yyyy'? I,m trying to create a hive table for importing csv data into table where the date format in the csv file is 'dd-MMM-yyyy' (for example 20-Mar-2018). When i created table in hive it turns out the entire column of date into null values. Can anyone suggest me how to figure out this?
My Query:
create external table new_stock (Symbol String,Series String,Dat date,Prev_Close float,Open_Price float,High_Price float,Low_Price float,Last_Price float,Close_Price float,Avg_Price float,Volume int,Turn_Over float,Trades int,Del_Qty int,DQPQ_Per float) row format delimited fields terminated by ',' stored as textfile LOCATION '/stock_details/'

A: Finally some help from @leftjoin, i solved the problem of converting string date with format (dd-MMM-yyyy) to (dd-MM-yyyy) by using select query. It would work fine.
select from_unixtime(unix_timestamp(columnname ,'dd-MMM-yyyy'), 'dd-MM-yyyy') from tablename;


text:
Q: How to put the files of a folder in an array? In a folder "images" I have a thousand xml files.Those filenames I want them to be insert into an array
$images = array('','');
Instead of writing them all by hand, and this folder will be updated often, how can I do it automatically ?

A: Just exclude the . and .. entries if you don't want them:
$files = array_diff( scandir($dir), array('.','..') );

A: . and .. are always present in ALL directories ('current directory' and 'parent directory', respectively). You have to specifically filter them out. However, since you want only images, you could use something like glob() to just fetch images using regular shell wildcard patterns, e.g.
$files = glob('*.jpg');

which would give you all the files whose names end in .jpg.


text:
Q: How to compute MLE for Pareto distribution data with right censored observation by using R programming? I am doing survival analysis and writing codes to compute MLE for several distributions. Yet, I get stuck while writing for Pareto distribution with right censored observation.
For complete/uncensored data, it can be dealt with by using the following coding provided by Macro in this post: How do I fit a set of data to a Pareto distribution in R?
    pareto.MLE <- function(x)
    {
      n <- length(x)
      m <- min(x)
      a <- n/sum(log(x)-log(m))
      return( c(m,a) )
    }

    # example.
    library(VGAM)
    set.seed(1)
    z = rpareto(1000, 2, 6)
    pareto.MLE(z)
    [1] 1.000014 5.065213

So, how about right censored data? I tried to follow the steps the previous post shows for right censored data by using its survival function where S(t)=(b/t)^a, but I still couldn't manage to get a solution, as I got n*log(m)-sum(log(t))=0, there's no more a after the differentiation w.r.t. a.
What should I do?

A: For a random sample $x_1, x_2,\ldots,x_n$ the likelihood with parameters $m$ and $a$ with the censoring done at $x_c$ is given by
$$\left(\left(\frac{m}{x_c}\right)^{\alpha }\right)^{n_c} \prod _{i=1}^{n-n_c} a m^a x_i^{-a-1}$$
where $n_c$ is the number of censored observations.  The maximum likelihood estimator of $m$ is still $\min x_i$ and the maximum likelihood estimator of $a$ becomes
$$\frac{n-n_c}{\sum _i^{n} \log (x_i)-n \log (\hat{m})}$$
Some R code follows:
# Function to create a random sample from a right-censored Pareto distribution
r.censored.pareto <- function(n, m, a, xc) {
  # n is sample size
  # m and a are the Pareto parameters
  # xc is the censoring value
  x <- m*(1 - runif(n))^(-1/a)
  x[x >= xc] <- xc
  x
}

# Function to return maximum likelihood estimates of m and a
censored.pareto.MLE <- function(x, xc) {
  # x is the random sample from the censored Pareto distribution
  # xc is the censoring value

  # Count the number of censored observations
  nc <- length(x[x >= xc])
  m.mle <- min(x)
  a.mle <- (length(x) - nc)/(sum(log(x)) - length(x)*log(m.mle))
  return(c(m.mle, a.mle))
}

# Generate random sample from a right-censored Pareto distribution
  set.seed(12345)
  x <- r.censored.pareto(1000, 5, 5, 8)

# Find maximum likelihood estimates of m and a
  censored.pareto.MLE(x, 8)
# [1] 5.001137 4.864037