text:
Q: ID a 1980s (TV) movie with the heroine on the run with her dead father's memories stored in a VCR+computer combo in a briefcase I saw this in the mid-to-late 1980s on British TV.  It had the feel of a made-for-TV movie and, as I recall, was American (though it could easily have been a Canadian production).
The feel was present-day sci-fi/thriller, kind of in the style of Knight Rider.
All I remember of the plot was that there was an inventor/tycoon who was murdered by the bad guys.  Said bad guys were also after his daughter, so she went on the run, armed with his latest invention, which was a briefcase-sized device into which her father had transferred his knowledge.  She could ask it questions, and it would spool a VCR tape of recordings of him saying various phrases, and it would stitch them together to produce a response.  I don't remember any more plot or any dialogue, except that the laptop would often give the same generic response (something like "answer unknown" or "insufficient data").  Exasperated, eventually the daughter asked "why do you keep saying that?" and it then spooled to her father saying "Because I don't have enough information to answer you!".
The way it dealt with the topic of (sort of) mind uploading, was unusual for the time, which is why that one aspect of it has stuck in my memory.

A: As per user8485927's comment, this seems to be 1987's Grand Larceny.

Freddy Grand, a woman estranged from her father for 18 years, travels to his estate on the French Riviera after learning of his death. There she carries out his final wishes and begins to learn something about his past. She discovers he was a thief who served time in prison, but was approached by an insurance company on his release to employ his talent in helping them to recover some stolen valuables. A reformed man of many years before his death, he wishes Freddy to continue his work.

This review has a bit more context:

Once again, I must admit from the beginning that, as a Louis Jourdan completest, I own this film and have watched it several times. It is charming, touching, and emotional. Louis Jourdan portrays Charles Grand, whose daughter Freddy (Marilu Henner) returns to his estate after his death. How does he appear? In video tapes he made for Freddy in which he schools her in how to expertly take over his job as a master thief who had worked for an insurance company to recover stolen property. What Freddy doesn't realize is that the "job" she is sent on is really a test and that the participants were in on it with Charles Grand. The best and most valuable lesson Freddy learns, however, is about her father. After being away from him for almost two decades, she comes to know him via the the video tapes--and to love him. Is this the best film ever made? No. It is not the worst, either. It is a heartwarming story that reminds us that it really is never too late.

It's not difficult to find online. The video/computer interface gets described and demonstrated about 17 minutes in, the "Dialogue Activated Data Display, or DADD". And indeed, one of the "needs more data" responses is for him to lean into the camera and say, "Insufficient information".


text:
Q: How to pass parameters to an alias? For bash script, I can use "$@" to access arguments. What's the equivalent when I use an alias?

A: Alias solution
If you're really against using a function per se, you can use:
$ alias wrap_args='f(){ echo before "$@" after;  unset -f f; }; f'
$ wrap_args x y z
before x y z after

You can replace $@ with $1 if you only want the first argument.
Explanation
This creates a temporary function f, which is passed the arguments.
Alias arguments are only passed at the end. Note that f is called at the very end of the alias.
The unset -f removes the function definition as the alias is executed so it doesn't hang around afterwards.

A: Aliases don't take arguments. They work more or less like simple text replacement, meaning all words after the alias (the ones that look like "arguments" to the alias) just get left at the end of the expanded alias.
For instance, if you were to alias ls to ls -la, then typing ls foo bar would really execute ls -la foo bar on the command line. Which is probably fine in that example, but if foob is an alias to foo | bar, then foob abc def expands to foo | bar abc def, and there's no way to arrange those two words to be used as arguments to the left-hand side of the pipeline.
One might attempt changing the alias to something like foo "$@" | bar or so, but that would expand to foo "$@" | bar abc def and use the positional parameters of the outer context in the expansion of "$@". That's probably not what you want.
If you want to have actual control over how the arguments are interpreted, then you could write a function like so:
my_program_wrapper() {
    local first_arg=$1 \
          second_arg=$2

    shift 2 # get rid of the first two arguments

    # ...

    /path/to/my_program "$@"
}

A: I'm answering for csh:
Yes, you can use the parameters in aliases and - as a difference to what has been said above - you can refer to them anywhere in the definition of alias - not only at the end.
Example for tar-gz -ing something:
$ alias tgz "tar cvf - \!:1 | gzip -9 > \!:2.tar.gz"

, where !:1 and !:2 are the parameters you will supply when calling your alias.
Example of use:
    $ ls
    clrcf.dat                             user_comment_2016.06.03_12:51:50.txt  user_comment_2016.06.03_12:54:48.txt
        TEST-wADM.tec                         user_comment_2016.06.03_12:52:04.txt  user_comment_2016.06.03_12:55:13.txt

    $ tgz user* out
    a user_comment_2016.06.03_12:51:50.txt 1K
a user_comment_2016.06.03_12:52:04.txt 1K
a user_comment_2016.06.03_12:54:48.txt 1K
a user_comment_2016.06.03_12:55:13.txt 1K

    $ ls out*
    out.tar.gz

Which effectively means that you used two parameters that you inserted at arbitrary places of the tar command, making of all of it an alias tgz

A: Adding to the present answers, an important thing to realize about how aliases work is that all the parameters you type after an aliased command will be used literally at the end. So there is no way to use alias for two commands (piped or not), out of which the first should interpret the parameters. To make it clear, here's an example of something that would not work as expected:
alias lsswp="ls -l | grep swp"

(an example inspired by this question) this will always use the output of ls -l performed in the current directory and do a grep on that - so using
lsswp /tmp/

would be equivalent to ls -l | grep swp /tmp/  and not ls -l /tmp/ | grep swp.
For all purposes where the arguments should be used somewhere in the middle, one needs to use a function instead of an alias.

A: You don't have to do anything, actually; aliases do this automatically.  For instance:
$ alias less="less -eirqM"
$ less foo.txt

You will see foo.txt's first page, and less will quit at EOF (-e), searches will be case-insensitive (-i), etc.

A: This example, to pretty print a markdown file in the terminal, is working if the first command of the pipe is able to read from stdin:
alias mdcat='(pandoc | lynx -stdin -dump) <'

So mdcat myfile.md can then be used instead of pandoc myfile.md | lynx -stdin -dump.
This is not exactly answering your question, as it does not make "$@" available in the alias, but it probably answers some real-world usecases for this question.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Unhandled Rejection (UnknownErrorException): The API version "2.0.91" does not match the Worker version "1.10.97" Got this error while trying to add PDF file into my website locally.
I have create one component called 'ViewPDF.jsx' and code for 'ViewPDF.jsx' is:
import React, { Component } from "react";
import { Page } from "react";
import { Document } from 'react-pdf/build/entry.webpack';
import  PDF  from 'react-pdf-js';

import { Resume } from '../Download/Resume.pdf';

class ViewPDF extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      page: 0,
      pages: 2
    };

    this.onDocumentComplete = this.onDocumentComplete.bind(this);
    this.onPageComplete = this.onPageComplete.bind(this);
  }

  onDocumentComplete(pages) {
    this.setState({ page: 1, pages });
  }

  onPageComplete(page) {
    this.setState({ page });
  }

  render() {
    return (

        <PDF file="{Resume}"/>

    );
  }
}

export default ViewPDF;

And I have created page under src/screen/Contact.jsx
Code for 'Contact.jsx' is:
import React, { Component } from "react";
import Navbar from "../components/Navbar.jsx";
import Footer from "../components/Footer.jsx";
import Jumbotron from "../components/Jumbotron.jsx";
import { Document } from "react-pdf";
import ViewPDF from "../components/ViewPDF.jsx";

class Contact extends Component {
  render() {
    return (

        <Navbar />
        <Jumbotron title="welcome" subtitle="put something" />

Contact Me

            Email Address:

              Click here for my Email Address

            Click here for my resume!
            resume

          <ViewPDF />

    );
  }
}
export default Contact;

My PDF file is saved locally under src/Download/Resume.pdf.
I am newbie to React. When I open page in Chrome I got this error message:
Unhandled Rejection (UnknownErrorException): The API version "2.0.91" does not match the Worker version "1.10.97"
Thank you in advance!


text:
Q: How to specify an absolute URL for generated chunk files in angular (CLI 7) I'm having issues as I serve my javascript files from a CDN. IN new angular cli (v7) when I enable lazy loading the generated chunk files are loaded from the root directory by default, however I want them to be served from a different url (s3 in this case).
How it is being loaded:
...
http://<website_url>/polyfills.js
http://<website_url>/runtime.js
http://<website_url>/main.js
...

How I want it to load:
...
http://<website_url>/abolutepath/polyfills.js
http://<website_url>/abolutepath/runtime.js
http://<website_url>/abolutepath/main.js
...

Just to mention I have tried base href and it doesn't work. It still loads the chunk fiels from root.
<base href="/abolutepath/">

A: You can specify --deployUrl when using build
ng build --prod --deployUrl http://<website_url>/abolutepath

Basically this is when you upload files into custom folder + if want to use CDN


text:
Q: Unity save scenes This is what I have:

All my information about player , guns are stored in monobehaviour scripts which are placed on them.When I press that button , scene2 gets activated.However , what should I do to "teleport" my player in the next scene?I would also like to get there my UI(healthbar , bullets).I've watched some videos about singletons but I'm not sure if that's my case.Any advice?

A: You should use DontDestroyOnLoad(). This does what it says. Basically, it doesn't destroy your game object when you load the new scene. You should remove the player prefab from the other scene, and put this in your player script:
...
   void Awake()
   {
       DontDestroyOnLoad(gameObject);
       ...
   }
...

This way, if all of your variables are stored on this script, they will save because they are not being destroyed through scenes.
This will save game objects childed to this. If it doesn't, make other variables for the children. Then, add multiple DontDestroyOnLoad(); statements with the different variables in the different statements.
(Note: this will not save it if you stop the game or close the application. It will keep the values through scenes, not game ends or app closes.)


text:
Q: ObjectFile problem I have created sample application in iphone 2.0... Now i want to make this application as object files ...
How can i do this?
Can anyone help me ?
Thanks in advance.....

A: See this SOQ Can I develop my own objective-C Framework for Cocoa Touch Applications?


text:
Q: I need some advice for my Cassandra model (time-series) I'm a working on an API with nodejs and Cassandra (helenus module), and  I have a cassandra model like the following one:
CREATE TABLE IF NOT EXISTS events (
  hour TIMESTAMP,
  type int,
  id timeuuid,
  created_at TIMESTAMP,
  invoice int,
  data text,
  PRIMARY KEY((hour, type), created_at)
 )WITH CLUSTERING ORDER BY (created_at DESC);

Now, I have a resource to search for all the types of event for a specific invoice number, so when I do a query like the below one, it returns the rows that match my conditions.
select *
from events
WHERE hour = '2014-01-20 21:00:00'
AND type IN (0,1,2)
AND invoice = 123456789
ORDER BY created_at DESC LIMIT 15;

But I run in troubles when I want to get all the rows from the beginning of the times related to that specific invoice number because my 'hour' field is restricting me a lot.
And Cassandra has a restriction that you can just use EQ and IN operators in the condition statement for the partition key (hour, type).
What would be the best model for my needs?
Thanks.

A: The issue is that you can't filter on arbitrary columns in Cassandra.  You need to know your queries in advance, and design your schema to answer those queries.  Presuming your stated query is the only one you need to run, you can modify your primary key as follows:
PRIMARY KEY((hour, type), invoice, created_at)
This will add invoice into the column name to form a composite name, and will allow you to run your query.


text:
Q: Building project with CUDA failed, Windows 7 Professional Visual Studio 2013 ultimate I am trying to write OpenCV program with CUDA functionality, but my machine has no NVidia graphic card. So I succeeded compiling it,but couldn't run it. Ok, I understand that. But when I try to run it on a machine which has correctly configured OpenCV (other projects,but without CUDA functionality,were working just fine) and CUDA support I get this error:

Any solutions?


text:
Q: Problem with altitude value in iPhone 3GS I have problem when i try to get altitude value in from iPhone to my application.
Please give me some solution. My code is here:
NSLog(@"didUpdateToLocation %@ from %@", newLocation, oldLocation);
//NSNumber *myNumber = [NSNumber numberWithDouble:(newLocation.altitude)];
double value = [newLocation altitude];
NSLog(@"test= %f",value);

Code is always written 0.0000 in NSlog.

A: The altitude value is pretty unreliable. It is only available if your location has been determined with GPS and even then it is usually a lot more inaccurate than the lat/long location.
In your example, the horizontal accuracy of +/– 80m suggests that the location fix has not been determined with GPS or that GPS reception is not very good in that area. Be sure to check the location's verticalAccuracy as well. If it is a negative value, the altitude value will have no meaning whatsoever.


text:
Q: Easy way to dismiss keyboard? I have quite a few controls scattered throughout many table cells in my table, and I was wondering if there's an easier way to dismiss the keyboard without having to loop through all my controls and resigning them all as the first responder. I guess the question is.. How would I get the current first responder to the keyboard?

A: You can send a nil targeted action to the application, it'll resign first responder at any time without having to worry about which view currently has first responder status.
Objective-C:
[[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];

Swift 3.0:
UIApplication.shared.sendAction(#selector(resignFirstResponder), to: nil, from: nil, for: nil)

Nil targeted actions are common on Mac OS X for menu commands, and here's a use for them on iOS.

A: Try:
[self.view endEditing:YES];

A: Tuck this away in some utility class.
+ (void)dismissKeyboard {
    [self globalResignFirstResponder];
}

+ (void) globalResignFirstResponder {
    UIWindow * window = [[UIApplication sharedApplication] keyWindow];
    for (UIView * view in [window subviews]){
        [self globalResignFirstResponderRec:view];
    }
}

+ (void) globalResignFirstResponderRec:(UIView*) view {
    if ([view respondsToSelector:@selector(resignFirstResponder)]){
        [view resignFirstResponder];
    }
    for (UIView * subview in [view subviews]){
        [self globalResignFirstResponderRec:subview];
    }
}

A: @Nicholas Riley & @Kendall Helmstetter Geln & @cannyboy:
Absolutely brilliant!
Thank you.
Considering your advice and the advice of others in this thread, this is what I've done:
What it looks like when used:
[[self appDelegate] dismissKeyboard]; (note: I added appDelegate as an addition to NSObject so I can use anywhere on anything)
What it looks like under the hood:
- (void)dismissKeyboard
{
    UITextField *tempTextField = [[[UITextField alloc] initWithFrame:CGRectZero] autorelease];
    tempTextField.enabled = NO;
    [myRootViewController.view addSubview:tempTextField];
    [tempTextField becomeFirstResponder];
    [tempTextField resignFirstResponder];
    [tempTextField removeFromSuperview];
}

EDIT
Amendment to my answer to included tempTextField.enabled = NO;.  Disabling the text field will prevent UIKeyboardWillShowNotification and UIKeyboardWillHideNotification keyboard notifications from being sent should you rely on these notifications throughout your app.

A: To be honest, I'm not crazy about any of the solutions proposed here.  I did find a nice way to use a TapGestureRecognizer that I think gets to the heart of your problem: When you click on anything besides the keyboard, dismiss the keyboard.

*

*In viewDidLoad, register to receive keyboard notifications and create a UITapGestureRecognizer:
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];

[nc addObserver:self selector:@selector(keyboardWillShow:) name:
UIKeyboardWillShowNotification object:nil];

[nc addObserver:self selector:@selector(keyboardWillHide:) name:
UIKeyboardWillHideNotification object:nil];

tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(didTapAnywhere:)];

*Add the keyboard show/hide responders.  There you add and remove the TapGestureRecognizer to the UIView that should dismiss the keyboard when tapped.  Note: You do not have to add it to all of the sub-views or controls.
-(void) keyboardWillShow:(NSNotification *) note {
    [self.view addGestureRecognizer:tapRecognizer];
}

-(void) keyboardWillHide:(NSNotification *) note
{
    [self.view removeGestureRecognizer:tapRecognizer];
}

*The TapGestureRecognizer will call your function when it gets a tap and you can dismiss the keyboard like this:
-(void)didTapAnywhere: (UITapGestureRecognizer*) recognizer {
    [textField resignFirstResponder];
}

The nice thing about this solution is that it only filters for Taps, not swipes.  So if you have scrolling content above the keyboard, swipes will still scroll and leave the keyboard displayed.  By removing the gesture recognizer after the keyboard is gone, future taps on your view get handled normally.

A: Quick tip on how to dismiss the keyboard in iOS when a user touches anywhere on the screen outside of the UITextField or keyboard. Considering how much real estate the iOS keyboard can take up, it makes sense to have an easy and intuitive way for your users to dismiss the keyboard.
Here's a link

A: A lot of overly-complicated answers here, perhaps because this is not easy to find in the iOS documentation. JosephH had it right above:
[[view window] endEditing:YES];

A: Here's what I use in my code. It works like a charm!
In yourviewcontroller.h add:
@property (nonatomic) UITapGestureRecognizer *tapRecognizer;
Now in the .m file, add this to your ViewDidLoad function:
- (void)viewDidLoad {
    //Keyboard stuff
    tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapAnywhere:)];
    tapRecognizer.cancelsTouchesInView = NO;
    [self.view addGestureRecognizer:tapRecognizer];
}

Also, add this function in the .m file:
- (void)handleSingleTap:(UITapGestureRecognizer *) sender
{
    [self.view endEditing:YES];
}

A: Even Simpler than Meagar's answer
overwrite touchesBegan:withEvent:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [textField resignFirstResponder];`
}

This will dismiss the keyboardwhen you touch anywhere in the background.

A: You should send endEditing: to working window being the subclass of UIView
[[UIApplication sharedApplication].windows.firstObject endEditing:NO];

A: This is a solution to make the keyboard go away when hit return in any textfield, by adding code in one place (so don't have to add a handler for each textfield):

consider this scenario:
i have a viewcontroller with two textfields (username and password).
and the viewcontroller implements UITextFieldDelegate protocol
i do this in viewDidLoad
- (void)viewDidLoad
{
    [super viewDidLoad];

    username.delegate = self;
    password.delegate = self;
}

and the viewcontroller implements the optional method as
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return YES;
}

and irrespective of the textfield you are in, as soon as i hit return in the keyboard, it gets dismissed!
In your case, the same would work as long as you set all the textfield's delegate to self and implement textFieldShouldReturn

A: In your view controller's header file add <UITextFieldDelegate> to the definition of your controller's interface so that it conform to the UITextField delegate protocol...
@interface someViewController : UIViewController <UITextFieldDelegate>

... In the controller's implementation file (.m) add the following method, or the code inside it if you already have a viewDidLoad method ...
- (void)viewDidLoad
{
    // Do any additional setup after loading the view, typically from a nib.
    self.yourTextBox.delegate = self;
}

... Then,  link yourTextBox to your actual text field
- (BOOL)textFieldShouldReturn:(UITextField *)theTextField
{
    if (theTextField == yourTextBox) {
        [theTextField resignFirstResponder];
    }
    return YES;
}

A: The best way to dismiss keyboard from UITableView and UIScrollView are:
tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag

A: In swift 3 you can do the following
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)

A: A better approach is to have something "steal" first responder status.
Since UIApplication is a subclass of UIResponder, you could try:
[[UIApplication sharedApplication] becomeFirstResponder]
[[UIApplication sharedApplication] resignFirstResponder]

Failing that, create a new UITextField with a zero sized frame, add it to a view somewhere and do something similar (become followed by resign).

A: You can force the currently-editing view to resign its first responder status with [view endEditing:YES]. This hides the keyboard.
Unlike -[UIResponder resignFirstResponder], -[UIView endEditing:] will search through subviews to find the current first responder.  So you can send it to your top-level view (e.g. self.view in a UIViewController) and it will do the right thing.
(This answer previously included a couple of other solutions, which also worked but were more complicated than is necessary. I've removed them to avoid confusion.)

A: Jeremy's answer wasn't quite working for me, I think because I had a navigation stack in a tab view with a modal dialog on top of it.  I'm using the following right now and it is working for me, but your mileage may vary.
 // dismiss keyboard (mostly macro)
[[UIApplication sharedApplication].delegate dismissKeyboard]; // call this in your to app dismiss the keybaord

// --- dismiss keyboard (in indexAppDelegate.h) (mostly macro)
- (void)dismissKeyboard;

// --- dismiss keyboard (in indexAppDelegate.m) (mostly macro)
// do this from anywhere to dismiss the keybard
- (void)dismissKeyboard {    // from: http://stackoverflow.com/questions/741185/easy-way-to-dismiss-keyboard

    UITextField *tempTextField = [[UITextField alloc] initWithFrame:CGRectZero];

    UIViewController *myRootViewController = <#viewController#>; // for simple apps (INPUT: viewController is whatever your root controller is called.  Probably is a way to determine this progragrammatically)
    UIViewController *uivc;
    if (myRootViewController.navigationController != nil) { // for when there is a nav stack
        uivc = myRootViewController.navigationController;
    } else {
        uivc = myRootViewController;
    }

    if (uivc.modalViewController != nil) { // for when there is something modal
        uivc = uivc.modalViewController;
    }

    [uivc.view  addSubview:tempTextField];

    [tempTextField becomeFirstResponder];
    [tempTextField resignFirstResponder];
    [tempTextField removeFromSuperview];
    [tempTextField release];

}

A: You may also need to override UIViewController disablesAutomaticKeyboardDismissal to get this to work in some cases. This may have to be done on the UINavigationController if you have one.

A: Subclass your textfields... and also textviews
In the subclass put this code..
-(void)conformsToKeyboardDismissNotification{

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissKeyBoard) name:KEYBOARD_DISMISS object:nil];
}

-(void)deConformsToKeyboardDismissNotification{

    [[NSNotificationCenter defaultCenter] removeObserver:self name:KEYBOARD_DISMISS object:nil];
}

- (void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [self resignFirstResponder];
}

In the textfield delegates (similarly for textview delegates)
-(void)textFieldDidBeginEditing:(JCPTextField *)textField{
     [textField conformsToKeyboardDismissNotification];
}

- (void)textFieldDidEndEditing:(JCPTextField *)textField{
    [textField deConformsToKeyboardDismissNotification];
}

All set.. Now just post the notification from anywhere in your code. It will resign any keyboard.

A: And in swift we can do
UIApplication.sharedApplication().sendAction("resignFirstResponder", to: nil, from: nil, forEvent: nil)

A: To dismiss a keyboard after the keyboard has popped up, there are 2 cases,

*

*when the UITextField is inside a UIScrollView

*when the UITextField is outside a UIScrollView
2.when the UITextField is outside a UIScrollView
override the method in your UIViewController subclass
you must also add delegate for all UITextView
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
}

*

*In a scroll view, Tapping outside will not fire any event, so in that case use a Tap Gesture Recognizer,
Drag and drop a UITapGesture for the scroll view and create an IBAction for it.

to create a IBAction, press ctrl+ click the UITapGesture and drag it to the .h file of viewcontroller.
Here I have named tappedEvent as my action name
- (IBAction)tappedEvent:(id)sender {
      [self.view endEditing:YES];  }

the abouve given Information was derived from the following link, please refer for more information or contact me if you dont understand the abouve data.
http://samwize.com/2014/03/27/dismiss-keyboard-when-tap-outside-a-uitextfield-slash-uitextview/

A: I hate that there's no "global" way to programmatically dismiss the keyboard without using private API calls. Frequently, I have the need to dismiss the keyboard programmatically without knowing what object is the first responder. I've resorted to inspecting the self using the Objective-C runtime API, enumerating through all of its properties, pulling out those which are of type UITextField, and sending them the resignFirstResponder message.
It shouldn't be this hard to do this...

A: It's not pretty, but the way I resign the firstResponder when I don't know what that the responder is:
Create an UITextField, either in IB or programmatically. Make it Hidden. Link it up to your code if you made it in IB.
Then, when you want to dismiss the keyboard, you switch the responder to the invisible text field, and immediately resign it:
  [self.invisibleField becomeFirstResponder];
  [self.invisibleField resignFirstResponder];

A: You can recursively iterate through subviews, store an array of all UITextFields, and then loop through them and resign them all.
Not really a great solution, especially if you have a lot of subviews, but for simple apps it should do the trick.
I solved this in a much more complicated, but much more performant way, but using a singleton/manager for the animation engine of my app, and any time a text field became the responder, I would assign assign it to a static which would get swept up (resigned) based on certain other events... its almost impossible for me to explain in a paragraph.
Be creative, it only took me 10 minutes to think through this for my app after I found this question.

A: the easist way is to call the method
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    if(![txtfld resignFirstResponder])
    {
        [txtfld resignFirstResponder];
    }
    else
    {

    }
    [super touchesBegan:touches withEvent:event];
}

A: A slightly more robust method I needed to use recently:
- (void) dismissKeyboard {
    NSArray *windows = [UIApplication sharedApplication].windows;

    for(UIWindow *window in windows) [window endEditing:true];

    //  Or if you're only working with one UIWindow:

    [[UIApplication sharedApplication].keyWindow endEditing:true];
}

I found some of the other "global" methods didn't work (for example, UIWebView & WKWebView refused to resign).

A: Add A Tap Gesture Recognizer to your view.And define it ibaction
your .m file will be like
    - (IBAction)hideKeyboardGesture:(id)sender {
    NSArray *windows = [UIApplication sharedApplication].windows;
    for(UIWindow *window in windows) [window endEditing:true];
    [[UIApplication sharedApplication].keyWindow endEditing:true];
}

It's worked for me

A: Yes, endEditing is the best option. And From iOW 7.0, UIScrollView has a cool feature to dismiss the keyboard on interacting with the scroll view. For achieving this, you can set keyboardDismissMode property of UIScrollView.
Set the keyboard dismiss mode as:
tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag

It has few other types. Have a look at this apple document.

A: In swift :
self.view.endEditing(true)

A: You have to use one of these methods,
[self.view endEditing:YES];

or
[self.textField resignFirstResponder];

A: Update
I found another simple way
simply declare a property :-
@property( strong , nonatomic) UITextfield *currentTextfield;

and a Tap Gesture Gecognizer:-
@property (strong , nonatomic) UITapGestureRecognizer *resignTextField;

In ViewDidLoad
_currentTextfield=[[UITextField alloc]init];
_resignTextField=[[UITapGestureRecognizer alloc]initWithTarget:@selector(tapMethod:)];

[self.view addGestureRecognizer:_resignTextField];

Implement the textfield delegate method didBeginEditing
 -(void)textFieldDidBeginEditing:(UITextField *)textField{

      _currentTextfield=textField;

    }

Implement Your Tap Gesture Method (_resignTextField)
 -(void)tapMethod:(UITapGestureRecognizer *)Gesture{

     [_currentTextfield resignFirstResponder];

 }


text:
Q: What does "A millions years ago" mean here? I would like to know what "A millions years ago" means in the following sentences:

'So Charlie boy,' Johnno says, 'tell us. How did you two first meet?'
I think at first he means Charlie and I. Then I realise
he's looking between Charlie and Jules. Right.
'A millions years ago . . .' Jules says. She and Charlie raise their
eyebrows at each other in perfect unison.
'I taught her to sail,' Charlie says. 'I lived in Cornwall. It was my
summer job.'

*

*Lucy Foley, The Guest List, Chapter 12

This is a thriller novel published in 2020 in the United Kingdom. One hundred and fifty guests would be gathering at some remote and deserted fictional islet called Inis an Amplóra off the coast of the island of Ireland to celebrate the wedding between Jules (a self-made woman running an online magazine called The Download) and Will (a celebrity appearing in a TV show program called Survive the Night). The day before the actual wedding day, Hannah, the wife of Charlie (Jules' friend), arrived at the island and is now at the dinner party for the rehearsal dinner with only some selected guests. And during the party, Johnno, Will's friend, asks Charlie and Jules as to how they came to meet each other in the first place. At first, Hannah thinks the question is directed to Charlie and herself, but soon realizes that it is for Jules and Charlie.
In this part, I wonder what "A millions years ago" means.
Is Jules saying basically like "once upon a time", with some wistfulness...? Or perhaps, is she saying "It would take a million years to tell you how we met, because it is a long story"?
And I wonder why it is "a millions years ago" rather than "a million years ago". I am wondering whether it is grammatically okay ('a' + plural), and guessing there might be an idiomatic expression regarding it, though I cannot find it...

A: I guess it's both, "once upon a time" with the nuance of a long story to be told. I use it in the same way when I want to talk about something that happened decades back and bears lots of memories.


text:
Q: Angular CLI: Live reload not working with Vagrant I'm upgrading from Angular 8 to Angular 9, and now finding that the Live Reload for the CLI is no longer working while using a Vagrant development environment.  The app does not recompile when changes are made to the codebase.
I've tried vagrant-fsnotify and vagrant-notify-forwarder with no luck.  I'd like to avoid using polling since it's already resource intensive running the dev server for other members of my team.
Angular: 9.1.10
Angular CLI: 9.1.7
Host OS: Ubuntu 18.04.4
Guest OS: Debian 10.4
Vagrant: 2.2.9

A: For, me this command works for me
ng serve --poll=2000


text:
Q: All system logs lack end of message newlines We have a curious issue where all logs in /var/log/ lack a trailing new-lines at the end of their messages, and instead contain an n, but the entire file is one 'line':
Jun  4 10:18:54 host sshd[12468]: Accepted publickey for username from xx.xx.xx.xxx port xxxx ssh2nJun  4 10:18:54 host sshd[12468]: pam_unix(sshd:session): session opened for user username by (uid=0)nJun  4 10:19:25 host sudo: username : TTY=pts/0 ; PWD=/home/username ; USER=root ; COMMAND=/bin/bashn

Super bizarre.  I looked everywhere, and the only complaints about a "lack of newlines" I can find on the internet refer to the messages themselves not being multi-line (lack on newlines in the message body).  However I can not find anything on a lack of trailing newlines, or on modifying/confirming the format of the messages.

A: Cause: One of our sysadmins had modified the RSyslog template, and omitted the \ before the n at the end of the template.
The RSyslog configuration file, located at /etc/rsyslog.conf allows to specify templates for the Messages:
# Use default timestamp format
#$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$template CustomFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
$ActionFileDefaultTemplate CustomFormat

Well, the admin had omitted the \ for the newline, resulting in:
$template CustomFormat,"%timegenerated% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%n"

No dice.
To summarize, if you have odd format issues in any logs handled by RSyslog, check the Template configurations for RSyslog, starting in /etc/rsyslog.conf


text:
Q: Use PHP to display thumbnails as links to images organized in MySQL database I have a folder of images and a MySQL database to manage them. The database has one table: images, and 7 fields: imgID, imgTitle, imgURL, imgDate, imgClass, imgFamily, & imgGender. The primary key is imgID and the Index Key is imgDate.
I wish to display thumbnails of these images on a web page as links to the large versions, using the imgDate to organize them with newest first, and oldest last. The images have the same file names as their thumbnails. The large images are located in new_arrivals_img/ relative to the site root, and the thumbnails are located in new_arrivals_img/thumbnails/ again relative to the site root.
As I'm new to both MySQL and PHP, I was hoping someone could help me with the code. Everything I have tried has failed.
Right now I'm building the site, and thus using MAMP to host it locally. I have had some problem figuring out relative paths for my images. Is there a way to set new_arrivals_img/ as the root?

A: given no code, I think this is what you are looking for
//connect to mysql database
$query = mysql_query("SELECT `imgURL` FROM `images` ORDER BY `imgDate` DESC") or die(mysql_error());

if(!$query) {
 echo "Cannot retrieve information from database.";
} else {
 while($row = mysql_fetch_assoc($query)) {
  echo "
";
 }
}

this would show the images with line break from the folder new_arrivals_img/thumbnails


text:
Q: Passing in Array of Vec3 using vispy's gloo So I'm using the gloo package in python to run some basic GL shaders.
For one shader, I need to pass in a uniform that is an array of 10 vec3s:
uniform vec3 u_warps[10];

However, when I try to set a value of this in python:
program['u_warps'] = warps // or gloo.VertexBuffer(warps)

I get the error:

KeyError: 'Unknown uniform or attribute u_warp'

Which suggests to me that this library is doesn't recognize array uniforms? If I remove the brackets after 'warps' ("warps[10] -> warps"), then the uniform is found, but fails to set correctly (because I am passing in an array worth of data).
Is there something I'm missing? Does anyone know if there is a way to set array uniforms in gloo?

A: For posterity, I emailed the people that maintain vispy and got the answer:
"For now the only solution is to pass in the elements of the uniform array individually:"
program['u_warps[0]'] = warps[0]
program['u_warps[1]'] = warps[1]
...

The maintainers said they hope to fix this issue soon.


text:
Q: Printing a text file in a patteren I have a very large amount of text(100000 words)  to parse and it has got following format
abrasion abrade:stem<>ion:suffix
abstainer abstain:stem<>er:suffix
abstention abstain:stem<>ion:suffix
accessibility access:stem<>ible:suffix<>ity:suffix
accretion accrete:stem<>ion:suffix
activist active:stem<>ist:suffix
adaptable adapt:stem<>able:suffix
addiction addict:stem<>ion:suffix

I need to convert it to this format
abrasion (S (abrade:stem) (ion:suffix))
abstainer (S (abstain:stem) (er:suffix))
abstention (S (abstain:stem) (ion:suffix))
accessibility (S (S (access:stem) (ible:suffix)) ity:suffix))
accretion (S (accrete:stem) (ion:suffix))
activist (S (active:stem) ist:suffix))
adaptable (S (adapt:stem) able:suffix))
addiction (S (addict:stem) ion:suffix))

The awk code, I use is
awk 'BEGIN{FS=OFS="\n"}{
   a=gensub(/([a-zA-Z]*):stem/,"( S\\1:stem)", "g");
   while ( a ~ /stem)<>.*:suffix/) {
     a=gensub(/(\([a-zA-Z]*:stem\).*?)<>([a-zA-Z]*):suffix/,"(\\1\\2:suffix)", "g", a);
   }
   while ( a ~ /<>/) {
     a=gensub(/([a-zA-Z]*?:prefix)<>(.*)/,"(S\\1\\2)", "g", a);
   }
   print a;}

This code fails to produce desired output and produce results for only 5 tokens.

A: Have look at this:
#!/usr/bin/perl

# provide data
$t = <<'EOT';
abrasion abrade:stem<>ion:suffix
abstainer abstain:stem<>er:suffix
abstention abstain:stem<>ion:suffix
accessibility access:stem<>ible:suffix<>ity:suffix
accretion accrete:stem<>ion:suffix
activist active:stem<>ist:suffix
adaptable adapt:stem<>able:suffix
addiction addict:stem<>ion:suffix
EOT

# iterate over lines
foreach $line (split /\n/, $t) {

    # split the line
    ($word, $def) = split /\s+/, $line, 2;
    @parts = split /\<\>/, $def;

    # loop over attributes
    $new = '';
    for ($pos = 0; $pos<$#parts; $pos++) {
            $new =
                $new eq '' ?
                qq[(S ($parts[0]) ($parts[1]))] :  # create new entry
                qq[(S $new ($parts[$pos]))];       # encapsulate existing entry
    }

    # output
    print qq($word $new\n);
}

produces:
abrasion (S (abrade:stem) (ion:suffix))
abstainer (S (abstain:stem) (er:suffix))
abstention (S (abstain:stem) (ion:suffix))
accessibility (S (S (access:stem) (ible:suffix)) (ible:suffix))
accretion (S (accrete:stem) (ion:suffix))
activist (S (active:stem) (ist:suffix))
adaptable (S (adapt:stem) (able:suffix))
addiction (S (addict:stem) (ion:suffix))

Possibly the groupings at accessibility should be the other way round, but this is not proofable for me, because your example seems to be syntactically incorrect there.
If this is the case, you would have to loop from $#parts-1to 0 instead.
Or possibly all stems and all suffices should be grouped into an S() group seperately.

A: use v5.10;
use strict;

while( my $line = <>)
{
    chomp $line;
    if( $line =~ /^(\w+)\s+(.+)/)
    {
        my $word = $1;
        my @stems = split '<>', $2;

        if( @stems )
        {
            my $stems = sprintf '(%s)', shift @stems;
            while( @stems )
            {
                $stems = sprintf '(S %s (%s))', $stems, shift @stems;
            }
            say "$word $stems";
        }
    }
}

A: Although the example seems to be not correct I try to give an awk solution:
cat >infile.txt <<TXT
abrasion abrade:stem<>ion:suffix
abstainer abstain:stem<>er:suffix
abstention abstain:stem<>ion:suffix
accessibility access:stem<>ible:suffix<>ity:suffix
accretion accrete:stem<>ion:suffix
activist active:stem<>ist:suffix
adaptable adapt:stem<>able:suffix
addiction addict:stem<>ion:suffix
TXT

awk '
function proc(desc,    p1, p2) {
  if (match(desc, /^.*<>/, arr)) {
    p1 = substr(desc, 1, RLENGTH - 2);
    p2 = substr(desc, RLENGTH + 1);
    return "S (" proc(p1) ") ("p2")";
  }

  return desc;
}

{
  print $1, "(" proc($2) ")"
}
' infile.txt

Output:
abrasion (S (abrade:stem) (ion:suffix))
abstainer (S (abstain:stem) (er:suffix))
abstention (S (abstain:stem) (ion:suffix))
accessibility (S (S (access:stem) (ible:suffix)) (ity:suffix))
accretion (S (accrete:stem) (ion:suffix))
activist (S (active:stem) (ist:suffix))
adaptable (S (adapt:stem) (able:suffix))
addiction (S (addict:stem) (ion:suffix))

The code calls the recursive function proc for the second field. It finds the last occurence of '<>' and then formats the string calling itself again for the first part. That's it. The only trick is to add the local p1 and p2 variables to the argument list of proc to make them really local.

A: Here is a possible awk solution:
{
    a = gensub(/([a-zA-Z]*:stem)<>([a-zA-Z]*:suffix)/,"(S (\\1) (\\2))", "1")
    while ( a ~ /<>[a-zA-Z]*:suffix/) {
        a = gensub(/(\(S.*)<>([a-zA-Z]*:suffix)/,"(S \\1 (\\2))", "1", a)
    }
    print a
}

Output:
abrasion (S (abrade:stem) (ion:suffix))
abstainer (S (abstain:stem) (er:suffix))
abstention (S (abstain:stem) (ion:suffix))
accessibility (S (S (access:stem) (ible:suffix)) (ity:suffix))
accretion (S (accrete:stem) (ion:suffix))
activist (S (active:stem) (ist:suffix))
adaptable (S (adapt:stem) (able:suffix))
addiction (S (addict:stem) (ion:suffix))

A: I think this Perl program will do what you need
The data sample is really too short, and you have given no explanation for the mismatched parentheses in your desired output for activist, adaptable and addiction, but I have programmed the pattern that I can see
I trust you are able to open a file in Perl? If you supply the path to your input file as a parameter on the command line then all you need to do is change <DATA> to <> and it will work. The output is sent to STDOUT, so if you want to store it to a file then simply redirect the output on the command line
use strict;
use warnings 'all';

while ( <DATA> ) {
    my ($word, $ss) = split;
    my @ss = split /<>/, $ss;

    while ( @ss > 1 ) {
        my $s = sprintf 'S (%s) (%s)', @ss[0,1];
        splice @ss, 0, 2, $s;
    }

    printf "%s (%s)\n", $word, $ss[0];
}

__DATA__
abrasion abrade:stem<>ion:suffix
abstainer abstain:stem<>er:suffix
abstention abstain:stem<>ion:suffix
accessibility access:stem<>ible:suffix<>ity:suffix
accretion accrete:stem<>ion:suffix
activist active:stem<>ist:suffix
adaptable adapt:stem<>able:suffix
addiction addict:stem<>ion:suffix

output
abrasion (S (abrade:stem) (ion:suffix))
abstainer (S (abstain:stem) (er:suffix))
abstention (S (abstain:stem) (ion:suffix))
accessibility (S (S (access:stem) (ible:suffix)) (ity:suffix))
accretion (S (accrete:stem) (ion:suffix))
activist (S (active:stem) (ist:suffix))
adaptable (S (adapt:stem) (able:suffix))
addiction (S (addict:stem) (ion:suffix))


text:
Q: Apparmor problem: Icedtea plugin freezes firefox (35.0.1) EDIT5: finally it's probably is an Apparmor problem.
/usr/lib/firefox/firefox{,*[^s][^h]}

is indeed in complain mode, but
/usr/lib/firefox/firefox{,*[^s][^h]}//browser_java
/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk
/usr/lib/firefox/firefox{,*[^s][^h]}//sanitized_helper

are in enforce mode. I don't know how to switch them to complain. The only profile I have in /etc/apparmor.d/ is usr.bin.firefox (with /usr/bin/firefox apparently being a link to /usr/lib/firefox/firefox.sh), and I did sudo aa-complain /etc/apparmor.d/usr.bin.firefox
There is a bug report https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1293439 marked as 'fix released', but I don't seem to enjoy the fix :-)
One workaround was to follow the method stated here How to use Firefox AppArmor profile with IcedTea Java plugin on Ubuntu 14.04?, that is to disable firefox profile altogether:
sudo ln -s /etc/apparmor.d/usr.bin.firefox /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.bin.firefox
sudo service apparmor reload

But as stated by the OP, this is not a satisfying solution... And until now, no one proposed a better solution...
Here are the DENIED messages from Apparmor:
type=AVC msg=audit(1424428803.909:134): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/run/user/1000/icedteaplugin-franck-OzMRPQ/4468-icedteanp-plugin-debug-to-appletviewer" pid=4513 comm="java" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428803.909:135): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/run/user/1000/icedteaplugin-franck-OzMRPQ/4468-icedteanp-plugin-to-appletviewer" pid=4480 comm="java" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428804.046:136): apparmor="DENIED" operation="exec" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/usr/bin/logger" pid=4514 comm="java" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0

type=AVC msg=audit(1424428804.395:137): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/proc/4477/cmdline" pid=4480 comm="java" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428804.406:138): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/run/user/1000/dconf/user" pid=4480 comm="java" requested_mask="wrc" denied_mask="wrc" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428804.407:139): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/run/user/1000/dconf/user" pid=4480 comm="java" requested_mask="wrc" denied_mask="wrc" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428804.407:140): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/run/user/1000/dconf/user" pid=4480 comm="java" requested_mask="wrc" denied_mask="wrc" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428804.407:141): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/run/user/1000/dconf/user" pid=4480 comm="java" requested_mask="wrc" denied_mask="wrc" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428804.408:142): apparmor="DENIED" operation="connect" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" pid=4517 comm=64636F6E6620776F726B6572 family="unix" sock_type="stream" protocol=0 requested_mask="send receive connect" denied_mask="send connect" addr=none peer_addr="@/tmp/dbus-VT8SEPjAqx" peer="unconfined"

type=AVC msg=audit(1424428804.408:143): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/run/user/1000/dconf/user" pid=4517 comm=64636F6E6620776F726B6572 requested_mask="wrc" denied_mask="wrc" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428804.408:144): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/run/user/1000/dconf/user" pid=4517 comm=64636F6E6620776F726B6572 requested_mask="wrc" denied_mask="wrc" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428804.880:145): apparmor="DENIED" operation="connect" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" pid=4480 comm="java" family="unix" sock_type="stream" protocol=0 requested_mask="send receive connect" denied_mask="send connect" addr=none peer_addr="@/tmp/dbus-VT8SEPjAqx" peer="unconfined"

type=AVC msg=audit(1424428804.881:146): apparmor="DENIED" operation="connect" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" pid=4480 comm="java" family="unix" sock_type="stream" protocol=0 requested_mask="send receive connect" denied_mask="send connect" addr=none peer_addr="@/tmp/dbus-VT8SEPjAqx" peer="unconfined"

type=AVC msg=audit(1424428804.929:147): apparmor="DENIED" operation="connect" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" pid=4480 comm="java" family="unix" sock_type="stream" protocol=0 requested_mask="send receive connect" denied_mask="send connect" addr=none peer_addr="@/tmp/dbus-VT8SEPjAqx" peer="unconfined"

type=AVC msg=audit(1424428804.931:148): apparmor="DENIED" operation="connect" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" pid=4480 comm="java" family="unix" sock_type="stream" protocol=0 requested_mask="send receive connect" denied_mask="send connect" addr=none peer_addr="@/tmp/dbus-VT8SEPjAqx" peer="unconfined"

type=AVC msg=audit(1424428805.106:149): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/proc/sys/net/ipv4/ip_local_port_range" pid=4480 comm="java" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

type=AVC msg=audit(1424428805.106:150): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/proc/sys/net/ipv4/ip_local_port_range" pid=4480 comm="java" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

type=AVC msg=audit(1424428805.929:151): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/home/franck/.mozilla/firefox/profiles.ini" pid=4480 comm="java" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

type=AVC msg=audit(1424428805.930:152): apparmor="DENIED" operation="exec" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/usr/bin/logger" pid=4519 comm="java" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0

type=AVC msg=audit(1424428805.981:153): apparmor="DENIED" operation="exec" profile="/usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk" name="/usr/bin/logger" pid=4520 comm="java" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0

=============================================================================
I need to use java applets to access some clients VPN portals, and I'm trying to use Icedtea plugin on Ubuntu 14.10 / Firefox 35.0.1.
Whenever I try to run an applet, Firefox will freeze for some time. It might be a long time, and I might have to kill Firefox.
This seems to happen with every applet I try, for example with every applet found here http://icedtea.classpath.org/wiki/IcedTea-Web-Tests.
I can't find any .icedtea directory with logs.
Running Firefox from the terminal gives me some information:
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~utopic1)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
java.io.FileNotFoundException: /run/user/1000/icedteaplugin-franck-2KgVYB/2434-icedteanp-plugin-to-appletviewer (Permission non accordée)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at java.io.FileInputStream.<init>(FileInputStream.java:101)
    at sun.applet.PluginMain.connect(PluginMain.java:186)
    at sun.applet.PluginMain.main(PluginMain.java:148)
<snip>
Something very bad happened. I don't know what to do, so I am going to exit :(

###!!! [Parent][MessageChannel::Call] Error: Channel timeout: cannot send/recv

Any idea how to fix this ?
EDIT: I made sure apparmor is in complain mode, not enforce, for Firefox.
EDIT2: rerun with 'firefox -g', but didn't get much more information.
Here is the output when running the applet:
[New Thread 0x7ffd5a3fe700 (LWP 5254)]
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-1~utopic1)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
java.io.FileNotFoundException: /run/user/1000/icedteaplugin-franck-s7zldV/5255-icedteanp-plugin-to-appletviewer (Permission non accordée)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at java.io.FileInputStream.<init>(FileInputStream.java:101)
    at sun.applet.PluginMain.connect(PluginMain.java:186)
    at sun.applet.PluginMain.main(PluginMain.java:148)

(<unknown>:5264): dconf-CRITICAL **: unable to create file '/run/user/1000/dconf/user': Permission non accordée.  dconf will not work properly.
(<unknown>:5264): dconf-CRITICAL **: unable to create file '/run/user/1000/dconf/user': Permission non accordée.  dconf will not work properly.
(<unknown>:5264): dconf-CRITICAL **: unable to create file '/run/user/1000/dconf/user': Permission non accordée.  dconf will not work properly.
(<unknown>:5264): dconf-CRITICAL **: unable to create file '/run/user/1000/dconf/user': Permission non accordée.  dconf will not work properly.
(<unknown>:5264): dconf-CRITICAL **: unable to create file '/run/user/1000/dconf/user': Permission non accordée.  dconf will not work properly.
(<unknown>:5264): dconf-CRITICAL **: unable to create file '/run/user/1000/dconf/user': Permission non accordée.  dconf will not work properly.
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(<unknown>:5264): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
Something very bad happened. I don't know what to do, so I am going to exit :(

###!!! [Parent][MessageChannel::Call] Error: Channel timeout: cannot send/recv

And here is the output of an ls:
~$ ls -l /run/user/1000/icedteaplugin-franck-s7zldV/5255-icedteanp-plugin-to-appletviewer
prw------- 1 franck franck 0 févr. 18 09:41 /run/user/1000/icedteaplugin-franck-s7zldV/5255-icedteanp-plugin-to-appletviewer

EDIT4: might be related to this https://bugzilla.redhat.com/show_bug.cgi?id=976833

A: First, putting the subprofiles into complain mode. You can manually do this by adding flags=(complain) to the profile.
eg.
/usr/lib/firefox/firefox{,*[^s][^h]}//browser_java flags=(complain) {
   ...
}

Once that is done reload the profile.
Now for at first pass at the rules you will need to add to /usr/lib/firefox/firefox{,*[^s][^h]}//browser_openjdk  to fix the listed denials. Please note there may be more denied messages after these are added. Also you should check /var/log/syslog for denied messages because Ubuntu has turned on extended dbus mediation and its denials do not go to the kernel ring buffer. Also this profile should be reloaded to make sure the new rules are added.
/usr/bin/logger Pix, # choose transition that makes sense for your profiles

/proc/sys/net/ipv4/ip_local_port_range r,
/proc/@{pid}/cmdline r,

owner @{HOME}/.mozilla/firefox/profiles.ini r,
owner /run/user/1000/dconf/user rw,
owner /run/user/1000/icedteaplugin-franck-OzMRPQ/4468-icedteanp-plugin-to-appletviewer r,

unix peer=(addr=@/tmp/dbus-* label=unconfined),

A: You can try adding the following rules to your ..../browser_openjdk child profile:
owner /run/user/*/icedteaplugin-*/* r,
/usr/bin/logger Pix,
@{PROC}/@{pid}/cmdline r,
owner /run/user/*/dconf/user rw,
@{PROC}/sys/net/ipv4/ip_local_port_range r,
owner @{HOME}/.mozilla/firefox/profiles.ini r,
unix (send, receive, connect),

I'd be a little concerned about these privileges, I don't know the entirety of what's stored in dconf, but I'd be reluctant to give it to every Java applet on the web. Allowing Java to connect to unconfined processes via Unix domain sockets may also be an avenue for escape.
Thanks


text:
Q: Why isn't a conceptual Git article out there without any piece of console juggling? I have googled this about 10 times or more, but couldn't find any fine explanation of things like rebase, stash, reflow, submodules (!), reflog etc.
I'd like drawings, figures, metaphors, only the concepts. And I bet many developers would like it as I'd do. Actual command line tools / GUIs can be one's personal preference after.
Do you know such a piece of article / post / PDF / video / whatever?

A: The famous "Git Parable" is pretty metaphoric and contains precisely zero console juggling.
On a more serious note, I reckon most guides show Git console commands simply to demonstrate the concepts being discussed; so take any guide and ignore the commands.
Having said that, I find the following guides to be of very high quality while mostly focusing on concepts rather than commands:

*

*"Git concepts simplified" (by the way, written by the author of gitolite).

*"Git for computer scientists".

*"Git from the bottom up".

A: There are lots of visual resources out there:

*

*Did you not find the pictures in the most recommended Git book, Pro Git, to be helpful?

*Learn Git Branching is a free one that can help you understand rebase.

*Atlassian has some Git guides with pictures.

*Code School has Git video courses that can explain Git concepts with pictures, though it is not free.


text:
Q: Node.js Socket.io: io.on ('connection') is not working io.on ('connection') doesn't work. I have been looking for an answer to my question for a long time, but I have not found it. I am using Express + Socket.io bundle, so I expected there might be problems. I found in one answer to a question to use express.static, but it didn't help. Vod file in which the server code:

var express = require('express')
var app = express();
var server = require('http').createServer(app);
var io = require('socket.io')(server);
var PORT = 3000;

var connections = [];

app.use(express.static(__dirname + '/public/'));

app.get('/', function (request, responce) {
    responce.sendFile(__dirname + '/public/index.html');
});

io.sockets.on('connection', function (socket) {
    connections.push(socket);
    console.log(connections);
    console.log('New user connected to chat!');
    socket.on('disconnect', function (data) {
        connections.splice(connections.indexOf(socket), 1);
        console.log('User disconnected.');
    });
});

server.listen(PORT, function () {
    console.log(`Start listening on http://localhost:${PORT}`);
});

Here is the index.html file:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Socket.io chat</title>
</head>
<body>
    Site is working!
</body>
<script src="/socket.io/socket.io.js"></script>
<script>
</script>
</html>

My directory tree looks like this:SocketChat/  index.js (server file)  package.json   package-lock.json  node_modules/  public/    index.html
I remember to restart index.js after changes and the text "Site is working!" it seems to me. What is the problem? Thanks in advance to those who will solve my question. Sorry if I have a silly mistake :|

A: It was necessary to add to the html page:

<script>
       var socket = io ();
</script>


text:
Q: React Tailwind - Not able to run build.css file I am new to tailwind I have a simple react shopping cart project with basic CSS and I want to convert it with Tailwind.
I have install tailwind using the tutorial below.
https://www.youtube.com/watch?v=v6Sy6VP2yOc
But I am stuck when in tutorial he use npm run build:css command.
Video Time lap -- https://youtu.be/v6Sy6VP2yOc?t=286
In tutorial it compile successfully but on my side it did not.
Can anybody tell me why?

A: Can you please check the below code? Hope it will work for you. You can try this way, it might be helpful for you.
"scripts": {
  "start": "react-scripts start",
  "build": "npm run build:css && react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject",
  "build:css": "postcss src/your-path -o src/your-path",
}

After that, you need to restart your project using the below command so that this will build your tailwind file automatically.
npm start


text:
Q: The eigenfunction of modified $1$-laplace equation? Let $\Omega\subset \mathbb R^2$ be open bounded with smooth boundary. It is well known that the laplace equation
$$
-\Delta u=0
$$
has a set of eigenvalues $0<\lambda_1<\lambda_2\leq\lambda_3<...$, and the corresponding eigenfunction forms a ONB in $L^2$.
My question: for any $\epsilon>0$ fixed, do we have a similar set of eigenfunctions for the following equation?
$$
-\operatorname{div}\left(\frac{\nabla u}{\sqrt{|\nabla u|^2+\epsilon}}\right)=0.
$$
If there do exists a countable set of eigenfunctions, what about the regularity? Could they form an ONB as the laplace equation?
I think, without $\epsilon$ term the above equation is ill-posted. But how about adding $\epsilon$ term? would it be helpful?
Thank you!
PS: by eigenfunction I am looking for solution like
$$
-\operatorname{div}\left(\frac{\nabla u}{\sqrt{|\nabla u|^2+\epsilon}}\right)=\lambda u,
$$
and also I am interested in regularity as well.


text:
Q: Spring Boot WS-Server - Custom Http Status I published endpoints using Spring Boot WS-Server
When I use SoapUI I see:
HTTP/1.1 200
Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, /; q=.2
SOAPAction: ""
Content-Type: text/xml;charset=utf-8
Content-Length: 828
Date: Thu, 29 Apr 2021 14:04:54 GMT
Keep-Alive: timeout=60
Connection: keep-alive
I would like to set custom HTTP Status in response (I know that it may be against the standard but it is an external requirement). I also read following topic:
Spring WS (DefaultWsdl11Definition) HTTP status code with void
But this solution failed
Spring Boot version: 2.2.7

A: Problem was solved
As I said I wanted to set custom HTTP status in SOAP response.
I found this post:
Spring WS (DefaultWsdl11Definition) HTTP status code with void
Author used EndpointInterceptor with TransportContext to get HttpServletResponse, then he changed status. The difference between my and his case is the fact, that he returned void from WebService method whereas I wanted to return some response.
In my situation following code in Spring WebServiceMessageReceiverObjectSupport class (method handleConnection) overrode servlet status previously set in interceptor:
if (response instanceof FaultAwareWebServiceMessage && connection instanceof FaultAwareWebServiceConnection) {
                    FaultAwareWebServiceMessage faultResponse = (FaultAwareWebServiceMessage)response;
                    FaultAwareWebServiceConnection faultConnection = (FaultAwareWebServiceConnection)connection;
                    faultConnection.setFaultCode(faultResponse.getFaultCode());
                }

In order to bypass this fragment of code I needed to define class with my own implementation of handleConnection method, which extended class WebServiceMessageReceiverHandlerAdapter
In my implementation I excluded change of status. Important thing is to pass WebMessageFactory bean in autowired constructor of this class, otherwise exception is raised during app's startup.
This class has to be marked with Spring stereotype (eg. @Component) and name of this bean has to be configured in Configuration class when configuring ServletRegistrationBean:
@Bean
    public ServletRegistrationBean<MessageDispatcherServlet> messageDispatcherServlet(ApplicationContext applicationContext){
        MessageDispatcherServlet servlet = new MessageDispatcherServlet();
        servlet.setApplicationContext(applicationContext);
        servlet.setTransformWsdlLocations(true);
        servlet.setMessageFactoryBeanName("webServiceMessageFactory");
        servlet.setMessageReceiverHandlerAdapterBeanName("myOwnMessageReceiverHandlerAdapter");
        return new ServletRegistrationBean<>(servlet,"/ws/*");
    }


text:
Q: Working with part of a query at a time I have a hibernate query which returns 10s of thousands of object results.  Is it possible to cycle through chunks of the query rather than handling the entire query at once?
Sample code:
Query q = session.createQuery("FROM Class");

List<Class> classList = (List<Class>) q.list();

Thanks

A: Use query.setMaxResults(int) and query.setFirstResult(int) to page through the query.
Usually you'd write a method that displays page x of the result size where y is the number of items per page:
public List<Thingy> showThingies(int itemsPerPage, int pageOffest){
    // ..
    query.setMaxResults(itemsPerPage);
    query.setFirstResult(itemsPerPage * pageOffset);
    // ..
}

A: You could use the ScrollableResults from hibernate
Something like:
ScrollableResults results = session.createCriteria(Project.class)
            .add(Restrictions.eq("projectType", Constants.REINDEX.PROJECT_TYPE))
            .setFetchSize(10)
            .scroll(ScrollMode.FORWARD_ONLY);

while (results.next()) {
        project = (Project) results.get(0);

If you are scrolling through a huge ammount of entities you should probably also clear your session from while to while, else you could run out of memory.
More information is to be found in the documentation 10.4.1.6. Scrollable iteration and as they wrote it, you should use pagination if you don't want your connection to stay open.


text:
Q: Python interview questions I am going to interview within two weeks for an internship that would involve Python programming.
Can anyone suggest what possible areas should I polish? I am looking for commonly asked stuff in interviews for Python openings. Apart from the fact that I have already been doing the language for over a year now, I fail to perceive what they can ask me.
Like for a C or C++ interview, there are lots of questions ranging from reversing of strings to building linked lists, but for a Python interview, I am clueless.
Personal experiences and/ or suggestions are welcomed.

A: Here are some easy ones:

*

*What are Python decorators and how would you use them?

*How do you debug your Python code?

*How would you setup many projects where each one uses different versions of Python and third party libraries?

*Do you follow PEP8 while writing your code?

A: How about something involving Python list comprehensions? To me, those were one of the big selling points over C++, after I read about them in Dive into Python.
"Write a list comprehension that builds a list of the even numbers from 1 to 10 (inclusive)".
Where the answer is anything like this (note the range values avoid a fencepost error):
foo = [x for x in range(1, 11) if (x % 2) == 0]
print foo
[2, 4, 6, 8, 10]

For that matter, if you understand all the concepts listed in Dive into Python, that should cover most of the important features.

A: Is Python pass by reference or pass by value is also a very good question.

A: Questions I've been asked:

*

*Describe two methods of meta-programming in Python.

*What is the GIL?

*Why is the GIL important?

*Why is there an alternative implementation of Python called Unladen Swallow?

*Django, Pylons, or Zope? Defend your position.

A: I have no such experiences, but here are some guesses:

*

*(Im)mutability

*First class functions/classes

*Closures

That's some stuff that python programmer should know, otherwise you may as well hire C programmer for the position.

A: I would go along the list in this answer. Try to refresh what you know following that list as far as you can. Don't worry if you cannot make it until the very end.

A: Besides other links people have provided. I also recommend Hidden Features of Python. Just in case they throw some tricky questions at you.

A: What is your sense, will they be trying to test whether you know Python, see whether you can get things done in Python, or test whether you can program (in Python)?
Those are very different things.
If they want you to show that you know Python, they may force you to do things like create a generator, then do it without using yield.  Explain how classes work.  Explain the C3 method resolution order.  And so on.
If they want you to show you can get things done in Python, you'll need to be competent with the basic data structures, and have a list of libraries that you'd go to for different kinds of tasks.  So you need to be comfortable with dictionaries, sets, arrays.  Likewise you need to know about things like BeautifulSoup for parsing HTML, be able to talk about a framework that could be used for web development, etc.  You don't necessarily need to know how to use those things well, but you should know where to go, how to figure out more, and be able to actually use them once the interviewer has given you things that are documented.
If they want you to show that you can program (in Python), you'll need to know the basic data structures, and know your algorithms.  This is much closer to the C/C++ questions that you'd be asked, except that you'll be expected to use native data structures where it makes your life easy.
To be safe you should prepare to some extent for all three.  For instance read through http://docs.python.org/tutorial/ and make some notes to yourself.  Hopefully you already know how to program.  And then try some random tasks, and force yourself to use libraries that you may have missed.  So, for instance, read some CSV, extract information programmatically out of a web page, build a small website with a framework, etc.


text:
Q: Gradle main source code substitution I'm trying to generated a pre-processed source code in Android, I'm applying some regex-es to my code through a Gradle task and copying that modified code to a new folder within the build folder, this is working properly, but the missing part is that after preprocessing the code, and setting the source for the Android task, gradle complains about duplicated classes. I want to replace the main srcDir for some specific cases (when the build is a Release build specifically) but I can't override the path for the classes to avoid the code duplication. How can I achieve this?
My gradle task as follow :
task filterComments(type: Copy) {
    from "$projectDir/src/main/java"
    into "$projectDir/build/generated-src"
    filter { line -> line.replaceAll('LoremIpsumDolor', 'LOREMIPSUMDOLOR') }
}

tasks.withType(JavaCompile) {
    task -> if (task.name.contains("compileRelease")) {
        task.dependsOn filterComments
        task.source "$projectDir/build/generated-src"
    }
}


text:
Q: How do you draw a line using the weight vector in a Linear Perceptron? I understand the following:
In 2D space, each data point has 2 features: x and y.
The weight vector in 2D space contains 3 values [bias, w0, w1] which can be rewritten as [w0,w1,w2].
Each datapoint needs an artificial coordinate [1, x, y] for the purposes of calculating the dot product between it and the weights vector.
The learning rule used to update the weights vector for each misclassfied point is w := w + yn * xn
My question is: how do you derive two points from the weight vector w = [A, B, C] in order to graph the decision boundary?
I understand A + Bx + Cy = 0 is the linear equation in general form (A, B, C are can be taken from the weights vector) but I don't know how to plot it.
Thanks in advance.

A: Recently I was trying to implement the same thing, but too confused how to draw the decision boundary plot with three weights $w_0,w_1,w_2$. And based on @Joshu solution mentioned above, I have written matplotlib code to draw boundary line.
def plot_data(self,inputs,targets,weights):
    # fig config
    plt.figure(figsize=(10,6))
    plt.grid(True)

    #plot input samples(2D data points) and i have two classes.
    #one is +1 and second one is -1, so it red color for +1 and blue color for -1
    for input,target in zip(inputs,targets):
        plt.plot(input[0],input[1],'ro' if (target == 1.0) else 'bo')

    # Here i am calculating slope and intercept with given three weights
    for i in np.linspace(np.amin(inputs[:,:1]),np.amax(inputs[:,:1])):
        slope = -(weights[0]/weights[2])/(weights[0]/weights[1])
        intercept = -weights[0]/weights[2]

        #y =mx+c, m is slope and c is intercept
        y = (slope*i) + intercept
        plt.plot(i, y,'ko')

A: The best way to draw a line is to find the minimum x value and maximum x value on your display axis. calculate y values using the known line equation (-(A+BX)/C). This result in two points use inbuilt plot command to draw a line.

A: Plug your weights into the general form (w0 + w1x + w2y = 0) and solve for x, x=0, y, y=0:
x = -(w0 - w2y)/w1
x = 0 when y = -w0/w2
y = -(w0 - w1x)/w2
y = 0 when x = -w0/w1

Now we have two points that lie on the line: (0, -w0/w2) and (-w0/w1, 0)
slope = -(w0/w2)/(w0/w1)
intercept = -w0/w2


text:
Q: Restrict IIS site to Windows domain users My workplace (~10 workstations and a server) serves a site via IIS 7 on Windows Server 2008 R2. (It's a MediaWiki wiki, nothing to do with ASP or .NET; and it's HTTP, not HTTPS.)
Users logged onto the Windows domain can visit the site by Intranet URL — OUR_MACHINE_NAME.local — and this works fine. However, the site is also accessible from the wider Internet (if you happen to know or guess the server's IP address), and for security reasons I want to prevent this. Only users logged into our Windows domain should be able to access the site.
I've spent a while experimenting with the Authorization settings in IIS, but nothing seems to have any effect. I also found some HTTP settings under "Windows Firewall with Advanced Security", but am not sure what I would need to change.
Can someone advise please? (Apologies for any wrong assumptions: I'm a programmer and have little experience of network configuration.)


text:
Q: Tannaka duality for closed monoidal categories I asked this some time ago at mathstackexchange, and people there explained to me the mathematical part of what I was asking, but the question about references remains open. In my impression, people here at MO are more active, so I hope, specialists in the category theory could clarify the remaining part of my question. (At the same time I foresee that somebody can suggest another idea of how this can be proved, and I would welcome this as well.)
The nLab article on the Tannaka duality says that this theory was generalized to monoids in arbitrary closed monoidal category (symmetric and complete in some sense):

if we take a monoid $A$ in such a category $\mathcal V$ and consider the category $_A{\mathcal V}$ of all left modules over $A$, then $A$ can be recovered from $_A{\mathcal V}$ as the object of enriched endomorphisms of the forgetful functor $F: {_A{\mathcal V}}\to {\mathcal V}$.

(As far as I understand, this result is called a reconstruction theorem.)
Some details in this construction are however explained at nLab vaguely, in particular,

how is the structure of the enriched category introduced on $_A{\mathcal V}$?

Can anybody give me a link to a text where this result is explained accurately so that I could refer to it with a clear conscience? (Perhaps I am missing something, I do not see where this is written. From what I see, I have the impression that this is folklore, but I have no confidence, and I do not dare to write this in my paper.)

A: I think a good reference for your question would be R. Street, Quantum Groups, A Path to Current Algebra, Chapter 16: Tannaka Duality (see here).


text:
Q: Chrome Browser Extension Load Dynamic Content From Default Popup Ppage I am struggling how to display dynamic or external content from popup.html in Chrome browser.
My manifest.json looks like:
{
    "name": "New Extension",
    "manifest_version": 2,
    "version": "0.1",
    "description": "My new Chrome extension",
    "icons": {
        "16": "name.png"
    },
  "options_page": "option.html",
  "browser_action": {
        "default_icon": "icon.png",
        "default_title": "New Extension",
        "default_popup": "popup.html"
        },
    "permissions": ["<all_urls>"]
}

Right now my popup.html looks like
<html>
<body>
show dynamic/externally loaded content here
</body>
</html>

Obviously that is incorrect/incomplete.
What are my options, can I "link through" the dynamic content?  I do not think I want to use IFRAME, but what about AJAX?
How can this be accomplished?
Any help appreciated.  Thank you in advance.


text:
Q: SOAP fault message S:Server cannot be cast to en I am inserting three input in SOAP request and when trying to get a response I am getting fault message specifying that cannot be cast to a class.
Here I have attached the SOAP response which I am facing.
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
  <faultcode>S:Server</faultcode>
  <faultstring>...bssv.J570040.valueobject.InternalOrderVO cannot be cast to ...bssv.JP570040.valueobject.IntermediateShipDet</faultstring>
  <detail>
    <ns2:exception xmlns:ns2="http://jax-ws.dev.java.net/" class="java.lang.ClassCastException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false">
      <message>bssv.J570040.valueobject.InternalOrderVO cannot be cast to bssv.JP570040.valueobject.IntermediateShipDet</message>
      <ns2:stackTrace>
        <ns2:frame class="bssv.JP570040.valueobject.showOrderDetVO" file="showOrderDetVO.java" line="123" method="<init>" />
        <ns2:frame class="bssv.JP570040.InvokeShippingDet" file="InvokeShippingDet.java" line="82" method="GetShippingOrder" />
        <ns2:frame class="bssv.JP570040.InvokeShippingDet" file="InvokeShippingDet.java" line="39" method="GetShippingOrder" />
        <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0" />
        <ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="39" method="invoke" />
        <ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="25" method="invoke" />
        <ns2:frame class="java.lang.reflect.Method" file="Method.java" line="597" method="invoke" />
        <ns2:frame class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker" file="WLSInstanceResolver.java" line="92" method="invoke" />
        <ns2:frame class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker" file="WLSInstanceResolver.java" line="74" method="invoke" />
        <ns2:frame class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java" line="151" method="invoke" />
        <ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl" file="EndpointMethodHandlerImpl.java" line="268" method="invoke" />
        <ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="100" method="processRequest" />
        <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="866" method="__doRun" />
        <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="815" method="_doRun" />
        <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="778" method="doRun" />
        <ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="680" method="runSync" />
        <ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="403" method="process" />
        <ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="532" method="handle" />
        <ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="253" method="handle" />
        <ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="140" method="handle" />
        <ns2:frame class="weblogic.wsee.jaxws.WLSServletAdapter" file="WLSServletAdapter.java" line="171" method="handle" />
        <ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke" file="HttpServletAdapter.java" line="708" method="run" />
        <ns2:frame class="weblogic.security.acl.internal.AuthenticatedSubject" file="AuthenticatedSubject.java" line="363" method="doAs" />
        <ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="146" method="runAs" />
        <ns2:frame class="weblogic.wsee.util.ServerSecurityHelper" file="ServerSecurityHelper.java" line="103" method="authenticatedInvoke" />
        <ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$3" file="HttpServletAdapter.java" line="311" method="run" />
        <ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter" file="HttpServletAdapter.java" line="336" method="post" />
        <ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="95" method="doRequest" />
        <ns2:frame class="weblogic.servlet.http.AbstractAsyncServlet" file="AbstractAsyncServlet.java" line="99" method="service" />
        <ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="820" method="service" />
        <ns2:frame class="weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction" file="StubSecurityHelper.java" line="227" method="run" />
        <ns2:frame class="weblogic.servlet.internal.StubSecurityHelper" file="StubSecurityHelper.java" line="125" method="invokeServlet" />
        <ns2:frame class="weblogic.servlet.internal.ServletStubImpl" file="ServletStubImpl.java" line="300" method="execute" />
        <ns2:frame class="weblogic.servlet.internal.TailFilter" file="TailFilter.java" line="26" method="doFilter" />
        <ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter" />
        <ns2:frame class="oracle.security.jps.ee.http.JpsAbsFilter$1" file="JpsAbsFilter.java" line="111" method="run" />
        <ns2:frame class="java.security.AccessController" file="AccessController.java" line="native" method="doPrivileged" />
        <ns2:frame class="oracle.security.jps.util.JpsSubject" file="JpsSubject.java" line="313" method="doAsPrivileged" />
        <ns2:frame class="oracle.security.jps.ee.util.JpsPlatformUtil" file="JpsPlatformUtil.java" line="413" method="runJaasMode" />
        <ns2:frame class="oracle.security.jps.ee.http.JpsAbsFilter" file="JpsAbsFilter.java" line="94" method="runJaasMode" />
        <ns2:frame class="oracle.security.jps.ee.http.JpsAbsFilter" file="JpsAbsFilter.java" line="161" method="doFilter" />
        <ns2:frame class="oracle.security.jps.ee.http.JpsFilter" file="JpsFilter.java" line="71" method="doFilter" />
        <ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter" />
        <ns2:frame class="oracle.dms.servlet.DMSServletFilter" file="DMSServletFilter.java" line="136" method="doFilter" />
        <ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter" />
        <ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3715" method="wrapRun" />
        <ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3681" method="run" />
        <ns2:frame class="weblogic.security.acl.internal.AuthenticatedSubject" file="AuthenticatedSubject.java" line="321" method="doAs" />
        <ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="120" method="runAs" />
        <ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2277" method="securedExecute" />
        <ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2183" method="execute" />
        <ns2:frame class="weblogic.servlet.internal.ServletRequestImpl" file="ServletRequestImpl.java" line="1454" method="run" />
        <ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="209" method="execute" />
        <ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="178" method="run" />
      </ns2:stackTrace>
    </ns2:exception>
  </detail>
</S:Fault>

A: Just looking at the error I would assume that, there is an error converting internal data item from Date type to external data item of Calendar data type.
Please find a sample of such conversion in bssv
 public Calendar setCalendar(Date date)
  {
    Calendar cal = Calendar.getInstance();
    if (date != null)
    {
      cal.setTime(date);
    }
    return cal;
  }


text:
Q: Get Console Output History (including Colors) Is it possible to somehow get the Console Output (including the Colors) using C# (P/Invoke, C++/CLI or 'pure' C++ is also fine by me)?
It would also be important to read the Console output, which has been printed before my application has started.
Imagening, that it is not possible to fetch such information, could one be able to use UIAutomation or similar to analyse the console window?

I would like to have some kind of result like this (though I can do the actual processing and converting myself):
// Pseudo-code //

public struct CONSOLE_CHARACTER {
    public uint xOffset;
    public uint yOffset;
    public char Character;
    public ConsoleColor ForegroundColor;
    public ConsoleColor BackgroundColor;
}

// Fetch the previous output including colors
CONSOLE_CHARACTER[] previous_output = Console.ReadCompleteOutput();

Some Data like this must be accessible somehow, as the graphics card has to draw the console window like any other one, and the user32/gdi32-Libraries somehow must acquire this kind of data...

EDIT: this comment proided by IInspectable did help me find the solution


text:
Q: Dask map_blocks - IndexError: tuple index out of range I want to do the following with Dask:

*

*Load a matrix from a HDF5 file

*Parallelize the calculation of each entry

Here is my code:
def blocked_func(x):
    return np.random.random()

with h5py.File(file_path) as f:
    d = f['/data']
    arr = da.from_array(d, chunks=(chunks_row, chunks_col))

    arr2 = arr.map_blocks(blocked_func, dtype='float32').compute()

But the code throws the following error:
File ".../remote_fr_thinkpad/test_big_data.py", line 43, in <module>
    arr2 = arr.map_blocks(blocked_func, dtype='float32').compute()
  File ".../anaconda3/lib/python3.7/site-packages/dask/base.py", line 156, in compute
    (result,) = compute(self, traverse=False, **kwargs)
  File ".../anaconda3/lib/python3.7/site-packages/dask/base.py", line 399, in compute
    return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
  File ".../anaconda3/lib/python3.7/site-packages/dask/base.py", line 399, in <listcomp>
    return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
  File ".../anaconda3/lib/python3.7/site-packages/dask/array/core.py", line 779, in finalize
    return concatenate3(results)
  File ".../anaconda3/lib/python3.7/site-packages/dask/array/core.py", line 3497, in concatenate3
    chunks = chunks_from_arrays(arrays)
  File ".../anaconda3/lib/python3.7/site-packages/dask/array/core.py", line 3327, in chunks_from_arrays
    result.append(tuple([shape(deepfirst(a))[dim] for a in arrays]))
  File ".../anaconda3/lib/python3.7/site-packages/dask/array/core.py", line 3327, in <listcomp>
    result.append(tuple([shape(deepfirst(a))[dim] for a in arrays]))
IndexError: tuple index out of range

I googled around and also tried dask's gu_func, but that threw the same error.
Thanks for your help.

A: map_block expects blocked_func to return an array of the same shape of its input (chunks_row, chunks_col), while it actually just returns a float.
Try either with
1) a function which preserves shape, e.g:
def blocked_func(x):
    return x*2

or
2) tell map_blocks that the shape of the output will be different:
arr2 = arr.map_blocks(blocked_func, chunks=(1,1), dtype='float32').compute()

but keep the dimensionality of the input array in blocked_func, e.g.:
def blocked_func(x):
    return np.random.random()[None,None]
    # or like this
    # return np.array([1,1])


text:
Q: submit a form using POSTMAN I am trying to login a web page from POSTMAN. Basically, I have to submit a form. Form data posted below,
<form action="https://www.revcontent.com/login" method="post" accept-charset="utf-8" class="cmxform animated flipInY" id="altForm" role="form">

<input type="hidden" name="rv_tsvm" value="919fb358fe5028ed53d40fca59766df0">

            <input type="hidden" name="desk" value="false">

                    <input type="text" class="form-control" placeholder="Username or E-mail" name="name" id="name" value="">

                    <input type="password" class="form-control" placeholder="Password" name="password" id="password" value="">

                <input id="submitBtn" class="btn btn-primary btn-lg btn-block no-margin " type="submit" name="login" value="Sign In">

Forgot your username or password?

    </form>

So, I have three input fields,
name : "user_name"
password : "password_site"
login : "Sign In"

In the POSTMAN, I have selected the POST method and URL is https://www.revcontent.com/login and I have defined the key and value in the body . I can login to the site with the same username and password. But, in the POSTMAN it is not working.

The Error it is showing,
<!DOCTYPE html>

        <title>Error</title>

An Error Was Encountered

The action you have requested is not allowed.

A: The error you are getting is 500 Internal server error, that means its not even checking your login credentials and some part of the application is blocking you from going to that route. I also tried on postman and I was also getting the same error. The culprit is cookies. So, you also need to pass the cookies with it.
Here is my postman working link. (https://www.getpostman.com/collections/c8459b16c8fb6fbe01d6). You can import it directly in your postman. Make sure you are passing the correct cookies, dummy values won't work.


text:
Q: Generate markup for jquery tabs using marionette views I want to generate a markup for jQuery tabs using Marionette Views like so:

ONE

TWO

THREE

Content heading 1

DATA

Content heading 2

DATA

Content heading 3

DATA

DATA:
I've a collection of data I receive from the server that shall be used to populate the tabs - like so.
ItineraryCollection:
[
    day1: {DATA},
    day2: {DATA},
    day2: {DATA},
]

I want to create a tab like so using $('#tab_container').tabs() using jQuery tabs function:

A: Although it's not a direct answer to your question, I've covered generating markup for external libraries on my blog here: http://davidsulc.com/blog/2013/02/03/tutorial-nested-views-using-backbone-marionettes-compositeview/
That post shows you how to use Marionette to create the markup to display a collapsible view. You should be able to easily adapt the concepts to your goal.


text:
Q: jQuery Object Constructor Optimization I am starting to optimize some of my scripts for a project I'm working on, and a good place to start seemed to be the jQuery constructors themselves.
Off the top of my head, I thought of a few different ways of constructing/passing around the jQuery objects. I then made a JSPerf with the following cases and got an incredibly unexpected result:
$("#inner").html();    // Fastest (1)

var x = $("#inner");   // (2)
x.html();

var x = $("#inner");   // (3) !!!
$("#inner").html();

var x = $("#inner");   // Slowest (4) !!!
$(x).html();

In cases 3 and 4, it was actually faster to re-perform the query and construct a jQuery from the results than to return a jQuery object from an already-constructed jQuery object. I had expected jQuery to just return the object if it was available, but this obviously cannot be true since there is a difference of ~100k ops/sec between Cases 3 and 4.
What's actually going on here? Is there a reason jQuery does not just return an already-constructed object (eg: perhaps it "refreshes" a jQuery object to match the DOM)? Or, are my tests just biased against Case 4 and these results mean nothing? I expected Case 3 to be the slowest simply because it performs the query twice, but why isn't it?

A: Take a look at the uncompressed production version (here's a copy from the 1.11.x branch):
You fill find the jquery constructor as
init = jQuery.fn.init = function( selector, context ) {
    // ...
}

So why is one of your examples slower than the other?
Take a look at the if/else structure inside that constructor, and (given many millions of iterations like you'd do in a performance test) you can safely assume that the execution time will vary depending on which path is taken.
Taking the your most extreme example (number 4), near the end of the constructor (so after many checks) you will find:
if ( selector.selector !== undefined ) {
    this.selector = selector.selector;
    this.context = selector.context;
}

return jQuery.makeArray( selector, this );

... which answers your other question:
Yes, if you pass a jquery object (or any object that exposes a selector property, jquery will reconstruct the object based on the selector and context, and return a new object. Probably for that very reason, they cannot possibly know that it's a fully fledged jquery object that you passed as selector.
Furthermore, if I call a constructor, I simply expect to get a new object, and not get  a reference to the one I pass in. :)
But if you do not want to care about the details too much (which is probably a good thing, since they might change the constructor one day, destroying your efforts of figuring it all out), the jquery learning center has a very good article about how to get the most out of the jquery constructor.