text:
Q: Bug tracking best practices In my company, these rules apply:

*

*Only testers are allowed to create issues.

*Developers must send e - mail a tester to have them create an issue.

*Developers send e - mail to technical lead for having him assign an issue to themselves for issues they think they can resolve.

*A developer cannot assign an issue to another developer (Must send e - mail to technical lead).

*If a developer's issue is blocked by another developer's code, she must solve this problem outside of the bug tracking system.

*Only testers are allowed to close issues which are opened by themselves.

*All assignments must go through technical lead so he can track issues.

*Bugs that are not directly related to user interface are not entered into the system (must be resolved externally).

What bug tracking flow are you using? Does it work well for you?

A: I've used a great number of issue tracking systems, including gnats (ugh!), Bugzilla (slightly less ugh), Trac, Jira, and now FogBugz.  I like Trac most of all, but that's probably because I'm not the administrator on FogBugz and it's being sadly and horribly mis-used in its current incarnation.
Getting the the workflow right is pretty crucial, and oddly enough it starts with deciding what to put in your bug tracker and how to label the things you put in there.  As soon as you have a customer, all development teams really track three kinds of issues:

*

*Problems noted by real customers (live bugs).

*Problems with new software currently in development (dev bugs).

*Things we want to do in the future (features).
Each of these three classes of issues have their own priorities, of course.  A 'live bug' that's just a spelling error on a button may be a lot less important than a 'dev bug' that's blocking a publicly announced release, or gating other development, testing, etc.
The severity of an issue describes how horrible the side affects are.  In my experience, this boils down to:

*

*The program is ruining something.  Data, customers being billed incorrectly, wrong medicine being dispensed.  This is as bad as it gets.  I once worked on a system where a software command retracted a hydraulic arm right through the middle of a serviceman.  This is as bad as it gets.

*The program is crashing and we don't have a work-around, but it's not ruining anything (other than being down) in the meantime.  If the downtime resulta in something getting ruined use severity #1.

*The program is misbehaving, but we have an identified work-around that can actually be used.

*The program is misbehaving in ways that are annoying but don't affect the results.

*The program needs to be better in some well defined way: easier to use, implement a new feature, run faster, etc.
Another problem that arises a lot in these systems is the concept of 'roles.'  As applied to issue tracking systems, roles boils down to who is allowed to do things.  Who gets to create issues?  Who gets to change the status, who gets to reassign them to another user, who gets to close them, etc.
In the small- to mid-size teams I've worked closely with, this general set of rules has worked well:

*

*Anyone can create an issue.  The creator can assign the issue to any (or most) recipients as it's being created.  The default recipient is the Issue Triage team.  Developers can note bugs they've found working on code this way, and assign the bug to themselves, to track why they are changing code.

*The Triage team meets (specify interval here) to evaluate and assign issues.  The Triage team specifically looks for duplicate reports, in which case the new issue is 'rolled up' into the existing issue chain; for unreproduced issues from the field, which are assigned to QA for reproduction; and for high-severity issues from the customers.

*The originator of a bug is the ONLY person that can close it.  Bug reports initiated by QA or by a CSR cannot be closed by a developer.  Yes, this means that bugs that CS and the dev team disagree on remain unresolved.  Why have the issue tracker report an issue as resolved when the people aren't in agreement?  If you want a digital repository of lies, you have C-SPAN.
Some teams may want to reserve moving an issue from one department to another to managers, other teams may allow any team member to move an issue on to (or BACK to) another team.  This may boil down to management suspicion, or simply to who is allowed to allocate work time.
The Triage process is the key.  The Triage team is essentially whoever in your organization decides who works on what, and what gets worked on next.  Having the team meet on a regular schedule helps to make sure that really important stuff doesn't get missed, and that the mundane stuff doesn't get dropped due to inattention.  If there isn't anything in the Triage queue, the meeting (concall, netmeeting, whatever the implementation is) can be cancelled by the meeting leader.
If you're using Scrum, the Triage team is probably the scrum masters, deciding if an issue is going to be pulled into the current sprint and properly assigning the priority if it's going into the backlog.

A:

A: Wait, you write:

If a developer's issue is blocked by
  another developer's code, she must
  solve this problem outside of the bug
  tracking system.

so there are bugs that fall outside of the normal bug flow. You have then a second system for tracking those bugs, or are these all ad-hoc?
Sounds like your bug tracking system is really a user-defect tracking system.
Does it work well for you or are you looking at alternatives?

A: I think that customers also should be able to create issues, with no separation between bug reports and feature requests.
Assignment of issues should not be performed by developers themselves: deciding which issues have to be fixed for next release should be of customer and manager responsibilities.
Other practices can be found in Painless Bug Tracking by Joel Spolsky.

A: I've used several different types of bug tracking systems over the past 10 years including nothing, a word document, FogBugz, Bugzilla, and Remedy.  FogBugz is by far the best one.  At that job anyone was allowed to enter bugs, and anyone could assign a bug to anyone else.  I found that this worked well especially if I found a small bug in my code.  Instead of spending an hour writing e-mails and filling out forms and getting several other people involved, I could quickly log that I found and fixed a bug.  This encouraged me to enter all the bugs I found and fix them quickly.  If a bug required a lot of work then I would assign it to my manager so he could prioritize it with my other work.
At the job where I used Bugzilla, every time a bug was created, assigned, or changed an e-mail was sent to all the developers and managers.  This had the opposite effect, it discouraged me from finding and entering bugs in the system.

A: logging bugs is about speed - just the minimum amount of information needed to investigate/replicate the bug
for web projects, this comes down to: 1) a descriptive bug title, 2) the page where the error occurred, 3) a description of the problem + a screenshot OR step-by-step instructions for replicating the problem (if a screenshot isnt provided)
screenshots are very powerful for two-reasons: 1) a picture says a thousand words, 2) it gives creditability to the bug report (ever investigate a bug you couldnt replicate and think "looks like the client is making stuff up again"?)
i have a blog article which goes into the topic further: Logging Bugs Like a Pro

A: We use BugZilla for bug tracking and there are rules like:

*

*Anybody can report a bug and every little change whatsoever should go through bug-tracking system. If it is an enhancement in the product, the bug should be marked as enhancement and bug-tracking system should be followed.

*Anybody can assign a bug to anybody else which means that there is ease in routing an issue to others if a bug resides in somebody else's code. There may be circumstances when a bug needs to be fixed at more than one place i.e., there is dependency on somebody else's code to get fixed first and after that other person will fix his/her code. Under those cases, a bug gets assigned to the person who needs to do the work first and then he/she re-routes the bug to appropriate person by re-assigning it.

*If an issue appears at more than one place and the code behind is different but the issue apparently is same, the bug is cloned so that a separate track can be kept of all the changes.

*Technical leads are responsible for prioritizing the bugs based on the demand of that particular fix.

*Testers/QAEs are responsible for assigning a Severity to the bug i.e., Critical/Major/Minor etc.

*All bugs go through bug-tracking system. Bugs coming from customers are classified separately by a custom flag to indicate a customer bug. Customer bugs are mostly in the older released builds and patches are created for them, therefore, those are kept separate.
This way we ensure that we keep track of all the changes simultaneously in our Source Control System (which is TFS btw) and the Bugzilla so that any changes can be traced back to the original code-change/owner if needed in the future.

A: Sounds pretty complicated. We are using roughly the following process:

*

*Everyone in the company can open an issue ticket and assigns it to a department.

*Every department has a "dispatcher" who checks the incoming tickets for validity and prioritizes them.

*Depending on the department's practices, developers are assigned tickets for the current development cycle by the dispatcher, or they assign themselves the tickets, highest priority first.

*When a ticket is solved, it goes back to whoever opened it. This person also performs all activities neccessary afterwards, like informing customers.

*All tickets are held in a software systems that makes these tasks easy. If you get a ticket, you also get an e-mail notification.

This is a lightweight process that encourages developers to take responsibility for their issues.
Aside from this, we have several quality assurance measures in place for the process of changing anything in the software, regardless of the source and type of the change requests. This includes especially:

*

*All code must be reviewed before it is checked into the source code management system. This includes GUI and database reviews by specialized reviewers if neccessary

*Code must be tested thoroughly by the developer himself before checking it in.

*After the monthly build, all changes have to be tested again to prevent problems that occur due to several changes affecting the same code.

*The monthly build enters a "first customer phase" where it is only rolled out to a few customer systems. If this phase shows no previously undetected errors, the build is declared safe.

A: My small shop uses a pretty simple workflow:

*

*Anyone can create an issue (I think it's unnecessarily restrictive not to allow this)  This includes customers and users of our open source projects.

*A change control board (sounds fancy, but it's just QA lead and head of engineering, plus product manager) reviews new issues and assigns fix version and priority

*Anyone can reassign a bug, to ask the reporter a question or pass on to another person to fix or test

*Anyone can mark a bug resolved

*Only QA can close a bug - we do this to enforce verification of each bug fix.

This way, everything gets logged in the bug tracking system and we keep things efficient by not restricting updates.  You can end up with a bit of "bug spam" this way, but it's better than creating bottlenecks in my experience.
We use JIRA as our bug tracker - it's possible to set up all kinds of custom workflows in JIRA to enforce your particular process, but I've never found the need to do that in smaller organizations.

A:
What bug tracking flow are you using?

*

*Tester will post the all bugs in open condition

*Assigning to Developer

*Developer will try to fix the bug -  fixed

*Bug Closed

*Reopen the bug status


text:
Q: Why do unresolved dependencies appear while migrating from 2.2.1 to 2.3.1? Hello I have tried to migrate my play project to newer version and I have generated some errors which I couldnt repair. I was trying to do it like it was shown at play framework site migrate from play 2.2.x to play 2.3.x
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#play-
java-jdbc_2.11;2.3.1: not found
[error] unresolved dependency: com.typesafe.play#play-java-ebean_2.11;2.3.1: not found
[error] unresolved dependency: com.typesafe.play#play-cache_2.11;2.3.1: not found
[error] unresolved dependency: com.typesafe#play-plugins-mailer_2.11;2.2.0: not found
[error] unresolved dependency: com.typesafe#play-plugins-util_2.11;2.2.0: not found
[error] Total time: 31 s, completed 2014-09-17 18:21:00
1. Waiting for source changes... (press enter to interrupt)

My build.sbt looks like:
name := "error"

version := "0.1.1"

scalaVersion := "2.11.1"

doc in Compile <<= target.map(_ / "none")

libraryDependencies ++= Seq(
  javaJdbc,
  javaEbean,
  cache
)
libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.24"
libraryDependencies += "org.fusesource.scalate" % "scalate-core" % "1.5.3"
libraryDependencies += "net.sf.opencsv" % "opencsv" % "2.3"
libraryDependencies += "com.typesafe" %% "play-plugins-mailer" % "2.2.0"
libraryDependencies += "com.typesafe" %% "play-plugins-util" % "2.2.0"
libraryDependencies += "org.apache.thrift" % "libthrift" % "0.9.1"
libraryDependencies += "org.apache.httpcomponents" % "httpclient" % "4.2"
libraryDependencies += "org.apache.httpcomponents" % "httpcore" % "4.2"
libraryDependencies += "org.codehaus.jackson" % "jackson-core-asl" % "1.1.0"
libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.3.1"

I will be very thankful for every help cause I couldn't find resolution for this anywhere.
In older version play 2.2.2 I had in build.sbt also at the end
play.Project.playJavaSettings
and all was working perfectly when I was trying to run play with this last play.Project.playJavaSettings it gave error at starting running
/home/error/workspace/play-angular/build.sbt:35: error: object Project is not a
member of package play
play.Project.playJavaSettings
     ^
[error] Type error in expression
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

A: I believe the issue is with project/plugins.sbt in which you missed the Typesafe Releases repository (resolver). Add the following and start over.
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

There's also the shortcut available (if you want to go geeky):
resolvers += Resolver.typesafeRepo("releases")

redpajama_set_name: RedPajamaStackExchange


text:
Q: Adding a wordpress user to Salesforce Contact I'm trying to do a relatively simple task by hooking into the Wordpress registration and adding the user that's being registered to a Salesforce db.  When I run the Salesforce db code outside of Wordpress it works flawlessly, but when I test this by registering on my wordpress website, I get an error stating: INVALID_LOGIN: Invalid username, password, security token; or user locked out.
Additionally, I receive this error from Wordpress "Cannot modify header information - headers already sent" which doesn't allow me to view the entire object data that's being sent to Salesforce.
This is my code:
 $SF_USERNAME = 'test';
 $SF_PASSWORD = 'test';

 define( 'CD_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );

 require_once (CD_PLUGIN_PATH . 'Toolkit/soapclient/SforceEnterpriseClient.php');
 require_once (CD_PLUGIN_PATH . 'Toolkit/soapclient/SforceHeaderOptions.php');

 function add_user_to_SF($user_id) {
$user = get_userdata($user_id);

 try {
     $mySforceConnection = new SforceEnterpriseClient();
     $mySoapClient = $mySforceConnection->createConnection(CD_PLUGIN_PATH . 'Toolkit/soapclient/enterprise.wsdl.xml');
     $mylogin = $mySforceConnection->login($SF_USERNAME, $SF_PASSWORD);

     print '
';
     print_r($mylogin);
     print '
';
     print '

';

$sObject = new stdclass();
$sObject->FirstName = $user->first_name;
$sObject->LastName = $user->last_name;
$sObject->Email = $user->user_email;

//echo "**** Creating the following:\r\n";
$createResponse = $mySforceConnection->create(array($sObject), 'Contact');

$ids = array();
    foreach ($createResponse as $createResult) {
        print_r($createResult);
        array_push($ids, $createResult->id);
    }

    } catch (Exception $e) {
      $errors->add( 'demo_error', __(print_r($_POST),'mydomain') );
      $errors->add( 'demo_error', __($mySforceConnection->getLastRequest(),'mydomain') );
      $errors->add( 'demo_error', __($e->faultstring,'mydomain') );
      return $errors;
}

}

 add_filter( 'registration_errors', 'add_user_to_SF', 10, 3 );

A: This is a php scope issue.
Adding:
global $SF_USERNAME;
global $SF_PASSWORD;
inside the function fixed the problem.

A: It looks like you might be missing the security token. It's appended to the end of the password.
This link explains how to generate the token
https://login.salesforce.com/help/doc/en/user_security_token.htm

A: You need to add your salesforce account security token with password
eg. Password - "testing"
    Security Token - "2321njjn32j32"
You need to pass as - "testing2321njjn32j32"
This will work properly.


text:
Q: Get OAuth2 Token in XML format from Mule OAuth2 provider; currently it returns it as JSON I have implemented OAuth2 provider using Mule Password grant type flow as shown on https://developer.mulesoft.com/docs/display/current/Creating+an+OAuth+2.0a+Web+Service+Provider. But it is returning token response in JSON format; I want it in XML format how can I do that ?
    <spring:beans>
        <ss:authentication-manager id="resourceOwnerAuthenticationManager">
            <ss:authentication-provider>
                <ss:user-service id="resourceOwnerUserService">
                    <ss:user name="user" password="password" authorities="RESOURCE_OWNER" />
                </ss:user-service>
            </ss:authentication-provider>
        </ss:authentication-manager>
    </spring:beans>

    <mule-ss:security-manager>
        <mule-ss:delegate-security-provider
            name="resourceOwnerSecurityProvider"
            delegate-ref="resourceOwnerAuthenticationManager" />
    </mule-ss:security-manager>

<oauth2-provider:config
        name="oauth2Provider"
        providerName="SampleAPI"
        supportedGrantTypes="RESOURCE_OWNER_PASSWORD_CREDENTIALS"
        port="8083"
        authorizationEndpointPath="sampleapi/api/authorize"
        accessTokenEndpointPath="sampleapi/api/token"
        resourceOwnerSecurityProvider-ref="resourceOwnerSecurityProvider"
        scopes="READ_RESOURCE POST_RESOURCE" doc:name="OAuth provider module">
            <oauth2-provider:clients>
                <oauth2-provider:client clientId="myclientid3" secret="myclientsecret"
                                        type="CONFIDENTIAL" clientName="Mule Bookstore" description="Mule-powered On-line Bookstore">
                    <oauth2-provider:redirect-uris>
                        <oauth2-provider:redirect-uri>http://localhost*</oauth2-provider:redirect-uri>
                    </oauth2-provider:redirect-uris>
                    <oauth2-provider:authorized-grant-types>
                        <oauth2-provider:authorized-grant-type>PASSWORD</oauth2-provider:authorized-grant-type>
                    </oauth2-provider:authorized-grant-types>
                    <oauth2-provider:scopes>
                        <oauth2-provider:scope>READ_RESOURCE</oauth2-provider:scope>
                        <oauth2-provider:scope>POST_RESOURCE</oauth2-provider:scope>
                    </oauth2-provider:scopes>
                </oauth2-provider:client>
            </oauth2-provider:clients>
    </oauth2-provider:config>

A: I think if you want to do this you need create a choice at the end of the flow, and then if the 'Accept' header is equal 'application/xml' you put a custom transformer from json to xml. Because the OAuth2 Spec says the token returned should be a json. I did it with spring security oauth2 but this is a customization.

A: You might want to create a new http mule flow which invokes the oauth2-provider token endpoint and convert its response to xml.
create a new mule configuration file:
<flow name="token-json-to-xmlFlow">
   <http:listener> <-- new token endpoint
   <http:request> <-- invoke the oauth2 provider token
   <transform-message> <-- json to xml transformer
</flow>

hope this helps.


text:
Q: asp mvc roles from httpcontext i want to pass current area name to authorization attribute, like:
[SexyAuthorize(Roles = Url.RequestContext.RouteData.Values["area"])]
public class FormsController : Controller
{
}

but Url is member of controller. how can i pass it other way?
i know that i can use User.InRole in each method, but i want do it for class. thx.

A: You can't pass dynamic values to an attribute like this. All values passed to an attribute in .NET need to be known at compile time. One possible workaround is to fetch this value in your custom implementation of the attribute as you have access to the HTTP context.
Something like:
[SexyAuthorize(RolesRouteParamName = "area")]
public class FormsController : Controller
{
    ...
}

and then:
public SexyAuthorizeAttribute: AuthorizeAttribute
{
    public string RolesRouteParamName { get; set; }

    protected override bool AuthorizeCore(HttpContextBase httpContext)
    {
        if (httpContext == null)
        {
            throw new ArgumentNullException("httpContext");
        }
        var roles = httpContext.Request.RequestContext.RouteData.Value[RolesRouteParamName];
        // TODO: continue with the implementation...
        ...
    }
}


text:
Q: BQ2002 NiMH Charging Circuit not working I have the following charging circuit based on the BQ2002 which will charge a NiMH battery using a 5V micro USB cable. I built the circuit already and noticed that the TIP32C is not getting hot and the circuit is not drawing any current, but its able to charge the battery just fine.
The circuit is supposed to turn off when the thermistor gets too hot.
Are there any major connection issues or are my resistor values wrong?
I would like to draw around 550 mA of current.
Thanks in advance
[![enter image description here][1]][1]
Below is the schematic which I updated
The circuit is working now but not drawing enough current. How do I deliver more current?
[1]: https://i.stack.imgur.com/i5gRU.png

A:
BQ2002 NiMH Charging Circuit not working

Thank goodness your circuit does not work. Did you read the datasheet for the BQ2002?
The datasheet clearly shows how to connect the controller:

*

*You have no connection from Bat to the NiMH you are charging ....so no voltage sensing.

*You have no current limiting or detection in the charge path, so no way to control the charging current.

*You give no idea of the cell/pack voltage, but the circuit you show would only work for 1 or 2 cells since the diode drop would be close to 1V and the TIP32C saturation voltage is over 1V.


text:
Q: Get current year for variable - Java I have three variables where I need the current year, one year ago from the present time, and two years ago from the present time, using Java. Would something like this work?:
String DNRCurrentYear = new SimpleDateFormat("yyyy").format(new Date());

Or do I need to make the year an int in order to subtract one, then two years from?
How would I get the current year minus one, and current year minus two?

A: Use LocalDate class from Java 8:
public static void main(String[] args) {
    LocalDate now = LocalDate.now();
    System.out.println("YEAR : " + now.getYear());

    LocalDate oneYearBeforeDate = now.minus(1, ChronoUnit.YEARS);
    System.out.println("YEAR : " + oneYearBeforeDate.getYear());

    LocalDate twoYearsBeforeDate = now.minus(2, ChronoUnit.YEARS);
    System.out.println("YEAR : " + twoYearsBeforeDate.getYear());
}

Output:
YEAR : 2019
YEAR : 2018
YEAR : 2017

A: You can use the Java 8 Year class and its Year.minusYears() method:
Year year = Year.now();
Year lastYear = year.minusYears(1);
// ...

To get the int value you can use year.getValue(). To get the String value you can use year.toString().


text:
Q: Run DockerCompose File in Background with the specific configuration(yaml) file I need docker-compose to run all the containers in the background.
I know, if i have one docker-compose.yaml. Then, it is go to the directory in which the configuration file is present and run:
docker-compose up -d
But, In my case, i have 3 docker-compose.yaml files in the configuration folder. And whenever, i run
docker-compose -d docker-compose.yaml up
It doesn't executes/ runs the container.
But, if i run docker-compose -f docker-compose.yaml up. Then, the docker containers will start executing on the foreground terminal.
I want these dockers to run detached from the terminal. How can i achieve that?

A: Docker has -d option for detached or you can use the usual & at the end of any linux command
docker-compose -f docker-compose.yaml up -d

P.s: It is a good idea to give a name to your container (specially when using -d) using the --name={some_name} so that you can easily get back to that container later using the name

A: Run below to command to specify docker-compose.yml file including build and send in background;
docker-compose -f docker-compose-1.yml up -d --build
This will also build new image if there are any changes in the project else it will run the same container.


text:
Q: Mail composer working on iPad but no on iPhone in a Universal app i've a problem with universal app on iOS iPhone4s/5 iPad, using a 3 different Storyboards, but with same class file .h .m for all application.
I create a button share with a popUp view and woking very well, when i tap on mail button iside the popUp view on the iPad working and present mail composer, but the same stuff in storyboard, with the same class on iPhone 4/5 open a mail level under the popup.
here coding using to send email:
- (IBAction)mailCompose:(id)sender {

        if ([MFMailComposeViewController canSendMail]) {
            MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
            mail.mailComposeDelegate = self;

            [mail setSubject:@"Try MyRadioRed Now"];
            NSArray *toRecipients = [NSArray arrayWithObjects:@"", nil];

            [mail setToRecipients:toRecipients];
            NSString *emailBody = @"MyHTML text";

            UIImage *myImage = [UIImage imageNamed:@"lockScreen.png"];
            NSData *imageData = UIImagePNGRepresentation(myImage);
            [mail addAttachmentData:imageData mimeType:@"image/png" fileName:@"myImge"];

            [mail setMessageBody:emailBody isHTML:YES];
            mail.modalPresentationStyle = UIModalPresentationPageSheet;
            [self presentViewController:mail animated:YES completion:nil];
        }
}

On iPad loading correct the popup view and when tap on email button, load the Mail Composer over the popup view

On iPhone loading correct the popupView, but when tap on email button, mail compose load under the popupview:

Is very strange because I'am not change the code on class and the object on the storyboards, I have to copy and paste storyborad obj with the same setting and using only one class reference for all.
Have idea what happen? how to solve this issue?
thanks!

A: NS log the presentation of the mail composer and check if its being called on the iPhone, are you testing this in simulator, device  or both?
If as you say the code is the same for all devices Check that you have email actually set up on your devices or you wont get presentation of the composer


text:
Q: Is it possible to generate the space separated header row using data factory copy activity?
I am using azure sql as source dataset and delimited file as sink dataset in the copy activity.
I tried copy activity but First row as header gives comma separated headers.
Is there way to change the header output style ?
Please note spacing is unequal (h3...h4)

A: In this repro, I tried to give

*

*1 space between 1st and 2nd column,

*2 spaces between 2nd and 3rd column,

*3 spaces between 3rd and 4th column.
Also, I tried to give same column name for column2 and column3. The approach is as follows.

*

*Data is copied from Azure SQL database to datalake in comma delimitted format as a staging file.

*This staging file is taken as a source in Dataflow activity.

*In source dataset, first row as header is not checked.

Data preview of Source transformation:

*Derived column transformation is added to change the column name of column2 and column3.
In this case, date_col of column1 is header data. Thus when column1 is 'date_col' replace column2 and column3 data with same column name.

column_2 = iif(Column_1=='date_col','ECIX',Column_2);
column_3 = iif(Column_1=='date_col','ECIX',Column_3);

*Again derived column transformation is added to concat all the columns with spaces. Column name is given as concat . Value for this column is
concat(Column_1,' ',Column_2,'  ',Column_3,'   ',Column_4)

*Select transformation is added and only concat column is selected here.

*In sink, new delimited file is added as a sink dataset. And in sink dataset also , first row as header is not checked.

Output file screenshot
After pipeline is run, the target file looks like this.

A: Keeping the source as azure sql itself in the dataflow, I created a  single derived column 'OUTDC' and added all the columns from the source like this:
(h1)+' '+(h2)+'      '+(h3)

Then fed the OUTDC to a delimited sink and kept the Headers option as single string like this:
['h1    h2          h2']


text:
Q: CloudKit Query Value Limit Error I have a query with a predicate in which I want to see if any values inside an array are contained in a CKRecord on CloudKit, but when I execute the query I get an error saying "Query filter exceeds the limit of values: 250 for container"
Is there another way to query my array? It has 500 objects in it, but it's dynamic so depending on the user it could be a lot less or a lot more.
CKDatabase *publicDatabase = [[CKContainer defaultContainer] publicCloudDatabase];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"PhoneNumber == %@", numbers1];
        CKQuery *query = [[CKQuery alloc] initWithRecordType:@"PhoneNumbers" predicate:predicate];
        [publicDatabase performQuery:query inZoneWithID:nil completionHandler:^(NSArray *results, NSError *error) {
            if (error) {
                NSLog(@"%@", error);
            }
            else {
                NSLog(@"%@", results);

            }
}];


text:
Q: Display base64 encoded string as image in a PDF file using iText I have a base64 encoded string. I want to display this as an image in a PDF file. I am using iText to achieve this. I am using apache commons codec to convert Base64 to byteArray.Below is the code -
    Document document = new Document();
    PdfWriter.getInstance(document,new FileOutputStream("C:\\Path\\Path\\example.pdf"));
    document.open();
    String example = "...base64..String";
    byte[] decoded = org.apache.commons.codec.binary.Base64.decodeBase64(example.getBytes());
    Image image1 = Image.getInstance(decoded);
    document.add(image1);
    document.close();

This code executes without any error but when I open the generated PDF file it opens with an "internal error" and no image is displayed. What is the problem?
The complete Base64 string is -
_9j_4AAQSkZJRgABAQAAAQABAAD_2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj_2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj_wAARCAIVAUADASIAAhEBAxEB_8QAHQAAAwADAQEBAQAAAAAAAAAAAAECAwYHBQQICf_EAFkQAAEDAgQDBAYFBggKCQIHAAEAAhEDBAUSITEGQVEHEyJhFDJxgZGhF5Ox0dIVI0JSVcEIFiQzYnLh8CU0NUVWgpKVsrM3RlNzdYSiw_FEYyY2VIOUo8L_xAAZAQEBAQEBAQAAAAAAAAAAAAAAAQIDBAX_xAApEQEBAAIBBQACAQQCAwAAAAAAAQIREgMTITFRIkFxBDJhoYGRQlLw_9oADAMBAAIRAxEAPwD9OoTQgSE0IEhNCBITQgSE0IEhNCBITQgSE0IEhNCBITQgSE0IEhNCBITQgSE0IEhNCBITQgSE0IEhNCBITQgSE0IGhNCBL5sSvrXDLCve39enb2tBhfUq1DDWtHMoxO_tcLsK99iFxTt7Sgwvq1ahhrWjmVw17sR7asX7

Thanks!


text:
Q: How can I run a ruby script as a service including Sinatra in ubuntu? I have written a script that parses my UPS's data via serial interface to a json file, looping indefinitely every 5 secs:
require 'json'

pipe = IO.popen("apcaccess")

upsdata_h = {}
data = []

while true

  pipe = IO.popen("apcaccess")
  upsdata_h[:ups] = {}
  data = []

  while (line = pipe.gets)
    data = line.split(':')
    upsdata_h[:ups][data[0].strip] = data[1].strip
  end

  puts "Internal temperature: #{upsdata_h[:ups]['ITEMP']}"

  File.open("upsdata.json", "w") do |f|
    f.write(upsdata_h.to_json)
  end

  sleep 5

end

I have also another small one to create a tiny api with sinatra:
require 'sinatra'

set :bind, '0.0.0.0'

get '/api/upsdata' do
  content_type :json
  File.read('upsdata.json')
end

I want to run them both as a service in my ubuntu server 15.04. How do I keep the script running forever in the background as other ubuntu's services ? Should I also include sinatra in the service so it loads on boot ?

A: You could start each service separately with upstart.
An upstart script lives in /etc/init with extension .conf, like /etc/init/myscript.conf.
Here's an example simple upstart script:
#!upstart
description "my server"
author      "Me"

start on filesystem
stop on runlevel [!2345]
respawn

script
    /path/to/ruby /path/to/script
end script

Once this piece is in place, you can manually start the service with start myscript


text:
Q: ASP.NET MVC 2 Cancel Asynchronous Action The MSDN documentation for using an asynchronous controller mentions choosing an asynchronous controller when you want to provide a way for users to cancel requests.
I couldn't find any documentation related to actually allowing users to cancel asynchronous requests, however. Is there a way to indicate to ASP.NET and/or the ASP.NET MVC framework that a request should be canceled?

A: If the asynchronous API that you called provides a way to cancel the request (either via .NET 4's CancellationToken class or via a CancelAsync method), you must call that to cancel whatever asynchronous operations are in flight.  Otherwise, call AsyncManager.Finish (via the controller's AsyncManager property) to force the MVC framework to call your XxCompleted method immediately.  Note that AsyncManager.Finish is really intended only if you need to bail out of requests that you have no other way of canceling (such as calling BeginXx / EndXx without a CancellationToken) and won't always work in other scenarios.

A: The default timeout is 45 seconds, so if there is no response, it will be canceled by server.
They did not allow users to cancel the request as to cancel one http request, you are creating another http request which is not a proper way.


text:
Q: Set UserImage and Username in nav header from Firebase I'm following this Tutorial to create blog and I successfully Created the blog. In give Tutorial, he has used Empty Activity but I used Navigation drawer Activity.
So now I would like to put the User image and User name in nav header if he is signed in if not use the default image and name  from drawable folder.
My Blog Recycle Adapter is

package com.nepalpolice.cdp;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.EventListener;
import com.google.firebase.firestore.FieldValue;
import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.FirebaseFirestoreException;
import com.google.firebase.firestore.QuerySnapshot;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import de.hdodenhof.circleimageview.CircleImageView;

import static com.android.volley.VolleyLog.TAG;
import static com.nepalpolice.cdp.webfaq.isNetworkStatusAvialable;

public class BlogRecyclerAdapter extends RecyclerView.Adapter<BlogRecyclerAdapter.ViewHolder> {

    public List<BlogPost> blog_list;
    public Context context;

    private FirebaseFirestore firebaseFirestore;
    private FirebaseAuth firebaseAuth;
    private PopupWindow popWindow;

    public BlogRecyclerAdapter(List<BlogPost> blog_list){

        this.blog_list = blog_list;

    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.blog_list_item, parent, false);
        context = parent.getContext();
        firebaseFirestore = FirebaseFirestore.getInstance();
        firebaseAuth = FirebaseAuth.getInstance();
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, int position) {

        holder.setIsRecyclable(false);

        final String blogPostId = blog_list.get(position).BlogPostId;
        final String currentUserId = firebaseAuth.getCurrentUser().getUid();

        String desc_data = blog_list.get(position).getDesc();
        holder.setDescText(desc_data);

        String image_url = blog_list.get(position).getImage_url();
        String thumbUri = blog_list.get(position).getImage_thumb();
        holder.setBlogImage(image_url, thumbUri);

        String user_id = blog_list.get(position).getUser_id();
        //User Data will be retrieved here...

        firebaseFirestore.collection("Users").document(user_id).get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
            @Override
            public void onComplete(@NonNull Task<DocumentSnapshot> task) {

                if(task.isSuccessful()){

                    String userName = task.getResult().getString("name");
                    String userImage = task.getResult().getString("image");

                    holder.setUserData(userName, userImage);

                } else {

                    //Firebase Exception

                }

            }
        });

        try {
            long millisecond = blog_list.get(position).getTimestamp().getTime();
            String dateString = DateFormat.format("MM/dd/yyyy", new Date(millisecond)).toString();
            holder.setTime(dateString);
        } catch (Exception e) {

            Toast.makeText(context, "Exception : " + e.getMessage(), Toast.LENGTH_SHORT).show();

        }

        //Get Likes Count
        firebaseFirestore.collection("Posts/" + blogPostId + "/Likes").addSnapshotListener(((Main2Activity) context),new EventListener<QuerySnapshot>() {
            @Override
            public void onEvent(QuerySnapshot documentSnapshots, FirebaseFirestoreException e) {

               if (e!=null) {
                   Log.w(TAG, "listening failed",e);
                   return;
               }

                if(!documentSnapshots.isEmpty()){

                    int count = documentSnapshots.size();

                    holder.updateLikesCount(count);

                } else {

                    holder.updateLikesCount(0);

                }

            }
        });

        if (InternetStatus.getInstance(holder.blogLikeBtn.getContext()).isOnline()) {
            //Get Likes
            firebaseFirestore.collection("Posts/" + blogPostId + "/Likes").document(currentUserId).addSnapshotListener(((Main2Activity) context), new EventListener<DocumentSnapshot>() {
                @Override
                public void onEvent(DocumentSnapshot documentSnapshot, FirebaseFirestoreException e) {

                    if (e != null) {
                        Log.w(TAG, "listening failed", e);
                        return;
                    }

                    if (documentSnapshot.exists()) {

                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                            holder.blogLikeBtn.setImageDrawable(context.getDrawable(R.mipmap.action_like_accent));
                        } else {
                            holder.blogLikeBtn.setImageDrawable(context.getResources().getDrawable(R.mipmap.action_like_accent));
                        }
                    } else {

                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                            holder.blogLikeBtn.setImageDrawable(context.getDrawable(R.mipmap.action_like_gray));
                        } else {
                            holder.blogLikeBtn.setImageDrawable(context.getResources().getDrawable(R.mipmap.action_like_gray));
                        }
                    }

                }
            });

        //Likes Feature

        holder.blogLikeBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                firebaseFirestore.collection("Posts/" + blogPostId + "/Likes").document(currentUserId).get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
                    @Override
                    public void onComplete(@NonNull Task<DocumentSnapshot> task) {

                        if(!task.getResult().exists()){

                            Map<String, Object> likesMap = new HashMap<>();
                            likesMap.put("timestamp", FieldValue.serverTimestamp());

                            firebaseFirestore.collection("Posts/" + blogPostId + "/Likes").document(currentUserId).set(likesMap);

                        } else {

                            firebaseFirestore.collection("Posts/" + blogPostId + "/Likes").document(currentUserId).delete();

                        }

                    }
                });
            }
        });
        }

    else{

        Toast.makeText(context, "Check Internet", Toast.LENGTH_SHORT).show();

    }

            holder.blogCommentBtn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    Intent commentIntent = new Intent(context, CommentsActivity.class);
                    context.startActivity(commentIntent);

                }
            });

    }

    @Override
    public int getItemCount() {
        return blog_list.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        private View mView;

        private TextView descView;
        private ImageView blogImageView;
        private TextView blogDate;

        private TextView blogUserName;
        private CircleImageView blogUserImage;

        private ImageView blogLikeBtn;
        private TextView blogLikeCount;

        private ImageView blogCommentBtn;

        public ViewHolder(View itemView) {
            super(itemView);
            mView = itemView;

            blogLikeBtn = mView.findViewById(R.id.blog_like_btn);
            blogCommentBtn = mView.findViewById(R.id.blog_comment_icon);

        }

        public void setDescText(String descText){

            descView = mView.findViewById(R.id.blog_desc);
            descView.setText(descText);

        }

        public void setBlogImage(String downloadUri, String thumbUri){

            blogImageView = mView.findViewById(R.id.blog_image);

            RequestOptions requestOptions = new RequestOptions();
            requestOptions.placeholder(R.drawable.image_placeholder);

            if (!((Activity) context).isFinishing()) {
                Glide.with(context).applyDefaultRequestOptions(requestOptions).load(downloadUri).thumbnail(
                        Glide.with(context).load(thumbUri)
                ).into(blogImageView);
            }
        }

        public void setTime(String date) {

            blogDate = mView.findViewById(R.id.blog_date);
            blogDate.setText(date);

        }

        public void setUserData(String name, String image) {

            blogUserImage = mView.findViewById(R.id.blog_user_image);
            blogUserName = mView.findViewById(R.id.blog_user_name);

            blogUserName.setText(name);

            RequestOptions placeholderOption = new RequestOptions();
            placeholderOption.placeholder(R.drawable.profile_placeholder);

            if (!((Activity) context).isFinishing()) {
                Glide.with(context).applyDefaultRequestOptions(placeholderOption).load(image).into(blogUserImage);

            }
        }
        public void updateLikesCount(int count){

            blogLikeCount = mView.findViewById(R.id.blog_like_count);
            blogLikeCount.setText(count + " Likes");

        }

    }

}

and my Mainactivity is

public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener  {
    final Context context = this;
    private boolean exit = false;
    Dialog dialog;
    private Menu mymenu;

    private TextView blogUserName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        Fragment fragment = new main();
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.fragment_frame, fragment, fragment.getClass().getSimpleName()).addToBackStack(null).commit();

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.setDrawerListener(toggle);
        toggle.syncState();

//Create Dialog

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        mymenu = menu;
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch(item.getItemId()) {
            case R.id.action_refresh:
                Intent intent = new Intent(MainActivity.this, UpdateService.class);
                startService(intent);
                LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                ImageView iv = (ImageView)inflater.inflate(R.layout.iv_refresh, null);
                Animation rotation = AnimationUtils.loadAnimation(this, R.anim.rotate_refresh);
                rotation.setRepeatCount(Animation.INFINITE);
                iv.startAnimation(rotation);
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
                    item.setActionView(iv);
                }
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
                    new UpdateTask(this).execute();
                }
                return true;
        }
        return super.onOptionsItemSelected(item);
    }

    public void resetUpdating()
    {
        // Get our refresh item from the menu
        MenuItem m = mymenu.findItem(R.id.action_refresh);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            if(m.getActionView()!=null)
            {
                // Remove the animation.
                m.getActionView().clearAnimation();
                m.setActionView(null);
            }
        }
    }

    @SuppressWarnings("StatementWithEmptyBody")
    @Override
    public boolean onNavigationItemSelected(MenuItem item) {
        // Handle navigation view item clicks here.
        int id = item.getItemId();

        if (id == R.id.store) {
            String url = "https://play.google.com/store/apps/developer?id=Sagar%20Rawal&hl=en";
            Intent i = new Intent(Intent.ACTION_VIEW);
            i.setData(Uri.parse(url));
            startActivity(i);

        } else if (id == R.id.contact) {
            Intent activity_about = new Intent(this, profile.class);
            startActivity(activity_about);

        } else if (id == R.id.weather) {
            Intent activity_weather = new Intent(this, com.nepalpolice.cdp.weather.MainActivity.class);
            startActivity(activity_weather);
        }

        else if (id == R.id.resistor) {
            Intent activity_weather = new Intent(this, com.nepalpolice.cdp.resistor.MainActivity.class);
            startActivity(activity_weather);
        }

        else if (id == R.id.result) {
            result fragment = new result();
            FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
            fragmentTransaction.replace(R.id.fragment_frame, fragment, "Main");
            fragmentTransaction.commit();
            fragmentTransaction.addToBackStack(null);

        }

        else if (id == R.id.pacman) {
            Intent activity_about = new Intent(this, pacman.class);
            startActivity(activity_about);

        }

        else if (id == R.id.tetris) {
            Intent activity_about = new Intent(this, MenuActivity.class);
            startActivity(activity_about);

        }

        else if (id == R.id.retro) {
            Intent intent500 = new Intent(this, com.nepalpolice.cdp.brickgame.GameActivity.class);
            startActivity(intent500);

        }

        else if (id == R.id.hangman) {
            Intent activity_about = new Intent(this, GameActivity.class);
            startActivity(activity_about);

        }

        else if (id == R.id.tictac) {
            Intent activity_about = new Intent(this, MainMenuScreen.class);
            startActivity(activity_about);

        }

        else if (id == R.id.home) {
            main fragment = new main();
            FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
            fragmentTransaction.replace(R.id.fragment_frame, fragment, "Main");
            fragmentTransaction.commit();
            fragmentTransaction.addToBackStack(null);

        }
         else if (id == R.id.email) {
            Intent activity_about = new Intent(this, Sendemail.class);
            startActivity(activity_about);
        } else if (id == R.id.call) {
            Intent intent = new Intent(Intent.ACTION_DIAL);
            intent.setData(Uri.parse("tel:+9779868336847"));
            startActivity(intent);

        } else if (id == R.id.share) {
            Intent sendIntent = new Intent();
            sendIntent.setAction(Intent.ACTION_SEND);
            sendIntent.putExtra(Intent.EXTRA_TEXT,
                    "Hey check out this awesome app at: https://play.google.com/store/apps/details?id=com.nepalpolice.cdp");
            sendIntent.setType("text/plain");
            startActivity(sendIntent);
        } else if (id == R.id.rate) {
            try {
                startActivity(new Intent(Intent.ACTION_VIEW,
                        Uri.parse("market://details?id=com.nepalpolice.mnemonics&hl=en" + getPackageName())));
            }
            catch (android.content.ActivityNotFoundException anfe) {
                startActivity(new Intent(Intent.ACTION_VIEW,
                        (Uri.parse("https://play.google.com/store/apps/details?id=com.faraksoch.sagar.eroutine&hl=en"))));
            }
        }

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        drawer.closeDrawer(GravityCompat.START);
        return true;
    }

    @Override
    public void onBackPressed() {
        if (exit)
            new AlertDialog.Builder(this)
                    .setTitle("Really Exit?")
                    .setMessage("Are you sure you want to exit?")
                    .setNegativeButton(android.R.string.no, null)
                    .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {

                        public void onClick(DialogInterface arg0, int arg1) {
                            // MainActivity.super.onBackPressed();
                            finish();
                            moveTaskToBack(true);
                        }
                    }).create().show();

        else {
            FragmentManager fm = getSupportFragmentManager();
            fm.popBackStack();

            if (getSupportFragmentManager().getBackStackEntryCount() ==1) {
                finish();
            }

            exit = true;
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    exit = false;
                }
            }, 800);

        }

    }

}

I have no clue if it is possible or not but if it is please help. I have followed several post but none of it helped.
My Firebase Structure is


text:
Q: Access VBA: Determine remote user I am working with an Access Database and want to see the user name that is logged in.
On the terminal server that they remote into, if in the command prompt if you type
echo %ClientName%

with VBA, it will return the correct information.
How to simulate this with VBA and the onOpen Event.

A: %username% contains username. Type set in command prompt to see other variables.
Environ Function
Returns the String associated with an operating system environment variable.
Syntax
Environ({envstring | number})

The Environ function syntax has these named arguments:
Part
Description
envstring Optional. String expression containing the name of an environment variable.
number Optional. Numeric expression corresponding to the numeric order of the environment string in the environment-string table. The number argument can be any numeric expression, but is rounded to a whole number before it is evaluated.
Remarks
If envstring can't be found in the environment-string table, a zero-length string ("") is returned. Otherwise, Environ returns the text assigned to the specified envstring; that is, the text following the equal sign (=) in the environment-string table for that environment variable.
If you specify number, the string occupying that numeric position in the environment-string table is returned. In this case, Environ returns all of the text, including envstring. If there is no environment string in the specified position, Environ returns a zero-length string.


text:
Q: JsonConvert.SerializeObject Splitting String into Array of Letters I have a controller which is supposed to return some location information by locationid. I return a Location object, then use JsonConvert.SerializeObject to turn it into a string, which I pass back to the web page. JsonConvert.SerializeObject is turning any strings into an array of letters. That is, if I had an object:
public class Location
{
    public string Address { get; set; }
}

Location l = new Location();
l.Address = "123 Main St";
var json = JsonConvert.SerializeObject(l);

then the I get the following result in my json variable:
{ "Address": ["1", "2", "3", "", "M", "a", "i", "n", "", "S", "t" ]}

Has anyone ever seen this before? I haven't tried anything because I'm not really sure what to even try. The Location object coming back is valid. I'm using MVC 5 in C#. Is there something in my Location object I should check for that might be causing this? It's built into a set of proprietary dll's we use across a variety of projects, but as far as I know no one else needs to convert to json (I'm the only web developer).


text:
Q: selectedItemId doesn't work anymore after androidx.navigation:navigation library update I have the following code:
activityBinding.bottomNav.selectedItemId = R.id.myFragment

that was working fine with androidx.navigation:navigation-* version 2.3.5 but is not working with version 2.4.2 and any other 2.4.* version.
I've searched everywhere but I haven't found a solution to make it work (also alternative code like menu.findItem(R.id.myFragment).isChecked = true didn't work).
Any idea of what I'm doing wrong?

A: It is working fine for me I am using 2.4.1 version of androidx.navigation:navigation-*
navController.addOnDestinationChangedListener { _, destination, _ ->
            when (destination.id) {
                R.id.mainFragment, R.id.recentsFragment, R.id.favouriteFragment
                -> {
                    // do your Code
                }
                else -> {
                   //do your code
                }
            }
            Log.i("TLogs", "onCreate: ${bottomNavigationView.selectedItemId}")
        }

You can check it according to the example I have done and attached.
Log is showing the current item Id

A: Since the new library, if with the navigator you set a fragment as starting fragment and you select with selectedItemId the same fragment, the result will be that you'll click on it but nothing will happen.
Putting the starting fragment in the nav_graph to something else and then selecting the right one using selectedItemId make it working.


text:
Q: System sounds / gnome shell (not playing or popping); Application sounds fine; Software Versions
Ubuntu: 20.04.1
GNOME Version: 3.36.3
PulseAudio: 13.99.1
ALSA: k5.4.0-48-generic.
The problems / symptoms of the issue(s)

*

*System sounds / gnome shell sounds either do not play or crackle / pop e.g. hitting ESC in the terminal

*When going into the normal settings / sound - clicking the test buttons on each of the speakers results in no response. Neither visual, nor audio response;

*As the title of the question suggests normal in-application sounds work just fine e.g. Chrome, VLC & Rhythmbox, ect

Background / History
These issues appeared relatively recently, in the last week after a specific incident. There was some update (don't know what packages / libraries) after which my sound on-board was not working all together. This had happened before but basically running alsa force-reload would solve the problem. This time it did not. All other USB & HDMI sound devices worked just fine, except the onboard audio device. I tried several approaches starting from reinstalling Pulse & ALSA. Nothing worked, after some time, I started actually considering that maybe the hardware was bad and booted windows to check if it still worked there; It did!!! After booting back into Ubuntu it miraculously worked. However, the above symptoms have materialized. Since then, I've tried the answer to this question without success.
Additional Info / Settings
uname -a
$ uname -a
Linux u20-5820k 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

lspci
$ lspci | grep -i Audio
00:1b.0 Audio device: Intel Corporation C610/X99 series chipset HD Audio Controller (rev 05)
01:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)

aplay -l
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Microphone [Yeti Stereo Microphone], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [GSX 1200 Pro Main Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [GSX 1200 Pro Main Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: PCH [HDA Intel PCH], device 0: CA0132 Analog [CA0132 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 3: PCH [HDA Intel PCH], device 1: CA0132 Digital [CA0132 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: NVidia [HDA NVidia], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: NVidia [HDA NVidia], device 11: HDMI 5 [HDMI 5]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 4: NVidia [HDA NVidia], device 12: HDMI 6 [HDMI 6]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

loaded audio drivers
$ /sbin/lsmod | grep snd
snd_hda_codec_hdmi     61440  1
snd_hda_codec_ca0132   110592  1
snd_hda_intel          53248  12
snd_intel_dspcfg       24576  1 snd_hda_intel
snd_hda_codec         135168  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_ca0132
snd_hda_core           90112  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_ca0132
snd_usb_audio         270336  8
snd_usbmidi_lib        36864  1 snd_usb_audio
snd_hwdep              20480  2 snd_usb_audio,snd_hda_codec
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
snd_rawmidi            36864  2 snd_seq_midi,snd_usbmidi_lib
snd_seq                69632  2 snd_seq_midi,snd_seq_midi_event
mc                     53248  5 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
snd_pcm               106496  8 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,snd_hda_core,snd_hda_codec_ca0132
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              36864  4 snd_seq,snd_pcm
snd                    90112  48 snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_timer,snd_pcm,snd_hda_codec_ca0132,snd_rawmidi

/etc/modprobe.d/alsa-base.conf
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7

# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
#
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
#
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }

# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-caiaq index=-2
options snd-usb-ua101 index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2

/etc/pulse/deamon.conf
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values are commented out.  Use either ; or # for
## commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

; resample-method = src-sinc-best-quality
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; remixing-produce-lfe = no
; remixing-consume-lfe = no
; lfe-crossover-freq = 0

; flat-volumes = no

; rescue-streams = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

; default-sample-format = s16le
; default-sample-rate = 44100
; default-sample-rate = 48000
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

; default-fragments = 4
; default-fragment-size-msec = 25

; enable-deferred-volume = yes
deferred-volume-safety-margin-usec = 1
; deferred-volume-extra-delay-usec = 0

/etc/pulse/default.pa
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.fail

### Automatically restore the volume of streams and devices
load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Should be after module-*-restore but before module-*-detect
load-module module-switch-on-port-available

### Use hot-plugged devices like Bluetooth or USB automatically (LP: #1702794)
.ifexists module-switch-on-connect.so
load-module module-switch-on-connect
.endif

### Load audio drivers statically
### (it's probably better to not load these drivers manually, but instead
### use module-udev-detect -- see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect tsched=0
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif

### Automatically connect sink and source if JACK server is present
.ifexists module-jackdbus-detect.so
.nofail
load-module module-jackdbus-detect channels=2
.fail
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-policy.so
load-module module-bluetooth-policy
.endif

.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP receiver module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gsettings.so
.nofail
load-module module-gsettings
.fail
.endif

### Automatically restore the default sink/source when changed by the user
### during runtime
### NOTE: This should be loaded as early as possible so that subsequent modules
### that look up the default sink/source get the right value
load-module module-default-device-restore

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
.ifexists module-console-kit.so
load-module module-console-kit
.endif
.ifexists module-systemd-login.so
load-module module-systemd-login
.endif

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music/video streams when a phone stream is active
load-module module-role-cork

### Block audio recording for snap confined packages unless they have
### the "pulseaudio" or "audio-record" interfaces plugged.
.ifexists module-snap-policy.so
load-module module-snap-policy
.endif

### Modules to allow autoloading of filters (such as echo cancellation)
### on demand. module-filter-heuristics tries to determine what filters
### make sense, and module-filter-apply does the heavy-lifting of
### loading modules and rerouting streams.
load-module module-filter-heuristics
load-module module-filter-apply

### Make some devices default
#set-default-sink output
#set-default-source input

EDIT 1:
/usr/bin/*session
$ ls /usr/bin/*session
/usr/bin/dbus-run-session  /usr/bin/gnome-session  /usr/bin/gnome-session-custom-session

A: In the config panel for audio, there is an option which says System Sounds. It may seem obvious but do you have it active?.
You can try:
sudo killall pulseaudio; pulseaudio -k; sleep 10; pulseaudio --start

Then go to the Settings and make sure the output is to the right device (HDMI monitor, Front or back computer jacks).
By the way I advice in the original post you mentioned, there is a typo.
sudo sed -i 's/SOUND_POER_SAVE_CONTROLLER=Y/SOUND_POER_SAVE_CONTROLLER=N/' /etc/default/tlp

Should be:
sudo sed -i 's/SOUND_POWER_SAVE_CONTROLLER=Y/SOUND_POWER_SAVE_CONTROLLER=N/' /etc/default/tlp

I added a comment hopefully they will address.
Otherwise it was not disabling the Power Save in the Sound.
Cheers


text:
Q: RewriteRule to match anything alphanumeric or dash only I am trying to write a rule that matches domain.com/abc
RewriteRule ^([^/\.]+)?$ results.php?category=$1 [L,NC]

This works and category=abc but this rule also seems to be triggered if I just go to domain.com
I need my rule to only match if the URL after the slash contains alphanumeric characters or a dash. It can not match a forward slash as domain.com/abc/123 would not be valid.
domain.com/abc123 is good
domain.com/abc-123 is good
domain.com/abc/123 should not match
domain.com should not match
domain.com/ should not match

A: You can use:
RewriteRule ^([\w-]+)/?$ results.php?category=$1 [L,QSA]

\w matches [a-zA-Z0-9_]
To avoid matching underscore use:
RewriteRule ^([a-zA-Z0-9-]+)/?$ results.php?category=$1 [L,QSA]

To safeguard it use this condition to avoid matching directories:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/?$ results.php?category=$1 [L,QSA]


text:
Q: Way to make only different state of nav in react-fullpage.js I'm trying to make a website, and I would like the first section of the landing page (the navigation header) to have a transparent background. The rest of the pages do not need transparent backgrounds.
The landing page is built using fullPage.js. I have tried using the scroll event, but it doesn't seem to be supported with fullPage.js. How else can I apply a separate CSS style to just one section using fullPage.js?
I'm adding current Header component code in App.js of React, and confusing to make only one status for the very first landing page's section's header.

function App() {
  return (
    <>
      <Header />
      <Routes>
        <Route path='/' element={<MainPage />} />
        <Route path='/company' element={<IntroPage />} />
        <Route path='/technology' element={<TechnologyPage />} />
        <Route path='/products' element={<ProductsPage />} />
        <Route path='/RnD' element={<RnDPage />} />
        <Route path='/support' element={<SupportPage />} />
        <Route path='/login' element={<LoginPage />} />
        <Route />
        <Route />
      </Routes>
      <Footer />
    </>
  );
}

export default App;

A: There may be a better solution, but the only one I can think of is to use two different heads. One on the page where it needs to be transparent, and another one on for rest. Give them different ID's, and just set it to transparent on the one where you need it.


text:
Q: dotnetnuke how to copy pages programatically I have thousands of pages which i need to export from qa to production. I have seen the export page function but is there a way to do this in batch? I have found code to create pages but not to extract them. All permissions and settings must also be copied.

A: You could use the Portal Templates (export) feature found under the Host/Sites page.
That will generate a template for the site, then you could transfer that to production (that would be a couple of files) and "apply" that template to your existing site.
The other option would be to backup/restore the database, that is how most people handle changes between staging/production. Though that assumes any changes already made in Production exist in Staging.


text:
Q: Pull data summing up the amount column such that the result is grouped by customers, month and year I have a customers table and a customer transactions table.
This is the customers' table below.

This is the customer transactions table below.

This is what I want to achieve below:

I want to be able to sum up the amount column such that the result is grouped by customers and month and year.
This is what I've done so far:
I created a model for both Customers and Customers transactions. I have this relationship in the Customer transactions model:
    public function customer()
    {
        return $this->belongsTo(Customer::class);
    }

I also have a Customer controller where I have the logic to fetch the data. In my CustomerController file:
    public function index()
    {
        $transactions = CustomerTransaction::with('customer')->get();

        dd($transactions);
    }

A: I was able to resolve it. In the CustomerController file, this is what I now have in the index method:
$transactions = CustomerTransaction::with('customer')
->selectRaw('customer_id, sum(amount) as amount, MONTH(date_created) as month, YEAR(date_created) as year')
->groupBy('customer_id', 'month', 'year')
->get();

Then in my view, I have this:

                            S/N
                            Name
                            Amount
                            Year month

                        @foreach ($transactions as $transaction)

                                {{ $loop->iteration }}
                                {{ $transaction->customers->name }}
                                {{ $transaction->amount }}
                                {{ $transaction->year }}-{{ sprintf('%02d', $transaction->month) }}

                        @endforeach

A: I was able to write the SQL query:
select ROW_NUMBER() OVER(ORDER BY (select null)) as id,
name as `Customer name`,
sum(amount) as `Total amount`,
concat(YEAR(date_created), '-',
lpad(MONTH(date_created), 2, '0')) as `Year month`
from customer_transactions
join customers on customers.id=customer_transactions.customer_id
group by `customer_id`, `Year month`
order by `customer_id`, `Year month`


text:
Q: Postfix to deliver mail to a virtual address mailbox Postfix version 2.6.6, Dovecot Version 2.0.9
I want to setup Postfix + Dovecot. Dovecot seems to be working. I can authenticate. However, the mailbox is empty! Nothing will get delivered! I followed many tutorials on Postfix + Dovecot but they seem to want to complicate things by using Dovecot LDA or MySQL. I just want it to be very simple and having Postfix deliver to the virtual mail boxes are fine. I don't need MySQL either. I already set up a custom password file that Dovecot uses for authentication and I can login to POP3 with SSL.
I can see from the logs that Postfix is delivering to the system user accounts (the catch-all), instead of the virtual users that I set up in Dovecot. The SMTP + SSL authentication seems to work also.
I can also see from the logs that Dovecot is checking the correct virtual mail folder.
I just need to figure out how to get Postfix to deliver to the virtual mail boxes. I have the following which I believe are relevant. Let me know what other settings you need to see:
alias_maps = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = xxx.com
myhostname = mail.xxx.com
mynetworks = 99.99.99.99, 99.99.99.99
myorigin = $mydomain
relay_domains = $mydestination, xxx.com, domain2.net, domain3.com
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_recipient_restrictions = reject_non_fqdn_sender reject_non_fqdn_recipient reject_unknown_recipient_domain permit_sasl_authenticated check_relay_domains
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = check_sender_mx_access cidr:/etc/postfix/bogus_mx reject_invalid_hostname reject_unknown_sender_domain reject_non_fqdn_sender
virtual_mailbox_base = /var/spool/vmail
virtual_mailbox_domains = xxx.com, domain2.net, domain3.com
virtual_minimum_uid = 444

Postfix master.cf:
submission inet n       -       -       -       -       smtpd
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth
  -o smtpd_sasl_security_options=noanonymous
  -o smtpd_sasl_local_domain=$myhostname
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o smtpd_sender_login_maps=hash:/etc/postfix/virtual
  -o smtpd_sender_restrictions=reject_sender_login_mismatch
  -o smtpd_recipient_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_sasl_authenticated,reject

Dovecot related:
mail_location = maildir:~/Maildir
passdb {
  args = /etc/dovecot/users.conf
  driver = passwd-file
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    mode = 0660
    user = postfix
  }
}

The virtual mail user:
vmail:x:444:99:virtual mail users:/var/spool/vmail:/sbin/nologin

Here is the /var/log/maillog when I try to send something to myself:
Oct 25 22:10:05 308321 postfix/smtpd[2200]: connect from user-999.cable.mindspring.com[99.99.99.99]
Oct 25 22:10:05 308321 postfix/smtpd[2200]: D224BD4753: client=user-999.cable.mindspring.com[99.99.99.99], sasl_method=LOGIN, sasl_username=info@xxx.com
Oct 25 22:10:06 308321 postfix/cleanup[2207]: D224BD4753: message-id=<7DC3C163CFFC483AB6226F8D3D9969D2@dumbopc>
Oct 25 22:10:06 308321 postfix/qmgr[2168]: D224BD4753: from=<info@xxx.com>, size=1385, nrcpt=1 (queue active)
Oct 25 22:10:06 308321 postfix/smtpd[2200]: disconnect from user-999.cable.mindspring.com[99.99.99.99]
Oct 25 22:10:06 308321 postfix/local[2208]: D224BD4753: to=<systemuser@xxx.com>, orig_to=<info@xxx.com>, relay=local, delay=1.1, delays=0.53/0.02/0/0.51, dsn=2.0.0, status=sent (delivered to mailbox)
Oct 25 22:10:06 308321 postfix/qmgr[2168]: D224BD4753: removed

A: It seems as if you've only defined the virtual domains to accept mail for. You also need to define the accounts.
Do that with the directive virtual_mailbox_maps in main.cf
Read more about it here: http://www.postfix.org/postconf.5.html#virtual_mailbox_maps


text:
Q: Connect VPN server to another VPN server i have two ubuntu 20.04 server with different locations.
i installed OpenVPN in servers and i want connect server 1 to server 2. that's mean when i connect to server 1 by OpenVPN, my IP changes to server 2 IP.
get it ? server 1 get data from server 2 then send to me.
how to do it ?? Thanks.


text:
Q: Measuring a view before rendering it and get a remained space (Android) I'm trying to solve this problem in ages but i can't find a solution:
I need to know how much height a webview with some HTML text in it will take in a LinearLayout, if the space occupied doesen't go over screen size i must add another webview with other HTML text in it. I can't figure out how to do it, i tried to call
measure() but it will give me 0 whatever measurespec i try to use.
Someone knows how to do it?
Thanks in advance.


text:
Q: Getting data from a column only if it contains number or special characters in Oracle I want data from a column only if it contains special characters or numbers.
My query looks as follows:
Select First_name from account where regexp_like(First_name,'[0-9]')

But I don't know how to achieve that special character thing

A: Well you're most of the way there already, just add the special characters you are interested in to the character class you've already defined in the regexp:
Select First_name
  from account
 where regexp_like(First_name,'[0-9@#$_!?*]')

To also select records where First_name is null use one of the two following queries:
Select First_name
  from account
 where regexp_like(First_name,'[0-9@#$_!?*]')
    or First_name is null

or
Select First_name
  from account
 where regexp_like(nvl(First_name,'!'),'[0-9@#$_!?*]')

The first one explicitly selects rows where First_name is null while the second query gets it by substituting a special character string for null strings.

A: How about upside-down approach? Select values that aren't all letters. How? Remove them from the string! Something like this:
SQL> with account (id, first_name) as
  2    (select 1, 'Little'     from dual union all   -- valid
  3     select 2, 'der Leyen'  from dual union all   -- valid
  4     select 3, 'F00t'       from dual union all   -- invalid; two zeros
  5     select 4, 'Sco#tt'     from dual union all   -- invalid; #
  6     select 5, 'Me@SO'      from dual union all   -- invalid; @
  7     select 6, 'What_is_it' from dual union all   -- invalid; _
  8     select 7, '12.345'     from dual union all   -- invalid; digits
  9     select 8, 'Huh? Whoa!' from dual             -- invalid; ?!
 10    )
 11  select id,
 12    first_name,
 13    regexp_replace(first_name, '[[:alpha:] ]', null) repl
 14  from account
 15  where regexp_replace(first_name, '[[:alpha:] ]', null) is not null
 16  order by id;

        ID FIRST_NAME REPL
---------- ---------- ----------
         3 F00t       00
         4 Sco#tt     #
         5 Me@SO      @
         6 What_is_it __
         7 12.345     12.345
         8 Huh? Whoa! ?!

6 rows selected.

SQL>

Column REPL is here to show what's left after replacing letters (and a space) with null; you wouldn't normally display it.


text:
Q: How to create a different product page structure for specific products under a one category? I want to have custom design only for all products which are under a one category. Assume you have category 'A' and it has products 'a','b','c'. I want only to show these 'a,b,c' products in a different structure (design). How to achieve this?

A: Following solution is done by editing the custom layout update section of the relevant category. Edit yourTheme/template/catalog/product/view-recipe.phtml file to obtain the look you want for the products of the specific category.

For anyone who is curious about this. The solution was a lot easier
  than I thought.
I only had to place this piece of code in the custom layout update
  section of the relevant category and i had to set the option 'Apply to
  products' to yes!
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/view-recipe.phtml</template></action></reference>

source : https://stackoverflow.com/questions/9819903/magento-product-view-template-based-on-category

A: This might be the easiest solution possible. Create a new theme and only change the product view page structure in that theme. There's a configuration available in admin panel, which allows you to  assign a theme against a product. See the image below.

Hope this would be useful for anyone searching for this.

A: Your question is not clear. However if you are looking to customize a particular category, then it is very easy to dot that. Magento generates a specific layout handle for each categories. It will name like CATEGORY_{ID}.
So suppose the category id is 22. then create local.xml layout file and put your custom design like this
File : app/design/frontend/<package>/<theme>/layout/local.xml
<layout>
    <CATEGORY_22>
         <!-- custom design comes here -->
    </CATEGORY_22>
</layout>

However if you need custom design for products that comes under a particular category, then there is no easy way to do this as per my knowledge.
One work around is check whether a product belongs to a particular category through an observer. If yes, add a custom layout handle to the layout. Later use this custom layout handle in order to put your custom designs.
So create an observer like this. (Let me call this module as Test_Test)
File : app/code/local/Test/Test/etc/config.xml
<config>
    <frontend>
        <events>
            <controller_action_layout_load_before>
                <observers>
                    <category_product_controller_action_layout_load_before>
                        <class>test_test/observer</class>
                        <method>controllerActionLayoutLoadBefore</method>
                    </category_product_controller_action_layout_load_before>
                </observers>
            </controller_action_layout_load_before>
        </events>
    </frontend>
    <global>
        <models>
            <test_test>
                <class>Test_Test_Model</class>
            </test_test>
        </models>
    </global>
</config>

The event we are observing here is ontroller_action_layout_load_before. This is a general event. So we it is important to do some pre checking before further proceeding. Observer somewhat looks like this.
File : app/code/local/Test/Test/Model/Observer.php
<?php

class Test_Test_Model_Observer
{
    public function controllerActionLayoutLoadBefore(Varien_Event_Observer $observer)
    {
        //replace this with your category id
        $categoyId = 12;

        $event = $observer->getEvent();

        //ensure product view page
        if ($event->getAction()->getFullActionName() == 'catalog_product_view') {
            $product = Mage::registry('current_product');

              //make sure product belongs to required categoy
            if (in_array($categoyId, $product->getCategoryIds())) {

                //adding custom layout handle
                $layout = $event->getLayout();
                $layout->getUpdate()->addHandle('special_category_product_view');
            }

        }

    }
}

Observer will add a custom layout handle special_category_product_view if the product that we viewing belongs to a particular category.Now in your layout XML file (you can associate one for this module and then use it. I recommend this. Or use local.xml), you can use this handle and specify your custom design there

Hope that will help

A: Tried the solutions from here, nothing worked for me (magento 1.9.3.4). Found a much simpler solution:
create a fancy_name.phtml file in your_theme/default/template/page/ (from copy of 1column-product.phtml or something).
Edit fancy_name.phtml until it becomes really fancy.
Go to magento backend, go to your product, go to design -> Custom layout update. Paste the following code and save:
<reference name="root">
    <action method="setTemplate"><template>page/fancy_name.phtml</template></action>
</reference>


text:
Q: ptrace usage in ARM I'm trying to analyse how a third party software is controlling some hardware. The board is i.mx7 based running i.MX Linux kernel 3.14.52.
The board is a development board and is running some demo software which I do not have the code for. Most of the configuration is done via ioctl calls and I've trying to use strace to learn more about information is being set/get.
As an example I get the following from strace:
ioctl(4, FBIOPUT_VSCREENINFO, 0x19fcebc)
I would like in some way to dereference the pointer in the third argument to see the data. I know the structure of the data, and from what I've read, if strace doesn't already know your structure, then you have no luck.
I have also read about writing my own code using ptrace to do something similar, but every single example is not for ARM. The code I've seen uses ORIG_EAX and EAX registers and ARM I believe uses orig_r and r7, but I have no idea how to access the "registers". I'm quite new to programming for Linux.
What's surprising is I can't even easily find anything in exhaustive Googling. Some threads allude to it but I cannot find specifics. I can't be the only person who needs to use ptrace on ARM? Admittedly I might be the only person trying to use it you don't know how!
Failing getting ptrace working, I would be happy just peeking at the memory where the strace indicates the structures are and I could rebuild them manually. How would I go about this?
Thanks for any hints or pointers, I'm really hitting a brick wall.


text:
Q: Repository pattern and shared entities I'm considering using the repository design pattern for data abstraction, I'm using Phalcon PHP framework and using the following structure:
ModelA
    |- Entity
        |- Entity1.php
        |- Entity2.php
        |- Entity3.php
    |- Repository
        |- RepositoryA.php
    |- Service
        |- ServiceA.php

Now if I had to use the same Entity2.php in another ModelB for instance, I would lose the most convenient use of the repository pattern, which is that I can change the data source for Entity2.php only by modifying RepositoryA.php, instead of worrying about who also might have used that entity.
If I didn't allow for direct access to entities, I can't perform joins across multiple repositories.
What is the best approach to handle this issue?

A: From your description, I'm going to assume that ModelA/Repository/RepositoryA.php is a concrete implementation.
If I am understanding your question correctly, you want to also have ModelB/Repository/RepositorA.php, both of which are accessing the same database table(s) to provide the same entity (say, ModelA/Entity/EntityA.php).
One thing you could do is turn both of those RepositoryA classes into interfaces, which you then implement elsewhere with one concrete class, something like this:
ModelA
    |- Entity
        |- Entity1.php
        |- Entity2.php
        |- Entity3.php
    |- Repository
        |- RepositoryA.php (interface, for dealing with ModelA\Entity\Entity1)
    |- Service
        |- ServiceA.php (depends on ModelA\Repository\RepositoryA)
ModelB
    |- Repository
        |- RepositoryB.php (interface, for dealing with ModelA\Entity\Entity1)
    |- Service
        |- ServiceB.php (depends on ModelB\Repository\RepositoryB)
Infrastructure
    |- Repository
        |- ConcreteEntity1Repository (concrete class that implements both RepositoryA and RepositoryB interfaces.  Somehow, an instance of this is passed to both ServiceA and ServiceB (dependancy injection or whatever you like))

This way, you can separate what concrete implementation you are using from your service layer, giving you more flexibility to change things around when you need to. (As an added bonus, this would make it much easier to do things like unit testing your code.)
With this approach, you are effectively using the same repository inside both models, but without creating any coupling between them. Depending on your system architecture, it could be rather complex to set things up this way and it may be overkill for the situation.
An alternative approach could be to not make RepositoryA and RepositoryB an interface, but turn them into concrete classes that delegate their work, either by passing a common "Entity1Repository" to them (and having RepositoryA and RepositoryB wrap the calls they need), or by creating an abstract base class that they both extend which contains any common functionality.
This has the added advantage that you can also add things specific to one model, without it being a part of the other model. (For example, ModelA\Repository\RepositoryA can have a function findRelatedTo(Entity3 $entity3), without forcing ModelB to know what an Entity3 is.)

A: I have a similar requirement with one of my projects. I went with creating a base class that repositories can extend just like one of Jory Geert's solutions. Here's a sample starter project I created using Phalcon 2.0 with Doctrine 2. Implementation is not that clean yet and documentation is still work in progress, but it should give you an idea.


text:
Q: Release build - resultset does not return result but debug version works I currently have the following code which works fine in my debug build
        std::vector<std::string> DB::ReturnResult()
        {
            std::vector<std::string> SymbolList;
            std::string SQL = "SELECT ....";
            prep_stmt = con->prepareStatement(SQL);
            res = prep_stmt->executeQuery();
            while(res->next())
            {
                SymbolList.push_back(res->getString("Column"));
            }
            return SymbolList;
        }

This code works fine in the debug build but the release version does not return any result from the tables.Any suggestions ? I am using VS2010 C++


text:
Q: Why does it return null in my binary search tree, search method I don't know why I am getting null in my method ?
public Node<E> search(int data, Node<E> start){
    Node<E> foundNode = null;

    if(data < start.getData()){
        search(data, start.getLeftNode());
    }

    if(data > start.getData()){
        search(data, start.getRightNode());
    }

    if(data == start.getData()){
        foundNode = start;
    }

    return foundNode;

}

if I put System.out.println(foundNode); before the return statement I get the node but when it returns it I get null!!

A: Here is my method:
private Node search(String name, Node node){
    if(node != null){
        if(node.name().equals(name)){
           return node;
        } else {
            Node foundNode = search(name, node.left);
            if(foundNode == null) {
                foundNode = search(name, node.right);
            }
            return foundNode;
         }
    } else {
        return null;
    }
}

A: You are missing the return statements for the recursive function calls:
search(data,start.getLeftNode()); and search(data, start.getRightNode());
Your method would only work when there are no recursive calls executed and if they are executed still foundNode that is returned remains NULL, since its a local variable.
So, correct code is:
public Node<E> search(int data, Node<E> start){
Node<E> foundNode = null;

if(data < start.getData()){
    return search(data, start.getLeftNode());
}

if(data > start.getData()){
    return search(data, start.getRightNode());
}

if(data == start.getData()){
    foundNode = start;
}
return foundNode;

}


text:
Q: What are the prerequisites to learning Axios? I'm trying to learn axios, because the previous developer on my work is using axios, I'm pretty new to web development, especially back end. I focus more on frontend ( using vue js mostly ) so I'm asking if there is something that I should learn first before learning axios? I'm not familiar in get, post or promise etc. Thank you

A: Knowing enough about basic Javascript, ajax fundamentals, array.map, promises and callback functions will be sufficient.
Ref: https://flaviocopes.com/axios/[https://flaviocopes.com/axios/][1]