text:
Q: java.lang.RuntimeException: Hilt classes generated from @HiltAndroidTest are missing I am trying to run a simple Robolectric test with Hilt.
@HiltAndroidTest
@Config(application = HiltTestApplication::class)
@RunWith(AndroidJUnit4::class)
class SplashActivityTest2 {

    @get:Rule
    var hiltRule = HiltAndroidRule(this)

    @Test
    fun fooTest() {
        val splashActivity = ActivityScenario.launch(SplashActivity::class.java)
    }
}

but when I try to run the test using Android Studio, am getting

java.lang.RuntimeException: Hilt classes generated from
@HiltAndroidTest are missing. Check that you have annotated your test
class with @HiltAndroidTest and that the processor is running over
your test

Here's the full stacktrace.
[Robolectric] com.theapache64.nemo.feature.splash.SplashActivityTest2.fooTest: sdk=28; resources=BINARY
Called loadFromPath(/system/framework/framework-res.apk, true); mode=binary sdk=28

java.lang.RuntimeException: Hilt classes generated from @HiltAndroidTest are missing. Check that you have annotated your test class with @HiltAndroidTest and that the processor is running over your test

    at dagger.hilt.android.internal.testing.TestApplicationComponentManager.<init>(TestApplicationComponentManager.java:68)
    at dagger.hilt.android.testing.HiltTestApplication.attachBaseContext(HiltTestApplication.java:39)
    at android.app.Application.attach(Application.java:212)
    at org.robolectric.util.ReflectionHelpers.callInstanceMethod(ReflectionHelpers.java:283)
    at org.robolectric.shadows.ShadowApplication.callAttach(ShadowApplication.java:79)
    at org.robolectric.android.internal.AndroidTestEnvironment.installAndCreateApplication(AndroidTestEnvironment.java:250)
    at org.robolectric.android.internal.AndroidTestEnvironment.setUpApplicationState(AndroidTestEnvironment.java:169)
    at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:301)
    at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:243)
    at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: dagger.hilt.android.internal.testing.TestComponentDataSupplierImpl
    at org.robolectric.internal.bytecode.SandboxClassLoader.getByteCode(SandboxClassLoader.java:164)
    at org.robolectric.internal.bytecode.SandboxClassLoader.maybeInstrumentClass(SandboxClassLoader.java:119)
    at org.robolectric.internal.bytecode.SandboxClassLoader.lambda$findClass$0(SandboxClassLoader.java:112)
    at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:53)
    at org.robolectric.internal.bytecode.SandboxClassLoader.findClass(SandboxClassLoader.java:111)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at dagger.hilt.android.internal.testing.TestApplicationComponentManager.<init>(TestApplicationComponentManager.java:58)
    at dagger.hilt.android.testing.HiltTestApplication.attachBaseContext(HiltTestApplication.java:39)
    at android.app.Application.$$robo$$android_app_Application$attach(Application.java:212)
    at android.app.Application.attach(Application.java)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    ... 11 more

Process finished with exit code 255

Here's my app/build.gradle
The same file with pure instrumentationTest (androidTest) works though.

A: To make Dagger Hilt works normally with Robolectric. Please make sure you have the following conditionals:

*

*Have kaptTest 'com.google.dagger:hilt-android-compiler:...' from your dependencies.

*Have @HiltAndroidTest in your test class.

*Have @Config(application = HiltTestApplication::class) in your test class or  specify which application to use in the robolectric.properties file:
application=dagger.hilt.android.testing.HiltTestApplication

A: You have missed this
kaptTest 'com.google.dagger:hilt-android-compiler:2.28-alpha'

from your dependencies..
source : https://developer.android.com/training/dependency-injection/hilt-testing
dependencies {
    // For Robolectric tests.
    testImplementation 'com.google.dagger:hilt-android-testing:2.28-alpha'
    // ...with Kotlin.
     kaptTest 'com.google.dagger:hilt-android-compiler:2.28-alpha'
    // ...with Java.
    testAnnotationProcessor 'com.google.dagger:hilt-android-compiler:2.28-alpha'

    // For instrumented tests.
    androidTestImplementation 'com.google.dagger:hilt-android-testing:2.28-alpha'
    // ...with Kotlin.
    kaptAndroidTest 'com.google.dagger:hilt-android-compiler:2.28-alpha'
    // ...with Java.
    androidTestAnnotationProcessor 'com.google.dagger:hilt-android-compiler:2.28-alpha'
}


text:
Q: XMLHttpRequest status is 0 rather than 200 I'm learning how to use AJAX by following thenewboston's tutorial. I keep receiving an xmlHttpRequest status of 0 rather than 200. I've looked up what status 0 is and it states that my request is not initialized. I've been poring over my files and I can't figure out why it's doing this.
I believe I narrowed it down to the xmlHttp.open not properly "linking"? to my foodstore.php file, or that there's something written incorrectly in the foodstore.php file.
My files are all stored in the htdocs folder with the Apache Web Server running locally on XAMMP 1.8.3-4.
index.html
<!DOCTYPE html>

The Chuff Bucket

        Enter the food you would like to order:
        <input type="text" id="userInput" />

foodstore.js
var xmlHttp = createXmlHttpRequestObject();

//creates connection object
function createXmlHttpRequestObject(){
    var xmlHttp;

    if(window.ActiveXObject){
        try{
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){
            xmlHttp = false;
        }
    }else{
        try{
            xmlHttp = new XMLHttpRequest();
        }catch(e){
            xmlHttp = false;
        }
    }

    if(!xmlHttp)
        alert("cant create that object boss!");
    else
        return xmlHttp;
}

//processes object
function process(){
    if(xmlHttp.readyState == 0 || xmlHttp.readyState == 4){
        alert('process run!');
        var food = encodeURIComponent(document.getElementById("userInput").value);
        xmlHttp.open("GET", "foodstore.php?food="+food, true);
        xmlHttp.onreadystatechange = handleServerResponse;
        xmlHttp.send(null);
    }else{
        alert('process NOT run!');
        setTimeout('process()',1000);
    }
}

function handleServerResponse(){
    if(xmlHttp.readyState == 4){
        //check if communication session is OK. no errors
        alert('xmlHttp status: ' + xmlHttp.status);
        if(xmlHttp.status == 200){
            xmlResponse = xmlHttp.responseXML;
            xmlDocumentElement = xmlResponse.documentElement;
            message = xmlDocumentElement.firstChild.data; //message equals data between response tags from foodstore.php
            document.getElementById("underInput").innerHTML = '' + message + '';
            setTimeout('process()', 1000);
        }else{
            alert('Something went wrong!');
        }
    }
}

foodstore.php
<?php
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';

echo '<response>';
    $food = $_GET['food'];
    $foodArray = array('tuna','ham','bacon','chicken');

    if(in_array($food, $foodArray))
        echo 'We do have ' . $food . '!';
    elseif($food == '')
        echo 'Enter a food';
    else
        echo 'Sorry we dont sell ' . $food . '!';
echo '</response>';
?>

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to retrieve the node values from a constparty object? I was trying to find an optimal dichotomized threshold for a continuous variable fitted to a survival model and I was using partykit::ctree() for this purpose:
> library(survival)
> library(partykit)
Loading required package: grid
> data("GBSG2", package = "TH.data")

> stree <- ctree(Surv(time, cens) ~ tsize, data = GBSG2)
> stree$node
[1] root
|   [2] V2 <= 19 *
|   [3] V2 > 19
|   |   [4] V2 <= 61 *
|   |   [5] V2 > 61 *

My question is how to retrieve the fitted thresholds (e.g. 19 and 61 in the above example).
> class(stree)
[1] "constparty" "party"

A: I finally figured it out but may be not the best way though.
stree$node$split$breaks
or
stree@tree$psplit$splitpoint


text:
Q: Time picker is not getting hours and minutes value correctly I am facing one issue, i am using time picker to display hours and minutes, User can change the Hours and minutes value upon taping on the hours and minutes field so it will open android keypad to enter new value of hours and minutes but what I observed that sometimes hours value updated properly and sometimes minutes value but at a time only one value is coming properly and other value is 0. I am using timepicker.getCurrenrHour() and getCurrentMinute() methods to get the updated value , but both value are not coming properly.
Please help me to resolve this issue.
Regards,
Amit

A: Use this code :
package org.stellent.Sample;

import java.util.Calendar;

import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.TimePicker;

public class DateandTime extends Activity implements OnClickListener{
private static final int TIME_DIALOG = 1;
Button time;

public void onCreate(Bundle state){
super.onCreate(state);
setContentView(R.layout.timeanddate);

time=(Button)findViewById(R.id.time);

time.setOnClickListener(this);

}

@Override
public void onClick(View v) {
if(v.equals(time)){
showDialog(TIME_DIALOG);
}
}

public Dialog onCreateDialog(int id){
Calendar cal=Calendar.getInstance();
switch(id){
case TIME_DIALOG:
return new TimePickerDialog(this,timepicker,cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE), false);
}
return null;
}

TimePickerDialog.OnTimeSetListener timepicker=new TimePickerDialog.OnTimeSetListener(){
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
Log.e("time :",String.valueOf(hourOfDay)+" : "+String.valueOf(minute));
}
};

}


text:
Q: Error printing correct number in C Hi I'm new to C and I am trying to print an 8 when running the program with "factorial 8". Instead of getting an 8, I am getting 56. Can anyone explain why?
#include <stdio.h>

int main(int argc, char **argv)
{
    int input;

    if(argv[1] == NULL)
    {
        printf("Error: please supply an integer on the command line.\n");
        return 0;
    }

    input = *argv[1];
    printf("%d", input);

    return 0;
}

A: You're getting a 58 because you're assigning the integer value of whatever argv[1] happens to pointing to.  You may want to look into atoi()
 input = atoi(argv[1]);

I'd really recommend that you verify that you have arguments by checking the number of arguments in argc rather than just dereferencing argv[1] and checking if it's null.

A: Here :
input = *argv[1];

you are trying to assign string(argv[1]) to int.
You should go like:
input = atoi(argv[1]);

A: The arguments in the main function are passed as strings. So when you do
input = *argv[1];

You are assigning string value to input. If you look at ascii table you can see the character "8" has the value of 56.
You can use atoi() function as other answer emphasize or, you can use strtol() to convert string into the integer.
For a more detailed answer about atoi() and strtol() check the answer https://stackoverflow.com/a/3421555/1589566


text:
Q: Apache server to host php panel I have a php admin panel for a voip client I'm using (https://github.com/dieonar/MyMumb-Panel) running on a Raspi2 with Apache2 on it.
I'm kind of new to hosting but I mainly want to use it on my local net, and thus writing 192.168.0.111/MyMumb-Panel (rasp pi local address) would direct me to this site.
However, while 192...111/index.html works fine, going to /MyMumb-Panel/index.php shows a blank page. I havent written the php module personally but I'm fairly sure it should work OOB..
I have low knowledge of apache and usually use WAMP, but sicne this is on linux, I'm confused with what inis to configure and so on..
Can someone give me pointers as to where to begin ? There's a readme on the git with instructions, which I've followed, but there's some confusion regarding Vhosts and configuring these..


text:
Q: Emails from VPS going to Spam folder i'm using unmanaged VPS from Contabo, i don't know why my emails are going to Spam folder, i checked many articles, i set SPF record but the same problem, any idea?
    Delivered-To: r_haceb@esi.dz
Received: by 10.140.28.98 with SMTP id 89csp63344qgy;
        Sun, 6 Apr 2014 13:02:57 -0700 (PDT)
X-Received: by 10.229.230.68 with SMTP id jl4mr29009103qcb.2.1396814577669;
        Sun, 06 Apr 2014 13:02:57 -0700 (PDT)
Return-Path: <contact@printdz.com>
Received: from vmi19458 (ip-30-185-143-79.static.contabo.net. [79.143.185.30])
        by mx.google.com with ESMTPS id m6si5836502qay.218.2014.04.06.13.02.53
        for <r_haceb@esi.dz>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 06 Apr 2014 13:02:57 -0700 (PDT)
Received-SPF: neutral (google.com: 79.143.185.30 is neither permitted nor denied by best guess record for domain of contact@printdz.com) client-ip=79.143.185.30;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 79.143.185.30 is neither permitted nor denied by best guess record for domain of contact@printdz.com) smtp.mail=contact@printdz.com;
       dkim=neutral (no key for signature) header.i=@printdz.com
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=printdz.com; s=default;
    h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Message-ID:Date:To:From; bh=vEH0oxcAnuvem9JO5KMEXGGPvJrXQ46uir2TfFo6T0U=;
    b=SnGkZAXRW9gO1IY3TP4v3QJ7gHArhtjIJN/sOCk2sOf0i/jLDNLNneZ8xaU2s/oV4OEzmETVPqJ2wFk5g1WDG9e8R27sKfzbwXj8R6H5UmvLgecJ/W7nJZRNeBYOxB6HJx4BkXoi4KaYFR2FYekufmfGWhExo/nPRPJyelzkvg4=;
Received: from ip-30-185-143-79.static.contabo.net ([79.143.185.30]:46956 helo=www.printdz.com)
    by vmi19458 with esmtpa (Exim 4.82)
    (envelope-from <contact@printdz.com>)
    id 1WWtHI-0000ie-Gv
    for r_haceb@esi.dz; Sun, 06 Apr 2014 22:02:52 +0200

A: I'm having the same problem. Note that your SPF is not configured or this line wouldn't appear

Received-SPF: neutral (google.com: 79.143.185.30 is neither permitted nor denied by best guess record for domain of contact@printdz.com) client-ip=79.143.185.30;

To confirm that your SPF is not ok, go here http://www.kitterman.com/spf/validate.html
The solution would be asking Contabo to fix your DNS record regarding SPF.


text:
Q: how to make curved wave with svg i am trying to make a curved wave with svg. I already have created an waterwave, but there should be at the end a second curved wave.
This is what i have now:
En this is how it should look like:

How can i achieve this?
This is the code i already have:

<svg class="four" viewBox="0 0 500 500" preserveAspectRatio="none">
            <path d="M0,100 C100,200 350,0 300,100 L500,0 L0,0 Z" style="stroke: none; fill:#1e90ff;"></path>
         </svg>

A: Make use of a quadratic Bézier curve in the last bit of your path like this:

<path d="M0,100 C150,200 350,0 300,100 Q400,25 500,25 L500,0 L0,0 Z"
style="stroke: none; fill:#1e90ff;"></path>
</svg>


text:
Q: Bulk Updates - Salesforce Marketing Cloud - Excel Connector I need to do a mass update to all of the email templates in Salesforce Marketing Cloud. From what I've researched, there are no built in app tools do allow this.
I know a popular tool for exporting/importing to Salesforce (not sure which segment it applies to) is Excel Connector, but not sure if that would somehow work for Marketing Cloud.

*

*Would the Excel Connector have access to all different segments of Salesforce including the Marketing Cloud?

*What are other ways one could bulk update email templates in Salesforce Marketing Cloud?

A: The Salesforce Excel Connector is to tool that works with Force.com (i.e Core Salesforce.com) and not Salesforce Marketing Cloud. Although these platforms are owned by the same company, it is important is recognise that they are very different "under the hood".
Therefore to answer your questions:

*

*Would the Excel Connector have access to all different segments of Salesforce including the Marketing Cloud? NO - to move data between Salesforce.com and Marketing Cloud, look to the Marketing Cloud Connector. This offers some data migration facility, but NOT EMAIL TEMPLATES

*What are other ways one could bulk update email templates in Salesforce Marketing Cloud? You could use the SOAP API if you are using Classic Content (Email Studio) or REST API if you are using Content Builder


text:
Q: No element found using locator error in protractor In my testing phase I want to test a header element h2 in html

HAL 9000

Jupiter   Feb 10, 2025

I wanted to test that the "Hal 9000" is visible or not could someone help me to find it in my protractor testing process
in my protractor I used
var child =   element(by.css('.col col-top.col-67')),                               element(by.css('.ng-binding'));
it('20 should update 2nd lead with proper data',function(){
expect(child.getText()).toBe('HAL 9000'); });

and i get an error message in my terminal as
NoSuchElementError: No element found using locator: By.cssSelector(".col col-top.col-67")
someone help me to fix this problen

A: for a more precise locator, you can always use:
element(by.css('.col.col-top.col-67 h2');


text:
Q: C# ParentForm.ActiveControl.Name if (Operators.CompareString(this.ParentForm.ActiveControl.Name, this.Name, false) == 0)
{
base.Focus();
}

From What I have experience in VB6,the above code doesn't work because they are never equal if the users didn't change to the same name.
From Example, the UserControl Name is ucCalendar, When I drag to my From, the name will automatically change to ucCalendar1,even though I can change to ucCalendar but usually we won't do that.
I think the coder want to compare whether the UserControl is the only control or ActiveControl on the Form so that he can force to focus it.
I don't know this C# works or not. Please tell me.

A: There is nothing in the WinForms code saying that two controls can not have the same name. The reason you think that is that you're looking at it from the designer perspective, when you use the designer it won't let you have two controls with the same name just because it uses there as field names for them in the code, and as you probably know there can not be two fields / properties / variables with the same name in the same scope. As a matter of fact there is no need for the Control's Name property to be anything.


text:
Q: Dependency Injection and development productivity Abstract
For the past few months I have been programming a light weight, C# based game engine with API abstraction and entity/component/scripting system. The whole idea of it is to ease the game development process in XNA, SlimDX and such, by providing architecture similar to that of the Unity engine.
Design challenges
As most game developers know, there are a lot of different services you need to access throughout your code. Many developers resort to using global static instances of e.g. a Render manager(or a composer), a Scene, Graphicsdevice(DX), Logger, Input state, Viewport, Window and so on. There are some alternative approaches to the global static instances/ singletons. One is to  give each class an instance of the classes it needs access to, either through a constructor or constructor/property dependency injection(DI), another is to use a global service locator, like StructureMap's ObjectFactory where the service locator is usually configured as an IoC container.
Dependency Injection
I chose to go the DI way for many reasons. The most obvious one being testability, by programming against interfaces and have all the dependencies of every class provided to them through a constructor, those classes are easily tested since the test container can instantiate the required services, or the mocks of them, and feed into every class to be tested. Another reason for doing DI/IoC was, believe it or not, to increase the readability of the code. No more huge initialization process of instantiating all the different services and manually instantiating classes with references to the required services. Configuring the Kernel(NInject)/Registry(StructureMap) conveniently gives a single point of configuration for the engine/game, where service implementations are picked and configured.
My problems

*

*I often feel like I am creating interfaces for interfaces sake

*My productivity has gone down dramatically since all I do is worry about how to do things the DI-way, instead of the quick and simple global static way.

*In some cases, e.g. when instantiating new Entities on runtime, one needs access to the IoC container / kernel to create the instance. This creates a dependency on the IoC container itself (ObjectFactory in SM, an instance of the kernel in Ninject), which really goes against the reason for using one in the first place. How can this be resolved? Abstract factories come to mind, but that just further complicates the code.

*Depending on service requirements, some classes' constructors can get very large, which will make the class completely useless in other contexts where and if an IoC is not used.

Basically doing DI/IoC dramatically slows down my productivity and in some cases further complicates the code and architecture. Therefore I am uncertain of whether it is a path I should follow, or just give up and do things the old fashioned way. I am not looking for a single answer saying what I should or shouldn't do but a discussion on if using DI is worth it in the long run as opposed to using the global static/singleton way, possible pros and cons I have overlooked and possible solutions to my problems listed above, when dealing with DI.

A: Should you go back to the old-fashioned way?
My answer in short is no. DI has numerous benefits for all the reasons you mentioned.

I often feel like I am creating interfaces for interfaces sake

If you are doing this you might be violating the
Reused Abstractions Principle (RAP)

Depending on service requirements, some classes' constructors can get
  very large, which will make the class completely useless in other
  contexts where and if an IoC is not used.

If your classes constructors are too large and complex, this is the best way to show you that you are violating a very important other principle:
Single Reponsibility Principle. In this case it is time to extract and refactor your code into different classes, the number of dependencies suggested is around 4.
In order to do DI you don't have to have an interface, DI is just the way you get your dependencies into your object. Creating interfaces might be a needed way to be able to substitute a dependency for testing purposes.
Unless the object of the dependency is:

*

*Easy to isolate

*Doesn't talk to external subsystems (file system
etc)

You can create your dependency as an Abstract class, or any class where the methods you'd like to substitute are virtual. However interfaces do create the best de-coupled way of an dependency.

In some cases, e.g. when instantiating new Entities on runtime, one
  needs access to the IoC container / kernel to create the instance.
  This creates a dependency on the IoC container itself (ObjectFactory
  in SM, an instance of the kernel in Ninject), which really goes
  against the reason for using one in the first place. How can this be
  resolved? Abstract factories come to mind, but that just further
  complicates the code.

As far as a dependency to the IOC container, you should never have a dependency to it in your client classes.
And they don't have to.
In order to first use dependency injection properly is to understand the concept of the Composition Root. This is the only place where your container should be referenced. At this point your entire object graph is constructed. Once you understand this you will realize you never need the container in your clients. As each client just gets its dependency injected.
There are also MANY other creational patterns you can follow to make construction easier:
Say you want to construct an object with many dependencies like this:
new SomeBusinessObject(
    new SomethingChangedNotificationService(new EmailErrorHandler()),
    new EmailErrorHandler(),
    new MyDao(new EmailErrorHandler()));

You can create a concrete factory that knows how to construct this:
public static class SomeBusinessObjectFactory
{
    public static SomeBusinessObject Create()
    {
        return new SomeBusinessObject(
            new SomethingChangedNotificationService(new EmailErrorHandler()),
            new EmailErrorHandler(),
            new MyDao(new EmailErrorHandler()));
    }
}

And then use it like this:
 SomeBusinessObject bo = SomeBusinessObjectFactory.Create();

You can also use poor mans di and create a constructor that takes no arguments at all:
public SomeBusinessObject()
{
    var errorHandler = new EmailErrorHandler();
    var dao = new MyDao(errorHandler);
    var notificationService = new SomethingChangedNotificationService(errorHandler);
    Initialize(notificationService, errorHandler, dao);
}

protected void Initialize(
    INotificationService notifcationService,
    IErrorHandler errorHandler,
    MyDao dao)
{
    this._NotificationService = notifcationService;
    this._ErrorHandler = errorHandler;
    this._Dao = dao;
}

Then it just seems like it used to work:
SomeBusinessObject bo = new SomeBusinessObject();

Using Poor Man's DI is considered bad when your default implementations are in external third party libraries, but less bad when you have a good default implementation.
Then obviously there are all the DI containers, Object builders and other patterns.
So all you need is to think of a good creational pattern for your object. Your object itself should not care how to create the dependencies, in fact it makes them MORE complicated and causes them to mix 2 kinds of logic. So I don't beleive using DI should have loss of productivity.
There are some special cases where your object cannot just get a single instance injected to it. Where the lifetime is generally shorter and on-the-fly instances are required. In this case you should inject the Factory into the object as a dependency:
public interface IDataAccessFactory
{
    TDao Create<TDao>();
}

As you can notice this version is generic because it can make use of an IoC container to create various types (Take note though the IoC container is still not visible to my client).
public class ConcreteDataAccessFactory : IDataAccessFactory
{
    private readonly IocContainer _Container;

    public ConcreteDataAccessFactory(IocContainer container)
    {
        this._Container = container;
    }

    public TDao Create<TDao>()
    {
        return (TDao)Activator.CreateInstance(typeof(TDao),
            this._Container.Resolve<Dependency1>(),
            this._Container.Resolve<Dependency2>())
    }
}

Notice I used activator even though I had an Ioc container, this is important to note that the factory needs to construct a new instance of object and not just assume the container will provide a new instance as the object may be registered with different lifetimes (Singleton, ThreadLocal, etc). However depending on which container you are using some can generate these factories for you. However if you are certain the object is registered with Transient lifetime, you can simply resolve it.
EDIT: Adding class with Abstract Factory dependency:
public class SomeOtherBusinessObject
{
    private IDataAccessFactory _DataAccessFactory;

    public SomeOtherBusinessObject(
        IDataAccessFactory dataAccessFactory,
        INotificationService notifcationService,
        IErrorHandler errorHandler)
    {
        this._DataAccessFactory = dataAccessFactory;
    }

    public void DoSomething()
    {
        for (int i = 0; i < 10; i++)
        {
            using (var dao = this._DataAccessFactory.Create<MyDao>())
            {
                // work with dao
                // Console.WriteLine(
                //     "Working with dao: " + dao.GetHashCode().ToString());
            }
        }
    }
}

Basically doing DI/IoC dramatically slows down my productivity and in
  some cases further complicates the code and architecture

Mark Seeman wrote an awesome blog on the subject, and answered the question:
My first reaction to that sort of question is: you say loosely coupled code is harder to understand. Harder than what?
Loose Coupling and the Big Picture
EDIT: Finally I'd like to point out that not every object and dependency needs or should be dependency injected, first consider if what you are using is actually considered a dependency:
What are dependencies?

*

*Application Configuration

*System Resources (Clock)

*Third Party Libraries

*Database

*WCF/Network Services

*External Systems (File/Email)

Any of the above objects or collaborators can be out of your control and cause side effects and difference in behavior and make it hard to test. These are the times to consider an Abstraction (Class/Interface) and use DI.
What are not dependencies, doesn't really need DI?

*

*List<T>

*MemoryStream

*Strings/Primitives

*Leaf Objects/Dto's

Objects such as the above can simply be instantiated where needed using the new keyword. I would not suggest using DI for such simple objects unless there are specific reasons. Consider the question if the object is under your full control and doesn't cause any additional object graphs or side effects in behavior (at least anything that you want to change/control the behavior of or test). In this case simply new them up.
I have posted a lot of links to Mark Seeman's posts, but I really recommend you read his book and blog posts.


text:
Q: ¿Como crear un procedimiento almacenado que deje actualizar cada columna una vez mediante triggers? Necesito crear un procedimiento almacenado pensado para cualquier base de datos, en el cual cree un trigger diferente
para cada tabla, cada trigger debe hacer que cada columna de la tabla solo pueda actualizarse UNA sola vez
Pensaba en agregar un columna extra que cuente las veces que se ha actualizado esa columna, pero no he logrado que funcione
Por lo pronto tengo el siguiente proceso almacenado que crea un trigger diferente por tabla, el cual cada trigger hace que
no se pueda actualizar ningun campo de la tabla en toda la base de datos:
alter proc sp_trigger_update_db_exec as
declare @MIN INT, @Nom varchar(50), @Texto varchar(8000)

select @MIN = MIN(ID) from SYSOBJECTS
where xtype='u' and name not like 'SYS%'

select @Texto=''

while @MIN is not null
begin
    select @Nom = name from SYSOBJECTS
    where id= @MIN
    select @Texto=''
    select @Texto=@Texto+ 'create trigger TR_'+Replace (@Nom,' ','')+ '_update2' + CHAR(13)
    select @Texto=@Texto+ 'on [' + @Nom + '] for update as' + CHAR(13)
    select @Texto=@Texto+ 'rollback tran' + CHAR(13)
    select @Texto=@Texto+ 'raiserror('+char(39)+'Por ahora no puedes actualizar este campo, ya que lo has actualizado una vez.'
    +char(39)+',16,1)'
    exec(@Texto)
    select @MIN= MIN(id) from SYSOBJECTS
    where xtype='u' and name not like 'sys%' and id >@MIN
end
go

cumple con que no se pueda actualizar ningun campo, pero debo de permitir que todos los campos puedan actualizarse una vez


text:
Q: A term to describe something that has both an inbound and outbound connection (Pardon the jargon.) Suppose we have a directed graph of nodes. If one node points to another node then we might say the node has an outbound connection and the other node has an inbound connection. What term, if any, might one use to describe a node that has both an inbound and an outbound connection.

A: In a directed graph, a node (vertex) is either internal or external. An external node (leaf/edge) can be either source or sink.

If a vertex is neither a source nor a sink, it is called an internal.
https://en.wikipedia.org/wiki/Directed_graph#Indegree_and_outdegree


text:
Q: Crash on sending intent with Galaxy Tab 3 I'm sending a share intent with the Glaxy Tab 3 (Intel x86 cpu).
But this result in a crash.
This is the log from the system
03

-13 16:08:19.738: D/CrashAnrDetector(2321): Build: samsung/santos10wifixx/santos10wifi:4.2.2/JDQ39/P5210XXUAMG7:user/release-keys
03-13 16:08:19.738: D/CrashAnrDetector(2321): Hardware: clovertrail
03-13 16:08:19.738: D/CrashAnrDetector(2321): Revision: 8
03-13 16:08:19.738: D/CrashAnrDetector(2321): Bootloader: P5210XXUAMG7
03-13 16:08:19.738: D/CrashAnrDetector(2321): Radio: unknown
03-13 16:08:19.738: D/CrashAnrDetector(2321): Kernel: Linux version 3.4.34-1142284 (dpi@DELL149) (gcc version 4.6 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Thu Jul 18 22:33:33 KST 2013
03-13 16:08:19.738: D/CrashAnrDetector(2321): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-13 16:08:19.738: D/CrashAnrDetector(2321): Build fingerprint: 'samsung/santos10wifixx/santos10wifi:4.2.2/JDQ39/P5210XXUAMG7:user/release-keys'
03-13 16:08:19.738: D/CrashAnrDetector(2321): Revision: '8'
03-13 16:08:19.738: D/CrashAnrDetector(2321): pid: 20644, tid: 20644, name: il.co.yes.yesgo  >>> il.co.yes.yesgo <<<
03-13 16:08:19.738: D/CrashAnrDetector(2321): signal 4 (SIGILL), code 2 (ILL_ILLOPN), fault addr 4000e370
03-13 16:08:19.738: D/CrashAnrDetector(2321):     eax 4003bec8  ebx 40028ff4  ecx 00000000  edx 00000001
03-13 16:08:19.738: D/CrashAnrDetector(2321):     esi 00000016  edi 00000067
03-13 16:08:19.738: D/CrashAnrDetector(2321):     xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000003b  xss 0000007b
03-13 16:08:19.738: D/CrashAnrDetector(2321):     eip 4000e370  ebp 00000004  esp bf8c058c  flags 00010212
03-13 16:08:19.738: D/CrashAnrDetector(2321): backtrace:
03-13 16:08:19.738: D/CrashAnrDetector(2321):     #00  pc 0000a370  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):     #01  pc 000089b4  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):     #02  pc 0000040c  [vdso]
03-13 16:08:19.738: D/CrashAnrDetector(2321): stack:
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c054c  bf8c0680  [stack]
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0550  bf8c0680  [stack]
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0554  00000001
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0558  40022baf  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c055c  4001803e  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0560  00000001
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0564  bf8c0578  [stack]
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0568  00000000
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c056c  410cbbd1  /system/lib/libdvm.so
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0570  00000003
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0574  00000003
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0578  bf8c05a0  [stack]
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c057c  00000001
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0580  40021f28  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0584  00000005
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0588  bf8c0680  [stack]
03-13 16:08:19.738: D/CrashAnrDetector(2321):     #00  bf8c058c  4000a3bf  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0590  00000001
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0594  4000a3a6  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c0598  40028ff4  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c059c  4000c9b4  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):     #01  bf8c05a0  00000067
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05a4  bf8c05e8  [stack]
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05a8  00000001
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05ac  00000004
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05b0  40021ecf  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05b4  4000e370  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05b8  00000002
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05bc  000050a4
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05c0  bf8c05ec  [stack]
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05c4  00000008
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05c8  0000002e
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05cc  00000073
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05d0  60f70099  /data/dalvik-cache/data@app@il.co.yes.yesgo-2.apk@classes.dex
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05d4  00000004
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05d8  40021f28  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          bf8c05dc  40021ecf  /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):          ........  ........
03-13 16:08:19.738: D/CrashAnrDetector(2321): memory map around fault addr 4000e370:
03-13 16:08:19.738: D/CrashAnrDetector(2321):     40003000-40004000 /system/bin/app_process
03-13 16:08:19.738: D/CrashAnrDetector(2321):     40004000-40028000 /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321):     40028000-40029000 /system/bin/linker
03-13 16:08:19.738: D/CrashAnrDetector(2321): processName:il.co.yes.yesgo
03-13 16:08:19.738: D/CrashAnrDetector(2321): broadcastEvent : il.co.yes.yesgo SYSTEM_TOMBSTONE
03-13 16:08:19.768: W/ContextImpl(2321): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1375 com.android.server.analytics.data.collection.application.CrashAnrDetector.broadcastEvent:291 com.android.server.analytics.data.collection.application.CrashAnrDetector.processDropBoxEntry:254 com.android.server.analytics.data.collection.application.CrashAnrDetector.access$100:60 com.android.server.analytics.data.collection.application.CrashAnrDetector$1.onReceive:102

Intent code
            Intent i = new Intent(Intent.ACTION_SEND);
            String mUrl;
            try {
                mUrl = URLEncoder.encode(media.getWebLink(), "UTF-8");
            } catch (UnsupportedEncodingException e) {
                mUrl = media.getWebLink();
            }
            String m = TvinciSDK.getApplicationContext().getString(R.string.share_message__f_s,
                    TvinciSDK.getSessionManager().getFirstName(),
                    media.getName(),
                    media.getWebLink());
//          i.putExtra(Intent.EXTRA_SUBJECT, "text");
            i.putExtra(Intent.EXTRA_TEXT, m);
//          i.putExtra(Intent.EXTRA_HTML_TEXT, message);
            i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            i.setType("text/plain");
            Context context =  v.getContext();
            if (context != null) {
                Intent chooserIntent = Intent.createChooser(i, context.getString(R.string.yesshare_title, title));
                chooserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(chooserIntent);
            }

A: OK. Well it appears this has to do with hardware acceleration on intel x86 devices.
As soon as I removed this filed from my manifest (not just settings it to false, but removing it) , it don't crash any more.

A: I think the error is by context. It is necessary to refer to the activity that implements the share button. Context context = this


text:
Q: How does one get a tree view in HTML to have hover effect on its nodes that span the full width of the tree? I have a tree view like below.  When I create a hover css effect, it applies only as far as the child node width.
See  https://jsfiddle.net/maxm007/Le3cj4s0/ to see what I mean.
How can I get it to apply to the full width of the tree?

      Parent

          Child 1

             Grandchild

          Child 2

A: A solution could be using a pseudo element and work, for example, on its property transform:translateX(-100%);

.tree-item-children {
  padding-left:25px
}

.tree-item-content{
  position:relative;
}

.tree-item-content::after{
  height:100%;
  content:"";
  display:block;
  position:absolute;
  top:0;right:0;
  transform:translateX(-100%);
  width:100%;
}

.tree-item-content:hover,
.tree-item-content:hover::after{
  background:yellow
}

      Parent

          Child 1

             Grandchild

          Child 2


text:
Q: unable Install R server on ubuntu artful (17.10), missing dependencies I get the following message on ubuntu when trying to install R server, any ideas on solving this?:

Reading package lists... Done Building dependency tree Reading state
  information... Done Some packages could not be installed. This may
  mean that you have requested an impossible situation or if you are
  using the unstable distribution that some required packages have not
  yet been created or been moved out of Incoming. The following
  information may help to resolve the situation:
The following packages have unmet dependencies:  r-base : Depends:
  r-base-core (>= 3.4.3-1artful0) but it is not going to be installed
            Depends: r-recommended (= 3.4.3-1artful0) but it is not going to be installed
            Recommends: r-base-html but it is not going to be installed E: Unable to correct problems, you have held broken packages.


text:
Q: NullPointerException, killed my program I'm trying to create my little box that shows the color when selected from the combo box. But I keep getting this error of NullPointerException when I try to run the program. I don't see what is wrong with it.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class ThreeColorsFrame extends JFrame
{
    private static final int FRAME_WIDTH = 300;
    private static final int FRAME_HEIGHT = 400;

    private JComboBox box;
    private JLabel picture;

    private static String[] filename = { "Red", "Blue", "Green" };
    private Icon[] pics = { new ImageIcon(getClass().getResource(filename[0])),
                    new ImageIcon(getClass().getResource(filename[1])),
                    new ImageIcon(getClass().getResource(filename[2])) };

    public ThreeColorsFrame()
    {
        super("ThreeColorsFrame");
        setLayout(new FlowLayout());

        box = new JComboBox(filename);

        box.addItemListener(new ItemListener()
        {
            public void itemStateChanged(ItemEvent event)
            {
                if (event.getStateChange() == ItemEvent.SELECTED)
                    picture.setIcon(pics[box.getSelectedIndex()]);
            }
        });

        add(box);
        picture = new JLabel(pics[0]);
        add(picture);

    }

}

Exception in thread "main" java.lang.NullPointerException
    at javax.swing.ImageIcon.<init>(Unknown Source)
    at ThreeColorsFrame.<init>(ThreeColorsFrame.java:33)
    at ThreeColorsViewer.main(ThreeColorsViewer.java:36)

A: Your problem is you haven't initialized picture. You have
private JLabel picture;

But this never gets set before:
 picture.setIcon(...);

is called in the constructor, albeit within a condition.
You need to initialize it, eg
picture = new JLabel(...); // whatever

A: You are using picture object before you have initialized it.
USE
picture.setIcon(pics[box.getSelectedIndex()]);

INITIALIZATION
picture = new JLabel(pics[0]);

Move the initialization statement above the listener.

A: I would try to initialize picture as soon as you declare it.
So instead of using private JLabel picture; try to use:
private JLabel picture = new JLabel(pics[0]);


text:
Q: images don't render in browser I use gulp as a automation and build system and when I build websites when i have background image in my css file added as a background-image property when I run gulp everything render properly in the browser, when I try to open index.html with gulp off images which comes from css files aren't rendered only those ones which are embedded with img tag in my html file works fine it happens even with build version of my website.
my gulpfile.js
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var changed = require('gulp-changed');
var htmlReplace = require('gulp-html-replace');
var htmlMin = require('gulp-htmlmin');
var del = require('del');
var sequence = require('run-sequence');

// Server
gulp.task('serve', ['sass'], function() {
    browserSync.init({
        server: 'src'
    });

    gulp.watch("src/*.html").on('change', browserSync.reload);
    gulp.watch('src/sass/**/*.scss', ['sass']);
});

// Compile SASS to CSS
gulp.task('sass', function() {
    return gulp.src('src/sass/**/*.scss')
               .pipe(sass().on('error', sass.logError))
               .pipe(autoprefixer({
                browsers: ['last 3 versions']
               }))
               .pipe(gulp.dest('src/css'))
               .pipe(browserSync.stream());
});

gulp.task('css', function() {
    return gulp.src('src/css/**/*.css')
        .pipe(cleanCSS())
        .pipe(gulp.dest('dist/css'));

});

gulp.task('js', function() {
    return gulp.src('src/js/**/*.js')
        .pipe(uglify())
        .pipe(gulp.dest('dist/js'));

});

gulp.task('img', function() {
    return gulp.src('src/img/**/*.{jpg,jpeg,png,gif}')
        .pipe(changed('dist/img'))
        .pipe(imagemin())
        .pipe(gulp.dest('dist/img'));

});

gulp.task('html', function() {
    return gulp.src('src/*.html')
        .pipe(htmlReplace({
            'css': 'css/main.css',
            'js': 'js/script.js'
        }))
        .pipe(htmlMin({
            sortAttributes: true,
            sortClassName: true
        }))
        .pipe(gulp.dest('dist/'));
});

gulp.task('clean', function() {
    return del(['dist'])
});

gulp.task('build', function() {
    sequence('clean', ['html', 'js', 'css', 'img']);
});

gulp.task('default', ['serve']);

package.json
"devDependencies": {
    "browser-sync": "^2.26.0",
    "del": "^3.0.0",
    "eslint": "^5.6.1",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^6.0.0",
    "gulp-changed": "^3.2.0",
    "gulp-clean-css": "^3.10.0",
    "gulp-html-replace": "^1.6.2",
    "gulp-htmlmin": "^5.0.1",
    "gulp-imagemin": "^4.1.0",
    "gulp-sass": "^4.0.1",
    "gulp-uglify": "^3.0.1",
    "node-sass": "^4.9.3",
    "run-sequence": "^2.2.1"
}


text:
Q: Troubleshoot PDO query I have a form for collecting various general settings for a website. I do some validation with JQuery, then POST the data to a PHP script for processing. It all seems to work fine, except that all fields in the table are filled with NULL instead of actual values.
My table has but 3 columns - TblID, SettingName, SettingValue. The latter can be NULL.
Here's the code:
/*
* This first array is a list of all the settings.
* The form inputs are named thus, and I want the `SettingName` value to
* also be pulled from this list.
* For example:
* input[name="BrowserTitle"] = 'My Site' =>
* $_POST['BrowserTitle'] = 'My Site' =>
* SettingName = BrowserTitle, SettingValue = 'MySite'
*/

$settings_arr = array(
    'BrowserTitle', 'SiteTitle', 'SiteBlurb',
    'SiteEmail', 'SiteAddress', 'SiteMobile', 'SiteLandline', 'SiteFax',
    'SiteSocialFacebookLink', 'SiteSocialYouTubeLink', 'SiteSocialTwitterLink',
    'SiteSEOKeywords', 'SiteSEOBlurb'
);
$settings = join('\',\'',$settings_arr);

//clear old values
$q = $su_gl_conn -> prepare(" DELETE FROM su_settings WHERE SettingName IN ('" . $settings . "') ");
$q               -> execute(); //works so far

//begin insert statement:
$tokens = array();
$sql = "INSERT INTO su_settings ( SettingName, SettingValue ) VALUES ";
foreach($settings_arr as $i => $settingName)
{
    $sql.= "( '" . $settingName . "', :settingValue" . $i . " ),";
    $tokens[':settingValue' . $i] = (!empty($_POST[$settingName])) ? $_POST[$settingName] : NULL;
}
$sql = rtrim($sql, ',');

$q = $su_gl_conn -> prepare($sql);
foreach($tokens as $tokenName => $tokenValue)
{
    $q -> bindParam( $tokenName, $tokenValue, PDO::PARAM_NULL);
}
$q -> execute();

The query does not fail, and all rows are filled - every SettingName is filled correctly with the right string, but every SettingValue is set to NULL. If I echo my $tokens array however, it does show the inputted values being mapped over correctly: the proper tokennames to the correct values.
The actual query when echoed:
INSERT INTO su_settings ( SettingName, SettingValue ) VALUES ( 'BrowserTitle', :settingValue0 ),( 'SiteTitle', :settingValue1 ),( 'SiteBlurb', :settingValue2 ),( 'SiteEmail', :settingValue3 ),( 'SiteAddress', :settingValue4 ),( 'SiteMobile', :settingValue5 ),( 'SiteLandline', :settingValue6 ),( 'SiteFax', :settingValue7 ),( 'SiteSocialFacebookLink', :settingValue8 ),( 'SiteSocialYouTubeLink', :settingValue9 ),( 'SiteSocialTwitterLink', :settingValue10 ),( 'SiteSEOKeywords', :settingValue11 ),( 'SiteSEOBlurb', :settingValue12 )

And the token array (with only 2 actual values):
:settingValue0=My Site:settingValue1=My Site:settingValue2=:settingValue3=:settingValue4=:settingValue5=:settingValue6=:settingValue7=:settingValue8=:settingValue9=:settingValue10=:settingValue11=:settingValue12=

I just need fresh eyes at this point, I can't figure why it's not working - it's probably something small. Any help appreciated!

A: Hint: look at the difference between bindParam() and bindValue().


text:
Q: Inhomogeneous phase-portrait with StreamPlot I have a problem with a must-be simple streamplot. The potential function governing the motion is U, and I have the following code in Mathematica:
U = -((1000.` x (1.25` - 1.` Sqrt[1 + 625.` x^2]))/Sqrt[1 + 625.` x^2])
StreamPlot[{Φ, -U}, {x, -0.05, 0.05}, {Φ, -1.5, 1.5}, StreamPoints -> Fine]

The problem is that I get the following plot:

What did I do wrong, or how should I overcome this horror?
EDIT
The result should look like the following phase plane plot created by MatLab:

The MatLab code snippet:
f=@(Y) [Y(2); -1/2*Y(1)*(1000-1250/sqrt(1+625*Y(1)^2))];
y1=linspace(-0.06,0.06,20);
y2=linspace(-0.5,0.5,20);
[x,y]=meshgrid(y1,y2);

u=zeros(size(x));
v=zeros(size(y));

for i=1:numel(x)
    Yprime=f([x(i); y(i)]);
    u(i)=Yprime(1);
    v(i)=Yprime(2);
end

quiver(x,y,u,v,'r');
figure(gcf)
xlabel('x')
ylabel('xdot')
axis([-0.08 0.08 -0.6 0.6])

I used the same equation here, unfortunately due to the aspect ratio the arrows are a bit distorted.
I would like the Mathematica plot to have arrows 'all over the place' as in MatLab, so somehow the seeding should be altered. I would prefer the streamplot of mathematica rather than the MatLab version, as the StreamPlot shows the arrows along trajectories, whereas MatLab generates only a vectorfield.


text:
Q: KeyboardAwareScrollView blocking nested scroll view and setState function not working

<View style={styles.container} keyboardShouldPersistTaps="always">
<KeyboardAwareScrollView>
<SafeAreaView>
<FlatList/>
<FlatList/>
</SafeAreaView>
</keyboardAwareScrollView>
</View>

im trying to have nested scroll view inside keyboardawarescrollview but it seems like i cannot do state update on the flatlist, the nested scroll also doesnt work.

A:

<View style={styles.container} keyboardShouldPersistTaps="always">
  <KeyboardAwareScrollView keyboardShouldPersistTaps="handled"> --> will solve the issue
    <SafeAreaView>
      <FlatList/>
      <FlatList/>
    </SafeAreaView>
  </keyboardAwareScrollView>
</View>


text:
Q: Running docker container on windows with a volume gives me an error I'm trying to run a simple docker image with a volume
docker run -dit -v J:\dvolumes:/data ubuntu

However I get the following error

docker: Error response from daemon: invalid mode: data.

I'm guessing it's thinking the ':' after the J is what separates the volume but I don't really know how to make it think otherwise (if that's the case).
Any help would be greatly appreciated

A: Issue was that I was trying to run the container in WSL2 so I should be using linux paths
WSL2

docker run -dit -v /j/dvolumes:/data ubuntu

Windows

docker run -dit -v j:/dvolumes:/data ubuntu


text:
Q: how i update multiple table using viewmodel in Asp.net mvc Employee Model
public class Employee
    {
        [Key]
        public int EmployeeID { get; set; }
        public string Name { get; set; }
        public virtual Department Departments { get; set; }
        public int DepartmentID { get; set; }
    }

Department Model
public class Department
    {
        public int DepartmentID { get; set; }
        public string DepartmentName { get; set; }
    }

View Model for Department and Employee
public class EDViewModel
    {
        public int ID { get; set; }
        public int EmployeeID { get; set; }
        public string Name { get; set; }
        public Department Departments { get; set; }
        public int DepartmentID { get; set; }
        public string DepartmentName { get; set; }
    }

Now i want to update both tables with single view.
Controller
public ActionResult Edit(int?id)
        {
// write some code for update both table at once time
}

PostMethod
 [HttpPost]
        public ActionResult Edit(EDViewModel Emodel)
        {
            var user = db.Employees.Where(c => c.Employee_Id == Emodel.Employee_Id).FirstOrDefault();
            user.UserName = Emodel.UserName;
            user.ProfilePicture = Emodel.ProfilePicture;
            db.Entry(user).State = EntityState.Modified;
            db.Entry(user).State = EntityState.Modified;
            db.SaveChanges();
            return RedirectToAction("Home");
        }

But in this method only Update Employee record not department

A: After many searching finally i get a solid solution
hope you like or improve this.
Controller
 public ActionResult Edit(int? id)
        {
            MYDb db = new MYDb();
            var user = db.Employees.Where(c => c.Employee_Id == Emodel.Employee_Id).FirstOrDefault();
            if (user != null)
            {
                var vm = new EDViewModel { Employee_id = user.Employee_id, departmentName = user.departmentName };
                if (user.department != null)
                {
                    user.Departmet_id = vm.Departments.Departmet_id;
                    user.DepartmentName = vm.Departments.DepartmentName;
                    user.Employee_id = vm.employee_id;
                    user.employeeName = vm.employeeName;
                }
                return View(user);
            }
            return Content("Invalid Id");
        }

 [HttpPost]
        public ActionResult Edit(EDViewModel Emodel)
        {
            var user = db.Employees.Where(c => c.Employee_Id == Emodel.Employee_Id).FirstOrDefault();
            user.EmployeeId = Emodel.EmployeeId;
            user.EmployeeName= Emodel.EmployeeName;
          user.DepartmentName= Emodel.Departmt.DepartmentName;
         // Just remove this line
          //  db.Entry(user).State = EntityState.Modified;
            db.SaveChanges();
            return RedirectToAction("Home");
        }

A: it worked for me
just remove this
 db.Entry(user).State = EntityState.Modified;

if we not remove this entityvalidation occur


text:
Q: Create possible pairs irrespective of order in a indefinite set of values What i am trying to figure out is an algorithm that will create possible pairs irrespective of order in a indefinite set of values.
for example let's say the set is A,B,C,D,E
then possible sets are
AB
AC
AD
AE
BC
CD
DE
but... i also want pairs of more than 2 values.
for example
ABC
ABD
ABE
BCD
BCE
but also ABCD or ABCE. The problem here is that i want to make a method with input an array of Strings STring[] and the output would be a list of Strings in pair of 2,3.... up to number of values -1.
If anyone has a thought of a solution please help. :)

A: It seems you want to construct a power set. This question is essentially the same, look there for answers.

A: This is one of the most computation-intensive things you could do. This will not scale well at all with an even remotely large set of data.
It's really not practical for indefinite sets. You could limit the pairs which can be generated, and therefore make this scale better.

A: What you want to create is some kind of power set of your input's permutations.
Java's iterator concept theoretically allows infinite sequences.
But what has your question to do with comparing?

A: Not the most efficient, but a solution:
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

public class PowersetTest {

public static void main(String [] args){
    Set<Set<String>> sets =  permute(Arrays.asList("a","b","c","d","e"));
    for (Set<String> item : sets){
        System.out.printf("Set: %s%n", item.toString());
    }
}
    static public <T> Set<Set<T>> permute (Collection<T> items){
      Set<Set<T>> result = new HashSet<Set<T>>();
      for (final T item : items){
        Set<T> subsetElements = filter(items, new Predicate<T>(){public boolean apply(T f){ return (f!=item);}});
        if (subsetElements.size() > 0) {
          result.addAll(permute(subsetElements));
        }
        Set<T> temp = new HashSet<T>();
        temp.addAll(items);
        result.add(temp);
      }
      return result;
    }

  static public <T> Set<T> filter(Collection<T> items, Predicate<T> filter){
    Set<T> result = new HashSet<T>();
    for (T item : items){
      if (filter.apply(item)) {
        result.add(item);
      }
    }
    return result;
  }

  public interface Predicate<T>{ public boolean apply(T item); }
}


text:
Q: Xcode orientation changes every-time before presentViewController My app supports UIInterfaceOrientationMaskAll. And All the ViewControllers  only support UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown except two ViewControllers. This two ViewControllers support UIInterfaceOrientationMaskAll.
The problem is that on iPad everything is perfect, but on iPhone, if each Viewcontroller stays UIInterfaceOrientationMaskPortrait, when I run
[currentViewController presentViewController:nextViewController1 animated:YES completion:nil];

currentViewController changes its orientation to UIInterfaceOrientationMaskPortraitUpsideDown, then presents nextViewController1 in UIInterfaceOrientationMaskPortrait.
[nextViewController1 presentViewController:nextViewController2 animated:YES completion:nil];

nextViewController1 changes its orientation to UIInterfaceOrientationMaskPortraitUpsideDown, then presents nextViewController2 in UIInterfaceOrientationMaskPortrait.


text:
Q: Having to hit enter with nohup command in bash I'm trying to run a java springboot server using the following nohup command.
nohup java -jar webservices-0.0.1-SNAPSHOT.jar > nohup.out 2>&1 &

But after running this, I'm getting the following output & I have to hit enter to run the subsequent commands.

$ + nohup java -jar -Dspring.config.additional-location=config/application-dev.properties webservices-0.0.1-SNAPSHOT.jar

Is there anyway to avoid this in bash?

A: It looks like you have shell debug tracing (set -x mode) turned on, meaning bash will print each command before executing it (but after expanding variables etc). Since the nohup java ... command is backgrounded, this happens asynchronously, and happens to get printed after the shell has printed its prompt, so you get "$ " (your shell prompt) followed by "+ nohup java ... (the debug trace).
(Note: you have errors & output from the command redirected to nohup.out, but since the trace is printed by the shell, not the command itself, the redirect doesn't apply.)
You don't actually need to press return at this point; the only thing pressing return does is get you a new, clean (not mixed with debug tracing) prompt. You could just enter another command as normal. However, since the shell is confused about where on the line you are, features like command editing and history recall may not work properly.
If you want to avoid this, I think your main options are to either turn off debug tracing (set +x) before running the command, or add a delay before the shell prints its next prompt:
nohup java -jar webservices-0.0.1-SNAPSHOT.jar > nohup.out 2>&1 & sleep 1

Here, the nohup java ... command runs in the background as usual, but the sleep 1 command runs in the foreground and so the shell won't print its next prompt for a second (which should be enough time for the background process to print its debug trace).


text:
Q: How to get multiple objects from an array with an id? I am stuck with Javascript basics.. Working in Angular.
I have an array with objects:
 $scope.persons = [
  {
    id: 1,
    name:'jack'
  },
  {
    id: 2,
    name:'John'
  },
  {
    id: 3,
    name:'eric'
  },
  {
    id: 2,
    name:'John'
  }
]

I would like to get the all objects that have same id with userId. So, loop through objects if the object id matches to user id select it.
$scope.getResult = function(userId){
   $scope.userId = userId;

   for(var i=0;i < $scope.persons.length; i++){

     if($scope.persons[i].id === $scope.userId){
       $scope.result = $scope.persons[i];
     }
   }
    $scope.userLogs = $scope.result;
 };

I get here only the last object which has the same id with userId.
How do I list all the objects that have the same id with userId?
Live:http://jsfiddle.net/sb0fh60j/
Thnx in advance!

A: You can use filter
 $scope.getUsers = function(x){
   $scope.userId = x;

   $scope.userLogs = $scope.persons.filter(function (person) {
       return person.id === x;
   })
 };

Example
Or, in your case, you need declare result as array before loop, and add matches to it, like this
$scope.getUsers = function(x){
   $scope.userId = x;
   $scope.result = [];

   for(var i=0;i < $scope.persons.length; i++){

     if($scope.persons[i].id === $scope.userId){
       $scope.result.push($scope.persons[i]);
     }
   }
    $scope.userLogs = $scope.result;
 };

Example

A: You are constantly overwriting your result as it is no array. try this instead:
$scope.result[] = $scope.persons[i];

A: rather than assigning you need to push that object to the array
$scope.result.push($scope.persons[i]);

A: $scope.result is not an array..
you have to declare a var result = []; and then you can do result.push($scope.persons[i]);
I don't understand why are you using $scope.result, it is useless to instantiate an attribute of the $scope and its watcher for this purpose, imho
edit: is useless also assign x to $scope;  added alse a jsfiddle
jsfiddle


text:
Q: WCF Service "Could not find default endpoint element" About one week ago I started with WCF for the first time, and so far I don't feel like I'm making any progress. I'm using Visual Studio 2010, .NET 4.0 (as far as I know, 4.5 is also installed) and Windows 7 professional.
The current issue is, I have a WCF service, and a client. When I run the client, the following line results in an exception:
Dim client As ABC_webservice.IService1 = New ABC_webservice.Service1Client

I changed the actual name of the service a bit before posting the code here.
This results in the following exception:
Could not find default endpoint element that references contract
'ABC_webservice.IService1' in the ServiceModel client configuration section.
This might be because no configuration file was found for your application, or
because no endpoint element matching this contract could be found in the client
element.

This is the relevant part of App.config for the webservice project:
<?xml version="1.0"?>
<configuration>

  <system.serviceModel>

    <behaviors>
      <serviceBehaviors>
        <behavior name="MEX">
          <serviceMetadata/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <bindings>
      <netNamedPipeBinding>
        <binding name="NamedPipeBinding" receiveTimeout="10:01:00" sendTimeout="00:01:00" transferMode="Streamed" maxReceivedMessageSize="4294967294" maxBufferSize="65536"/>
      </netNamedPipeBinding>
      <netTcpBinding>
        <binding name="NetTcpBindingConf" receiveTimeout="10:01:00" sendTimeout="10:01:00" transferMode="Streamed" maxBufferSize="65536" maxReceivedMessageSize="4294967294"/>
      </netTcpBinding>
    </bindings>

    <services>
      <service behaviorConfiguration="MEX" name="ABC.ABC_webservice.ABC_webservice">
        <endpoint address="IService1" binding="netTcpBinding" name="NetTcpFileTransfer" contract="ABC.ABC_webservice.IService1"/>
        <endpoint address="IService1" binding="netNamedPipeBinding" bindingConfiguration="NamedPipeBinding" name="NetPipeFileTransfer" contract="ABC.ABC_webservice.IService1"/>
        <endpoint address="MEX" binding="mexTcpBinding" bindingConfiguration="" name="MetadatEndpoint" contract="IMetadataExchange" kind="" endpointConfiguration=""/>
        <host>
          <baseAddresses>
            <!-- <add baseAddress="http://localhost:8732/Design_Time_Addresses/ABC_webservice/Service1/"/> -->
            <add baseAddress="net.tcp://localhost:8732"/>
            <add baseAddress="net.pipe://localhost"/>
          </baseAddresses>
        </host>
      </service>
    </services>

  </system.serviceModel>

    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
</configuration>

And this is the relevant part of app.config for the client project:
<?xml version="1.0"?>
<configuration>

  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

  <system.serviceModel>

    <bindings>
      <netNamedPipeBinding>
        <binding name="NetPipeFileTransfer" transferMode="Streamed" />
      </netNamedPipeBinding>
      <netTcpBinding>
        <binding name="NetTcpFileTransfer" />
      </netTcpBinding>
    </bindings>

    <client>
      <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
        contract="IMetadataExchange" />
      <endpoint address="net.tcp://localhost:8732/IService1" binding="netTcpBinding"
        bindingConfiguration="NetTcpFileTransfer" contract="ABC_webservice.IService1"
        name="NetTcpFileTransfer">
        <identity>
          <userPrincipalName value="LAPTOP-XYZ\XYZ" />
        </identity>
      </endpoint>
      <endpoint address="net.pipe://localhost/IService1" binding="netNamedPipeBinding"
        bindingConfiguration="NetPipeFileTransfer" contract="ABC_webservice.IService1"
        name="NetPipeFileTransfer">
        <identity>
          <userPrincipalName value="LAPTOP-XYZ\XYZ" />
        </identity>
      </endpoint>
    </client>

  </system.serviceModel>

</configuration>

The config-files are derived from http://www.gonetdotnet.info/posts/wcf-articles/transfer-huge-file-to-wcf, but to be honest I don't really know what I'm doing.
First of all I would like to get a solution for this error. Eventually I'm trying to build a webservice and client combo that will be able to download files from the service to the client. At the moment the service as well as the client are running on my laptop and I want to get that working first while avoiding difficult security issues, but eventually the client and service will be on different servers on the internet, and I guess the process has to be secured with certificates. Any help will be greatly appreciated.


text: Q: Album artwork on iTunes shows but when I change song it vanished I went into iTunes to put the album artwork for my new album and it worked (if you don't count the 2 times that it also vanished) and then I went to one of my other albums. When I switched back to my new album there was no artwork. How do I fix this and how can I stop it from happening in the future?


text:
Q: How to set default app per filetype programmatically? I want to get independent of installed apps and share most of my apps as portable versions in a cloud drive. So my idea is whenever I sit on a new device I just sync my cloud drive and start some kind of process which installs my setup.
By installing I mean setting up my windows settings and so on. And I want to set the default apps per filetype. For example bind .txt files to d:\cloud\notepad++\notepad++.exe
Here is a simplified script how I try to do this. I stripped ErrorActions and so on to make it more readable.
$exe = "d:\cloud\notepad++\notepad++.exe"
$app = "notepad++.exe"
$ext = ".txt"

# Remove old associations
Remove-Key -Key "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$ext"
Remove-Key -Key "HKCR:\$ext"
Remove-Key -Key "HKCR:\$app"

# Setup new associations
cmd /c assoc $ext=$app
cmd /c ftype $app="$exe" "%1" "%*"
Set-ItemProperty -Path "HKCR:\$app" `
                    -Name "(Default)" `
                    -Value "Text file" `
                    -Type String

This kind of works. Whenever I try to open a .txt file now it asks me which app to use and pre-selects notepad++.
Okay that's kind of annoying but I could live with that. Although. When I check always use this app to open .txt files it gets simply ignored. I always get this dialog.

A: Although this post is over 3 years old, the SetUserFTA might help you.
See references here and here.
It worked for me to programmatically set the default browser in Windows 10 and it should work for any other file types.
EDIT
Here is what I did:

*

*Download the latest SetUserFTA from here and inzip to extract the SetUserFTA.exe.

*Create a BAT file containing the following:
i. Change directory (cd) to the folder (path to) where SetUserFTA.exe is located.
ii. A number of lines/instructions defining the desired default association for each file type. For example, to set Firefox as my default web browser, I added the following lines:
REM web browser: Firefox
SetUserFTA  http FirefoxHTML
SetUserFTA  https FirefoxHTML
SetUserFTA  .htm FirefoxHTML
SetUserFTA  .html FirefoxHTML

REM ... add any other file extensions here

*Run the BAT file, either on-demand or you can schedule it using Task Scheduler. Make sure to run the BAT file "with the highest permissions" (it needs that to be able to update the Windows registry) from your user context.


text:
Q: How to start search dialog in a new Activity? I need to implement a search function in my Android application. I would like to have the "Search" hardware button launch a new Activity with the standard search dialog already displayed. I guess I could do it manually, but maybe there is a way to do this using the standard Search dialog?
Here is what I do:
In the MainActivity I hijack the search button, like this:
    public boolean onKeyDown(int KeyCode, KeyEvent event) {
    if (KeyCode==KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0){
        Intent i = new Intent(Month.this, SearchActivity.class);
        i.setAction("android.intent.action.SEARCH");
        startActivity(i);
        return true;
    }
    return super.onKeyDown(KeyCode, event);
}

In the Android Manifest.xml, in the SearchActivity section I have this:
        <activity android:name=".SearchActivity"
                        android:screenOrientation="portrait"
                        android:launchMode="singleTop"
                        android:configChanges="keyboardHidden|orientation">
        <intent-filter>
            <action android:name="android.intent.action.SEARCH" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
        <meta-data android:name="android.app.searchable"
              android:resource="@xml/searchable"/>

    </activity>

And in the MainActivity section:
        <activity android:name=".MainActivity"
                        android:screenOrientation="portrait"
                        android:configChanges="keyboardHidden|orientation">
                    <meta-data android:name="android.app.default_searchable"
                            android:value=".SearchActivity" />

    </activity>

I assumed, that sending the android.intent.action.SEARCH to the SearchActivity should open the Search Dialog. But it does not.... SearchActivity is displayed, but I have to press Search button again to see the Search dialog.
What am I missing?

A: (This is just a bit too long for a comment.)
What does logcat say? Failed intent invocation should have a stack trace. Also, I suggest you read the docs more carefully. For example, you don't have to intercept the search button event as it opens the search dialog by default anyway. You should also check if you have the searchable configuration. If you want to start the search dialog from another activity, make sure you have this markup in your activity's declaration.


text:
Q: Browser using Java not Javascript as DOM manipulation language Is/was there a browser that used Java instead of Javascript as it's client-side programming language?
I appreciate that it would have required sites to have multiple versions of their client-side scripting logic as Javascript always seems to have been the dominant language.
Not as an Applet language, but as the language for interacting with the DOM.
I am aware that IE used VBScript for a while.
I am doing a research project on the evolution of the browser and there is so much noise in search engines for these terms that it is difficult to answer this question.

A: There is a WebView (based on the WebKit) in JavaFX 2 in which you can pass a Java object to JavaScript an call methods on it.
So this can be considered as a browser running on a JVM. Here is an example of how Google Maps are rendered in this browser: Maps in JavaFX 2.0.
JS-to-Java call sample: WebViewSample.


text:
Q: Set the dataGridColumn's ItemRenderer dynamically I have this DataGrid:
<mx:DataGrid id="myDataGrid">
    <mx:columns>
        <mx:DataGridColumn dataField="colA" headerText="Column A:" width="40"
            headerRenderer="path.customComponents.VerticalHeader"
            itemRenderer="path.customComponents.CustomDataGridItemRenderer" />
    </mx:Columns>
</mx:DataGrid>

Only I don't know in advance how many columns there will be. So I tried building the columns with a function in ActionScript:
private var _columns:Array;

[Bindable]
public function set columns(value:Array):void
{
    var c:Array = [];
    for each(var object:Object in value)
    {
        var column:DataGridColumn = new DataGridColumn();
        column.headerText=object.name;
        column.width=40;

        // Setting the Renderers like this doesn't work!
        column.headerRenderer =
                path.customComponents.VerticalHeader;
        column.itemRenderer =
                path.customComponents.CustomDataGridItemRenderer;

        c.push(c);
    }
    myDataGrid.columns = c;
}
public function get columns():Array
{
    return _columns;
}

But for some reason, the renders cannot be set like this. (column.itemRenderer = com.ItemRenderer).
What is the proper way to set these renders dynamically?

A: itemRenderer and headerRenderer expects an mx.core.IFactory as its value. In mxml, the string value that you pass is automatically converted into mx.core.ClassFactory. In ActionScript, you have to do it yourself.
column.itemRenderer
            = new ClassFactory(path.customComponents.CustomDataGridItemRenderer);


text:
Q: Sharing EventLoopGroup between client and server bootstraps I have an application that both acts as a UDP server and as a TCP client. Therefore, I create two Bootstraps to set up Netty.
Is it a good idea to share the same EventLoopGroup between the two Bootstraps?
It would mean that the same thread pool will be used to:

*

*Receive/reply to UDP datagrams

*Receiving TCP data

(Sending TCP data will be done by my application's threads.)
Thanks,
Mickael

A: Yes it is a good idea and yes the threads will be used for udp and tcp.


text:
Q: How to create bootable image of Windows 10, with pre installed softwares in it? I have windows 10 installed in my laptop. I have lots of installed software, e.g. Microsoft Office, Visual studio, Netbeans etc.
It is possible to create a .iso file of my current operating system, so that If I format my laptop and install windows 10 again from the created .iso file, I don't need to install the software, which I have installed earlier.
Is it possible on linux as well ??

A: No, it is not possible to create "fresh install ISO with preinstalled Office and other software" however you can create recovery disk by following this guide: Create Windows recovery
You can also download the actual clean Windows 10 ISO install directly from Microsoft: Windows 10 Download
Your best option would probably be to clone the whole partition as a backup.

A: Take a look at this page from Microsoft. Good luck :)
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/audit-mode-overview

A: You can look following tutorials given at microsoft website about building custom images from windows setups, this process is called desktop manufacturing
https://docs.microsoft.com/en-in/windows-hardware/manufacture/desktop/oem-deployment-of-windows-10-for-desktop-editions-get-tools
a lot of tutorials with this respect have been clearly given here
https://www.tenforums.com/tutorials/1977-windows-10-tutorial-index.html
one them which I feel will be relevant in your situation you can find here
in part3  on the link below
how to create windows 10 iso image for clean in place upgrade repair installation
This tutorial will show how to create an ISO file of the latest Windows 10 build
Part Three: Custom ISO with pre-installed software, no user accounts
https://www.tenforums.com/tutorials/72031-create-windows-10-iso-image-existing-installation.html
You will need to have appropriate tools like Windows ADK to do all this
you can download them here
Windows ADK downloads 7.5 GB
https://developer.microsoft.com/en-us/windows/hardware/windows-assessment-deployment-kit
https://www.microsoft.com/en-us/software-download/windowsinsiderpreviewADK
a couple of other tutorial links which may help people in a situation like you are
how to create windows 10 image from upgrade files
https://www.tenforums.com/tutorials/74480-uup-iso-create-bootable-iso-windows-10-build-upgrade-files.html
Install the Windows Assessment and Deployment Kit (Windows ADK) Technical Reference, with Windows Preinstallation Environment. If you're using the ADK for Windows 10, version 1809, you'll have to download and install the WinPE addon after you install the ADK. Previous versions of the ADK include Windows Preinstallation Environment in the ADK installer.
Use DISM /add-driver to add a device driver to your WinPE image.
Dism /Add-Driver /Image:"C:\WinPE_amd64\mount" /Driver:"C:\SampleDriver\driver.inf"
You can add multiple drivers to an image by using one command, but it's often easier to troubleshoot problems if you add each driver package individually.
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-mount-and-customize
what is DISM
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/what-is-dism
For a complete technical description of WIM, see the Windows Imaging File Format (WIM) white paper.
https://go.microsoft.com/fwlink/?LinkId=92227
You can add device drivers to a Windows image before, during, or after you deploy the image. When planning how to add drivers to your Windows deployment, it's important to understand how driver folders are added to the image, how driver ranking affects deployment, and the digital signature requirements for drivers.
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/device-drivers-and-deployment-overview
Add remove drivers to an offline windows image
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-and-remove-drivers-to-an-offline-windows-image
Add device drivers to windows during windows setup
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-device-drivers-to-windows-during-windows-setup
To understand how windows setup works see windows setup technical reference
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-technical-reference
Understanding Digital Signature Requirements
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/device-drivers-and-deployment-overview
64 bit driver guidelines
https://go.microsoft.com/fwlink/?LinkId=529487
deploy a custom image
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/deploy-a-custom-image
create bootable ISO from windows 10 build upgrade files
https://www.tenforums.com/tutorials/74480-uup-iso-create-bootable-iso-windows-10-build-upgrade-files.html
Desktop manufacturing
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/
In case you don't want to go through all the steps above and want a simple solution in your situation for example home user who wants an image backup and then restore all the softwares which were previously present on your system
then you can have a look at free versions of image backup and restore software like
https://www.macrium.com/reflectfree
https://www.clonezilla.org/


text:
Q: Expression to create and populate column based on filtered fields I wanted to create a column and populate it with data based on data from other fields.
If column_1 contains fields which has similar string (eg. field_1 = "Country: UK", field_2 = "Country: US", field_3 = "City: London"), is there an expression to update fields which ONLY contain part of the string - in this case "Country"?

A: This is connected to a related question I asked earlier: Create and immediately update field using Field Calculator
Following on from Matthias' answer, this expression allowed me to add a filter and populate NewColumn in just one step:
case when "column_1" ILIKE '%Country%' then 1
else 0
end


text:
Q: Find unique index for repeating characters in array I am looping through an array of strings and their characters to compare their indexes with another array of characters. The code works until the strings have duplicate characters - it then only returns the index of the first (duplicate) character. eg: ["IAMDEFANDJKL"] for "A" and "D" the loop returns only the first index for each occurrence.
eg: ["abode"] returns [1,2,4,5] which then after .length is applied returns [4] - so ["IAMDEFANDJKL"] should return [4,5,6,10,11,12] which then returns [6] (currently returns [7] because "D" occurs twice)
How could I edit the code to return a unique index for all the characters?
function solve() {
  var alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
                  'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
                  'u', 'v', 'w', 'x', 'y', 'z'];
  var testArray = ["IAMDEFANDJKL","thedefgh","xyzDEFghijabc"];
  var countArray = [];

  for(var i = 0; i < testArray.length; i++) {
    var string = testArray[i];
    var newArray = [];

    for(var char = 0; char < string.length; char++) {
      var character = string.charAt(char);
      var characterIndex = string.indexOf(character);

      for(var alpha = 0; alpha < alphabet.length; alpha++) {
        var alphaString = alphabet[alpha];
        var alphaIndex = alphabet.indexOf(alphaString);
        var characterUpper = character.toUpperCase();
        var alphaStringUpper = alphaString.toUpperCase();

        if(characterIndex === alphaIndex && characterUpper ===
           alphaStringUpper) {
          newArray.push(alphaIndex);
        }
       var arrayLength = newArray.length;
      }
    }
   countArray.push(arrayLength);
  }

 return countArray;

};

solve();

A: You could use an object and store the last found indices plus one for the next search.

function solve() {
    var alphabet = [...'abcdefghijklmnopqrstuvwxyz'];
    var testArray = ["IAMDEFANDJKL", "thedefgh", "xyzDEFghijabc"];
    var countArray = [];

    for (var i = 0; i < testArray.length; i++) {
        var string = testArray[i];
        var newArray = [],
            lastIndex = {};

        for (var char = 0; char < string.length; char++) {
            var character = string[char];
            lastIndex[character] = lastIndex[character] || 0;
            var characterIndex = string.indexOf(character, lastIndex[character]);

            if (characterIndex !== -1) lastIndex[character] = characterIndex + 1;

            for (var alpha = 0; alpha < alphabet.length; alpha++) {
                var alphaString = alphabet[alpha];
                var alphaIndex = alphabet.indexOf(alphaString);
                var characterUpper = character.toUpperCase();
                var alphaStringUpper = alphaString.toUpperCase();

                if (characterIndex === alphaIndex && characterUpper === alphaStringUpper) {
                    newArray.push(alphaIndex);
                }
              var arrayLength = newArray.length;
            }
        }
        countArray.push(arrayLength);
    }
    return countArray;
}

console.log(solve());

A shorter approach by using a check for the same index of the strings.

function solve() {
    var alphabet = 'abcdefghijklmnopqrstuvwxyz',
        testArray = ["IAMDEFANDJKL", "thedefgh", "xyzDEFghijabc"],
        i, j, count, string,
        result = [];

    for (var i = 0; i < testArray.length; i++) {
        count = 0;
        string = testArray[i].toLowerCase();
        for (j = 0; j < string.length; j++) {
            if (string[j] === alphabet[j]) count++;
        }
        result.push(count);
    }
    return result;
}

console.log(solve());

A: Hard to understand what is your desired output but I will try.
const alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
    'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
    'u', 'v', 'w', 'x', 'y', 'z'];
const testArray = ["IAMDEFANDJKL","thedefgh","xyzDEFghijabc"];

const result = testArray.map(str => {
    return Array.from(str.toLowerCase()).map((char) => {
        return alphabet.findIndex(alphabetChar => alphabetChar === char)
    })
});

Output will be:
[ [ 8, 0, 12, 3, 4, 5, 0, 13, 3, 9, 10, 11 ],
  [ 19, 7, 4, 3, 4, 5, 6, 7 ],
  [ 23, 24, 25, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2 ] ]

Which means it replaces each character of a string with index of this character inside of other array


text:
Q: How to differentiate postback true from forward navigation from another postback true event I have a custom components to render a selectOneMenu from a database according a table name.
In JSF 1.2 I have to override encodeBegin method from MenuRenderer class and I have this code to validate postback true:
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {

    if (context.isPostback()) {
        return;
    }
    // More code to load items
}

If I use this component in a page and I access directly to URL the items are loaded fine (because postback is false), but when I forwarded by navigation rules the items are not loaded (because postback is true).
In JSF 1.2 (Mojarra) this worked perfectly but in MyFaces 2.0 (IBM Was 8.5) always isPostBack is true on forward navigation.
What implications does delete postback validation?
EDIT:
To complement my question you can read this link because I have the same question. In JSF 1.2 it was different?


text:
Q: Debouncing Circuit with Schottky Diode I found the following circuit interfacing with a GPIO input on an MCU that has an internal pull up resistor. The GPIO is being used to detect the state of the push button. I have two questions regarding this circuit:

*

*How does the inductor debounce the push button?

*What is the purpose of the diode here? If it is a flyback diode, should it not be connected across the inductor instead so that the inductor can dissipate energy?

Any help is much appreciated!
EDIT:
The GPIO is now called out in the image.

A: When looking at inductor circuits I sometimes try to visualise what the complimentary capacitor circuit would look like. In this case that would be a cap between the GPIO and GND. So, for the inductor it would have to be in series with the input.

simulate this circuit – Schematic created using CircuitLab
Figure 1. Complimentary circuits?
My guess is that as the switch closes we have an R-L time delay before the GPIO is pulled low. When the switch opens the inductor will force some current through - giving a micro-arc - until the switch is truly open.

*

*In the capacitor version the input is pulled low instantly but is slow to release.

*In the inductor version the input is slow to get pulled down but will release instantly.

How does the inductor debounce the push button?

I think I've covered that above.

What is the purpose of the diode here? If it is a flyback diode, ...?

I don't know but there are usually input protection diodes on the GPIO so the one pointing up from GND to the GPIO would suffice to provide the ground return path.

... should it not be connected across the inductor instead so that the inductor can dissipate energy?

No. I think that in this case we want to force an arc.
Maybe someone else can think of a reason for the Schottky diode. I might if I sleep well enough.

A: The inductor slows down (only) the falling edge of the signal, so any bouncing will reset the state:

The diode does not make any difference in the simulation.
But the only difference it could make is to block any positive voltages from the inductor, so so I'd have to guess that the designer feared this could happen when the switch is opened.


text:
Q: How to get correct output using mysql query? I am using mysql to generate correct output. I am join two table using left join with the where clause my both table structure is given below:
I am using query
select e.fee_particular,e.fee_amount,s.paid from es_feemaster e left join es_feepaid_new s on s.fee_particular=e.es_feemasterid where s.es_preadmissionid=914 and s.voucherid=208 and e.fee_class=13

My first table structure

My Second table structure is

I am getting this kind of output

But my desire output should be

Please help me to generate desire output as soon as possible.
Thanks  in advance

A: Outer join is the solution i hope. same can be done with an NVL too.
select e.fee_particular,e.fee_amount,s.paid from es_feemaster e left join es_feepaid_new s on s.fee_particular=NVL(e.es_feemasterid,s.fee_particular) where s.es_preadmissionid=914 and s.voucherid=208 and e.fee_class=13


text:
Q: Symfony2: Always use @Assert entity annotations for form validation SF2 can guess the type of an element in the form. And it can guess the correct values for (among others) the required and the max_length attributes. But it only will try to do the latter when guessing the field type, i.e.: when the field type is not specified explicitly.
Apart from the fact that this does not seem very sensible to me, I wonder if there is some way to make SF2 use @Assert annotations such as  @Assert\NotBlank and @Assert\Length to set these options, even if the field type is specified explicitly. Or to phrase it differently: I would like the form to use as many of the @Assert annotations in the entity as possible, regardless of whether the type is guessed or not.
If it makes a difference: I'm using Symfony 2.7


text:
Q: How to fetch a List-type from Pytorch DataLoader? I'm trying to got List-type data while itering the DataLoader. Here is a simple example:
from torch.utils.data import DataLoader,Dataset

tests = [('test resume1',[1,2,3]),
         ('test resume2',['a','b','c']),
         ('test resume3',['Q',"W",'E']),
         ('test resume4',[',','.','/']),
         ('test resume5',['!','@','#'])]

class testdataset(Dataset):
    def __init__(self,data):
        self.x = [item[0] for item in data]
        self.y = [item[1] for item in data]
    def __getitem__(self,index):
        return self.x[index],self.y[index]
    def __len__(self):
        return len(self.x)

temp = testdataset(tests)
print(temp[0])
pack = DataLoader(temp,batch_size=2,shuffle=True)
for i,unit in enumerate(pack):
    print(i,type(unit),len(unit))
    print(unit)

I'm looking forward to print every batch like [('test resume2', 'test resume4'), [('a', 'b', 'c' ), (',', '.', '/')]], while the result is:
('test resume1', [1, 2, 3])
0 <class 'list'> 2
[('test resume2', 'test resume4'), [('a', ','), ('b', '.'), ('c', '/')]]
1 <class 'list'> 2
[('test resume5', 'test resume1'), [('!', 1), ('@', 2), ('#', 3)]]
2 <class 'list'> 2
[('test resume3',), [('Q',), ('W',), ('E',)]]

Why does the list being splited in the batch? How can I get the return value in Dataset?

A: You can write your own collate_fn for the data loader to do what you want:
def collate_fn(list_items):
     x = []
     y = []
     for x_, y_ in list_items:
         print(f'x_={x_}, y_={y_}')
         x.append(x_)
         y.append(y_)
     return x, y

Using this custom collate function:
pack = DataLoader(temp,batch_size=2,shuffle=True,collate_fn=collate_fn)
for i,unit in enumerate(pack):
    print(i,type(unit),len(unit))
    print(unit)

will give you:
0 <class 'tuple'> 2
(['test resume4', 'test resume3'], [[',', '.', '/'], ['Q', 'W', 'E']])
1 <class 'tuple'> 2
(['test resume5', 'test resume1'], [['!', '@', '#'], [1, 2, 3]])
2 <class 'tuple'> 2
(['test resume2'], [['a', 'b', 'c']])

Please see torch.utils.data.DataLoader for more information on customizing the Dataloader.


text:
Q: Exception AttributeError message when using manage.py in django-nonrel for Google app engine I'm using Python 2.7 and django-nonrel for running Django projects on Google app engine. I'm using version 1.6 of the Google app engine SDK. I run python manage.py syncdb or python manage.py deploy. After the command completes I get the following message:
Exception AttributeError: "'NoneType' object has no attribute 'mkstemp'" in <bound method DatastoreFileStub.__del__ of <google.appengine.api.datastore_file_stub.DatastoreFileStub object at 0x8a2422c>> ignored

Why do I get this message and is there any way to fix it?

A: It has already been reported.
See this.
Apparently, it doesn't break anything.
As you can see, the answer is:
"Dont worry, just ignore it"

A: GAE 1.6.0 doesnt work for me too, 1.5.2 does.


text:
Q: What does root means in terminal? What is the difference between the following:
I have 2 accounts in my OS, baron and root
I login with baron account, then run the command sudo -s
baron@linux:~@ sudo -s
[sudo] password for baron:
root@linux:~@/home/baron#

I logout, then login with root account and terminal shows:
root@linux:~@

So why the terminal is showing the same when I login with different accounts?

A: Your prompt shows the user, hostname & current dir
user@hostname:/current/dir $

When you execute the sudo command as a normal user (baron in your case), you're giving the system an order to make "something" as root or with root privileges. See root definition
With the -s option, you're giving the order to become root user with an interactive shell environment since there's no command specified
--From man sudo
-s [command]
               The -s (shell) option runs the shell specified by the SHELL environment variable if it is set or the shell as specified in the password database.  If a command is specified, it is passed to the shell for execution
               via the shell's -c option.  If no command is specified, an interactive shell is executed.

Then, when you login as root, the main account will be root, so you don't need to execute sudo at all


text: Q: Существуют ли минусы в разных используемых IDE в команде? На данный момент работаю программистом python. У нас абсолютно не важно какая IDE у каждого члена команды. Просматривая вакансии java-разработчиков вижу, что часто указывается IDE для работы в команде. Не понимаю, на что это влияет ?