text:
Q: Unsafe member access on an `any` value, for a typed object Hitting a TypeScript error I can't figure out
I have a DateRange model defined as
export interface DateRange {
  from: { year: number, month: number, day: number },
  to: { year: number, month: number, day: number }
}

and then I have a method which takes in one as a parameter
dateRangeSelected(value: DateRange)

Then my intellisense works properly as a type value dot from dot year it all shows up as expected, but I'm getting a lint error when access its members

value.from.year

results in an error that

Unsafe member access .from on an any value

*

*How can I resolve this error, where might my typing issue be...

Per suggestion below I tested and found that when defining interface from the same component instead of exporting it works...
Could it be my import statement?
import DateRangePicker, { DateRange } from
    '../components/DateRangePicker.vue';

The component has a default export for its component
export default MyComponent { ... }
export interface DateRange { ... }


text:
Q: UIButton label detect tap on specific text I have the following UIButton to render a checkbox and label;

To create this, I used a UIButton control with an NSMutableAttributedString to give "Terms & Conditions" a different style to the rest of the text.
Just like with a checkbox on a web page, I want the user to be able to tap either the grey text or the image itself to toggle the checkbox on or off.
But if the user clicks "Terms & Conditions" I want that to perform an action (e.g. load a terms URL).
This is really easy to do in Android as you can use checkbox.setMovementMethod(LinkMovementMethod.getInstance());, but in iOS I'm really struggling to find a way to basically create a checkbox with a label that contains a link.
Has anyone ever done this before and how did you approach?

A: I ended up doing the following;
Created a UIButton (empty text label) for my actual checkbox and a UITextView for my adjacent checkbox label text.
I then used NSMutableAttributedString like so;
class MyViewController: UIViewController, UITextViewDelegate {

    override func viewDidLoad() {
        let attributedTermsTitle = NSMutableAttributedString()
        attributedTermsTitle.append(NSAttributedString(string: "I have read and accept the ", attributes: [NSFontAttributeName:UIFont(name: "My-Font", size: 14)!]))
        attributedTermsTitle.append(NSAttributedString(string: "Terms & Conditions", attributes: [NSFontAttributeName:UIFont(name: "My-Font", size: 14)!, NSLinkAttributeName: "terms"]))

        termsText.linkTextAttributes = [NSForegroundColorAttributeName: UIColor.blue]
        termsText.attributedText = attributedTermsTitle

        termsText.delegate = self
        termsText.isSelectable = true
        termsText.isUserInteractionEnabled = true
        termsText.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(MyViewController.toggleCheckbox)))
    }

    func toggleCheckbox(sender: UITapGestureRecognizer) {
        termsButton.isChecked = !termsButton.isChecked
    }

    func textView(_ textView: UITextView, shouldInteractWith URL: URL, in characterRange: NSRange) -> Bool {

        let link = URL.absoluteString
        if(link == "terms") {
             // link to the Terms web page / screen
        }

        return false
    }

}

and for the UIButton, gave the class;
class CheckBox: UIButton {
    let checkedImage = UIImage(named: "checkbox_on")! as UIImage
    let uncheckedImage = UIImage(named: "checkbox_off")! as UIImage

    var isChecked: Bool = false {
        didSet{
            if isChecked == true {
                self.setImage(checkedImage, for: UIControlState.normal)
            } else {
                self.setImage(uncheckedImage, for: UIControlState.normal)
            }
        }
    }

    override func awakeFromNib() {
        self.addTarget(self, action:#selector(buttonClicked(sender:)), for: UIControlEvents.touchUpInside)
        self.isChecked = false
    }

    func buttonClicked(sender: UIButton) {
        if sender == self {
            isChecked = !isChecked
        }
    }
}

End result is that both the UIButton and the non-linked text of the UITextView will toggle the checkbox on and off.  The "Terms & Conditions" text will link to the website or segue somewhere else.
Hopefully this helps someone else out.

A: You can use TTTAttributedLabel to make a particular part or word tappable in a UILabel.
For example
label.text = @"Fork me on GitHub!"; // Repository URL will be automatically detected and linked
NSRange range = [label.text rangeOfString:@"me"];
[label addLinkToURL:[NSURL URLWithString:@"meUrl"] withRange:range];

Here me becomes tappable and on tapping that word delegate method didSelectLinkWithURL gets called and you can check for that link inside that function
(void)attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url {
    NSLog(@"link %@", [url absoluteString]);
   if ([url absoluteString] == @"meUrl") {
   //implement your logic here
   }
    NSLog(@"whole label %@", label);
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Counting number of strings in a List with Python I have a list in my hand and I want to create vocabulary from this list. Then, I want to show each word and count the same strings in this list.
The sample list as below.
    new_list = ['one', 'thus', 'once', 'one', 'count', 'once', 'this', 'thus']

First, I created a vocabulary with below.
    vocabulary = []
        for i in range (0, len(new_list)):
            if new_list[i] not in vocabulary:
                vocabulary.append(new_list[i])`
    print vocabulary

The output of above code is: "count, once, one, this, thus."
I want to show the number of each words in the list as below. [count][1], [once][2], [one][2], [this][1], [thus][2].
In order to get above result; I try below code.
    matris = []

    for i in range(0,len(new_list)):
        temp = []
        temp.insert(0,new_list.count(new_list[i]))
        matris.append(temp)

    for x in matris:
        print x

Above code only gives the number of words. Can someone advise me how can I print the word name and number of the words together such as in [once][2] format.

A: Use a Counter dict to get the word count then just iterate over the .items:
from collections import Counter

new_list = ['one', 'thus', 'once', 'one', 'count', 'once', 'this', 'thus']

cn = Counter(new_list)
for k,v in cn.items():
    print("{} appears  {} time(s)".format(k,v))

If you want that particular output you can wrap the elements in the str.format:
for k,v in cn.items():
    print("[{}][{}]".format(k,v))

[thus][2]
[count][1]
[one][2]
[once][2]
[this][1]

To get the output from highest count to lowest use .most_common:
cn = Counter(new_list)
for k,v in cn.most_common():
    print("[{}][{}]".format(k,v))

Output:
[once][2]
[thus][2]
[one][2]
[count][1]
[this][1]

If you want the data alphabetically from lowest to highest and from highest to lowest for the count you need to pass a key -x[1] to sorted to negate the count sorting the count from highest to lowest:
for k, v in sorted(cn.items(), key=lambda x: (-x[1],x[0])):
    print("[{}][{}]".format(k, v))

Output:
[once][2]
[one][2]
[thus][2]
[count][1]
[this][1]

A: new_list = ['one', 'thus', 'once', 'one', 'count', 'once', 'this', 'thus']
vocabulary = list(dict.fromkeys(new_list))
print(*vocabulary, sep = "\n")

OUTPUT:
one
thus
once
count
this

#######################
matris= ["["+str(item)+"]"+"["+str(new_list.count(item))+"]" for item in
new_list]
print(*list(dict.fromkeys(matris)), sep = "\n")

OUTPUT:
[one][2]
[thus][2]
[once][2]
[count][1]
[this][1]


text:
Q: Geometric Significance of some features of the Exterior Algebra I've been tinkering with differential forms for a while now, and I've had a few questions all rolled into one trying to understand them. The exterior derivative is quite natural to me - it looks just like a regular old derivative, and so I believe I have a good intuition about how it works.
The first question that struck me was that I did not have a similar intuition about the interior derivative. I wanted to know in what sense it was a derivative, if any, and either way I wanted to get an idea of what this guy really does. A geometric interpretation would have been ideal. At one point I was thinking about tensor contractions and how that's kind of like a trace, but that's not really what the interior derivative is anyway, so I ended up putting that aside for a while.
But I noticed something interesting that has given me renewed interest in the question when I learned about Hodge duality.
We will work in $\mathbb R^3$ with the usual coordinates. Consider an arbitrary $1-$form which we'll write down as $F_x dx + F_y dy + F_z dz$. We'll compute the exterior derivative of this, and we end up with $$ \bigg ( \frac{\partial F_x}{\partial y} - \frac{\partial F_y}{\partial x} \bigg ) dx \wedge dy + \bigg ( \frac{\partial F_x}{\partial z} - \frac{\partial F_z}{\partial x} \bigg ) dz \wedge dx + \bigg ( \frac{\partial F_y}{\partial z} - \frac{\partial F_z}{\partial y} \bigg ) dy \wedge dz $$
Amazingly (at least to me), this is the Hodge dual of the curl!
Now, we can do a similar computation using $d(i_X)$. If we let $X = \alpha \frac{\partial }{\partial x} + \beta \frac{\partial}{\partial y} + \gamma \frac{\partial}{\partial z}$. $X$ is a vector field so these could be functions of $x,y,z$, it doesn't really matter. Now if we let $\omega$ denote the $3-$form, $dx \wedge dy \wedge dz$. We can now compute.
The computation is a little laborious to do directly from the definition, but there's a nice little formula which we can use to shortcut the computation. What we end up with is $$ \alpha dy \wedge dz + \beta dz\wedge dx + \gamma dy \wedge dz$$
after a few little rearrangements. Now we take the exterior derivative of this, and we have $$\bigg (\frac{\partial \alpha}{\partial x} + \frac{\partial \beta}{\partial y} + \frac{\partial \gamma}{\partial z} \bigg ) (dx \wedge dy \wedge dz) $$And again in a way that totally amazes me, this is Hodge dual of the divergence of $X$!
Now this motivates the question: What is the geometric significance Hodge duality? If there was some nice way to think about what the Hodge dual of something is, it would help me to understand the interior derivative, maybe.
There is a problem though, which makes me worry that all of this is just coincedence of some sort - the above analysis depends on the fact that the Hodge dual on a 3-manifold takes 1-forms to 2-forms, which is how we able to see what's going on with the curl. In particular, curl is not even defined in dimensions different from 3. Divergence is defined in general though, so that much is a welcome sign.
So somehow, I want to say that what I have learned will give me an avenue to understanding interior derivatives, and exterior derivatives better, but I don't know how to interpret Hodge duality, and I have these concerns.
In Summary: How is the interior derivative a derivative, geometrically? What is the geometric content of Hodge duality? Can I put these together to understand interior and exterior derivatives?

A:
How is the interior derivative a derivative?

I wouldn't say it is. My background is in Clifford algebra, and that discipline's equivalent of this operation is universally referred to as a product operation, not a derivative operation.

What is the geometric content of Hodge duality?

Short version: you're finding the orthogonal complement of whatever you're dualizing.
Longer version: That orthogonal complement picture doesn't generalize to non-simple forms (i.e. forms that cannot be factored into wedge products of vectors). Only simple forms correspond to subspaces.

Can I put these together to understand interior and exterior derivatives?

Perhaps, but not in the way I think you want.
I think what you really want is the codifferential $\delta$, such that $\delta \omega = \star d \star \omega$ up to a minus sign.
The interior derivative is really more of a dual analogue to the wedge product.  Let $\chi$ be the 1-form corresponding to a vector field $X$ under some symmetric bilinear form $g$ that determines the Hodge dual operation $\star$.  Then $\iota_X \omega = \star^{-1} (\chi \wedge (\star \omega))$.


text:
Q: Defining a long string with javascript I have a simple problem that I just can't seem to figure out.  In the code below I get an error (test_str is not defined) because the line defining "var str=" is spread across two lines.  After the word "fox" there is a CR LF and I guess my javascript engine in my browser thinks I want a new statement there.  Now of course in this example I can simply get rid of the carriage return and put it all on one line to fix it.  But my real intent is for a much longer string in some production code which I don't really want to mess with deleting all those CR LF's.

    Test String

A: Just put a \ at the end of each line still in the string
str = "  The quick brown \  // <---
fox jumped over the log.";

A: Easiest thing to do is to add a \ at the end of the lines:
function test_str() {
  str = "  The quick brown \
  fox jumped over the log.";
  alert(str);
}

jsFiddle example

A: Use \r\n in your string to represent CR LF :
str = "The quick brown\r\nfox jumped over the log.";

A: Try this:
str = " the quick brown fox\r\n" +
  "fox jumped over the lazy dog";

A: String literals can't span multiple lines in JavaScript. You'll need to either explicitly continue each line onto the next:
var foo = "The quick brown fox\
 jumped over the lazy\
 dog";

Or concatenate string literals:
var foo = "The quick brown fox " +
          "jumped over the lazy " +
          "dog";

I personally prefer the latter, as you'll be able to indent it more reasonably without as much regard to whitespace within the string, since
var foo = "asdf \
           bar";

would result in a string like "asdf           bar".

A: Try escaping the newline literal,
str = "  The quick brown \
      fox jumped over the log.";

A: Another way to define multi line strings is to use an Array and join them. This allows you to easily define a new line character (\n\r) for each line assuming you store lines by Array index ("" for no character seperation between lines). For instance below will create the following string:

The quick brown
  fox jumped over the log.

str = ["  The quick brown ",
  "fox jumped over the log."].join("\n\r");//each line should be a new line


text:
Q: Unwanted property sharing in Kivy My code dynamically sizes the widgets before putting them in a parent view. The width is simply calculated as an integer for each widget and independently assigned. The problem is that when a larger widget appears, all the previous ones size exactly the same, even though they are already placed and untouched.
I turned on a debugger to investigate. Turns out the width of each widget is placed in one place in the memory. So they all are practically the same and changing it for one widget causes others to change appropriately. Here is a dirty app that represents an issue:
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
from kivy.uix.label import Label
from kivy.uix.widget import Widget
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.scrollview import ScrollView
from kivy.uix.gridlayout import GridLayout

Builder.load_string('''
<ScrollView>:
    canvas:
        Color:
            rgba: 1, 1, 1, 1
        Rectangle:
            pos: self.pos
            size: self.size

<Message>:
    x: 5
    width: 500
    canvas:
        Color:
            rgba: 1,0,0,1
        Rectangle:
            pos: self.pos
            size: self.size
    BoxLayout:
        pos: root.pos
        height: self.height
        canvas:
            Color:
                rgba: 1,1,1,1
            RoundedRectangle:
                pos: root.x, root.y
                size: self.width, self.height

        TextInput:
            pos: root.pos
            size: root.size
            id: msg
            background_color: 0, 0, 0, 0
''')

class Chat(Screen):
    pass

class Message(Widget):
    pass

class ChatApp(App):
    def width_modify(self):
        min_width = 160
        max_width = 320
        max_line = 0
        for i in self.msg_stack[-1].ids['msg']._lines_labels:
            if i.width > max_line:
                max_line = i.width
        curr_width = max_line + 15
        return curr_width

    def msg_in(self, btn):
        msg_stack = self.msg_stack
        msg = self.tx1_main.text.strip("\n ")
        msg_stack.append(Message())
        msg_stack[-1].ids['msg'].text = msg

        msg_stack[-1].size_hint = [None, None]
        msg_stack[-1].width = self.width_modify()
        msg_stack[-1].height = (len(msg_stack[-1].ids['msg']._lines_labels) + 1) * (msg_stack[-1].ids['msg'].line_height)
        for i in msg_stack[-1].walk():
            i.height = msg_stack[-1].height
            i.width = msg_stack[-1].width

        msg_stack[-1].y = self.sv1_main.height - 5 - self.pr_msg_y - msg_stack[-1].height

        self.msg_layout.add_widget(msg_stack[-1])
        self.pr_msg_y += msg_stack[-1].height + 5

    def build(self):
        self.msg_stack = []
        self.pr_msg_y = 5

        self.chat = Chat()
        self.tx1_main = TextInput(size_hint = (0.9, 0.155))
        self.sv1_main = ScrollView(pos_hint = {"top":0.87, "center_x":0.5},
                                   size_hint = (0.97, 0.65))
        self.msg_layout = GridLayout(height = 10, cols = 1, size_hint_y = None)
        self.msg_layout.bind(minimum_height = self.msg_layout.setter('height'))

        self.bt1_main = Button(size_hint = (0.061, 0.078),
                               pos_hint = {"top":0.097, "center_x":0.951},
                               on_press = self.msg_in)

        self.chat.add_widget(self.tx1_main)
        self.chat.add_widget(self.sv1_main)
        self.sv1_main.add_widget(self.msg_layout)
        self.chat.add_widget(self.bt1_main)
        return self.chat

ChatApp().run()

I suspect the problem might be in the kv definition of the Message widget, particularly this line width: 500. It is some property I've put for testing purposes and now removing it causes my sizing to break. Also, commenting it out doesn't really seem to solve anything. So what can I do?
This is a link to demonstrate the problem. The red corners shouldn't extend

A: Upgrading to the latest development version of Kivy (v1.9.2-dev0) seems to fix the problem


text:
Q: How do I read this "install Script"? SpotifyController Spotify Controller.
I downloaded the files from the Ubuntu link provided in the aforementioned. Within was an instillation file with instructions, but i have no idea how to read it! Yes, I'm a complete  newbie. Thanks for the help in advance!
This is what the "install" file contains ....
#!/bin/bash

echo
echo
echo Installing Spotify Controller Server...
sleep 1
echo
echo This installation file has been created for Ubuntu. If you are not using that distribution, installation might not work, but it should be pretty straightforward to modify the script to work for your distribution.
echo This program requires Spotify and Java. Press enter to continue...
read inputline
echo

echo Proceeding with installation. Creating application shortcut...
sleep 1
echo "/usr/bin/KillSpotifyController -silent" > SpotifyController
echo "echo Starting Spotify Controller..." >> SpotifyController
echo "cd '$PWD'" >> SpotifyController
echo "sh SpotifyController.sh" >> SpotifyController
chmod +x SpotifyController
sudo mv SpotifyController /usr/bin/
sudo cp -f resources/KillSpotifyController /usr/bin/
sudo cp -f resources/icon.png /usr/share/pixmaps/spotifycontroller.png
sudo cp -f resources/icon_stop.png /usr/share/pixmaps/spotifycontroller_stop.png

cp -f resources/SpotifyController.desktop $HOME/Desktop/
sudo cp -f resources/SpotifyController.desktop /usr/share/applications/

echo
echo Program is now installed. Simply run \"Spotify Controller\" from your desktop, or type \"SpotifyController\" to start the server. Make sure you have Spotify up and running with songs in the play queue.
sleep 1
echo
echo "To automatically start Spotify Controller Server when computer boots, add the application to System -> Preferences -> Startup Applications".
sleep 1
echo
echo "Don't forget to install the Spotify Controller app from Play Store."
sleep 1
echo
echo If you experience any problems, see the file \"TROUBLESHOOTING\".
sleep 1
echo
echo "Happy Listening!"

A: First, let's go the way that I think it was meant to be used:
Open a terminal (CTRL+ALT+T), and type this in:
cd PATH/TO/SPOTIFY # Edit PATH/TO/SPOTIFY to the path that spotify was extracted
bash ./install

It should work fine.

But if you want to read the script itself, here's a quick tutorial, or rather, a lot of bullets about it :P (based on the script you showed):

*

*Lines starting with # are (usually) comments. Also, usually, when you see # in the middle of the line, the rest of the line will be considered a comment. What's a comment? It's stuff that doesn't get executed (very useful for indicating what is going on, in a human-friendly way, hence the name "comment").

*Lines starting with echo print text. For example:
echo testing 1 2 3

will print:
testing 1 2 3

*When you see a line like this:
echo "testing 1 2 3" > FILE

what will happen is that testing 1 2 3 will be written to FILE. Notice that if FILE does not exist, it will be created, and if FILE has contents in it, it will be overridden. That's why sometimes you see this instead:
echo "testing 1 2 3" >> FILE

Which will then append testing 1 2 3 to FILE (due to >> instead of >)

*When you see sleep at the beginning of a line, it will make the computer pause for n seconds, with n being the number after sleep (e.g. sleep 1 will wait for one second)

*read will get input from you (you will enter text, and then when you press ENTER, it will get sent to the program). How does the program read this? With the argument next to it. So read test will ask you to enter text, and once you're done, it will set the value of the variable test to the text you entered.

*To access a variable, prepend $ to the name of the variable. BASH will automatically replace the variable with its contents. Check this example out:
 test="hello world"
 echo $test # Will show hello world
            # BASH will interpret this as:
            # echo "hello world"

*To assign a value to a variable, write a command in this format: variable=value. Notice that there are no spaces between =, variable, and value.

*chmod changes the access rights of a file. I won't go into detail about this (though there are some tutorials about this:  http://www.analysisandsolutions.com/code/chmod.htm, http://catcode.com/teachmod/, and http://www.perlfect.com/articles/chmod.shtml), but in the example you mentioned, it shows:
chmod +x SpotifyController

That will add execute permissions to SpotifyController, meaning that you can run it as an application

*sudo allows you to run commands as root (think administrator, if you're used to windows). Notice that it (usually) needs your password to run (for security reasons), but don't be alarmed if it doesn't ask each time. Most of the time, after entering your password once, it will wait for 15 minutes before asking for your password again (but, of course, it will only ask if you run sudo after the 15 minutes)

*mv moves a file from one place to another. If it stays in the same place, but you change the name of the new file, it acts as a renaming tool

*cp copies a file from one place to another. The -f switch forces it to, and -r copies it recursively (needed if you're copying a directory)

*PWD is a special variable that holds the current working directory (which can be set by cd)

*If you're wondering about the \"'s, you can check out BASH escaping tutorials: http://tldp.org/LDP/abs/html/escapingsection.html, http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_03.html.
And, of course, if you want to learn more about BASH, check out these tutorials (but feel free to google around also, of course =):
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/
http://www.hypexr.org/bash_tutorial.php (less about scripting, and more about how to use the shell)
http://linuxconfig.org/bash-scripting-tutorial
Hope this helps!


text:
Q: How to check if HTML5 FileSystemDirectoryHandle points to an existing directory Lets say I am building an IDE and want to have an option to open recently used folders which also persists after a page refresh. References to FileSystemDirectoryHandle-s, obtained by showDirectoryPicker() are stored in an indexeddb, but real filesystem directory might have been deleted (at some point in time after referencing). What is the proper API to check if it points to an existing directory?
I was thinking of using getDirectoryHandle but I do not have parent reference, nor does it accept empty name argument.
I can try-catch for await (const entry of directory.values()), but this has some downsides (requires permissions granted, consider page refresh) and for that reason its not convinient ux to run through a list of handles (multiple confirms). I wonder if there is something more appropriate.
For the moment I am using
async getError(handle:FileSystemDirectoryHandle) {
    if(await handle.queryPermission({mode:"readwrite"}) !== 'granted'
        && await handle.requestPermission({mode:"readwrite"}) !== 'granted')
        return ERROR_NO_PERMISSION;

    try {
        for await (const _ of handle.values())
            return;
        return;
    } catch(error) {
        return error instanceof DOMException && error.code == DOMException.NOT_FOUND_ERR
            ? ERROR_DOES_NOT_EXIST
            : ERROR_UNKNOWN;
    }
}


text:
Q: Asus HD 7750 - The VGA card is not supported by UEFI driver. I installed windows 8 on my pc with uefi enabled.
After installing it when i am turning off the CMS and enabling secure boot, i am getting this message.
"The VGA card is not supported by UEFI driver."

A: The GPU must support the new Video Protocol from which is called Graphics Output Protocol (GOP). Disable the fastBoot option in the UEFI firmware to fix it. Now the old VGA loading is enabled.


text:
Q: Render multitype link field via fluid - TYPO3 What is the best way to render link field in TYPO3 fluid template?
Link field is defined via flexform as:
<field_link type="array">
  <TCEforms type="array">
    <config type="array">
      <type>input</type>
      <eval>trim</eval>
      <wizards type="array">
        <link type="array">
        <type>popup</type>
        <title>Link</title>
        <icon>link_popup.gif</icon>

        <params type="array">
          <blindLinkOptions>file,spec,email,folder</blindLinkOptions>
        </params>
        <JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
        </link>
      </wizards>
    </config>
    link
  </TCEforms>
</field_link>

Fluid comes with viewhelpers such as link.email, link.external, link.page but my link field could be either page id or external link or email or link to sys_file record. How do you handle that in your projects without making multiple if statemens in fluid template? (custom viewhelper?, typoscript object)?

A: You can also use the f:link.page to generate links external urls or files, that does not matter as internally typolink is used.
If you are using the wizards like in your example, you should use the f:link.typolink viewhelper which supports all attributes.

A: Link for email works perfect
here my flexform:
<settings.link>
    <TCEforms>
        Link
        <config>
            <type>input</type>
            <size>30</size>
            <eval>trim</eval>
            <softref>typolink,typolink_tag,images,url</softref>
            <wizards>
                <_PADDING>2</_PADDING>
                <link>
                    <type>popup</type>
                    <title>Link</title>
                    <module>
                        <name>wizard_element_browser</name>
                        <urlParameters>
                            <mode>wizard</mode>
                        </urlParameters>
                    </module>
                    <icon>link_popup.gif</icon>

                    <params>
                        <blindLinkOptions>file,folder,url,spec</blindLinkOptions>
                    </params>
                    <JSopenParams>height=500,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
                </link>
            </wizards>
        </config>
    </TCEforms>
</settings.link>

Output:
Liunk


text:
Q: How do I calculate the distance between one atom to another in a cooper conductor? Regarding the atomic model which  free electrons are moving from one atom to another, I want to estimate the distance between those atoms

A: Electrons don't matter in this case - this is only about the nuclei. So, you know how many atoms a given mass of some material contains, right? That's simply the atomic weight and Avogadro's number. Now, instead of calculating absolute numbers for a given mass, you can use the density, which gives you number of atoms per unit volume. Take the cube root of that volume and you know the average distance between atoms in your material.


text:
Q: Does Ubuntu for Phones nativly support SIP I've just received my brand new Ubuntu phone from Meizu.
Does anyone know if the phone supports SIP nativly, for caller and text app?

A: As far as I can figure out (having spent several years of looking), no it does not (shame).
I think there would be demand for it, and as there are Javascript SIP libraries, I do not think it would be too difficult, but I have not yet been able to find even an installable app for it. Not having any experience programming SIP apps, I would not know where to start, but if someone wants to help, maybe there will be soon!


text:
Q: git commit --author doesn't work when global not set working on a lab machine which has a shared login.  don't want to set global git config parameters.
git commit --author="username <email>"

This used to work on older git versions. now it produces this error:
*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'blah@blah.(none)')

Any thoughts?

A: First, With Git 2.29 (Q4 2020), the error message is clearer.
See commit 9ed104e (21 Aug 2020) by Junio C Hamano (gitster).
(Merged by Junio C Hamano -- gitster -- in commit e9bd00a, 31 Aug 2020)

ident: say whose identity is missing when giving user.name hint

If user.name and user.email have not been configured and the user invokes:
git commit --author=...

without specifying the committer identity, then Git errors out with a message asking the user to configure user.name and user.email but doesn't tell the user which attribution was missing.
This can be confusing for a user new to Git who isn't aware of the distinction between user, author, and committer.
Give such users a bit more help by extending the error message to also say which attribution is expected.

The error message will clearly state:
Author identity unknown
# or
Committer identity unknown

Second, from OP's comment:

Other people use the machine and the same repo. I guess I could set up the git config and then remove the configuration when I'm done

You can wrap the git command and forcing each used to identify themselves (once per shell session).
See "Best pracitces for multi-developer Git for single user application" and my project VonC/gitw.

A: Another solution is, to set the identity just for one run of git commit and make use of the -c option of git.
git -c user.name="Your Name" -c user.email="you@example.com" commit -m "message"

My scenario is to run a docker container with setting a user (not being root in the container), with has no write permission on it home directory. The image is docker.io/alpine/git.
$ docker run -u 1004:1005 -it --rm --entrypoint=/bin/sh docker.io/alpine/git
~ $ git config --global user.email "you@example.com"
error: could not lock config file /git/.gitconfig: Permission denied

A: What if you set the git config info just for the current repository?
  git config user.email "you@example.com"
  git config user.name "Your Name"

EDIT
Based on OP comment a possible solution is:
GIT_AUTHOR_EMAIL="you@email.com" && GIT_AUTHOR_NAME="Your Name" && git commit

A: In Terminal:

*

*git config --global user.email "nive54@gmail.com"

*git config --global user.name "Nivetha"
Note:

GitHub registered email --> nive54@gmail.com
Your system name --> Nivetha (Refer to thispc->properties for this.)

A: For those who are working on Gitbash.
The steps include, setting up a username and then providing an email address, so that you can commit the changes, when you use $git commit -m "message to display" command.
For username:
$git config --global user.name "xyz"

For email address:
$git config --global user.email anything@gmail.com

[Do not use quotes while writing email]
So, the next time you use this command,
$ git commit -m "abc.txt file added"
Successful changes are made.


text:
Q: Decoding an image (64 bit string) sent from Swift with Python? I'm trying to take an image with Swift, encode a base64 string, send it to a Django app, and recreate the image from that. However, all the images I've had have been unusable.
Here's my Swift code:
let imageData = UIImagePNGRepresentation(image)
let base64String = imageData!.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0))
let postString = "image=" + base64String
request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding)

And here's my Python code:
base64_data = request.POST.get('image')
with open("melanie/images/%s.jpg" % image_name, "wb") as img:
        img.write(base64_data.decode('base64'))

Can anyone help me figure out where I'm going wrong?


text:
Q: Munin fills server memory In the last weeks, it happened several times to me that my vserver (Debian Lenny) was out of RAM (500M) and therefore wasn't able to run apache anymore. When looking at the processes with top, I saw that there were many open munin-limits and munin-cron processes that consumed most of the memory.
My guess would be that sometimes Apache temporarily needs more memory, which prevents munin-cron from running. And if munin-cron isn't able to stop itself, it would fill the memory until nothing is left.
I don't know whether this guess is true, but could maybe someone know what the problem is and how to prevent it? If necessary I'll remove munin, but I'd prefer to keep it running.

A: munin-cron calls munin-limits, if something prevents munin-limits from finishing you'll end up with munin-cron and munin-limits processes. As far as I can see (I don't use munin-limits), munin-limits is responsible for forwarding notifications regarding configured thresholds that's been exceeded. So, in order to try to figure out why munin-limits don't finish, you could try to run munin-limits as close as possible to how cron invokes it, with the addition of the --debug option.
Other general advise: check your logs and check if cron have sent any emails with output from munin-cron/munin-limits.


text:
Q: Return from select condition true or false I have next query:
SELECT COALESCE(some_timestamp, true) as "isFinished"
from user_satus
where id = 3344 and some_timestamp > now()

it fails with next error:
COALESCE types timestamp with time zone and boolean cannot be matched.
what I need that is return true if some_timestamp > now() else false.

A: I think you want something like this:
select (count(*) > 0) as "isFinished"
from user_satus
where id = 3344 and some_timestamp > now();

Or, more efficiently:
select exists (select 1
               from user_status
               where id = 3344 and some_timestamp > now()
              ) as isFinished;

Note:  The logic seems strange, to consider something finished if a timestamp is in the future.

A: If you need a boolean field that just checks if some time stamp is greater than current timestamp then you can use this.
    SELECT
    CASE WHEN some_timestamp > now() THEN TRUE ELSE FALSE END AS IS_FINISHED
    FROM USER_STATUS

A: You can use MAX() aggregate function:
SELECT MAX(some_timestamp > NOW()) AS isFinished
FROM user_satus
WHERE id = 3344;


text:
Q: Add labels on JSON respond first post here.
I have a raspberry with openenergymonitor running.
I can get data using JSON for some values.
Example:
http://192.168.1.252/feed/fetch.json?ids=4,5
Respond:
[24.43,41.76]
Is there a way to manipulate the url so to change the respond to:
[Temperature: 24.43, Humidity: 41.76]
Best regards.


text:
Q: Is there a convex function tending to $\infty$ and bounded above by $(\log x)^2$? I know that there is no convex function $f$ on $(1,\infty)$ such that $f(x) \rightarrow \infty $ as $x \rightarrow \infty$ and at the same time $f(x)<\log x$ for all $x \in (1,\infty)$ because convex function is a supremum of some affine functions.
What I am wondering is:
Can we extend this result to powers of logarithms? In particular, is there a convex function $g$ on $(1,\infty)$ such that $g(x) \rightarrow \infty$ as $x \rightarrow \infty$ and $g<\log ^2 $?
Any hint would be really appreciated! Thanks and regards.

A: The exact same argument applies to powers of logarithms.  Any affine function of positive slope is eventually larger than $\log^n$ for any fixed $n$, and so no convex function going to $\infty$ can be bounded by $\log^n$.


text:
Q: question regarding inequalities and equivalence if you have a question where you let x,y>0 and want to prove if $x^2<y^2$ then $x<y$ then would it be correct to use $\iff$ as you go through so
$x^2<y^2$ $\iff$ $x^2-y^2<0$ $\iff$ $(x+y)(x-y)<0$ $\iff$ $x<y$
Im mainly asking about if the last one is correct i believe it is because you are under the assumption that x and y are both positive.
Thanks


text:
Q: Queue implementation as Array So I was required to do an implementation of queue in arrays, and I wasn't having any trouble till I saw I was getting a funny output after I dequeue and try to enqueue another value...
For example (output):
Queue: [1]     //Enqueue 1
Queue: [1, 2]  //Enqueue 2
Queue: [2]      //Dequeue
Queue: [2, 2]   //Enqueue 3
Queue: [2, 2, 3] //Enqueue 4
Queue: [5, 2, 3, 4]  //Now is a total mess...

My code contains queue, dequeque and resize methods everything was working fine and I really don't have any idea at all of how to fix it anymore...
Here's my code with the main if you want to try it. Thanks.
public class MainQueue {
    public static void main(String[] args) {

        int capacity=5;
        Queue<Integer> queue = new Queue<Integer>(capacity);

        queue.enqueue(1);
        System.out.println("Queue: "+ queue);
        queue.enqueue(2);
        System.out.println("Queue: "+ queue);
        queue.dequeue();
        queue.enqueue(3);
        System.out.println("Queue: "+ queue);
        queue.enqueue(4);
        System.out.println("Queue: "+ queue);
        queue.enqueue(5);
        System.out.println("Queue: "+ queue);

    }
}

Class
import java.util.NoSuchElementException;

public class Queue<E> {
    private E[] elements;//array in generic
    private int front;//first element or front of the queue
    private int back;//last element or back of the queue
    private int capacity; //capacity of the queue
    private int count; //indicates number of elements currently stored in the queue

    public Queue(int size)
    {
        capacity = size;
        count = 0;
        back = size-1;
        front = 0;
        elements =(E []) new Object[size];  //queue array empty
    }

    //Returns true if the queue is empty or false
    public boolean isEmpty()
    {
        return count==0;//means its true
    }

    //Add elements to the queue
    public void enqueue(E item)
    {
        if(count == capacity)
        {
            resize(capacity*2);
            // System.out.println("Queue is full");

        }

        back =(back+1) % capacity;    //example back=(0+1)%10=1
        elements[back]=item;
        //elements[0]=0
        //item=elements[count];
        count++;
    }

    //Public resize
    public void resize(int reSize){
        E[] tmp = (E[]) new Object[reSize];

        int current = front;
        for (int i = 0; i < count; i++)
        {
            tmp[i] = elements[current];
            current = (current + 1) % count;
        }

        elements = tmp;
        front = 0;
        back = count-1;
        capacity=reSize;

    }

    //Dequeue method to remove head
    public E dequeue()
    {
        if(isEmpty())
        throw new NoSuchElementException("Dequeue: Queue is empty");
        else
        {
            count--;
            for(int x = 1; x <= count; x++)
            {
                elements[x-1] = elements[x];
            }
            capacity--;
            return (E) elements;
        }
    }

    //peek the first element
    public E peek()
    {
        if(isEmpty())
        throw new NoSuchElementException("Peek: Queue is empty");

        else
        return elements[front];
    }

    //Print queue as string
    public String toString()
    {

        if(isEmpty()) {
            throw new NoSuchElementException("Queue is empty");
        }

        String s = "[";
        for(int i = 0; i < count; i++)
        {
            if(i != 0)
            s += ", ";
            s = s + elements[i];// [value1,value2,....]
        }

        s +="]";
        return s;
    }

    public void delete() {   //Delete everything
        count = 0;
    }
}

A: You are updating the back in the enqueue() method using the current value of back, but you aren't updating it in the dequeu() method at all. That is not going to work correctly. In fact, you should rather calculate back based on count.
Just change:
back = (back + 1) % capacity;

to:
back = count % capacity;

A: In dequeue you are not updating the back variable that determines the position on which you add new value with enqueue. Furthermore in dequque you could copy nonexistent value on index 0 from index 1 when you have count just of 1. This is a special case that will make out of bounds error if you made a queue with capacity(size) of 1, enqueued something and then dequeued it.


text:
Q: Гиперссылки как у iCloud Pages Добрый день, как сделать гиперссылки как у iCloud Pages когда пишешь сайт и он сразу становится ссылкой как и в Google Docs.
Имеется div contenteditable="true". Подскажите как реализовать подобное?


text:
Q: Unknown AttributeError with Python Inheritnence I've got a class that inherits from an abstract class in Python
class MyAbstractClass():
    __Var1 = 0

    def __init__(self):
        pass

class MySubClass(MyAbstractClass):
    def __init__(self):
        MyAbstractClass.__init__(self)

    def MyFunc(self):
        print self.__Var1

This comes out with the following error:
AttributeError: MySubClass instance has no attribute '_MySubClass__Var1'

It's good to note that these two classes are in seperate files.
I've searched around, and most suggestions were to change my code from the use of "super()" to explicit names of the parent. However, I am still reciving this error.
Any idea whats up?

A: What you see is the name mangling. Names starting with double underscore are treated in a special way to avoid name collision in subclasses.
Basically whenever you have an __some_name attribute in a class, it is renamed automatically to _YourClass__some_name to avoid name collision when inheriting.
You can check this using the dir() function:
>>> class MyClass(object):
...     __var = 1
...
>>> dir(MyClass)
['_MyClass__var', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']

Note how the list does not contain __var but instead contains _MyClass__var.
The fix is simple: do not use variable names that start with double underscore. If you want to mark a variable as private the convention is to use a single underscore.
I want to stress again that the main purpose of the name mangling is to avoid namespace collisions with subclasses:
>>> class MyClass(object):
...     def __init__(self, val):
...             self._value = val
...
>>> class MySubclass(object):
...     def __init__(self, val):
...             super(MyClass, self).__init__(val)
...             self._value = val ** 2  #this hides the base class attribute!
...

Note that if the base class is from a third party library, then you can't know which private attributes are defined, since they are not part of the API. Checking with dir gives you only a hint on which name are used, but since they are an implementation detail they can change without notice.
You shouldn't use this to "mark" the attributes as private. The python convention is that attributes starting with a single underscore are private.
On a related topic, also names of the form __something__ with double underscore both at the beginning and the end of the name are treated specially. Some of them implement the special methods and thus you should never use this kind of identifier.

A: The double-underscore intentionally obfuscate the variable name to make it semi-private.  See http://docs.python.org/2/tutorial/classes.html#private-variables-and-class-local-references for more details.
To resolve the issue, change __Var1 to _Var1.

A: The double underscore in front of Var1 does name mangling. At runtime __Var1 looks like _MySubClass__Var1.
Try renaming it _Var1 , with a single underscore.
Name mangling is how Python creates private variables of a sort.  It's really to prevent namespace collisions.
There is some detail on this here


text:
Q: Where can I find all of the alien artifacts in Fortnite? In Fortnite's Battle Royal, we're currently in Chapter 2 Season 7 which is alien themed. There is an additional resource available this season called alien artifacts that are specifically meant for unlocking customizations for the Kymera character:

So far I've collected 174 of 360 alien artifacts and I'm trying to locate the rest. With that in mind, I know there are maps giving a week by week breakdown of artifact locations:

Weeks 1, 4, 7, & 10
Weeks 2, 5, & 8
Weeks 3, 6, & 9

However, looking at them individually does not quickly provide me with the following information:

*

*Which POI has the densest concentration of artifacts?

*If I drop in at the aforementioned POI, which POI should I travel towards in order to find the most artifacts possible in a single match?

Is there a single map image that can show all alien artifact locations?

A:
Note: If anyone would like to update this map at any time; the brush is a solid brush with 100% hardness and a size of 15px, the color utilized is ff3434.

Where should I drop-in?
Based on density and accounting for elevation changes, you should drop-in at Slurpy Swamp. More specifically, you should drop in to the southwest of Slurpy Swamp:

Which direction should I travel?
To get the best bang for your buck, you'll start at the aforementioned drop spot and travel in an S shape to Corny Complex:

While you'll initially miss out on the two central containers, you'll net approximately, 40 artifacts (assuming you haven't already gathered any in this path).
Where should I look?
After searching the web, I came across an article that describes the locations of many artifacts.
Weeping Woods, Believer Beach and Corny Complex
The first points of interest on your list (assuming that you've already collected some artifacts) should likely be Weeping Woods, Believer Beach and Corny Complex. This is due to the fact that all three locations have five artifacts each in their surrounding areas:

Point of Interest
Location Descriptions

Weeping Woods
inside a wooden shack that's close to the Durrr burger west of Weeping Woods

-
close to the wall on the southern side, inside the smaller of the two wooden lodges with a blue roof

-
on the satellite dish at the IO station to the east

-
inside the small hut at the base of the guardian tower

-
to the southeast by a trio of trees just south of the main road and due north of Hydro 16

Believer Beach
at the bottom of the Spire stairs east of Believer Beach

-
on top of the satellite dish in the IO base west of this location

-
inside the roof of the blue and brown house towards the southeast corner of Believer Beach

-
in the attic above the bedroom of the blue house, in the southeast of Believer Beach

-
inside the small hut on the crescent-shaped island to the west

Corny Complex
in the orchard to the north of Corny Complex, across the road

-
at the entrance to the bridge due south of this location

-
inside the barn furthest west in Corny Complex. Look to the ceiling to find it

-
in the corrupted area on the cliff overlooking Corny Complex (to the northwest)

-
inside the main dining hall of the Gas 'n' Grub

Misty Meadows
Misty Meadows is the next likely location to result in a high yield for those who've already begun collecting artifacts.

Point of Interest
Location Descriptions

Misty Meadows
on the left island due north of this location, in the house close to the spire

-
above the bell right at the top of the clock tower

-
underneath a small wooden bridge to the east

-
inside a blue shipping container at the IO station to the southeast

Pleasant Park, Craggy Cliffs, Catty Corner and Slurpy Swamp
Each of these locations have a total of three artifacts in their immediately surrounding areas.

Point of Interest
Location Descriptions

Pleasant Park
behind the house northeast of this location, close to the spire

-
under the roof of the wooden gazebo in the centre of Pleasant Park

-
underneath the roof of the gazebo in the centre of Pleasant Park

Craggy Cliffs
east of this location

-
by the campsite northeast of Craggy Cliffs

-
inside the roof of the Unremarkable Shack on the island to the northwest

Catty Corner
up the scratching post to the west of this location

-
head up the stairs in the camp at the top of the mountain and head inside the building

-
by the small house at the weather station on the mountain

Slurpy Swamp
inside the factory

-
inside Hydro 16, suspended in the air in the main room

-
head for the wooden buildings and look at the stairs of the one furthest east

Retail Row, Boney Burbs, Coral Castle, Lockie's Lighthouse and Dirty Docks
These locations are a bit more spread out and are less likely to result in a high yield match. Each of these POIs have two artifacts.

Point of Interest
Location Descriptions

Retail Row
by the pool close to the pylon northeast of this location

-
behind the bus stop by the road leading south of Retail Row

Boney Burbs
around the main complex in this location

-
in the corrupted area near the lake

Coral Castle
inside the castle in the centre of this location

-
inside the elevator shaft of the ruined base to the north

Lockie's Lighthouse
inside the smaller shack next to the lighthouse

-
inside the shed next to the house. Lockie Lighthouse is on the island northeast of Coral Castle

Dirty Docks
next to where the alien trees are growing (the purple bit on the map between Dirty Docks and Steamy Stacks)

-
underneath one of the metal structures to the northwest of the IO base (west of Dirty Docks)

Additional Locations
Of all the locations you could travel to, these will produce the lowest yields (individually, at least), in that they each only have one artifact to find. These are best utilized as fillers during the match once you've already hit the larger areas.

Point of Interest
Location Descriptions

Steamy Stacks
on the pipes by the central building close to the floodlights

Isla Nublada
go to the island that's just southwest off the coast between Slurpy Swamp and Misty Meadows. You'll find the artifact inside the ruins

Holly Hatchery
inside the orange beach hut on the beach

Stealthy Stronghold
inside the left tower on the southern main gate

FN Radio
inside the IO base main building on the ground floor

Gorgeous Gorge
in the room with the suspended ships, it's underneath the middle one. You'll need to build a platform leading up to it

Camp Cod
on the small island southeast of Misty Meadows, head for the silver building to the east. It's in the rafters close to the targets

Dampy Dish
the IO base southwest of Slurpy Swamp. It's in a toilet cubicle

Zero Point
at the base of the new crater in the middle of the map


text:
Q: SSH2 PHP compress directory EOF error I have a script that does a backup using php and the ssh2 library.
The script connects to a remote machine using ssh2 and performs the backup tasks.
I would like to compress the backup directory in order to minimise the downloading time.
I managed to do it but when I open my compressed file in my local machine it says : 'unexpected end of file' :(
I work on Ubuntu 11.10. and php5. My remote machine runs Centos.
To compress the file I am using tar to archive my backup directory followed by gzip, so I end with a myarchiveddir.tar.gz
Code looks as follows:
        ....
    $execO = ssh2_exec($conn,"cd /tmp/;tar -cf {$newFile}.tar myRemoteFolder");
    $execO = ssh2_exec($conn,"cd /tmp/;gzip {$newFile}.tar");
    $output = fclose($execO);

I have been trying and researching for a solution but I always seem to end in the same point. Could anyone throw a bit of light to this problem. I am new to ssh2 library so I am a bit green in this field. Im sure it cannot be that complicated tho, it must be something I am missing.
Many Thanks in advance.
Manuel

A: Doesn't myRemoteFolder need a trailing slash /?


text:
Q: Word for spelling words as pronounced using the alphabet not IPA Phonetic spelling is when you spell words using IPA. Is it also called the same when you use alphabet? Just like this:
pronunciation [pruh-nuhn-see-ey-shuh n]


text:
Q: Generar imagen en un frame con Tkinter Estoy intentando generar una imagen dentro de un frame que esta dentro de una clase pero no me genera la imagen a pesar de que el mismo label toma el tamaño de la imagen. He investigado pero ningún método luce como mi código.
Sé que usando este código si se genera sin problemas:
from tkinter import *

v=Tk()

f = Frame(v)

i = PhotoImage(file="pizza2.png")

l = Label(f, image=i)
l.pack()

f.pack()

v.mainloop()

El código con el que estoy trabajando actualmente es este:
from tkinter import *

#Clase que generará la ventana y manipulará los frames
class VentanaMF(Tk):
    #*args permite pasar tantas variables como deseen
    #*kwargs trabaja con variables para diccionarios
    def __init__(self, *args, **kwargs):
        Tk.__init__(self, *args, **kwargs) #Inicializa los elementos de tkitner

        #Ventana
        ventana = Frame(self) #contiene el frame para mostrar los componentes del programa
        ventana.pack(side="top", fill="both", expand=True)
        ventana.grid_rowconfigure(0, weight=1)
        ventana.grid_columnconfigure(0, weight=1)

        self.frames = {} #Diccionario que manejara los frames del programa

        for Fr in (Inicio, MPrincipal):

            frame = Fr(ventana, self) #Funcion para el frame principal

            self.frames[Fr] = frame

            frame.grid(row=0, column=0, sticky="nsew") #posicionamiento del frame//los posicionamientos de sticky expanden el elemento en la dirección dada

        self.show_frame(Inicio)

    def show_frame(self, cont):
        #Comandos para mostrar el frame
        frame = self.frames[cont]
        frame.tkraise()#Trae el frame al frente de todo

#Clase que contiene la presentación del programa
class Inicio(Frame):
    def __init__(self, parent, controller):
        Frame.__init__(self, parent)

        lp = Label(self, text="Texto cualquiera", font="times 12 bold")
        lp.pack(pady=10, padx=10) #Los pad modifican el tamaño de la etiqueta

        bmp = Button(self, text="Menú principal", command=lambda: controller.show_frame(MPrincipal))
        bmp.pack()

#Clase para menú principal
class MPrincipal(Frame):
    def __init__(self, parent, controller):
        Frame.__init__(self,parent)

        ltitle = Label(self, text="Provincias")
        ltitle.place(x=100, y=20)
        ltitle.pack()

        #Imagen de prueba
        i = PhotoImage(file="pizza2.png")

        li = Label(self, image=i, bg="black")
        li.place(x=100, y=100)
        li.pack()

        bbutton = Button(self, text="Presentación del grupo", command=lambda: controller.show_frame(Inicio))
        bbutton.place(x=200, y=200)
        bbutton.pack()

        b1 = Button(self, text="Bocas del Toro", command=lambda: controller.show_frame(PBdT))
        b1.place(x=10, y=10)

class PBdT(Frame):
    def __init__(self, parent, controller):
        Frame.__init__(self,parent)

        ltitle = Label(self, text="Ubicación 1")
        ltitle.place(x=100, y=20)

        bmp = Button(self, text="Menú principal", command=lambda: controller.show_frame(MPrincipal))
        bmp.pack()

#Modulo principal
py=VentanaMF()
py.geometry("800x600")

py.mainloop()

Aún no manejo bien este lenguaje, por lo que el código está documentado para saber lo que ocurre. Además, cabe destacar que he intentado mostrar la imagen usando label y canvas pero ninguno me ha resultado, no se si estaré pasando algo por alto.

A: El problema se encuentra en la definición de MPrincipal.__init__:
class MPrincipal(Frame):
    def __init__(self, parent, controller):

        # ...

        i = PhotoImage(file="pizza2.png")
        li = Label(self, image=i, bg="black")

        # ...

En lugar de almacenar la imagen en i utiliza self.i:
self.i = PhotoImage(file="pizza2.png")
li = Label(self, image=self.i, bg="black")

La imagen debe ser accesible para el widget padre del label, y si la almacenas en una variable local del método, al finalizar la ejecución de dicho método la imágen deja de ser visible para el widget padre (cosas de Tcl/Tk).
Un saludo!


text:
Q: Handlebars, nested each with parallel arrays I have two arrays like below.
const arr1 = [ 1, 2 ]
const arr2 = [[1,3,5],[2,4,6]]

I want loop through arr1 and inside loop I want to loop through arr2[arr1.index].
My attempt is below, but of course it is not working:
{{#each arr1}}
    {{#each arr2.[ @index ]}} //index is from #each arr1
    {{/each}}
{{/each}}

Any ideas?

A: You can achieve that result by doing:
{{#each arr2}}
    {{#each this}}
       {{ this }}
    {{/each}}
{{/each}}

A: Well answer is lookup helper and ../ for reaching parent scope.
{{#each arr1}}
    {{#each (lookup ../arr2 @index)}} //index is from #each arr1
    {{/each}}
{{/each}}


text:
Q: Fabric-ca Certificate not working with tomcat I have a centralized fabric-ca server which serves nodes requesting for crypto material. In effect the setup is as follows:
Ubuntu 16.04 running Tomcat 8 and Java 1.8
I have a servlet which will connect to fabric-ca server (On a remote machine using https and fetch the relevant certificates).
When I try to enroll a user, I get the following java error
Stack Trace
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1959)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:328)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:322)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1614)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:987)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
    at org.hyperledger.fabric_ca.sdk.HFCAClient.httpPost(HFCAClient.java:1122)
    at org.hyperledger.fabric_ca.sdk.HFCAClient.enroll(HFCAClient.java:454)
    at org.hyperledger.fabric_ca.sdk.HFCAClient.enroll(HFCAClient.java:398)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:486)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
Caused by: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
    at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:362)
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:270)
    at sun.security.validator.Validator.validate(Validator.java:260)
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)
    ... 50 more
Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors
    at sun.security.provider.certpath.PKIXCertPathValidator.validate(PKIXCertPathValidator.java:153)
    at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(PKIXCertPathValidator.java:79)
    at java.security.cert.CertPathValidator.validate(CertPathValidator.java:292)
    at sun.security.validator.PKIXValidator.doValidate(PKIXValidator.java:357)

I have tried adding the server's ca-cert.pem to tomcat's keystore (available at /opt/bitnami/apache-tomcat/java/lib/cacerts) as well as to ubuntu. Still no avail.
Am I missing something?


text:
Q: Is getting mile markers in Apple MapKit or Google Maps SDK possible? I can't find any documentation about using mile markers, only latitude and longitude. Is this even possible? Basically the situation is I get a JSON with a road and a mile marker and I want to be able to represent that data on a map.  I know I could tediously convert mile markers to coordinates, but that just seems asinine. Is there another way?

A: You will likely need outside data for this. Check state or even US DOT data sources for something you could use here. You could then represent it on a map with MapKit directly (annotations) or possibly look into making your own raster layer with Mapbox Studio.


text:
Q: Get array of matching strings From a given string I want an array of all the substrings within the parenthesis of given string for example I have a string
COUNTER_SUM(lehr_in) / COUNTER_SUM(feeder) * 100

Here I have two substrings within the parenthises "lehr_in" and "feeder" so my result should be
["lehr_in", "feeder"]

A: There's probably a better way to do this using regexes, but here's what I came up with:
a.split(/[^(]*\(([^)]+)\)[^(]*/).reject(&:empty?)


text:
Q: Cant open cells using openpyxl I am trying to work with openpyxl following a Programming with Mosh Python course. I can't open cells when using the .cell method. This happens for me when calling the cell by string as well. Any help welcome. Thank you.
Here's my code:
import openpyxl as xl
wb = xl.load_workbook('transactions.xlsx')
sheet = wb['Sheet1']
cell = sheet.cell(1, 1)
print(cell)
# prints <Cell 'Sheet'.A1> without actual cell information

A: Use .value to get information from a cell. Here is the corrected code:
import openpyxl as xl
wb = xl.load_workbook('transactions.xlsx')
sheet = wb['Sheet1']
cell = sheet.cell(1, 1)
print(cell.value)


text:
Q: Problem converting 32 bit VBA to 64 bit VBA function Option Explicit
Option Compare Text
Option Base 1

Private Declare PtrSafe Function lstrlen Lib "kernal32" Alias "lstrlenW" ( _
    ByVal lpString As Long) As LongPtr

Private Declare PtrSafe Function StrTrim Lib "shlwapi" Alias "StrTrimW" ( _
    ByVal pszSource As Long, _
    ByVal pszTrimChars As Long) As LongPtr

Private Function TrimWS(ByVal Text As String) As String
    'unicode safe
    Dim WHITE_SPACE As String
    WHITE_SPACE = " " & vbTab & vbCr & vbLf & Chr(1) & Chr(2) & Chr(3) & Chr(4) & Chr(5) & Chr(6) & Chr(7) & Chr(8) & Chr(9) & Chr(10) & Chr(11) & Chr(12) & Chr(13) & Chr(14) & Chr(15) & Chr(16) & Chr(17) & Chr(18) & Chr(19) & Chr(20) & Chr(21) & Chr(22) & Chr(23) & Chr(24) & Chr(25) & Chr(26) & Chr(27) & Chr(28) & Chr(29) & Chr(30) & Chr(31) & Chr(32) & ChrW(&HA0)

    If StrTrim(StrPtr(Text), StrPtr(WHITE_SPACE)) Then
        TrimWS = Left$(Text, lstrlen(StrPtr(Text)))
    Else
        TrimWS = Text
    End If

End Function

This function above isn't working when I swapped to 64 bit. The "StrPtr" areas seem to error out because this doesn't exist in 64 bit. Also the lstrlen doesn't seem to work either. It gives a mismatch error.
Can anyone give some suggestions on how to convert this to 64 bit?
I tried swapping the original function to LongPtr, I'm not sure what this function does but it's taking all those charcodes and testing for it. If it exists its running the lstrlen function.
I kinda hit a wall on this one.

A: I setup the LongPtr in the wrong spot. It works fine now.
Private Declare PtrSafe Function lstrlen Lib "Kernel32" Alias "lstrlenW" ( _
    ByVal lpString As LongPtr) As Long

Private Declare PtrSafe Function StrTrim Lib "shlwapi.dll" Alias "StrTrimW" ( _
    ByVal pszSource As LongPtr, _
    ByVal pszTrimChars As LongPtr) As Long


text:
Q: Access restriction: The type 'Application' is not API (restriction on required library rt.jar) Here is the code:
package mscontroller;

import javax.swing.*;
import com.apple.eawt.Application;

public class Main {
    public static void main(String[] args)
    {
        Application app = new Application();
        app.setEnabledAboutMenu(true);

        AMEListener listener = new AMEListener();
        app.addApplicationListener(listener);
        JFrame mainFrame = new JFrame("Application Menu Example");
        mainFrame.setSize(500, 500);
        mainFrame.setVisible(true);
    }
}

here is the error:
Exception in thread "main" java.lang.Error: Unresolved compilation
problems:   Access restriction: The type 'Application' is not API
(restriction on required library
'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar')
    Access restriction: The constructor 'Application()' is not API
(restriction on required library
'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar')
    Access restriction: The type 'Application' is not API (restriction on
required library
'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar')
    Access restriction: The method
'Application.setEnabledAboutMenu(boolean)' is not API (restriction on
required library
'/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar')
    AMEListener cannot be resolved to a type    AMEListener cannot be
resolved to a type

    at mscontroller.Main.main(Main.java:9)

eclipse says this:

Access restriction: The type 'Application' is not API (restriction on    required library '/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/jre/lib/rt.jar')

A: I was having the same problem.  When I initially created the java project in Eclipse I specified JRE 8.  When I went into the project's build path and edited the JRE System Library, the Java 8 execution environment was selected.  When I chose to use an "Alernate JRE" (still java 8) it fixed the error for me.

A: Adding javafx accessible permission in eclipse oxygen
go to project> properties> java build path> libraries> then expand the libraries and double click on> Access rules there you set the permission
Resolution : Accessible
Rule Pattern : javafx/**

A: Had the same problem. Here's how I solved it:
Go to Package Explorer.  Right click on JRE System Library and go to Properties. In the Classpath Container > Select JRE for the project build path select the third option (Workspace default JRE).
Source :  https://thenewboston.com/forum/topic.php?id=3917

A: We use IBM Rational Application Developer (RAD) and had the same problem.
ErrorMessage:
Access restriction: The type 'JAXWSProperties' is not API (restriction on required library 'C:\IBM\RAD95\jdk\jre\lib\rt.jar')
Solution:
go to java build path and under Library tab, remove JRE System Library. Then again Add Library --> JRE System Library

A: Go to the following setting:
Window -> Preferences -> Java-Compiler-Errors/Warnings-Deprecated and restricted API-Forbidden reference (access rules)
Set it to Warning or Ignore.

A: In Eclipse Mars.2 Release (4.5.2):
Project Explorer -> Context menu -> Properties -> JavaBuildPath -> Libraries
select JRE... and press Edit: Switch to Workspace JRE (jdk1.8.0_77)
Works for me.

A: Even if its old question, for me in Eclipse I just right click on Src folder and properties (Alt+Enter) and the check for the Ignore optional compile problems removed the error.

A: This happened to me as well, and the answers given here already were not satisfying, so I did my own research.
Background: Eclipse access restrictions
Eclipse has a mechanism called access restrictions to prevent you from accidentally using classes which Eclipse thinks are not part of the public API. Usually, Eclipse is right about that, in both senses: We usually do not want to use something which is not part of the public API. And Eclipse is usually right about what is and what isn't part of the public API.
Problem
Now, there can be situations, where you want to use public Non-API, like sun.misc (you shouldn't, unless you know what you're doing). And there can be situations, where Eclipse is not really right (that's what happened to me, I just wanted to use javax.smartcardio). In that case, we get this error in Eclipse.
Solution
The solution is to change the access restrictions.

*

*Go to the properties of your Java project,

*

*i.e. by selecting "Properties" from the context menu of the project in the "Package Explorer".

*Go to "Java Build Path", tab "Libraries".

*Expand the library entry

*select

*

*"Access rules",

*"Edit..." and

*"Add..." a "Resolution: Accessible" with a corresponding rule pattern.
For me that was "javax/smartcardio/**", for you it might instead be "com/apple/eawt/**".

A: I have eclipse JRE 8.112 , not sure if that matters but what i did was this:

*

*Right clicked on my projects folder

*went down to properties and clicked

*clicked on the java build path folder

*once inside, I was in the order and export

*I checked the JRE System Library [jre1.8.0_112]

*then moved it up above the one other JRE system library there (not sure if this mattered)

*then pressed ok

This solved my problem.

A: I simply just add e(fx)clipse in eclipse marketplace. Easy and simple

A: To begin with (and unrelated), instantiating the Application class by yourself does not seem to be its intended use. From what one can read from its source, you are rather expected to use the static instance returned by getApplication().
Now let's get to the error Eclipse reports. I've ran into a similar issue recently: Access restriction: The method ... is not API (restriction on required project). I called the method in question as a method of an object which inherited that method from a super class. All I had to do was to add the package the super class was in to the packages imported by my plugin.
However, there is a lot of different causes for errors based on "restriction on required project/library". Similar to the problem described above, the type you are using might have dependencies to packages that are not exported by the library or might not be exported itself. In that case you can try to track down the missing packages and export them my yourself, as suggested here, or try Access Rules. Other possible scenarios include:

*

*Eclipse wants to keep you from using available packages that are not part of the public Java API (solution 1, 2)

*Dependencies are satisfied by multiple sources, versions are conflicting etc. (solution 1, 2, 3)

*Eclipse is using a JRE where a JDK is necessary (which might be the case here, from what your errors say; solution) or JRE/JDK version in project build path is not the right one

This ended up as more like a medley of restriction-related issues than an actual answer. But since restriction on required projects is such a versatile error to be reported, the perfect recipe is probably still to be found.

A: We had to change our application to build against the JDK 1.8 using Window->Preferences->Java->Installed JREs. However, after changing that, the JRE System Library specified in the Project Explorer was still incorrect. To fix this, right click on "JRE System Library [wrong-jre-here]" and change from Execution environment: to "Workspace Default (yer-default-here)"

A: Remove Existing/Configured System Library:
Eclipse(IDE) -> Project Explorer -> Project Name-> (Option) Build Path -> Configure Build Path -> Java Build Path -> Libraries -> (Select) JRE System Library [(For me)jre1.8.0_231] -> Remove.
Currently you are at same location:
Eclipse(IDE) -> Project Explorer -> Project Name-> (Option) Build Path -> Configure Build Path -> Java Build Path -> Libraries
Now Add Same System Library Again:
Add Library -> JRE System Library -> Workspace default JRE ((For me)jre1.8.0_231) -> Finish -> Apply -> Close.
Now wait to finish it.

A: I had this problem because the project facet associated with my project was the wrong java version.
To fix this is I did the following:

*

*Right click on the project and select Properties

*Select 'Project Facets' and change version of java to something greater than 1.4.

*Click [Apply]

This will rebuild your project and hopefully the error will be resolved.

A: It worked: Project Properties -> ProjectFacets -> Runtimes -> jdk1.8.0_45 -> Apply

A: In the Eclipse top menu bar:
Windows -> Preferences -> Java -> Compiler -> Errors/Warnings ->
Deprecated and restricted API -> Forbidden reference (access rules): -> change to warning

A: If you're having this same issue using Spring Tool Suite:
The Spring Tool Suite's underlying IDE is, in fact, Eclipse. I've gotten this error just now trying to use some com.sun.net classes. To remove these errors and prevent them from popping up in the Eclipse Luna SR1 (4.4.2) platform of STS:

*

*Navigate to Project > Properties

*Expand the Java Compiler heading

*Click on Errors/Warnings

*Expand deprecated and restricted API

*Next to "Forbidden reference (access rules)" select "ignore"

*Next to "Discouraged reference (access rules)" select "ignore"

You're good to go.

A: I'm using eclipse neon 3. I just wanted to use javafx.application.Application, so I followed Christian Hujer's answer above and it worked. Just some tips: the access rules are very similar to the import statement. For me, the access rules I added was "javafx/application/**". Just replace the dot in the import statement with forward slash and that's the rule. Hope that helps.

A: I had a little different problem. In Project - Properties - Libraries - JRE library, I had the wrong JRE lib version. Remove and set the actual one, and voila - all Access restriction... warnings are away.

A: If someone is having this issue only in your CI tool while running maven, what did the trick for me was to explicitly define the execution environment in your MANIFEST.MF.
In my case, I did this by inserting the following line in my OSGi bundle manifest file:
Bundle-RequiredExecutionEnvironment: JavaSE-1.8

A: What worked for me was adding the access restricted package to the MANIFEST.MF file. In Eclipse, the "Access Restricted" errors showed up in the Problems tab for several files. I just right clicked on each error, clicked "Quick Fix", and chose "Add '[package]' to imported packages".

A: I had faced the same error on Eclipse 4.20.0 with JRE 1.8. To get rid of this compilation error, do the following:
Project --> Properties --> Java Compiler --> Errors/Warnings --> Deprecated and Restricted API --> Forbidden Reference (access rules) -->  ignore


text:
Q:  against static resource I'm using SLDS datepicker on my VF page. I tried <apex:slds /> at the first place to load utility-sprite event icon to click and load the calendar. But it didn't load properly. Then i switched back to good old SLDS static resource. And it started loading. What could go wrong here. Here is my code. Appreciate your help.

        Start Date

            <svg aria-hidden="true"  class="slds-input__icon slds-input__icon--right slds-icon-text-default">
                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{!URLFOR($Resource.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#event')}"></use>
            </svg>

            <input id="fromdate" value="{!displayStartDate}" class="slds-input" type="Text" tabindex="8" label="From"/>
            <apex:inputHidden id="fromHidden" value="{!startDate}"/>

A: Tried the below and it works. the key is the static resource name you need to refer is

$Asset.SLDS

from documentation

To reference assets in the Lightning Design System, such as SVG icons
  and other images, use the URLFOR() formula function and the
  $Asset.SLDS global variable. To use SVG icons, add the required XML
  namespaces by using xmlns="http://www.w3.org/2000/svg" and
  xmlns:xlink="http://www.w3.org/1999/xlink" in the html tag.

<apex:page >
    <apex:slds />

        Start Date

            <svg aria-hidden="true"  class="slds-input__icon slds-input__icon--right slds-icon-text-default">
                <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{!URLFOR($Asset.SLDS, '/assets/icons/utility-sprite/svg/symbols.svg#announcement')}"></use>
            </svg>

</apex:page>


text: Q: Three machines deploy six nodes redis cluster Three servers are used to deploy redis cluster, and three masters and three slaves are deployed in a cross-deployment method. One master and another server are deployed on one server. There is no problem in using the cluster normally, and the master and slave will be crossed. However, if a server is directly shut down and reconnected, there may be two masters on one server, or two slaves on one server. Is there any way to avoid it?


text:
Q: Magento Exception Error: Invalid method Mage_Catalog_Block_Product_View_Type_Simple::displayProductStockStatus() i tried to install a theme to my magento system
and when i try to open a product page its shows me an error:
Exception printing is disabled by default for security reasons.
please help me
the error:
    Invalid method Mage_Catalog_Block_Product_View_Type_Simple::displayProductStockStatus(Array
(
)
)

Trace:
#0 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/design/frontend/default/ma_erida/template/catalog/product/view/type/default.phtml(30): Varien_Object->__call('displayProductS...', Array)
#1 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/design/frontend/default/ma_erida/template/catalog/product/view/type/default.phtml(30): Mage_Catalog_Block_Product_View_Type_Simple->displayProductStockStatus()
#2 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/embxsto1/...')
#3 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#4 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#5 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#6 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#7 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('product_type_da...', true)
#8 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/design/frontend/default/ma_erida/template/catalog/product/view.phtml(56): Mage_Core_Block_Abstract->getChildHtml('product_type_da...')
#9 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/embxsto1/...')
#10 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#11 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#12 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#13 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#14 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#15 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#16 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#17 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/design/frontend/default/ma_erida/template/page/1column.phtml(52): Mage_Core_Block_Abstract->getChildHtml('content')
#18 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/embxsto1/...')
#19 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#20 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#21 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#22 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#23 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(391): Mage_Core_Model_Layout->getOutput()
#24 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Cms/Helper/Page.php(132): Mage_Core_Controller_Varien_Action->renderLayout()
#25 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'no-route')
#26 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Cms/controllers/IndexController.php(75): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'no-route')
#27 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Cms_IndexController->noRouteAction()
#28 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('noRoute')
#29 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#30 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch()
#31 /home/embxsto1/domains/emb1.xstore.co.il/public_html/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#32 /home/embxsto1/domains/emb1.xstore.co.il/public_html/index.php(81): Mage::run('', 'store')
#33 {main}

A: You can check what exception occurred in your Magento system by navigating through:

*

*[Document_Root]/var/report folder and

*Open the file # corresponding to exception number on your browser's screen.

or
you can enable exception printing for debugging purposes by:

*

*Open [Document_Root]/errors folder

*Rename local.xml.sample to local.xml
Both ways are helpful to trace and debug exceptions and errors in Magento.

A: Here is the solution:
1) Navigate to the "errors" folder.
2) Change local.xml.sample to local.xml
3) You should now see a new list of crazy errors all over the Magento page - this is okay.
4) Open magento/lib/Zend/Cache/Backend/File.php and look for:
protected $_options = array(
'cache_dir' => 'null',

5) Change it to:
protected $_options = array(
'cache_dir' => 'tmp/',

6) Save it.

A: I face this problem , the easy and 100% working solution is remove the cache files .
In magneto folder go var/cache
Then delete all files , and refresh your site
:-)

A: The Easy and 100% working solution is  rename cache file.
In magneto root folder var/cache
Then rename cache file name , and refresh your site.

A: There are 3 things you can do to fix this issue.
1. Delete cache folder
Do this first, 90% you will get the error fixed.
First, go to root folder var/cache
delete/rename magento cache
Now you can rename or just remove all cache files, and refresh your Magento site to see if the error is gone.

*Read log of Magento
As you can see the error message: Error log record number: xxxxxxxxxx, here xxxxxxxxxx is the name of log file we need to check. All error log files are located in Magento/var/report folder, just open file manager and go to that folder and find the corresponding file and read the log to find solution.

*Enable error printing
If the solution above doesn't help, you can enable printing errors to check what problems caused the error. To do this follows these steps:
Step 1: go to folder  Magento/errors
There you will see  local.xml.sample  file, just rename it to  local.xml , the purpose of this action is to enable error printing in Magento
Step 2: Reload the error page and you will see the full list of error message, this will help you fix the issue.
Those steps are mentioned in this tutorial, you can take a look. Hope this helps


text:
Q: Haskell: Filtering a list based on a predicate for all other elements in the list I have a list of natural numbers [1..n] (this list is never empty) and I would like to filter each element by testing a predicate with all other elements in the list. I would like to return a list of those numbers who never fulfilled the predicate. My idea is this:
filter (\x -> 1 == length [y| y <- [1..n], pred y x]) [1..n]

I am testing if the length is equal to 1 since for x==y the predicate returns true.
This does work as intended, however, I was wondering if there is a cleaner way to do this. I'm not really looking for more performance, but rather a more simple solution.

A: As far as complexity, I don't think you can do better than quadratic, since, after all, the very definition of the problem is to test each element with each other. So unless there is more to be known about the structure of the problem, you're stuck there.
But you can perhaps cut down on the performance somewhat by stopping early. Calculating length every time means enumerating all elements from 1 to n, but you don't actually need that, right? You can stop enumerating once pred returns True for the first time. To do that you can use and:
filter (\x -> and [not (pred y x) | y <- [1..n], y /= x]) [1..n]

Or, alternatively, you can move the predicate to the condition part and then test the resulting list for emptiness:
filter (\x -> null [y <- [1..n], y /= x && pred y x]) [1..n]

But I like the former variant better, because it better describes the intent.
Finally, I think this would look cleaner as a list comprehension:
[ x
| x <- [1..n]
, and [not (pred y x) | y <- [1..n], y /= x]
]

But that's a matter of personal taste, of course.


text:
Q: Get args value from @before advice I already spend almost 1 week to understand this AOP thingy.
I aware that from the JoinPoint, we can pass the args to advice @AfterReturning something like that.
But, to get the value from @before advice back to JointPoint, it seems like impossible (based on my try and error).
Please help me to confirm, and if possible I would appreciate if you can show how it can be done.
Thank you.

A: Not sure I get you correctly, but if you are asking how to get information from a @Before advice back to the calling code, then that just won't work.
The @Before, @After and @AfterThrowing phases give you only a limited amount of control, by design. If you want to have complete control, you need to use an @Around advice.
I'll add more info if you add more detail to your question.


text:
Q: Sum and count data from columns I have a DataFrame like:
1        member_id  application_name  active_seconds
2           192180             Opera   6
3           192180             Opera   7
4           192180             Chrome  243
5           5433112            Chrome   52
6           5433112            Opera   34
7           5433112            Chrome 465

And I try to group it.
I want to count application_name to id and sum active_seconds to application_name.
I use df.groupby(['member_id', 'application_name'])['event_duration'].sum() and df.groupby(['member_id', 'application_name']).size() and second return to me correct value, but first return
       member_id  application_name  active_seconds
       192180             Opera             67
       192180             Chrome            243
       5433112            Chrome           52465
       5433112            Opera              34

What I do wrong?

A: Your active_seconds seem to be of dtype string, so sum() concatenates them.
If you do df.info(), active_seconds probably shows object as dtype, which implies they are string rather than int. Do
df.active_seconds =  pd.to_numeric(df.active_seconds)

to convert. In case there are errors, you can use the keyword errors to handle those as explained in the docs.


text:
Q: Replace or enhance default on-screen Keyboard I am running Ubuntu 19.04 on a Surface Go. There is the default on-screen keyboard which looks exactly like the ones on phones.
But I need (at least sometimes) the extra keys like Alt, Ctrl, and Umlauts.
So I would like either too enhance the default layout or disable it and use Onboard. I couldn't find any useful hints.
Could anyone help me here?

A: From the Ubuntu Documentation:
Press the flag () button to change your settings for Language or Input Sources.
If you are unable to do so, you can change the layout of the keyboard via following this guide.
To qoute from the article:
If you wish to configure the keyboard for the current session only, run
dpkg-reconfigure keyboard-configuration

Then select the layout with the extra keys (like Alt, Ctrl and umlauts).
If you want to replace the On Screen Keyboard, use this guide to install florence keyboard to your system. It is extremely configurable.


text:
Q: Java Web app: Welcome file list Should the welcome file mentioned in welcome file list tag always be physically present?
i.e. jsp, html etc. Or can it be a URL pattern?
I defined a welcome file list in the web.xml as:
<welcome-file-list>
    <welcome-file>/home</welcome-file>
</welcome-file-list>

/home downloads a JSON file from the server to display on the browser. But whenever I start the application, it does not take me to the following page: http://localhost:8080/myapp/home. Instead it always goes to http://localhost:8080/myapp/ only. Please advise what am I doing wrong.

A: it does need to have a physical file on your webapp folder for a welcome file to be found even if some kind of controller will treat the request, for example, if you have a JSF app and the FacesServlet only handles requests of type *.faces on your app you should place an empty file called home.faces under your webapp folder, so it can be correctly mapped, on your case I guess the issue is slightly different, you want to fetch data from the server side and display it on the browser when user first lands on your app, so what you can do is actually:

*

*Create an HTML called home.html as your welcome file with an empty div as a placeholder for your data.

*Use a Javascript library or do an AJAX call to fetch the JSON from the server side

*If the result call is OK, render the placeholder DIV with data fetched from server.


text:
Q: mIRC on event variables I've noticed a big lack in documentation from mIRC scripting abilities so I apologize if I've missed something but I've been searching everwhere.
Basically, I have an on event when someone says something, I need to get there entire message, how is this possible? I've managed to discover $1- however this only grabs the text from what the event triggered from to the end, I need the entire message, is this possible?

A: This is actually pretty simple, although maybe you're on an earlier version of mirc, if the documentation is lacking:
on *:TEXT:*I need help with*:#channel: {
  msg $chan $1-
}

$1- will always contain the full message.  $# are space-delimited identifiers, so if your message is john: I need help with etc, $1 will contain john:, and $2 will contain I, and so on and so-forth.  Adding the dash means 'this and everything onwards'.  Since your match text is 'everything before I need help with and everything after, this code will always contain the full text.
The code above, in case it is not obvious, will message the channel the event triggered on with the full message text.  Whatever you do with the text is up to you; it's just an example.

A: /dbg
alias dbg {
  if !$debug {  debug -i d dbg  }
  if $regex($1-,/.+!.+@.+.PRIVMSG.#.+:.+/g) {
    echo 4 -s $*
  }
}

$1- or $1