text:
Q: lost connection with mx.servername while performing the HELO handshake I am new to administering a mail server so I am at a loss when the mail server can send to certain emails like gmail, telus, and shaw but not other email addresses. Just specific ones I guess. Here is one example in the mail logs:
<info@dockyardsliving.ca>, relay=mx.dockyardsliving.ca[65.254.254.50]:25, delay=67513, delays=67512/0.01/0.35/0, dsn=4.4.2, status=deferred (lost connection with mx.dockyardsliving.ca[65.254.254.50] while performing the HELO handshake)
Here is a look at my main.cf file too:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

readme_directory = no

smtpd_tls_cert_file = /etc/ssl/certs/mailserver.pem
smtpd_tls_key_file = /etc/ssl/private/mailserver.pem
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost, localhost.localdomain, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_tls_security_level = may
smtpd_tls_auth_only = yes
smtpd_recipient_restrictions =  permit_mynetworks
                                permit_sasl_authenticated
                                reject_unauth_destination

Any idea why I can send to some emails but not others? Is there anything that looks out of order?
UPDATE
Ok so I changed
myhostname = mail.website.com

and Restarted the postfix service but I was now unable to receive email so I tried it with myhostname = website.com and still same thing. So I just went back to localhost for now.
UPDATE
So it works now. Checked the logs and the email is getting accepted at the location. Had to add the line below to main.cf
smtp_helo_name = mail.website.com
Thanks

A: Some mail servers are pretty strict about how you greet them, for example they could:
Reject connections where the domain provided at HELO and EHLO has neither an 'A' nor an 'MX' record in DNS
or
Reject the request when the HELO or EHLO hostname is not in fully-qualified domain or address literal form, as required by the RFC
smtp_helo_name defaults to $myhostname (which is in your main.cf set to localhost) so you can try setting it to proper host.example.com

A: The remote server gives 5?? greeting and closes the connection.
Result of "telnet test" from my comp (with IP address masked):
telnet mx.dockyardsliving.ca smtp
Trying 65.254.254.51...
Connected to mx.dockyardsliving.ca.
Escape character is '^]'.
554 impinc04.yourhostingaccount.com NO UCE error: R6.1: aaa.bbb.ccc.ddd is on the Spamhaus blacklist. Please visit: http://www.spamhaus.org
Connection closed by foreign host.

Telnet smtp port on the host yourself to get reason for your host.


text:
Q: Excel file in Python with XLRD I'm looking to load an excel file (xlsx) which is about 35MB and has close to 100k rows of data into a sqlite database for some research. The file has about 40 columns and I might want to selectively load columns into a sqlite DB.
I'm approaching this as a straightforward XLRD and load to Sqlite problem. Is there a better way of doing this - such as using a different module?
And given the volume of data, would the SQLite manager plugin for Firefox be the right utility to view some of the data?

A: I would definitely use pandas for such operations. It has implemented wrappers for many data inputs (including excel). It is based on numpy and features a bunch of statistical methods to apply on your data. You can easily select the columns of your choice, and then directly store them in any database.
Its main data structure is called dataframe.
An example of the code you could use to load, and store data.
import pandas as pd
dataframe = pd.read_excel(YOUR_FILE)
dataframe.to_sql(*args)

A: You could use a python command line tool like this one:
https://pypi.org/project/xlsx2sqlite/
Then once you have your data imported you can view it using sqlitemanager or dbeaver database tools.

redpajama_set_name: RedPajamaStackExchange


text:
Q: AWS S3 file restore - deleted file(Delete Marker) Using AWS SDK Created S3 versioning, Its working fine. And Each file creating unique version id. Using getObject method i can retrieve version id. The same scenario i deleted file, in versioning "Delete Marker" added.

*

*How do i get deleted file version id?

*How do i restore this file using AWS SDK?


text:
Q: Writing a Simple AutoHotkey Script (press a key every X second on desktop) I need to press any useless key (like F11) every 5 minutes or less to keep the windows active (if it became inactive for 5 minutes it will lock-out).
But I need the key to be pressed on the desktop (so it doesn't effect any open windows).
I have tried
Loop
{
   ControlSend, {F11}, WindowsApplication1
   Sleep, 100000
}

but doesn't seem to work.
thanks.

A: Why do you want to send F11 to the desktop?
If it's just to keep your computer awake you can use the following script:
#SingleInstance, force
#Persistent
SetTimer, NoSleep, 30000
Return

NoSleep:
 DllCall( "SetThreadExecutionState", UInt,0x80000003 )
Return

From Microsoft:

SetThreadExecutionState function
  Enables an application to inform the system that it is in use, thereby preventing the system from entering sleep or turning off the display while the application is running.

It is also possible to emulate mouse-action to keep the system from sleeping
(if above script somehow doesn't work for you):
Loop {
    Sleep, 30000
    MouseMove, 1, 0, 1, R  ;Move the mouse one pixel to the right
    MouseMove, -1, 0, 1, R ;Move the mouse back one pixel
}

So there would be no need to emulate actually pressing a key.

A: In previous comment, @Rik proposed an AutoHotkey script. It works, but let me provide a simpler version:
#Persistent ; script will stay running after the auto-execute section (top part of the script) completes
#SingleInstance Force ; Replaces the old instance of this script automatically

; https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-setthreadexecutionstate
; 0x80000002 = ES_CONTINUOUS | ES_DISPLAY_REQUIRED
DllCall("SetThreadExecutionState", UInt, 0x80000002)

This script will make Windows think that there is an application running which shouldn't be interrupted by the screensaver (but you can still lock your screen manually by pressing a default Win+L key combination, for instance). It is the technique which is used by media players in order to prevent your screen from switching off while you are watching a video. This technique works even if there are corporate policies enforced which don't allow you to disable screen locking in Windows options.


text:
Q: Fast switching between two lines in file in vim sometimes I have to switch between 2 lines. To do this, I have to pass line number. Are there shortcuts to moving between 2 last 'visited' list. Something similar to '. (it moves to last edited line)

A: ctrl-o and ctrl-i will move backwards and forwards through your history of jump points.  A jump point is pretty much any command that moves the cursor more than one line.  It will also go back to previous files that were loaded into the current buffer.
See :h jump-motions for more information.

A: You can use bookmarks, something like ma to mark a bookmark named a, and then 'a to go to it. Naming boomarks a and b for example, you can switch between them with 'a and 'b.

A: Double-backtick or double single-quote will do exactly that
There is a command that will bounce to the last location you jumped away from. If repeated, it will then return to the jump destination you were just on. If repeated further it will bounce you back and forth between the two locations.
The command has two forms:
``

or
''


text:
Q: Kotlin: Default value for the argument(s) of generic method Why this is correct and the below one is wrong?
Correct one
fun main () {
    AppModule().provideHttpClient(CIO)
}

Wrong
    fun <T : HttpClientEngineConfig> provideHttpClient(engineFactory: HttpClientEngineFactory<T> = CIO): HttpClient

Type mismatch.
Required:HttpClientEngineFactory
Found: CIO

With CIO being defined as:
public object CIO : HttpClientEngineFactory<CIOEngineConfig> {
    init {
        addToLoader()
    }

    override fun create(block: CIOEngineConfig.() -> Unit): HttpClientEngine =
        CIOEngine(CIOEngineConfig().apply(block))

    override fun toString(): String = "CIO"
}

A: The semantics of a generic method is that "I work with any type", so the type parameters of a generic method is specified by the caller - the caller gets to decide what T is. Therefore, the default value that you specify as the callee must be compatible with HttpClientEngineFactory<T>, for any T that the caller might pass in.
Using CIO doesn't work here, because you are forcing T to be CIOEngineConfig.
Imagine what would happen if the default value of CIO was allowed, and the caller did:
AppModule().provideHttpClient<SomeOtherEngineConfig>()

From the way that provideHttpClient is declared, this should be possible - I'm passing SomeOtherEngineConfig for the generic type parameter T, and since the engineFactory parameter has a default value, I don't need to pass any other parameters. But when this actually gets run, the default value of CIO is used for a parameter of type HttpClientEngineFactory<SomeOtherEngineConfig>!
It's easy to workaround this: simply declare another overload of provideHttpClient that is not generic:
fun provideHttpClient(): HttpClient = provideHttpClient(CIO)


text:
Q: Quick Java inheritance Ok so just practicing questions from my textbook for Christmas finales but I sometimes don't understand what some of the questions want.
I'm a bit lost,does it want me to inherit Email tester class?
Question :
Create a class EmailTester with a main
method which uses the Message class to make a
message and print it.
public class Message{
    String rep;
    String send;
    String mess = "message";

    public Message(String rep,String send){
        rep = "recipient";
        send = "sender";
        mess="";

    }
    public  void append(){
        mess = " "+"blah blah";
    }

    public String toString(){
        mess = "From: Santa Clause\nTo: Rudolf Reindeer\n . . .";
        return mess;
    }
}

--
public class EmailTester {
    public static void main(String[] args){
        //?
    }
}

A: You don't need something so complicated as inheritance. If your course was any good, you should have learned about creating objects first, and inheritance later, because inheritance makes no sense without first understanding creating simple objects!
String output = new Message("foo", "bar").toString();

then print that String.

A: A class should inherit another class only when it shares "is a relationship".

*

*EmailTester is a Message : Does not sound correct

*Suppose if there is an Email class then, Email is a message - sounds correct

So in your case, no need to extend Message class, rather create an instance of Message class and do the needful.

A: Message message = new Message("blah", "blah"):

A: EmailTester with a main method which uses the Message class to make a message and print it.
Clearly it states has a relationship(composition). EmailTester has a Message. No inheritance is required.
Inheritance is applied when you can sense is a relationship. e.g Car and Vehicle.

A: Change your constructor to look like this:
public Message(String recipient, String sender){
        this.recipient = recipient;
        this.sender = sender;
        body = "";
}

The variable names don't matter, but I think they are more intuitive. The main point is that you want each instance of Message to store the values used to construct it.
Then in EmailTester, you do something like this:
Message m = new Message("recipient", "sender");

You will have to ask your professor what it means to "send" a message in this context.
As for inheritance, I have no idea how it applies. Perhaps your instructor is looking to expand things in a future exercise so you have different kinds of messages.


text:
Q: CSS transform doesn't change CSS layout I have a flex layout that shows a long blue line then text after it.

There's no space between me and the blue line

Now I want to rotate the blue line by 90 degrees:

There's now space between me and the blue line.

However, now the text is not flushed with the end of the blue div. It seems it keeps its old width.
How can I make the rotated blue div is flush next to the text? (I've played around with transform-view to no avail.)
(I understand, in this example, I could just change the dimensions of the blue div, but in my actual case I'm using an SVG image, which is obviously a lot harder to change)

A: As Paulie_D pointed out, CSS transforms won't change the layout.
Instead, I altered the element so I didn't need to rotate it.
In my case, this involved rotating an SVG in inkscape, then copying each element to a new file, so no global transformations were used.


text:
Q: xscreensaver screen savers that use 3D graphics take up 100% of a CPU thread and will not close Previously posted on Ask Ubuntu. Removed for irrelevancy:
https://askubuntu.com/questions/886963/process-polyhedra-using-100-cpu-thread?
System:

*

*Linux Mint 17.3 Cinnamon 64-bit

*Kernel 3.19.0-32-generic

*Intel Xeon E3-1231 v3 (4 core, 8 thread)

*NVIDIA GeForce GTX 950 NVIDIA driver 375.26

I noticed my fans getting a little noisy lately and opened the system monitor to find one of the threads of my 8 thread (4 core) CPU under constant 100% load.
I ran top and got the following result:

Polyhedra is the screen saver I've been using for a while but did not have this problem until recently. (Obviously the screen saver itself was not running at the time I took the screenshot. The process continued until I killed it manually in system monitor)
I started scrolling through the screen savers in the settings menu and every time a new xscreensaver screen saver that has 3D graphics was opened in the preview window another CPU thread hit 100% and stayed there until I killed the process:

I recently updated NVIDIA drivers (including CUDA) and had trouble installing them on first try from the update manager. I suspect this might be a source of the problem. Does anyone know?

A: I found this thread while troubleshooting a similar problem in Mint 18.1.  My CPU rarely runs hotter than 33 C.  Yesterday, I discovered that temps had climbed to 41 C after two breaks from work.  I ran 'top,' discovered 99 - 100% CPU usage by xscreensaver polytopes.  Disabling the screensaver fixed the problem.


text:
Q: Autocomplete IE & Firefox Hy,
I need little help.
I use jquery Autocomplete and it only works on Chrome. Any IE or Firefox doesnt show a list.
here is my code:
  $(function() {

$( "#project" ).autocomplete({
  minLength: 0,
  source: "fetch.php",
  focus: function( event, ui ) {
    $( "#project" ).val( ui.item.label );
    return false;
  },
  select: function( event, ui ) {
    $( "#project" ).val( ui.item.label );
    $( "#project-id" ).val( ui.item.value );
    $( "#project-description" ).html( ui.item.desc );
    return false;
  },
})
.autocomplete( "instance" )._renderItem = function( ul, item ) {
  return $( "
" )
    .append( "" + item.label + "
" + item.desc + "" )
    .appendTo( ul );
};

});
I have the #project field in a modal. Is that the problem?
I searched on stackoverflow but nothing helps me.
Thanks!

A: Try the following instead:
$(function() {
$("#project").autocomplete({
        minLength: 0,
        source: "fetch.php",
        focus: function(event, ui) {
            $("#project").val(ui.item.label);
            return false;
        },
        select: function(event, ui) {
            $("#project").val(ui.item.label);
            $("#project-id").val(ui.item.value);
            $("#project-description").html(ui.item.desc);
            return false;
        },
    })
    .data("ui-autocomplete")._renderItem = function(ul, item) {
        return $("
")
            .data("ui-autocomplete-item", item)
            .append("" + item.label + "
" + item.desc + "")
            .appendTo(ul);
    };
});

It looks like the handles have changed in newer versions of jQuery: 1.9 & 1.10
It looks like the sample used here is using the old handles, that no longer work correctly!


text:
Q: comparing field from database with integer in php I pulled usernames and passwords from database, and they match, I can pass the login page. But I want to restrict some access to users, and provide access to admins, i do this with field admin in database. admin is int, and can have values 1 and 0. This code always enters else barnch of  this if ($result == '1').
It is truly annoying, can you provide some clues?
$sql="SELECT admin FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";

$result=mysql_query($sql);

if(mysql_num_rows($result) == 1) {
     $_SESSION['username'] = $_POST['username'];
     if ($result == '1'){
      echo "uspeh admine";
     }else{
      echo "uspeh korisnice";
     }

 }else{
    echo "neuspeh";
 }

A: $result is a the resource for the results. You need to use mysql_fetch_assoc() or similar.
$row = mysql_fetch_assoc($result);
if ($row['admin'] == '1') {
  echo "uspeh admine";
} else {
  echo "uspeh korisnice";
}

A: You need to get an array representation of the query's results:
$row = mysql_fetch_assoc($result);

echo $row['some_key_maybe_id'];


text:
Q: ATG search API changes from 2006.3 to 9.1. i want the API differences so i can show them what we need to change ATG search API changes from 2006.3 to 9.1. i want the API differences so i can show them what we need to change

A: The changes go beyond the API differences. 9.1 Search is quite different from 2006.3 or 2007.1 I'd say there is no simple, short answer to your question that would fit this forum.
See
ATG 9.1 Search documentation: http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/Search9.1/
ATG 2006.3 Search documentation:
http://www.atg.com/repositories/ContentCatalogRepository_en/manuals/Search2006.3/
Both link require ATG.com account.


text:
Q: Not able to open Control Center UI on localhost I am trying to understand confluent kafka and do some hands on with it
Trying to setup on my local machine .
I have followed the instructions in this doc : https://docs.confluent.io/platform/current/quickstart/ce-docker-quickstart.html#cp-quickstart-step-1
I am unable to navigate to Control Center at http://localhost:9021 . I am getting
localhost refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

I have disabled system and chrome firewalls , increased docker memory to 8GB and few suggestions on stackoverflow
Could you please help me to resolve this


text:
Q: Convert a SUMIFS to SUBTOTAL across two tables in Excel I have been creating a home budget file in Excel but have hit a snag in one of my formulas and am hoping someone can help me solve this. I have seen a couple of answers on this forum, but have had no luck in incorporating the answers into my spreadsheet.
I have two tables, on separate Sheets and need to access the values from one table in another table:
Sheet(1) has the table named INCDATA
Sheet(2) has the table named IEINC
Table IEINC has the source (search) criteria to look for in table INCDATA.
I have the following formula that correctly sums the data between the two tables;
=SUMIFS(INDEX(INCDATA,,MATCH(C$10,INCDATA[#Headers],0)),INCDATA[[Details]:[Details]],$B11)

What I am now trying to do is to either add this to, or change this to a "SUBTOTAL" function so that only visible rows are calculated when I filter the dates in table INCDATA
I have tried this formula, but get the wrong result;
=SUBTOTAL(109,INDEX(INCDATA,,MATCH(C$10,INCDATA[#Headers],0)),INCDATA[[Details]:[Details]],$B11)

That formula results in a Total of all Values displayed:
60.00 (Displayed in each row of the search criteria)
But what I am looking to do is add and display the individual search criterias based on the displayed rows when filtered.
Income01  10.00
Income02  20.00
Income03  30.00
Does anyone have any suggestions.

A: Maybe this is what your are looking for.
Change in Subtotal from 109 to 9.
=SUBTOTAL(9, ....

Function of Subtotal:
"Function_num     Required. The number 1-11 or 101-111 that specifies the function to use for the subtotal. 1-11 includes manually-hidden (filtred) rows, while 101-111 excludes them (hidden/filtered rows); filtered-out cells are always excluded."

So converting this formula to take care of filtering it should go from:
=SUMIFS(INDEX(INCDATA,,MATCH(C$10,INCDATA[#Headers],0)),INCDATA[[Details]:[Details]],$B11)

to this, applied in Sheet "Income&Expenses" Cell: H11
=SUMPRODUCT(SUBTOTAL(9, OFFSET('Income(Data)'!$C$5:$C$10,ROW('Income(Data)'!$C$5:C9)-MIN(ROW('Income(Data)'!$C$5:C9)),,1)),--('Income(Data)'!$B$5:B9=$B$11))

So when you apply filter on the sheet "Income(Data)":

It will only sum the applied filters in the "Income&Expenses":


text:
Q: AngularJS - Error: ng:areq - Bad Argument controller is not a function I'm reading the book Angularjs Essentials - http://www.goodreads.com/book/show/23139559-angularjs-essentials
I'm trying to follow the code exmaples.
I have this plunker with the code I have
https://plnkr.co/edit/jFK3ooODMChtXJqO7syf?p=preview
locally in chrome I get the error
    Error: ng:areq
    Bad Argument

    Argument 'parkingCtrl' is not a function, got undefined

I'm sure the problem is syntax in 'angular module' bit at the top of either controller.js, services.js or directive.js
Can anyone see what I'm doing wrong or how the stop this error

A: When you define your service, you had recreated the app again with this syntax angular.module('parking', []) that's why the defined controller is no longer existing after this file loaded. So you can change this to angular.module('parking') as below in services.js file will fix the issue
angular.module('parking').factory("parkingService", function() {
    var _calculateTicket = function (car) {
        var departHour = new Date().getHours();
        var entranceHour = car.entrance.getHours();
        var parkingPeriod = departHour - entranceHour;
        var parkingPrice = parkingPeriod * 10;
        return {
            period: parkingPeriod,
            price: parkingPrice
        };
    };
    return {
        calculateTicket: _calculateTicket
    };
});

A: There are two issues
(i) Change the references as below in plunker
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js"></script>

(ii) No need to have dependencies injected for the service parkingService, change it as
angular.module('parking').factory("parkingService", function() {
}

DEMO


text:
Q: JQuery find and change class of all elements with data attribute I have tried various ways of finding all elements with a specific data attribute to change their class.  Currently I have this, which is not working for the other elements on the same parent div, #search_list_container:
$( '#search_list_container' ).on( 'click', '.favourite', function () {
            $(this).removeClass('favourite');
            $(this).addClass('favourite_selected');
            var fav = $(this).attr( 'data-specimen');
            $("[data-favourite='"+ fav +"']").removeClass('favourite');
            $("[data-favourite='"+ fav +"']").addClass('favourite_selected');

Specifically the lines
$("[data-favourite='"+ fav +"']").removeClass('favourite');
$("[data-favourite='"+ fav +"']").addClass('favourite_selected');

The clicked element changes class OK, but I want the other elements on the the same div (#search_list_container) to also change class.
The HTML is:

The elements on the left aren't changing, but the elements on the right are.  They have the same data attribute.
CSS:
.favourite{
    background: url(../images/favourite_plain.png) no-repeat center;
    width:20px;
    height:17px;
    margin-left:20px;
    cursor:pointer;
    float:left;
}

.favourite_selected{
    background: url(../images/favourite_selected.png) no-repeat center;
    width:20px;
    height:17px;
    margin-left:20px;
    cursor:pointer;
    float:left;
}

A: There are 2 issues with your code.
1: you are selecting a single element using $(this) and then adding  and removing class. This is why only on the clicked element classes are getting updated.
2: You are using the wrong attribute data-favourite to select elements, you need to use data-specimen.

$('#search_list_container' ).on( 'click', '.favourite', function () {
            var fav = $(this).attr( 'data-specimen');
            $("[data-specimen='"+ fav +"']").removeClass('favourite');
            $("[data-specimen='"+ fav +"']").addClass('favourite_selected');
 });

First

Second

A: You don't have a data-favourite attribute in your HTML, if you want to change the class of all data-specimen you should rather use $("[data-specimen='"+ fav +"']") like so :

$('#search_list_container').on('click', '.favourite', function() {
  $(this).removeClass('favourite');
  $(this).addClass('favourite_selected');
  var fav = $(this).attr('data-specimen');
  $("[data-specimen='" + fav + "']").removeClass('favourite');
  $("[data-specimen='" + fav + "']").addClass('favourite_selected');
})
.favourite {
  background-color: yellow;
}

.favourite_selected {
  background-color: green;
}

Test1

Test2

Test3

Test4


text:
Q: Apply style to specific text in a styled paragraph using Docx4j How to apply italic style to a specific text in a styled paragraph using Docx4j?
Let's say a paragraph, as below, has been added to a document and it already has a style.
word1 word2 word3 word4
What I need is to apply italic style to word3 and the general style of the paragraph is not modified, so words word1 word2 and word4 keep as is.
Thanks in advance.

A: Sure, you'll need word3 to be in a run (w:r) of its own, so you can apply run property (w:rPr) of italics (w:i) to it.
So first, you'll need logic to split the run, if necessary.
Then simply apply the formatting.  To see how to do that, create a docx (in Word say), with italics applied. The use the docx4j webapp or Word Helper AddIn to generate applicable code.

A: I was able to achieve it by unmarshalling a text string as below:
p = (P) XmlUtils.unmarshalString(
    "<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">"
    + "<w:pPr><w:pStyle w:val=\"style\"/></w:pPr>"
    + "<w:r><w:t xml:space=\"preserve\">word1 word2 </w:t></w:r>"
    + "<w:r><w:rPr><w:i/></w:rPr><w:t>word3</w:t></w:r>"
    + "<w:r><w:t xml:space=\"preserve\"> word4</w:t></w:r></w:p>");

And adding it to the document.


text:
Q: Error: Opening the cache (E:type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/r-cran.list I'm trying to install R. I tried the instructions from the best answer on a previous post, without success. I'm using ubuntu 16.04.6 LTS 64-bit.
I tried the method but my terminal window seemed to do nothing, even though when I tried to close the window it says there were processes running. I tried it a few times. And now I have an error message in the thin grey tray up top:
An error occurred, please run the package manager from the right-click menu or apt-get in a terminal to see what is wrong.

The error message was:
Error: Opening the cache (E:type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/r-cran.list,
E:The list of sources could not be read.)

This usually means that your installed packages have unmet dependencies.

Starting the package manager (through the notification) didn't do anything, i got this message (image attached):
E: Type 'sudo' is not known on line 1 in source list/etc/apt
sources.list.d/r-cran.list
E: The list of sources could not be read. Go to the repository dialogue to correct the problem.
E:_cache->open()failed, please report.

I don't know how to go to the repository, or how to report. How do I fix this issue?
I also tried the instructions on this link as well, copying the source and pasting into a terminal, which is probably not how to do this, but I don't know how to access the /etc/apt/sources.list file.
@heynnema when I ran the code it says
cat:  /etc/apt/sources.list.d/r-cran.list: No such file or directory
@heynnema the fix didn't work here is the output from terminal:
(gedit:2641): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

** (gedit:2641): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-spell-enabled not supported

** (gedit:2641): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

** (gedit:2641): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-spell-enabled not supported

** (gedit:2641): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

** (gedit:2641): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-position not supported
helwalaura@Galactica:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Executing: /tmp/tmp.L1dGqRuvRD/gpg.1.sh --keyserver
keyserver.ubuntu.com
--recv-keys
E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg: requesting key E084DAB9 from hkp server keyserver.ubuntu.com
gpg: key E084DAB9: public key "Michael Rutter <marutter@gmail.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
helwalaura@Galactica:~$ sudo apt-get update
E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/r-cran.list
E: The list of sources could not be read.
helwalaura@Galactica:~$

@heynemma here is the result from cat /etc/apt/sources.list.d/r-cran.list
helwalaura@Galactica:~$ cat /etc/apt/sources.list.d/r-cran.list
sudo tee /etc/apt/sources.list.d/r-cran.list
sudo cat <<EOF | sudo tee /etc/apt/sources.list.d/r-cran.list
deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/

@heynnema when I deleted the other 2 lines of code, this showed up in terminal window:
(gedit:3157): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

** (gedit:3157): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-spell-enabled not supported

** (gedit:3157): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

** (gedit:3157): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-position not supported

A: To try and pick up the pieces, we'll start from the beginning... this should get you started... use copy/paste with the following lines, as some of them are very long...
Note: Some/all of these "R" packages are in the Ubuntu 19.10 repositories.
In terminal...
sudo -H gedit /etc/apt/sources.list.d/r-cran.list
Add this as the only line in the file...
deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/

Save the file and quit gedit.
In terminal... copy/paste one command at a time into terminal... first command is long...
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get update
sudo apt-get install r-base r-base-dev

Source: How to install R on Ubuntu 16.04 Xenial?
Source: https://cran.r-project.org/bin/linux/ubuntu/README.html
Update #1:
Leftovers... but easy fixes...
sudo -H gedit /etc/apt/sources.list

Go to gedit prefs, and enable line numbering.
Go to the very end of the file (line 52) and you'll probably find a line like this...
deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/

Delete that line. Save the file and quit gedit.
sudo apt-get update
sudo apt-get install r-base r-base-dev

And we should be done!


text:
Q: Where does Steam download apps to on Mac? (What's the save path?) Where does Steam download apps to on Mac? (What's the save path?)
Where is the local content stored?

A: Update about this location from Valve, today. They received obviously many complaints about the Documents folder, so they are changing that soon.

(...) As soon as the feature to help users
  uninstall Steam completely when they
  drag it to the Trash is complete, we
  will be moving the game content folder
  into "~/Library/Application
  Support/Steam".

A: The default is your Documents directory.

A: Move or hide Steam content from Documents


text:
Q: Using batch to verify a process is running with WMIC I am attempting to write a script that will check if a process is running (in my case a virtual machine)
@echo off
wmic process where name="VirtualBox.exe" | find "GitHubEnterprise" /c > tmpcount
set /p count= < tmpcount
echo Number of instances = %count%

So doing this allows me to see whether my instance of GitHub is running or not but it requires that I am able to write the output of find to a file then read it back in and delete the file.  (It should be noted that there are two copies of VirtualBox.exe running at anytime so I am attempting to verify that the GitHubEnterprise instance is running).
What I would like to do is store this count number from the find directly into a variable or use it in some form of an if statement.
Now from my own research on this I've seen many suggestions of using a for loop for this and I have attempted it in the following manner with no success:
@echo off
setlocal enableextensions
for /f "tokens=*" %%a in (
'wmic process where "name='VirtualBox.exe'" ^| find "GitHubEnterprise" /c'
) do (
@set count = %a
)
echo Number of instances = %count%
pause
endlocal

Can anyone see / tell me what I am doing incorrectly here or make a suggestion to do this better.
Thanks everyone, have a great day.
JD

A: Try using SETX,
Set environment variables, SETX can be used to set Environment Variables for the machine (HKLM) or currently logged on user (HKCU):
Set the variable _my_count to '5' in the users environment:

SetX _my_count 5

then read the environment variable later...

IF "%_my_count%" == "" GOTO DOTHIS

another way would to use the registry and the REG command.


text:
Q: Is running with different cores different from running with different thread in OpenMP? To execute a section of a code in parallel using a known number of thread, we usually do this:
#pragma omp parallel num_threads(8)
{}

However, how can we set number of cores instead of thread? Are these different?

A: TL;DR: you cannot directly specify a number of cores in OpenMP preprocessing directives, but you can control how OpenMP threads are mapped on the available cores.
How it works:
Software threads can be dynamically created and destroyed at runtime by applications.
They are mapped on hardware resources like hardware threads and cores that are fixed at runtime for a given platform.
You cannot control cores directly (in user-space), only threads.
In OpenMP you can control the number of threads at runtime using several approaches:

*

*the num_threads clause in preprocessing directives

*the OMP_NUM_THREADS environment variable

*the omp_set_num_threads runtime function

OpenMP abstracts the hardware hierarchy using places. It defines a place as "an  unordered set of implementation-defined hardware unit of a device on which one or more OpenMP threads can execute". In practice, places are usually a set of hardware threads on CPUs. Examples of valid place includes a given hardware socket, three specific cores or one specific hardware thread (multiple places can share the same hardware execution units). Places can be manually set using the OMP_PLACES environment variable.
The mapping/binding of the OpenMP threads to places can be controlled using the environment variable OMP_PROC_BIND, or more recently using the clause proc_bind within preprocessing parallel directives. For example, you can force OpenMP threads to be bound to places, or to be uniformly spread among them.
Example:
If you want to use 4 cores, you can use the following environment:
OMP_PLACES="cores(4)"
OMP_PROC_BIND=close

The OpenMP runtime will arbitrarily select 4 cores of your hardware and execute the threads on it so that the first thread will run on the first core, the second thread on the second core, etc. If there are 8 threads, then each of the 4 core will execute two OpenMP threads (even if you have a processor with 8 cores).


text:
Q: Name node is in safe mode. Not able to leave root# bin/hadoop fs -mkdir t
mkdir: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/root/t. Name node is in safe mode.

not able to create anything in hdfs
I did
root# bin/hadoop fs -safemode leave

But showing
safemode: Unknown command

what is the problem?
Solution: http://unmeshasreeveni.blogspot.com/2014/04/name-node-is-in-safe-mode-how-to-leave.html?m=1

A: If you use Hadoop version 2.6.1 above, while the command works, it complains that its depreciated. I actually could not use the hadoop dfsadmin -safemode leave because I was running Hadoop in a Docker container and that command magically fails when run in the container, so what I did was this. I checked doc and found dfs.safemode.threshold.pct in documentation that says

Specifies the percentage of blocks that should satisfy the minimal
  replication requirement defined by dfs.replication.min. Values less
  than or equal to 0 mean not to wait for any particular percentage of
  blocks before exiting safemode. Values greater than 1 will make safe
  mode permanent.

so I changed the hdfs-site.xml into the following (In older Hadoop versions, apparently you need to do it in hdfs-default.xml:
<configuration>
    <property>
        <name>dfs.safemode.threshold.pct</name>
        <value>0</value>
    </property>
</configuration>

A: Try this
sudo -u hdfs hdfs dfsadmin -safemode leave

check status of safemode
sudo -u hdfs hdfs dfsadmin -safemode get

If it is still in safemode ,then one of the reason would be not enough space in your node, you can check your node disk usage using :
df -h

if root partition is full, delete files or add space in your root partition and retry first step.

A: Namenode enters into safemode when there is shortage of memory. As a result the HDFS becomes readable only. That means one can not create any additional directory or file in the HDFS. To come out of the safemode, the following command is used:
hadoop dfsadmin -safemode leave

If you are using cloudera manager:
go to >>Actions>>Leave Safemode

But it doesn't always solve the problem. The complete solution lies in making some space in the memory. Use the following command to check your memory usage.
free -m

If you are using cloudera, you can also check if the HDFS is showing some signs of bad health. It probably must be showing some memory issue related to the namenode. Allot more memory by following the options available. I am not sure what commands to use for the same if you are not using cloudera manager but there must be a way. Hope it helps! :)

A: try this, it will work
sudo -u hdfs hdfs dfsadmin -safemode leave

A: In order to forcefully let the namenode leave safemode, following command should be executed:
 bin/hadoop dfsadmin -safemode leave

You are getting Unknown command error for your command as -safemode isn't a sub-command for hadoop fs, but it is of hadoop dfsadmin.
Also after the above command, I would suggest you to once run hadoop fsck so that any inconsistencies crept in the hdfs might be sorted out.
Update:
Use hdfs command instead of hadoop command for newer distributions. The hadoop command is being deprecated:
hdfs dfsadmin -safemode leave

hadoop dfsadmin has been deprecated and so is hadoop fs command, all hdfs related tasks are being moved to a separate command hdfs.

A: The Command did not work for me but the following did
hdfs dfsadmin -safemode leave

I used the hdfs command instead of the hadoop command.
Check out http://ask.gopivotal.com/hc/en-us/articles/200933026-HDFS-goes-into-readonly-mode-and-errors-out-with-Name-node-is-in-safe-mode- link too

A: safe mode on means (HDFS is in READ only mode)
safe mode off means (HDFS is in Writeable and readable mode)
In Hadoop 2.6.0, we can check the status of name node with help of the below commands:
TO CHECK THE name node status
$ hdfs dfsadmin -safemode get

TO ENTER IN SAFE MODE:
$ hdfs dfsadmin -safemode enter

TO LEAVE SAFE mode
~$ hdfs dfsadmin -safemode leave

A: Run the command below using the HDFS OS user to disable safe mode:
sudo -u hdfs hadoop dfsadmin -safemode leave

A: use below command to turn off the safe mode
$> hdfs dfsadmin -safemode leave


text:
Q: Characters getting encoded to � I am using php + mysql to make a dynamic page. My db has  "Make which is encoded to �Make in the web page. I though it to be an encoding issue so,I tried using     <html lang='en' dir='ltr'> &  <meta charset="utf-8" />  But that too didn't help

A: When dealing with any charset, it's important that you set everything to the same. You mentioned having set both PHP and HTML headers to UTF-8, which often does the trick, but it's also important that the database-connection, the actual database and it's tables are encoded with UTF-8 as well.
Connection
You also need to specify the charset in the connection itself.

*

*PDO (specified in the object itself):
$handler = new PDO('mysql:host=localhost;dbname=database;charset=utf8', 'username', 'password', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET CHARACTER SET UTF8"));

*MySQLi:  (placed directly after creating the connection)

*

*For OOP: $mysqli->set_charset("utf8");

*For procedural: mysqli_set_charset($mysqli, "utf8");
(where $mysqli is the MySQLi connection)

*MySQL (depricated, you should convert to PDO or MySQLi): (placed directly after creating the connection)
mysql_set_charset("utf8");
Database and tables
Your database and all its tables has to be set to UTF-8. Note that charset is not exactly the same as collation (see this post).
You can do that by running the queries below once for each database and tables (for example in phpMyAdmin)
ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

File-encoding
It might also be needed for the file itself to be UTF-8 encoded. If you're using Notepad++ to write your code, this can be done in the "Format" drop-down on the taskbar (you should use Convert to..., as this won't mess your current file up) - but any decent IDE would have a similar option. You should use UTF-8 w/o BOM (see this StackOverflow question).
Other

*

*It may be that you already have values in your database that are not encoded with UTF-8. Updating them manually could be a pain and could consume a lot of time. Should this be the case, you could use something like ForceUTF8 and loop through your databases, updating the fields with that function.

Should you follow all of the pointers above, chances are your problem will be solved. If not, you can take a look at this StackOverflow post: UTF-8 all the way through.

A: If the � is in your database column itself, change the original character to the following:
http://www.w3schools.com/charsets/ref_html_ansi.asp


text:
Q: Making an Anagram Game I was just wondering if within pygame it was possible to make an anagram game: What I was thinking was making an array with a list of anagrams in it and then when the scene is launched a text line paired with import random would pick a random anagram.
My first question would be with my idea stated above could I set something up so the same anagram won't display twice?
The second question would be how could/ can I integrate an input text box within the game itself and not by using the interpreter?

A: Yes, this is possible.
To answer the first question, "could I set something up so the same anagram won't display twice?":
import random

anagrams = ["here", "is", "an", "example"]
remaining_anagrams = anagrams.copy()

def choose_anagram():
    global remaining_anagrams
    current_anagram = random.choice(remaining_anagrams)
    remaining_anagrams.remove(current_anagram)
    return current_anagram

def reset_anagrams():
    global remaining_anagrams, anagrams
    current_anagrams = anagrams.copy()

If you prefer not to use global you can pass the global variables in as arguments instead.
As far as to create a text input on screen with Pygame I recommend following this guide. Good luck!


text:
Q: React router render component on same page im using react router on my project, when i hit the login button, it renders the content of App component, but displays them on the same page. i want to display on new page when i hit login, help me
import React, { Component } from 'react';
import * as service from '../services/service';
import '../App.css'
import '../index.css'
import App from'../App'
import { Link, Redirect, Router, Route, browserHistory,IndexRoute } from 'react-router';
// import createHistory from 'history/createBrowserHistory'

class Login extends Component {
  constructor(props) {
    super(props);
    this.state = {
      messages: []
    }
  }
  onSubmit() {
    browserHistory.push('/world');
    }
  render() {
    const { messages } = this.state;
    return (

 Doctor Login Page

        <form>

        <Router history={browserHistory}>
        <Route path="/world" component={App}/>
      </Router>

          Username: <input name='email' placeholder='Email' />

          Password: <input name='password' placeholder='Password' type='password' />

          <button onClick={() => this.onSubmit()}>Login</button>
        </form>

    );
  }
}

export default Login;

A: It looks like you want to tackle this in either two ways
1) Use the 'exact path' property from the react-router library
<Route exact path="/world" component={App}/>

2) remove the code below the route and put that into a component itself and declare its own route as your code above has the main router running as well as leaving static JSX below the routers.
<Route exact path="/" component={Login}/>
<Route exact path="/world" component={App}/>

A: Be sure to put the most specific route at the top. React route will scan each route once find a match it will redirect to that route in case you didn't use the 'exact' keyword.
example:

<Route path="/world" component={App}/>
<Route path="/" component={Login}/>

I had this issue before and to reorder of the routes was the solution in case of anyone face this in the future.


text:
Q: How to put combobox Items in a list? I added Items to a combobox using:
SqlDataReader sqlReader = sqlCmd.ExecuteReader();
while (sqlReader.Read())
{
    string name = sqlReader.GetString(0);
    combobox1.Items.Add(name);
}
sqlReader.Close();
conn.Close();

Now I want to put these value in a string list. Is that possible and how can I do that?

A: private List<string> ComboBoxList = new List<string>();

Create this outside of the method you are currently in. This List will allow you to use it in any method within the class.
private List<string> ComboBoxList;

or Try this instead of the top piece of code. They both work.
SqlDataReader sqlReader = sqlCmd.ExecuteReader();
                while (sqlReader.Read())
            {

                string name = sqlReader.GetString(0);
                combobox1.Items.Add(name);
                comboBoxList.Add(name);
            }
            sqlReader.Close();
            conn.Close();
        }

Create a new list and add each name to the list.

A: Simply you can do something like
string[] items = new string[combobox1.Items.Count];

 for(int i = 0; i < combobox1.Items.Count; i++)
   {
       items[i] = combobox1.Items[i].ToString();
   }

Or if want to Create a string list directly from reader object than
var itemList=new List<string>();
SqlDataReader sqlReader = sqlCmd.ExecuteReader();
                while (sqlReader.Read())
                {

                    string name = sqlReader.GetString(0);
                    combobox1.Items.Add(name);
                    itemList.Add(name);
                }
                sqlReader.Close();
                conn.Close();
            }

Use of LINQ will make you job very easier
var arr = combobox1.Items.Cast<Object>()
      .Select(item => item.ToString()).ToArray();

A: I'm sure there's a more elegant method, but this works
List<string> values = this.ComKeyType.Items
                      .Cast<object>()
                      .Select(x => x.ToString().Split('=')[1].Replace(" }", "").Trim())
                      .ToList();

A: You probably want this:
List<String>  cbList = new List<String>();

var lstItems= ComboBox1.Items.Cast<Object>()
          .Select(item => item.ToString()).ToList();

cbList.Add(lstItems);

A: You would really need to separate concerns in your code to make it maintainable.
If you want to bind a list to combobox, you can do it in XAML:
<ComboBox ItemsSource="{Binding MyList}" SelectedItem="{Binding CurrentItem}" />

You'd better make an ObservableCollection property in your view model:
public ObservableCollection<string> MyList {get; private set;}

and initialize it in your view model's constructor:
MyList = new ObservableCollection<string>(GetNames());

GetNames() here is the method where your SQL code is incapsulated:
private List<string> GetNames() {
    var myList = new List<string>();
    SqlDataReader sqlReader = sqlCmd.ExecuteReader();
    while (sqlReader.Read())
        {
            string name = sqlReader.GetString(0);
            myList.Add(name);
        }
    sqlReader.Close();
    conn.Close();

    return myList;
}


text:
Q: Detailed grouping by date windows explorer Now, Windows 10 (and maybe Winodws 8) is showing "A long time ago" instead of "Last Year"... like it was in Windows XP.
I also think there was also "Two Years ago", and only then if there is old enough files and folders it was "A long time ago"...
Actually, I can provide a screenshot:
https://i.stack.imgur.com/9wdBG.jpg
The groups are also more specific and detailed about shorter periods of time.
I use Windows 10 all the time since its arrival, but still I miss the XP file grouping by date.

A: I've never found nor seen a way to modify the grouping categories when using Group by in Explorer.
However, the Libraries (the true Libraries, which are in essence a saved search) have the additonal Arrange by > context menu entries, some of which offer stacks, where the group appears as a single item that can then be viewed like a subfolder. The Arrang by options vary according to the optimization specified in the library's Properties:

Here, I created a Library that refences my Documents folder, but specifies Pictures as the content. Because a Pictures library offers two date-related arrangements: Month (presented in stacks) and Day (groups with headers):

Also, when you select a Month stack, its contents will be grouped by Day:

To the best of my knowledge, this is the best you can do without resorting to 3rd-party software that might offer more options.


text:
Q: Server changes network port being used between PXE boot and the booted OS Whenever I PXE boot a CentOS 6.5 server, I have some grief with the server using different network ports between installation and the booted operating system.
I've seen this with multiple servers now. The behavior is as follows:

*

*I plug a network cable into the first onboard ethernet port (PXE boot fails on any other port).

*I power on the server, press F12, and it begins the PXE boot installation.

*When installation is complete, I reboot the server.

*When the server comes up, networking is dead.

*I unplug the ethernet cable from the onboard port and replug it into the first network card port.

*Networking is alive again.

Is there a way to prevent this port change from happening in the first place, rather than having to do an awkward cable swap or network reconfiguration every time?
I've looked at the BIOS and various CentOS articles online, but my Google-fu has failed me.
EDIT: As requested, here is some additional information.
The PXE boot server mentioned is a Cobbler server. It automates the installation with a kickstart template, and currently only configures the network via DHCP.
Also, the motherboard in use is a SuperMicro H8DGU-F.
The kickstart template is as follows:
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Firewall configuration
firewall --enabled
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config') # This becomes: 'network --bootproto=dhcp --device=eth0 --onboot=on'
# Reboot after installation
reboot

#Root password
rootpw --iscrypted $default_password_crypted
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone  America/Denver
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
autopart

%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')
%end

%packages
$SNIPPET('func_install_if_enabled')
%end

%post
$SNIPPET('log_ks_post')
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET('post_install_kernel_options')
$SNIPPET('post_install_network_config')
$SNIPPET('func_register_if_enabled')
$SNIPPET('download_config_files')
$SNIPPET('koan_environment')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
# Enable post-install boot notification
$SNIPPET('post_anamon')
# Start final steps
$SNIPPET('kickstart_done')
# End final steps
%end

A: Linux probes dedicated network card first here and I wonder if any ways to change this order. Thus on-board port gets name ethX other then eth0.
If you agree to stand It then just use the --device=bootif kickstart network option to configure the PXE boot interface exactly:
network --bootproto=dhcp --device=bootif --onboot=on
Some additional speculations:
It would be also great to assign eth0 name to the boot interface automatically. Providing an option of passing bootif MAC address to kickstart post installation script It would be possible to rewrite UDEV rules accordingly. Unfortunately I currently do not know ways to do It.


text:
Q: PCB Crack Repair When replacing a component on my DJM450 (DJ Mixer) I stupidly cracked a small part of the PCB. Now, in terms of effect for me, it's minimal but very annoying.
I want to repair it, if possible.

Every video, walkthrough, etc I have seen has not addressed the PCB as I understand it in these photos.
So, does anyone have a guide or advice?
Is it worth attempting the repair considering that I have a workaround if I have to?
Most of the videos I have seen have done the work between the "lines". Where as, if I am correct, I would need to repair/ solder the actual copper "lines". Am I mistaken?
--
Edit: For clarity before I close;

*

*It's a DJM-450

*It's only got design/ "lines" on one side of the board (the side you can see)

What I did;

*

*Scraped back the coating on the board

*Soldered the "lines" using small solder (clamped the board and had someone hold a light for me!)

*Did a quick test to ensure it was working

*Using epoxy on the other side, sealed the board

*Tested working again and screwed back in place.

Thank you all.

A: If it's more than a 2-sided board then unless you have a layout of the internal traces, you're probably out of luck.  You can try putting it back together and hope that all there is in the broken area is ground and power planes and that they're not shorted -- it depends on how much you love your mixer, and how much money and effort it'd take to replace it.
What GT Electronics said about drilling the end of the crack to stop it from propagating.
I would do the following:
Mechanically fix the board.  I would do this by scuffing areas of the board that don't have traces, across the crack, and then epoxying some scrap pieces of PCB material across the crack.  This, plus the crack-stop hole will prevent the board from breaking up worse.  Use good epoxy; name brand in your area (good hobby/consumer-grade ones in the US are Devcon, Gorilla, or Bob Smith Industries; actual industrial-grade would be better).
Electrically fix the bad traces.  My inclination would be to scrape the solder mask off of the traces around the crack and patch with wire with diameter about half the width of the trace.  GT Electronics is probably right about using wires that start and end at component holes -- I'd probably still scrape the solder mask, and solder the wire down on top of the trace.  It's probably not at all a concern on that board, but in the event that the traces have high frequency or noise-sensitive signals on them, following the original traces will get you as close as possible to the original designers intent.
Just for personal improvement, review what you did to break the board, and try not to do it again!  I've learned innumerable lessons from innumerable mistakes, but only where I've done so purposely.

A: Look at the copper traces on each side of the board. Find a solder pad that each of the (on each side of the crack) gives access to the trace. Solder some 24 to 28-gauge wires to those pads that essentially bridge across the crack. It looks like 4 traces are impacted on the side you show.  There may be more on the other side. Based on the low quality design and lack of copper flood, I'm guessing it is a two layer board and you have no inner layers to worry about.
Also, drill a 1.5mm hole (1/16" hole) through the crack to stop crack propagation. Ideally at the end of the crack or within 10mm of the end of the crack if components are in the way. See yellow x. Best loactation I can see but you'll have to check other side of the board for any interferences.

A: If by "repair" you mean broken traces then if it's a 2-layer board, get a fiberglass burnishing pen and rub off the solder mask around the breaks in traces so you can solder to reconnect them.
If it's not two layer you are SOL.
If you mean the mechanical crack then glass fabric with with low viscosity composite epoxy resin away from the traces on both sides? But you are liable to functionally mess the board up if the resin runs the wrong way out of the fabric. And the glass might not adhere best to the solder mask which would mean you need to scrape it away in those areas too.
Or buy bare FR4 or G10 which is the same stuff the PCB is made of (glass/epoxy) and cut it into strips and epoxy it into place with regular epoxy away from the traces. You can cut 1/32"/0.8mm and thinner FR4 with scissors.
Splinting the board before repairing traces makes repairing traces easier but only if you don't mess up and get epoxy on the traces or too close to the traces (normal epoxy won't withstand soldering heat). Recommend a tiny clamp on the corner to hold the crack steady so you electrically repair the board first.

A: Existuje elektovodive pero na opravy plošinych spojov masku (to zelené) z plochy môžeš oškrabať aj tenkým plochým skrutkovačom ale opatrne a potom podľa návodu na pere prepojiť poškodené plochy. Po uschnuti odporúčam prelakovať
In English: "There is an electrically conductive pen for repairing the joints mask (the green) from the surface you can scrape with a thin flat screwdriver but carefully and then follow the instructions on the pen to connect the damaged surfaces. After drying, I recommend repainting"


text:
Q: dbt get value from agate.Row to string I want to run a macro in a COPY INTO statement to S3 bucket. Apparently in snowflake I can't do dynamic path. So I'm doing a hacky way to solve this.
{% macro unload_snowflake_to_s3() %}

    {# Get all tables and views from the information schema. #}
    {%- set query -%}
        select concat('COPY INTO @MY_STAGE/year=', year(current_date()), '/my_file FROM (SELECT OBJECT_CONSTRUCT(*) from my_table)');
    {%- endset -%}

    -- {%- set final_query = run_query(query) -%}
    -- {{ dbt_utils.log_info(final_query) }}
    -- {{ dbt_utils.log_info(final_query.rows.values()[0]) }}

    {%- do run_query(final_query.columns.values()[0]) -%}

    -- {% do final_query.print_table() %}

{% endmacro %}

Based on above macros, what I'm trying to do is:

*

*Use CONCAT to add year in the bucket path. Hence, the query becomes a string.

*Use the concatenated query to do run_query()again to actually run the COPY INTO statement.

Output and error I got from dbt log:
09:06:08  09:06:08 + | column                                                                                | data_type |
| ----------------------------------------------------------------------------------------------------------- | --------- |
| COPY INTO @MY_STAGE/year=', year(current_date()), '/my_file FROM (SELECT OBJECT_CONSTRUCT(*) from my_table) | Text      |

09:06:08  09:06:08 + <agate.Row: ('COPY INTO @MY_STAGE/year=2022/my_file FROM (SELECT OBJECT_CONSTRUCT(*) from my_table)')>
09:06:09  Encountered an error while running operation: Database Error
  001003 (42000): SQL compilation error:
  syntax error line 1 at position 0 unexpected '<'.
root@2c50ba8af043:/dbt#

I think the error is that I didn't extract the row and column specifically which is in agate format. How can I convert/extract this to string?

A: You might have better luck with dbt_utils.get_query_results_as_dict.
But you don't need to use your database to construct that path. The jinja context has a run_started_at variable that is a Python datetime object, so you can build your string in jinja, without hitting the database:
{% set yr = run_started_at.strftime("%Y") %}
{% set query = 'COPY INTO @MY_STAGE/year=' ~ yr ~ '/my_file FROM (SELECT OBJECT_CONSTRUCT(*) from my_table)' %}

Finally, depending on how you're calling this macro you probably want to gate this whole thing with an {% if execute %} flag, so dbt doesn't do the COPY when it's parsing your models.

A: You can use dbt_utils.get_query_results_as_dict function to get rid of agate part. Maybe after that your copy statement can work.
{%- set final_query = dbt_utils.get_query_results_as_dict(query) -%}
{{log(final_query ,true)}}
{% for keys,val in final_query.items() %}

    {{log(keys,true)}}
    {{log( val ,true)}}
{% endfor %}

if you run like this you will see ('COPY INTO @MY_STAGE/year=', year(current_date())...') and lastly remove "('')" by
{%- set final_val=val | replace('(', '')| replace(')', '') | replace("'", '') -%}```

That's it.


text:
Q: Ag-grid number filter decimal separator Does the number filter (agNumberColumnFilter) in ag-grid allow choosing a decimal separator?
Currently, it seems that only a dot is allowed (e.g. "1.5") when entering a value in the filter, even if the browser locale uses a comma as the decimal separator ( (1.5).toLocaleString() == "1,5").
So far, I've only found a workaround – replacing NumberFilter.prototype.onFilterChanged to allow a comma.
Is there out-of-the box functionality for selecting the decimal separator? Since ag-grid officially supports internationalisation, support for both dot and comma is a fundamental requirement…


text:
Q: Does the Standard Library have an opposite to unicodedata.decomposition? unicodedata.decomposition sequentially decomposes Unicode characters into its components with the return values being strings of code points separated by space.
E.g
>>> unicodedata.decomposition("á") # 0061 is 'a' and 0301 is the 'acute accent'
'0061 0301'

I'm working with Unicode characters that have multiple diacritics (Vietnamese, e.g. ế, ở) and don't always decompose in the desired order (I need to strip the tone mark, but not the other diacritic mark, if any).
So, I'm looking for a function that can compose characters from code points, e.g.
>>> compose([0x0065, 0x0302]) # 'e', 'circumflex'
'ê'

ADDENDUM: While I know that writing a function that solves my specific problem (Vietnamese) is trivial, I've posted this question in the assumption that the general problem has been solved by someone before me, and it's perhaps somewhere in the standard library.

A: The answer is actually not far from your link in the python doc, it's the function below: unicodedata.normalize
>>> unicodedata.normalize('NFC', '\u0065\u0302')
'ê'


text:
Q: How do I broadcast my opencv camera onto a fake camera? I am trying to use open cv to edit what my camera sees, then run it through zoom. I was thinking that maybe I could make my computer think that there were two cameras, the second being the one that connects through zoom because 2 apps cant use the same camera. How can I do this(I use windows 10)? (with detailed instructions please.)

A: If you want to create a virtual webcam device, you could take a look at https://github.com/radium226/fake-webcam.
To capture it, you could use opencv, which allows image grabbing and some pretty cool modification.


text:
Q: Gamma CDF and inverse CDF not producing compliment values Why isn't the inverse gamma function producing the original x value?
Code
x = 0.2
alpha = 2
u = sp.stats.gamma.cdf(x, alpha)
x1 = sp.stats.invgamma.cdf(x, alpha)
print "x: ", x
print "G: ", u
print "GInv:", x1

Output
x:  0.2
G:  0.0175230963064
GInv: 0.0404276819945

When I perform a similar operation in Excel I get the same value back.
=GAMMADIST(Q15,2,1,TRUE)
=GAMMA.INV(Q16,2,1)

Output
0.2
0.017523096
0.2

I know I'm just overlooking something, but I can't seem to figure out why the inverse isn't working for me.

A: In scipy.stats, gamma is the gamma distribution and invgamma is the inverse gamma distribution.  These are two different probability distributions--see the wikipedia article for the relation of the inverse gamma to the gamma distribution.
If you want the inverse of gamma.cdf, use gamma.ppf.  (The acronym ppf stands for percent point function, which is another name for the quantile function.)
For example,
In [7]: p = gamma.cdf([1, 2, 3], 0.5)

In [8]: gamma.ppf(p, 0.5)
Out[8]: array([ 1.,  2.,  3.])