text:
Q: How to move gitlab-ci.yml file outside of repository The idea of having the CI configuration in repository is ridiculus.
Lets say I want to contribute to https://github.com/laravel/laravel
I have a local gitlab based CI for testing my changes.
The issue is adding .gitlab-ci.yml into the repository is ridiculus for at least 2 reasons:

*

*Lets tell 100 000+ people that my gitlab server is at my-gitlab.foo.com, my jenkins is at my-jenkins.bar.com and to trigger a build you must POST my-build-server.baz.com/trigger/abc-123, that is definately not going to cause lot of people trying to hack my servers.

*99% of project maintainers is going to reject a pull request containing a stupid .gitlab-ci.yml file pointing to some private build servers

So knowing that .gitlab-ci.yml MUST NOT be placed inside the repository, my question is where can I put it, so it will still work (I will still be able to run certain scripts on push and/or trigger jenkins or any other build server)?
The best I was able to find was to place .gitlab-ci.yml in another project and then place a trigger in .gitlab-ci.yml inside the application, that solves #1 but still does not solve #2, and it makes the system too complicated

A: How about placing the GitLab file in another project and updating the project settings to use that file?

you can specify an alternate filename path, including locations outside the project.

*

*Pipeline settings docs


text:
Q: What is the best practice when implementing equals() for entities with generated ids If I have a table with columns A, B, C, D
   A: auto-generated id (PK)
   B & C: combination must be unique (these are the columns that actually define identity in the business sense)
   D: some other columns
Now, if I'll create business objects based on this table (e.g. in Java), which one would be a better implementation of the equals() method:

*

*define equality based on A

*define equality based on B and C

or, it wouldn't really matter which of the two I choose.

A: I agree with @S.P.Floyd as well. But I wanted to add something more.
There are situations when an entity doesn't have unique business properties. For instance, an entity may only have A (the PK) and B (a business property), but many entities have the same B value.
In this case, it is difficult to create an equals() and hashcode(). You certainly do not want to base them on A, as you won't be able to compare a persisted object with one that hasn't been persisted yet. And you can't base it on B alone, because then many objects that are different unique entities would appear to be the same.
What I do in these situations is have a Date created = new Date(); property. When an entity is created, it automatically gets a created timestamp. In my equals() and hashcode() I include both B and created. This isn't perfect, as there is a very slim chance that two objects could be created at the same time (especially in a clustered solution), but it's a start. If you must, add a UID or other generated business property that isn't the database's PK.

A: Definitely B and C, because you want the equals() contract to be valid even before entities are persisted. You say yourself:

these are the columns that actually
  define identity in the business sense

If that is the case, then that is the logic equals() should use. Database keys are the database's concern and should be of no concern to your business layer.
And don't forget to use the same properties in hashcode(), too.

A: If (B,C) is a unique pair, there's no need for an auto-generated id in addition. For the table, A is equivalent to (B,C) (one-to-one relation).
You may want or need the extra key, but I agree with seanizer, use (B,C) for equals and because A is redundant (and null before the object is persisted), don't use that for equals (and hashcode)

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to tar-bzip old files in yearly groups I wish to know a command I can use to grab and archive all files for a year at a time. I am working on a directory that has 72000 files, with files dated from 2007 to current. And I wish to make that more manageable by tar-bziping older files in one-year groups. Thus, all files from 1-1-2007 to 12-31-2007, etc. Thanks for the help!

A: You can use the find command to select files based on their modification time.
cd /path/to/directory
find -type f -newermt 2007-01-01 ! -newermt 2008-01-01

Note that this selects files created in 2007 in your time zone, and files timestamped exactly at midnight on year change are grouped with the preceding year.
If your version of CentOS has an old version of find that doesn't support -newermt, you can use -newer with fencepost files instead.
touch -d 2007-01-01 /tmp/2007-01-01
touch -d 2008-01-01 /tmp/2008-01-01
find -type f -newer /tmp/2007-01-01 ! -newer /tmp/2008-01-01

Assuming that the file names don't contain newlines, you can pipe the resulting listing as input for tar with the -T option (-T - means to read file names from standard input).
cd /path/to/directory
find -type f -newermt 2007-01-01 ! -newermt 2008-01-01 |
tar -cjf /elsewhere/2007.tar.bz2 -T -

(Consider tar -cJf /elsewhere/2007.tar.xz instead, xz is faster to decompress and compresses better, at the expense of requiring more memory when compressing.)


text:
Q: Which Power automate/flow license removes the 90 days limitation I am receiving the below message once in a while for my flows
 We noticed that your flow has not run at all in the past 90 days. We disabled it on 10/1/2021
8:15:14 PM.
If you need any help enabling and automating your scenario, here are some helpful resources
that can help you get started

Found these ones:
https://docs.microsoft.com/en-us/power-automate/limits-and-config#expiration-limits
https://flow.microsoft.com/en-us/pricing/
My current licensing is as follows:

Not use which plan can resolve this issue?
Does the $15 per month plan solve this issue? Is there any documentation for this?

A: A cloud flow that has no successful triggers will expire and be turned off. After 90 days of inactivity, the flow creator will receive an email. If no action is taken in next 30 days, the flow will be systematically turned off and the creator will be notified in an email. For enterprise scenarios, we recommend you buy a standalone Power Automate license listed in Pricing article to ensure your flow isn't turned off due to inactivity. You can turn your cloud flows back on anytime.
Read more on expiration limits
Workaround #1: Cause the flow to run manually
The fastest, short-term solution is to make sure your flow is triggered by performing some manual action. The action depends on the type of triggered used by your flow. If you are not sure - navigate to the flow and switch to the edit mode. Then verify what triggered is used.
Workaround #2: Using Premium License
Flows disabled after 90 days of inactivity is by design for users with Community and Microsoft 365 Plans. We can upgrade to a "premium" license for Power Automate in order to bypass the expiration limitation:

Workaround #3: Create a new flow
We can't control this behavior directly. There is no setting we can tweak to prevent flows from being disabled after 120 days of inactivity.
That being said, we can create a new flow that will create a "TEST" list item every 90 days and then immediately delete it. This will indirectly cause the original flow to trigger, which, in turn will reset the 90 day timeout period.
Create a new Flow

*

*Create a new flow with a Recurrence (Scheduled) trigger. Configure it to run every 90 days.

*

*In this flow, create two actions:

*

*Create item. Give it a "TEST" title.

2. Delete item. Pass ID of the item that we created a step earlier. Essentially, all we do is create an item and then immediately delete it.

*

*Now save the new flow. Don't forget to give it a good name.

Update the original flow

*

*Open the original flow and switch to Edit mode.

*Right after the trigger, add a  Condition.

*In the condition, check  if the Title equals to TEST.

*Inside if yes - add a Terminate step.

*Set Status to Canceled.

*

*Save and close this flow.

Workaround #4: Automatically turn on disabled flows
Credits to Mohsen Sichani and Pieter Veenstra. Original solution: Automatically re-enable flows that were suspended in Power Automate

*

*Create a new flow that will run every day.

*Add an action to search for suspended Flows:

*

*Turn on suspended flows:


text:
Q: Recommended file system setup for development projects? I just got a new computer (Mac, if relevant) and I'm in the process of downloading IDEs and other stuff intended for development. Is there a recommended pattern for setting up the file system for development?
On a different computer in the past, I just created a folder titled Development in the home directory and then all workspaces were dumped in there. There is a workspace folder for Eclipse projects and then some other folders for Xcode projects.
I searched and read this blog post that recommends the conventions for Go. Any other recommended setups?
I plan to contribute to open source projects and to have some Xcode and Java projects of my own, if any of that's relevant.

A: This might be primarily opinion based, but the folder structure I've settled on is based on my use cases. I generally have two ways I use code: experimenting with a language, and working on a project (and that project sometimes has multiple languages). Accordingly, I create two folder heirarchies: ~/Code/<language>/ for experimenting with a language, and ~/Git/<projectname>/ for projects.
The Code might look something like this:
Code/
├── Bash
│   └── tmp.sh
├── C
│   └── tmp.c
├── CPP
│   └── tmp.cpp
└── Python
    ├── multifile
    │   ├── first.py
    │   └── second.py
    └── tmp.py

And the Git folder would look something like this:
Git/
├── CoolProject
└── Project1
    ├── README.md
    ├── doc
    └── src

In the Code directory, I worry much less about structure or documentation. Once/If a project grows big or important enough to version control I place it in the Git directory where I try to follow the conventional folder hierarchy for the language, like your Go link, or this Python guide or whatever Eclipse would make for Java. I do try to have a README.md at the root level of each project so I'll know what it does and I can put it on GitHub easily.


text:
Q: counting recursive calls WITHOUT variables is it possible to count depth of recursion without variables?

A: Are you looking for something like this?
public int foo(int count) {
    if (exitCondition) return count;
    foo(count+1);
}

Other ways of counting invocations would involve reflection or using byte-code modifying libraries (i.e., AoP).

A: in java,
Thread.currentThread().getStackTrace()

can be used to determine the call depth. the number of recursive calls is the difference between the stack length and the position of the first frame.
or throw an exception and then retrieve the stack from the top-most function with:
Throwable.getStackTrace()

Returns an array of stack trace elements, each representing one stack frame. The zeroth element of the array (assuming the array's length is non-zero) represents the top of the stack, which is the last method invocation in the sequence. Typically, this is the point at which this throwable was created and thrown. The last element of the array (assuming the array's length is non-zero) represents the bottom of the stack, which is the first method invocation in the sequence.

http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Throwable.html

A: Your question is extremely vague, so I'm making a couple of assumptions:

*

*By "number of recursive calls" you mean "depth of recursion"

*The original caller of the function wants to know the depth, so the recursive method returns it

*By "no variables," this means you can't even use local variables to track the depth

So if you're in some random method and you call your recursive function:
public void randomMethod() {
    Something somethingToRecurseOn = ... ;
    int depth = recurse(somethingToRecurseOn);
}

This is the expected usage for my solution. Here's the recurse method:
public int recurse(Something s) {
    Something subS = s.getSubS();
    if (subS == null) { // Exit condition
        return 1;
    }
    // Do something with subS
    return recurse(subS) + 1;
}

You integrate the depth into the return value of your function, and assume a depth of 1 for your exit condition.
This is actually relevant to an interview question I've asked in the past, where you have to return the number of elements in a recursive sequence, and the signature is:
public int collatz(int n)

Where n is the number you're operating on to find the next number of the sequence, which stops at 1. If it's implemented with recursion instead of iteration, it essentially returns the recursion depth.


text:
Q: Lamé's proposed proof to Fermat's theorem Good evening, I'm reading Lamé's proposed proof for Fermat's last theorem. He get to this equation:
$$x^n+y^n=(x+y)(x+jy)(x+j^2y)\cdots(x+j^{n-1}y)$$
where $j$ is the n-th root of unity. Then he proof that each of the $x+j^iy$ is relatively prime to the others, so that it is an nth power.
Finally the book says that Lamé closed his proof showing how this condition leads to infinite descent, but I'm not able to see how...
Could anyone help me, please?


text:
Q: log4net Udp appender in mono on Ubuntu not logging Running Ubuntu on a Minnow Max trying to use log4net in a mono application the Udp appender does not log to the remote location. Running the same application on a Raspberry Pi 2 with identical configs the Udp appender logs correctly. When I enable log4net logging there are no errors and the output of the log was identical on both machines. I have used nmap and Wire Shark to verify the Udp port is open and sending packets. The file appender on the Minnow is logging correctly.
C# Code
private static readonly ILog Logger = LogManager.GetLogger($"Drake.Mfg.DCS.{Environment.MachineName}");
public static LogLevel ConsoleLevel { get; set; }

public static void LogToNet(string message, LogLevel logLevel)
{
    try
    {
        switch (logLevel)
        {
            case LogLevel.None:
                break;
            case LogLevel.Trace:
                Logger.Trace(message);
                break;
            case LogLevel.Debug:
                Logger.Debug(message);
                break;
            case LogLevel.Info:
                Logger.Info(message);
                break;
            case LogLevel.Warn:
                Logger.Warn(message);
                break;
            case LogLevel.Error:
                Logger.Error(message);
                break;
            case LogLevel.Fatal:
                Logger.Fatal(message);
                break;
            case LogLevel.AlwaysLog:
                Logger.Info(message);
                break;
            default:
                throw new ArgumentOutOfRangeException(nameof(consoleLevel), consoleLevel, null);
        }
        Console.WriteLine($"{message}");
        Console.ResetColor();
    }

Log4Net.Config
<?xml version="1.0" encoding="utf-8"?>
<log4net>
  <appender name="Main" type="log4net.Appender.RollingFileAppender">
    <file value="dcsLog.log" />
    <appendToFile value="true" />
    <maximumFileSize value="1GB" />
    <maxSizeRollBackups value="3" />
    <encoding value="utf-8" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%utcdate{ISO8601} %-8level %-28logger %message%newline" />
    </layout>
</appender>
  <appender name="UdpAppender" type="log4net.Appender.UdpAppender">
    <remoteAddress value="192.168.10.53" />
    <remotePort value="7071" />
    <layout type="log4net.Layout.XmlLayoutSchemaLog4j" />
    <encoding value="utf-8" />
  </appender>
  <root>
    <level value="Debug" />
    <appender-ref ref="Main" />
  </root>
  <logger name="Drake.Mfg.DCS.DEI80021">
    <level value="Debug" />
    <appender-ref ref="UdpAppender" />
  </logger>
</log4net>

Mono

Mono JIT compiler version 4.3.0 (master/844fc33 Tue Oct 20 14:21:50
  EDT 2015) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and
  Contributors. www.mono-project.com
          TLS:           __thread
          SIGSEGV:       altstack
          Notifications: epoll
          Architecture:  amd64
          Disabled:      none
          Misc:          softdebug
          LLVM:          supported, not enabled.
          GC:            sgen

log4net

1.2.15

A: The Log4Net config is case sensitive as xml is. The Hostname for the Minnow was in lowercase and I was looking for upper. Because I do not have sole control over hostnames I used a To Upper.
ILog logger = LogManager.GetLogger($"Drake.Mfg.DCS.{Environment.MachineName.ToUpper()}");

Fixed it now and in the future.


text:
Q: Why can't I copy SSH keys to Vagrant VM? When I execute my cp-sshkey.yml playbook (logged in as myself, not the vagrant user) from my top-level Vagrantfile directory...
ansible-playbook cp-sshkey.yml

I'm getting this error:
TASK: [authorized_key user=vagrant key="{{ lookup('file', './files/id_rsa_vagrant.pub') }}"] ***
fatal: [web1] => Failed to template user=vagrant key="{{ lookup('file', './files/id_rsa_vagrant.pub') }}": could not locate file in lookup: ./files/id_rsa_vagrant.pub

I don't understand why this error is occurring.  It's a very simple playbook and the public key file is where I say it is:
.
├── .vagrant
│   └── machines
├── Vagrantfile
├── ansible.cfg
├── bootstrap-mgmt.sh
├── files
│   └── id_rsa_vagrant.pub
├── inventory.ini
├── secrets.yml
├── site.yml
├── website
└── cp-sshkey.yml

Here's my config and host files and the playbook:
# ansible.cfg
[defaults]
hostfile = inventory.ini
remote_user = vagrant
private_key_file = .vagrant/machines/default/virtualbox/private_key
host_key_checking = False

# inventory.ini
[local]
localhost ansible_connection=local

[web]
web1 ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222

# cp-sshkey.yml
- name: Install vagrant's public key on VM
  hosts: web1
  sudo: True
  tasks:
    - authorized_key: user=vagrant key="{{ lookup('file', './files/id_rsa_vagrant.pub') }}"

What am I doing wrong here?  Thanks.

A: Quick answer will refine - am playing with this myself but just learning:
I assume you are trying to add your public key (or other key on your ansible console that is no related to the vagrant keys ) to the vagrant machine to allow you to ssh into it without vagrant ssh
I assume that you have checked all the file permissions etc and that you aren't juggling multiple instances. Tried with 127.0.0.1 and localhost and that you've tried with the full file path instead of relative to working directory - my examples use files in subfolders with templates although not in the working snippet below.

*

*Are you able to vagrant ssh
and perhaps check the .ssh/authorized_keys file ?

*Are you able to confirm that ansible can connect doing something like ansible web  -a df

*are you able to ssh into the Vagrant machine using ssh -i .vagrant/machines/default/virtualbox/private_key vagrant@127.0.0.1 -p 2222
In my role task file I have this task.
- name: Copy origin public key to auth keys
  authorized_key: user=vagrant key="{{  lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"

Also my host definition has the user:
web1 ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 ansible_ssh_user=vagrant
but assume that the config you use should work.
This play worked is working for me although my directory structure is different - I expect you're comfortable that your is fine.
Some things to watch out for that caught me:

*

*when you rebuild the Vagrant machine you will need to flush out your .ssh/known_hosts if you have already ssh'd - can remove from known_hosts with sh-keygen -R [localhost]:2222

*makes me uneasy seeing localhost as a machine tag

My Setup:

*

*ansible 2.2.0.0

*vagrant Version: 1.9.1

*Mac OSX

*VBox 5.1.6

*Vagrant Instance - ubuntu/trusty64


text:
Q: Need jGrid with Json I got JGrid which works for table and not for the Json format, does any one have json version for
http://www.overset.com/2008/08/30/animated-sortable-datagrid-jquery-plugin-jtps/
Thanks in advance

A: here is the example
{
  total: "xxx",
  page: "yyy",
  records: "zzz",
  rows : [
    {id:"1", cell:["cell11", "cell12", "cell13"]},
    {id:"2", cell:["cell21", "cell22", "cell23"]},
      ...
  ]
}

You can found this information at the following link:
http://www.secondpersonplural.ca/jqgriddocs/index.htm
That example is the default json readear, but you can modify it


text:
Q: implement decreasing key in binomial heap in the binomial heap structure, we know only the pointer that points to the min node, but how can I decrease the key of arbitrary node? in this case, first of all, I should find this node and then perform swapping with O(lgN) time.
I search online and many points out how to decrease node but does not mention how to access this node to be decreased.
Edit:
I should use pointers that point to each node of the heap.

A: Maybe I'm missing something here, but if you have the key to your 'arbitrary node' couldn't you just use an O(lg n) time lookup to find it, and then decrease it using the algorithm you found online?


text:
Q: Power Virtual Agents Automatically suggest a solution before connecting to a live agent I was looking for a basic ability for bot to learn from the questions and answers the agents provide that can be used as suggestion the chatbot replies to users before it connects them to live agent. I looked up QnA maker does similar stuff and can I be able to integrate it over here?

A: Go to https://language.cognitive.azure.com/
Click on Create

Choose Custom Question Answering

After creating, go to that project
Click on Edit Knowledge Base and create question and answer pairs.
After creating the Knowledge base, go to deploy the knowledge base

Click on Deploy

Create a bot and attach the existing knowledge base to bot before going to the Live Chat


text:
Q: "Find All > Related Messages" feature searches everywhere in Outlook 2007 In Outlook 2003, when right-clicking a message and selecting Find All >> Related Messages, it would search your Inbox and Sent Items for emails with a similar subject, but it doesn't search other folders (e.g. Deleted Items).
In Outlook 2007, when using the Find All Related Messages feature, the search location (Look for: ... In: ...) is automatically set to the Inbox folder, the Sent Items folder and the whole account (the root checkbox). Unchecking the account checkbox corrects the behavior and searches only in the checked folders. Alternatively, unchecking the Search subfolders checkbox also solves the problem, but that too is checked by default. So basically, the fact that the Inbox and Sent Items checkboxes are checked is meaningless, since it searches the whole account anyway. I haven't been able to find a setting to change either the default search location (to remove the root account checkbox) or to remove the Search subfolders default checked state, so that the Deleted Items folder isn't searched by default.
Thanks for any help!
EDIT: Taking into account that this may be a permanent issue with Outlook 2007, as JNK mentioned, can anyone with Outlook 2010 attest whether this issue was fixed in that version?

A: People have been complaining about this for a while.  I checked a couple of official MS websites and some unofficial Outlook user forums, and apparently it has been reported and put in as a feature request but there is no way to do it in 2007.

A: How's this for a keyboard shortcut sandwich?
press and release the alt key, then type hznfrr
ugh.
I right-clicked on the menu item, chose Add to Quick Access Toolbar.
Now I just go alt then 6.
Your number might be different.


text:
Q: Angular: focusout event not working with div tag I have a div tag which works as select box with multi select feature.

                <ng-container *ngFor="let selectedBaseVal of selectedBaseLicences.icdata; let baseVal=index">

                        {{selectedBaseVal.License}}

                                            Select Base License

                 </ng-container>

            <ng-container *ngFor="let base of selectedBaseLicences.icdata">

                         <input type="checkbox" [checked]="base.Checked" name="checkbox1" (change)="base.Checked = !base.Checked">

                         {{base.License}}

            </ng-container>

It looks like this What I'm trying is, when I click outside the div it should get disabled, so I'm trying with focusout event and in disableSelect() method I'm just making a value false. But focusout event is not working. Does div doesn't support focusout? Or is there any other way to disable?

A: For using blur you should add tabindex (ex: tabindex="3") attribute or contentEditable to div then it will support the blur event.

<
Click in divs and outside of them

  This div could not support blur!

  This div support blur!

For angular:

The above example will work in angular.

A: Basic Button Disable on mouse out from div example:
Solution
HTML:

    <button [disabled]="disableButton"> Out from Here</button>
Touch here to enable

TS:
import { Component } from '@angular/core';
import { FormGroup, FormBuilder, FormControl, Validator } from '@angular/forms';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  disableButton: boolean = false;

   myForm: FormGroup;

  constructor(private fb: FormBuilder){
  }

  focuslost(event){
    console.log(event);
    this.disableButton = true;
  }

  focus(){
    this.disableButton= false;
  }
}

A: In your first line of code focusout with blur.
(blur)="disableSelect($event)"


text:
Q: automatic reload of div container instead of a whole page refresh after a certain time, i'd just like a specific div container to reload/refresh. is there any way to do this?

A: You can get the effect you desire with jQuery and Googles ajax api

A: If you had a page that served quotes, like quote.html for example, you could do this:
setInterval(refreshQuote, 10000); //every 10 seconds

function refreshQuote() {
  $("#quoteContainer").load("quote.html");
}

In this case the expected return from quote.html (or whatever source you have) it a simple string that is the quote, it will take this and replace the content of

 with it.

A: i think that one aproach would be


text:
Q: how to disable security component for certain actions in cakephp? I have a form in my add_note action, where I do not want SecurityComponent to put its tokens or checking. How do I do this?
I have tried requireAuth('some_other_action') etc. but it doesn't work.

A: In CakePhp 2.3 do:
$this->Security->unlockedActions= array('add_note');

A: Original answer for CakePHP 1.2 to 2.2.x:
public function beforeFilter() {
    if (isset($this->Security) && $this->action == 'add_note') {
        $this->Security->validatePost = false;
    }
}

Updated answer for CakePHP 2.3+ and 3.x (as pointed out in the other answer):
public function beforeFilter(Event $event)
{
     $this->Security->config('unlockedActions', ['add_note']);
}

Also, it's possible to unlock specific fields (as pointed out in the comments)
$this->Form->unlockField('Note.id');


text:
Q: When using CefSharp SendKeyEvent, I am unable to type the document c#, Cefsharp winform 88.2.90
ExecuteJavascriptAsync and OffScreen are not my considerations.
I type in a Word document like this
1234567890
CefSharp is typing on the Input Element like this
abcdefghijklmnopqrstuvwxyz
However, when I type in Word and Cefsharp types at the same time, my focus shifts to the Cefsharp Input Element, and Cefsharp enters the wrong value.
For example, CefSharp enters the wrong value this way
a1b2c3d4e5f6..............................
Even if I'm typing, CefSharp enter the correct values.
How can I solve this problem?
void ClickandType(string inputString)
{
    var host = browser.GetBrowserHost();
    host.SendMouseMoveEvent(xPosition, yPosition, false, CefEventFlags.None);
    Thread.Sleep(50);
    host.SendMouseClickEvent(xPosition, yPosition, MouseButtonType.Left, false, 1, CefEventFlags.None);
    Thread.Sleep(50);
    host.SendMouseClickEvent(xPosition, yPosition, MouseButtonType.Left, true, 1, CefEventFlags.None);
    foreach (var c in inputString)
    {
        host.SendKeyEvent(new KeyEvent { WindowsKeyCode = c, Type = KeyEventType.Char });
        Thread.Sleep(10);
    }
}


text:
Q: Change colour of SVG element before modal box opens and keep it that colour while the box is open I want to change the colour of the SVG element I click on to open a modal box. This seems more difficult than it would otherwise be, possibly because of the hover behaviour I have going on with the SVG element already.
Atm the element is red and scaled larger when the cursor is on it, but goes back to white when I click on it to open a modal. How do I keep it red when the modal is open and only change back to white when the modal closes? I still want the hover behaviour I have already when I don't click anything.
asylumQ is a Q shape and AsylumTr is a hole in the middle. When the mouse hovers over the Q or the hole in the Q the Q shape turns red (this isn't perfect, but using js to group the 2 elements together did not work and grouping them in the SVG also wrecked the behaviour so maybe I will fix this later).
Here is the js:
            asylumQ.hover(function() {
            asylumQ.attr({ opacity: 1, fill: 'red', stroke: 'red' });
            asylumQ.animate({ transform: 's2,2'}, 300, mina.easein);
            asylumTr.animate({ transform: 's2,2'}, 300, mina.easein);
        },
            function() {
                asylumQ.attr({ opacity: 1, fill: 'white', stroke: 'white' });
                asylumQ.animate({ transform: 's0.8,0.8'}, 300);
                asylumTr.animate({ transform: 's0.8,0.8'}, 300, function () {
                    asylumQ.animate({ transform: 's1,1'}, 20);
                    asylumTr.animate({ transform: 's1,1'}, 20);
                });
            }
        );

        asylumTr.hover(function() {
            asylumQ.attr({ opacity: 1, fill: 'red', stroke: 'red' });
            asylumQ.animate({ transform: 's2,2'}, 300, mina.easein);
            asylumTr.animate({ transform: 's2,2'}, 300, mina.easein);
        },
            function() {
                asylumQ.attr({ opacity: 1, fill: 'white', stroke: 'white' });
                asylumQ.animate({ transform: 's0.8,0.8'}, 300);
                asylumTr.animate({ transform: 's0.8,0.8'}, 300, function () {
                    asylumQ.animate({ transform: 's1,1'}, 20);
                    asylumTr.animate({ transform: 's1,1'}, 20);
                });
            }
        );

        asylumTr.click(function() {
            asylumQ.attr({ opacity: 1, fill: 'red', stroke: 'red' });
            $('#asylumModal').modal('show');
        });

A: Define a CSS class with the colour you want and then add it to the element class list while the dialog is open. And remove it again when you close the dialog.
Example:

$("#myrect").click(function() {

  // Add a class to the rect which keeps it with the hover styling.
  // Note: We can't use jQuery's addClass() for this because it doesn't work with SVGs
  $("#myrect").attr("class", "dialogIsOpen");

  // Open the modal
  $("#myModal").modal();

  // Attach a handler for the dialog's hide event so we can remove the class we added
  $('#myModal').on('hidden.bs.modal', function (e) {
    $("#myrect").removeAttr("class");
  });

});
rect {
  transform: scale(1,1);
  transition: all 0.5s;
  cursor: pointer;
}

rect:hover,
.dialogIsOpen {
  transform: scale(1.25,1.25);
  fill: red;
}

/* position the modal out of the way so we can see the SVG */
.modal-dialog {
  margin-top: 160px !important;
}
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

<svg>
  <g transform="translate(150 75)">
    <rect id="myrect" x="-50" y="-50" width="100" height="100" fill="white" stroke="black"/>
  </g>
</svg>

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Modal title

An example modal

        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>


text:
Q: How to Add a Conditional Attribute in a Visual Force form? I have a VisualForce form that includes a phone number input. I want to turn off Autocomplete on this input based on an incoming URL parameter.
This is what I have now:
<apex:inputText value="{!phone}" styleclass="phone" id="phone" maxlength="16"  />

And I need something like this, I think:
<apex:inputText value="{!phone}" styleclass="phone" id="phone" maxlength="16" autocomplete="{!IF($CurrentPage.Parameters.phoneac == 'false'),"off","")}" />

But it doesn't seem to work this way. What am I missing?
It might be that autcomplete is not a valid field for VisualForce?

A: OK, pleased to announce I solved my own question. There were two issues.

*

*I had a misplaced ')' in my code. Don't need that extra paren.

*It's quite true that autocomplete is not valid field for VisualForce. But there's a handy prefix 'html-' that allows many fields to be passed through to the page. That worked to get the autocomplete attribute through.
So the working code is:
<apex:inputText value="{!phone}" styleclass="phone" id="phone" maxlength="16"  html-autocomplete="{!IF($CurrentPage.Parameters.phoneac == 'false',"off","on")}" />

Thanks for following along.


text:
Q: Trouble synchronizing generic TList and TListBox I have trouble keeping a TListbox in sync with a TList. Each time an item is added to a generic TList, OnNotify is called and the callback calls just one procedure: create_gradients. Its code is below:
  procedure TColor_Dialog.create_gradients;
  var Editor: TGradient_Editor;
      eGradient: Int32;
      y: single;
      s: string;
  begin
     List_Names.Clear;
     List_Gradients.Clear;

     for eGradient := 0 to FColor_Editor.nGradients - 1 do
     begin
        List_Names.Items.Add (FColor_Editor [eGradient].Check_Rainbow.Text);
     end; // for

     List_Gradients.BeginUpdate;
     try
        for eGradient := 0 to FColor_Editor.nGradients - 1 do
        begin
           Editor := FColor_Editor [eGradient];
           y := (eGradient + 1) * Editor.Height;
           Editor.Position.Y := y;
           s := Editor.Check_Rainbow.Text;
           List_Gradients.AddObject (Editor);
        end; // for
     finally
        List_Gradients.EndUpdate;
     end; // try..finally
  end; // create_gradients //

As you see it simply enumerates all items in the list. Each item in the list is a TGradient_Editor which in turn has TFrame as a parent. On the parent are some FMX controls as combolorboxes, an image and a checkbox (Check_Rainbow). Check_Rainbow.Text is used for identification  purposes. When the gradient editor is created, it creates a unique name from frame_%s where %s is a sequence number that is incremented each time a gradient editor is created. Owner and Parent are both List_Gradients.

From the image above you can see what happens. the listbox on the right is added for checking and just shows the text's, which is the correct sequence by the way. When I use the debugger to follow the addition of the gradient editors to List_Gradient they are processed in the same order. But the order of the gradient editors is wrong. I have to mention that the aligment of the gradient editors is alTop. I added even some code to ensure that the editor is Positioned at the very bottom of the List_Gradients.
I appear not to understand something. I cannot imagine that sequential adding to a TListBox cannot result in the correct order. What am I doing wrong?

A: Try this instead:
procedure TColor_Dialog.create_gradients;
var
  Editor: TGradient_Editor;
  eGradient: Int32;
  y: single;
begin
  List_Names.Clear;
  List_Gradients.Clear;

  for eGradient := 0 to FColor_Editor.nGradients - 1 do
  begin
    List_Names.Items.Add (FColor_Editor[eGradient].Check_Rainbow.Text);
  end;

  List_Gradients.BeginUpdate;
  try
    y := 0.0; // or whatever value you want to start at...
    for eGradient := 0 to FColor_Editor.nGradients - 1 do
    begin
      Editor := FColor_Editor[eGradient];
      Editor.Position.Y := y;
      List_Gradients.AddObject(Editor);
      y := y + Editor.Height;
    end;
  finally
    List_Gradients.EndUpdate;
  end;
end;

A: As requested I moved the answer to this section. The correct code is:
  procedure TColor_Dialog.create_gradients;
  var Editor: TGradient_Editor;
      eGradient: Int32;
      y: single;
  begin
     List_Gradients.BeginUpdate;
     try
        List_Gradients.Clear;
        y := 0;
        for eGradient := 0 to FColor_Editor.nGradients - 1 do
        begin
           Editor := FColor_Editor [eGradient];
           Editor.Position.X := 0;
           Editor.Position.Y := y;
           Editor.Width := List_Gradients.Width;
           List_Gradients.AddObject (Editor);
           y := y + Editor.Height;
        end; // for
     finally
        List_Gradients.EndUpdate;
     end; // try..finally
  end; // create_gradients //

and not using any alignment anymore. Adding Objects to a TListBox is a real nice feature of FMX. However, be prepared that things sometimes work differently than you expect. For one thing: objects are not positioned in the same way as strings.


text:
Q: Change Javascript BLOB encoding to ANSI instead of UTF-8 I was wondering if it is possible to save a simple txt file with Javascript and BLOB with the ANSI encoding.
At this moment I have a script that creates a txt file with CRLF line endings, but with a UTF-8 encoding.
Is it possible to save it with the ANSI encoding? I need this to import the txt file on a 'old' windows program that needs ANSI instead of UTF-8.
This is the example I used:
https://jsfiddle.net/UselessCode/qm5AG/
let textFile = null;

function makeTextFile () {
    let text = `Some text with nice line endings\nand special characters like é and ü.`;

    const data = new Blob([text], {
        type: "text/plain",
        endings: "native"
    });

    if (textFile !== null) {
        window.URL.revokeObjectURL(textFile);
    }

    textFile = window.URL.createObjectURL(data);

    return textFile;
}

A: There used to be an option using the TextEncoder API to encode from USVStrings to arbitrary encodings, but this has been removed from specs and browsers.
You'd need to use a library in order to perform the conversion. Here, I'll use inexorabletash/text-encoding:

(async()=> {
const text = `Some text with nice line endings\nand special characters like é and ü.`;
const encoding = 'windows-1252'; // a.k.a ANSI

const encoder = new TextEncoder(encoding, {
  NONSTANDARD_allowLegacyEncoding: true
});
const data = encoder.encode(text); // `data` is an Uint8Array
const encoded_as_ANSI = new Blob([data]);

// for demo only
const encoded_as_UTF8 = new Blob([text]);

const ANSI_read = await readAsText(encoded_as_ANSI, encoding);
const UTF8_read = await readAsText(encoded_as_UTF8, encoding);

console.log("(ANSI)", ANSI_read);
console.log("(UTF8)", UTF8_read);
})();

function readAsText(blob, encoding) {
  return new Promise(res => {
    const reader = new FileReader();
    reader.onload = e => res(reader.result);
    reader.readAsText(blob, encoding);
  });
}
<script>window.TextEncoder = null;// force installation of the polyfill</script>
<script src="https://cdn.jsdelivr.net/gh/inexorabletash/text-encoding/lib/encoding-indexes.js"></script>
<script src="https://cdn.jsdelivr.net/gh/inexorabletash/text-encoding/lib/encoding.js"></script>

However going this route, we loose the endings option, since this applies only to string blobParts.
So one way would be to first create an utf-8 Blob, with the endings option, then convert this UTF-8 blob to ANSI:

(async () => {
  const text = `Some text with nice line endings\nand special characters like é and ü.`;
  const encoding = 'windows-1252'; // a.k.a ANSI

  const utf8_blob = new Blob( [text], { endings: "native" } );
  const utf_8_txt = await utf8_blob.text();

  const encoder = new TextEncoder(encoding, {
    NONSTANDARD_allowLegacyEncoding: true
  });
  const data = encoder.encode(utf_8_txt); // now `data` is an Uint8Array
  const encoded_as_ANSI = new Blob([data]);

  const read_as_ANSI = await readAsText(encoded_as_ANSI, encoding)
  console.log(read_as_ANSI);
})();

function readAsText(blob, encoding) {
  return new Promise(res => {
    const reader = new FileReader();
    reader.onload = e => res(reader.result);
    reader.readAsText(blob, encoding);
  });
}
<script>window.TextEncoder = null;// force installation of the polyfill</script>
<script src="https://cdn.jsdelivr.net/gh/inexorabletash/text-encoding/lib/encoding-indexes.js"></script>
<script src="https://cdn.jsdelivr.net/gh/inexorabletash/text-encoding/lib/encoding.js"></script>


text:
Q: How can I directly access a server behind HAProxy? I'm trying to enable a way for developers/testers to access specific servers behind a HAProxy, to facilitate testing.  The way we do it right now is by accessing the server's hostname (e.g. server1.mywebsite.com) directly, but we've seen differences relating to virtual hosts, ssl, etc... I'd like to set a cookie or a query string arg or something so I can force a server to be used...
something like
www.mywebsite.com (with cookie super_secret_cookie=server1)
or
www.mywebsite.com?super_secret_key=server1
To be clear, this would be used by internal users, not the public in general.
Ideas?
Edit: I'm using version 1.3.12

A: I guess your question is outdated, but for those who come after, heres how I did it:
we define some acl:
frontend http-in
acl has_server1_cookie  hdr_beg(cookie) server1

use_backend single_server1_backend if has_server1_cookie

and of course we have to define that backend:
backend single_server1_backend
server server1.mywebsite.com 192.168.1.123:80 maxconn 32 check

we can even add to the backend section the following
reqadd backend:\ server1

which will tell haproxy to add to each request dispatched to server1 a http header
backend: server1

which is nice and eays for checking just to be sure that it actually works..

A: You're unnecessarily complicating things.  If you've got "differences relating to virtual hosts, ssl, etc" then FIX THOSE.  When you start bodgying things up with cookies and query string args (are you going to modify your application to persist that query string arg through every request?  Even more complications...) you just make things more complicated, which means more difficult to debug, more likely that it'll be accidentally broken by an unrelated change, and generally you just make life difficult for yourself and everyone else.
So, take a step back, and instead of asking about implementing a half-baked solution you've come up with, ask a question about how to solve your problem.  "We have an haproxy, and would like to access the machines directly, but when we do this we get (describe difference with virtual hosts)."
My guess for your vhosts problem is that they're not setup to accept the machine's name directly, which is trivial to fix -- an extra entry in server_name (or a new ServerAlias) gets you away there.  For SSL, that's a smidge trickier if you're not using a wildcard cert, but since it's only internal users, ignoring the SSL warning is a (semi-)valid solution to the problem -- or you can just run a separate SSL cert for the per-machine stuff (on an internal CA).  If you're terminating SSL on the load balancer, stop doing that then.


text:
Q: Creating Dovecot Master users/passwords doesn't work I've been cracking my head on this for hours. I want to create a master user that has access to all dovecot accounts. I've followed the tutorial on dovecot website, however, it still it either says "Authentication failed" or "Waiting for authentication process to respond" and it never works. What could I possibly be doing wrong here? Thanks
//dovecot.conf
# 2.0.16: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.2-RELEASE amd64
auth_master_user_separator = *
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
namespace {
  inbox = yes
  location =
  prefix = INBOX.
  separator = .
  type = private
}

passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}
passdb {
  args = /usr/local/etc/dovecot/passwd.master
  driver = passwd-file
  master = yes
}
protocols = imap pop3
service auth {
  client_limit = 6000
}
service imap {
  process_limit = 2048
  vsz_limit = 1256 M
}
service pop3 {
  process_limit = 2048
}

userdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}
userdb {
  driver = passwd
}
protocol pop3 {
  pop3_uidl_format = UID%u-%v
}
    --> as instructed from http://wiki.dovecot.org/Authentication/MasterUsers

cat passwd.master
master:{SHA}E9RIKlmYWisBS3ObR16GwKUZNZg=

telnet localhost 143
 Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    a login loginuser*master mypassword
    * OK Waiting for authentication process to respond..
    * OK Waiting for authentication process to respond..
    * BYE Disconnected for inactivity.
    Connection closed by foreign host.

or
telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN
1 login loginuser*master mypassword
1 NO [AUTHENTICATIONFAILED] Authentication failed.
* BYE Disconnected for inactivity.
Connection closed by foreign host.

//dovecot -n
# 2.0.16: /usr/local/etc/dovecot/dovecot.conf
# OS: FreeBSD 8.2-RELEASE amd64
auth_master_user_separator = *
disable_plaintext_auth = no
login_greeting = CFI mail server ready.
mail_location = maildir:~/Maildir
namespace {
  inbox = yes
  location =
  prefix = INBOX.
  separator = .
  type = private
}

passdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}
passdb {
  args = /usr/local/etc/dovecot/passwd.master
  driver = passwd-file
  master = yes
}
protocols = imap pop3
service auth {
  client_limit = 6000
}
service imap {
  process_limit = 2048
  vsz_limit = 1256 M
}
service pop3 {
  process_limit = 2048
}

userdb {
  args = /usr/local/etc/dovecot/dovecot-sql.conf
  driver = sql
}
userdb {
  driver = passwd
}
protocol pop3 {
  pop3_uidl_format = UID%u-%v
}

A: Finally got it work! First, I had to auth_master_user_separator = + instead of with *. This removed the complaint from dovecot that Username character disallowed by auth_username_chars: 0x2a (username: loginuser*master)
Then realized I was adding master password records using the htpasswd command to the wrong file /usr/local/etc/dovecot/dovecot.master yet in my configs it the right file is /usr/local/etc/dovecot/passwd.master. I don't know how i failed to see that quickly.
Lastly I wasn't testing the master user logins well using telnet. I was using 1 login loginuser+master mypassword instead of 1 login existing_user@example.com+master mypassword
Lastly my configs in dovecot.conf look something like
auth_master_user_separator = +
#auth_username_chars = *  #dovecot complains about the "*" character
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
passdb {
        driver = passwd-file
        args = /usr/local/etc/dovecot/passwd.master
        master = yes
        #pass = yes

}
passdb {
        #driver = shadow
        driver = pam
}
userdb {
  driver = passwd
}


text:
Q: AndroidViewClient - can't getXY() coordinates I'm running AndroidViewClient and am able to dump a complete hierarchy, but things fail when I try to getXY() or touch(). Even the solution from Get Current Focused Window Name using AndroidViewClient gives me an error.
  kwargs1 = {'verbose': True, 'ignoresecuredevice': True}
  kwargs2 = {'startviewserver': True, 'forceviewserveruse': True,
             'autodump': False, 'ignoreuiautomatorkilled': True}
  device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
  vc = ViewClient(device, serialno, **kwargs2)
  view = vc.dump(window='-1')
  widget = vc.findViewByIdOrRaise("id/no_id/5")
  widget.useUiAutomator = False
  print widget
  # Up until here runs no problem.
  print widget.getXY() # fails.
  widget.touch() # also fails.

My stack trace goes something like:
print widget.getXY()
File "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.5.3-py2.7.egg/com/dtmilano/android/viewclient.py", line 680, in getXY
    (wvx, wvy) = self.__dumpWindowsInformation(debug=debug)
File "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.5.3-py2.7.egg/com/dtmilano/android/viewclient.py", line 798, in __dumpWindowsInformation
dww = self.device.shell('dumpsys window windows')

File "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.5.3-py2.7.egg/com/dtmilano/android/adb/adbclient.py", line 377, in shell
self.__send('shell:%s' % cmd, checkok=True, reconnect=False)

File "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.5.3-py2.7.egg/com/dtmilano/android/adb/adbclient.py", line 243, in __send
self.__checkOk()

File "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.5.3-py2.7.egg/com/dtmilano/android/adb/adbclient.py", line 286, in __checkOk
raise RuntimeError("ERROR: %s %s" % (repr(recv), error))

RuntimeError: ERROR: ''
Any thoughts?

A: widget = vc.findViewByIdOrRaise("id/no_id/5")
widget.useUiAutomator = False
widget.getXY()
x = (str)widget.windows[widget.currentFocus]
print x

Above code will get the Display Activity name and height and width of the screen,if u want only height and width refer below one
h = device._AdbClient__getDisplayHeight("")
w = device._AdbClient__getDisplayWidth("")
print (str)(h)
print (str)(w)


text:
Q: Where is located sp_msreplcheck_publish stored procedure? sp_msreplcheck_publish is a sp that checks if you have sufficient rights to run a statement to alter a published table (transactional replication).
Trying to alter a published table without elevated rights fires trigger tr_MStran_altertable that calls sp_MStran_ddlrepl that execute sp_msreplcheck_publish. It returns correctly :

Only members of the sysadmin fixed server role or db_owner fixed
  database role can perform this operation.

The mystery for me  is that I cannot find this sp in published database or in master. Is it generated on demand?

A: If is hidden from general view but, if you connect using a Dedicated Administrator Connection, you can see it in master via:
USE [master];
GO

SELECT OBJECT_DEFINITION(OBJECT_ID(N'sys.sp_msreplcheck_publish'));

Not sure what you need to see the definition for, though, or why knowing where it is stored will help you accomplish anything. It's really this simple, and you can't change it, regardless of where it is stored:
create procedure sys.sp_MSreplcheck_publish
as
begin
    --
    -- Do the sysadmin check first as it is 4 times more efficient
    -- than is_member call and reduces performance overhead in case
    -- the user has sysadmin privileges
    --
    if    is_srvrolemember('sysadmin') = 1 or
        is_member ('db_owner') = 1
    begin
        return (0)
    end
    else
    begin
        raiserror (21050, 14, -1)
        return (1)
    end
end


text:
Q: Dynamically Make ComboBox Visible on Worksheet Change - VBA 2007 I created a userform with a multipage.  On one of the multipages I have a combination of TextBoxes and ComboBoxes.  There are a total of 9 Boxes next to each other.  They are all control sourced to the excel sheet behind it.  When a user enters data into the the first box, it dynamically creates another 9 boxes which correspond to the next row.  This process repeats.  Now, the 9th box is a TextBox which the visibility is set to false.  The 8th box is a ComboBox.  If the value in the 8th box is "Existing" Then the visibility of the 9th Box is True.
This is how I'm dynamically created the additional TextBoxes/ComboBoxes:
Private Sub Worksheet_Change(ByVal Target As Range)
    Select Case Left(Target.Address, 2)
        Case Is = "$A"
        Dim cCntrl As Control
        Dim i As Integer
        For i = 0 To 8
        //skipping to case 7 and 8
        Case Is = 7
            Set cCntrl = UserForm1.Frame13.Controls.Add("Forms.ComboBox.1", "Login" & i & Target.Row + 1, True)
            With cCntrl
                .Width = UserForm1.ComboBox240.Width
                .Height = UserForm1.ComboBox240.Height
                .Top = (10 + UserForm1.ComboBox240.Height) * (Target.Row - 1)
                .Left = UserForm1.ComboBox240.Left
                .ControlSource = "'Multi Branch'!" & Chr(65 + i) & Target.Row + 1
                .List = Worksheets("Setup").Range("BILLING").Value
                .Style = fmStyleDropDownList
            End With
            Case Is = 8
                Set cCntrl = UserForm1.Frame13.Controls.Add("Forms.TextBox.1", "Login" & i & Target.Row + 1, True)
            With cCntrl
                .Width = UserForm1.TextBox287.Width
                .Height = UserForm1.TextBox287.Height
                .Top = (10 + UserForm1.TextBox287.Height) * (Target.Row - 1)
                .Left = UserForm1.TextBox287.Left
                .ControlSource = "'Multi Branch'!" & Chr(65 + i) & Target.Row + 1
                .Name = "BTwo" & (Target.Row - 1)
                .Visible = False
            End With
        End Select
    Next

Here is how I am currently changing the visibility:
        Case Is = "$H"
        If Target.Value = "Existing" Then
            UserForm1.Controls("BTwo" & Target.Row - 2).Visible = True
        Else
        If Target.Row = 2 Then Exit Sub
            UserForm1.Controls("BTwo" & Target.Row - 2).Visible = False
        End If
    End Select

This method technically works, but only after I leave the 8th box.  This seems like an OnExit sort of move.  The first row i simply did an onchange event which works fine.  Any thoughts as to how I can change the visibility on change WITHOUT having to select another box?


text:
Q: SSRS Report Manager Report names Is it possible to have SSRS's Report Manager display a report name that is not the .RDL file name?
I.E. I have a Report .RDL named "MyReportAboutSomeImportantStuff.RDL" but I want the Report Manager to display this user friendly as "My Report About Some Important Stuff."

A: Yes, it's possible. After deploying to the reportserver, you can browse to the report through Report Manager and use the "Properties" tab to manually change the displayed name of the report - e.g. inserting the spaces.
If you get sick of doing this by hand (and you will), it's also possible to script this and several other post-deployment operations using rs.exe. See TechNET: Scripting Deployment and Administrative Tasks


text:
Q: Enviornment broken after uninstalling Rails 6.0.0.rc1 I ran
gem uninstall rails -v 6.0.0.rc1
gem uninstall railties -v 6.0.0.rc1
and even rvm remove ruby-2.6.1
then reinstalled ruby, created a new gemset but get this error on any bin/rails generate .. command (using rails 5.2.3):
Running via Spring preloader in process 25797
.rvm/gems/ruby-2.6.1/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- /home/me/.rvm/gems/ruby-2.6.1/gems/railties-6.0.0.rc1/lib/rails/commands.rb  (LoadError)

A: Fixed by running
spring stop
from terminal


text:
Q: Network connection down after installing Visual Studio 2015 After installing visual Studio 2015 CE with Xamarin and Android Emulator my Windows 8.1 network connection is not working anymore.
Using Device Manager I now have 4 devices:

*

*Hyper-V Virtual Ethernet Adapter #2

*Hyper-V Virtual Ethernet Adapter #3

*Realtek PCI-E GBE Family Controller #2 (which cannot start)

*Realtek PCI-E GBE Family Controller #3 (which cannot start)
I tried to uninstall all of them, the result is always the same, they all come back with the warning sign.
UPDATE:
After uninstalling some visual studio components my network connection is working again. Uninstalled components include:

*

*Windows SDK

*IIS Server

*Android Emulator


text:
Q: Having Problems with $('img').load(function(){something}); in ie and firefox Here is my code. This centers images vertically with the class productImage. I have a bunch of images within the class. This works fine in chrome. but itermittently in ie and firefox. I can't figure out what's going on. I think it has something to do with when the image is getting loaded. I though by binding the load event to each image, it would always wait until each image is loaded until it fires, but it is not ... sometimes. Can anyone shed some light on this?
$('img.productImage').each(function(){
var jproductImage = $(this);

jproductImage.load(function(){
    jproductImage.css({
    'margin-left' : -jproductImage.width()/2 + 'px',
    'margin-top': -jproductImage.height()/2 + 'px'
    });
});

});

Thanks,
Matt

A: It could be that the images are getting cached by the browser, thereby preventing the .load event from firing. You can circumvent this problem by testing for the .complete property on each image, and where it is set, manually triggering the .load event:
$('img.productImage').one("load",function() {
    $(this).css({
        'margin-left': $(this).width() / 2 + 'px',
        'margin-top': $(this).height() / 2 + 'px'
    });
}).each(function() {
    if(this.complete) $(this).trigger("load");
});

Also, your outer .each is a bit redundant. The above is all that is needed.

A: .load is simply unreliable on images, crossbrowser.  Firefox will not fire it when loading the image from cache, for instance. Check out the jQuery docs for .load.
One section reads:

Caveats of the load event when used with images
A common challenge developers attempt to solve using the .load() shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:
It doesn't work consistently nor reliably cross-browser
It doesn't fire correctly in WebKit if the image src is set to the same src as before
It doesn't correctly bubble up the DOM tree
Can cease to fire for images that already live in the browser's cache

In my experience, creating an image object, binding a handler to it's load event, and then setting the src works more reliably if that strategy is possible.

A: What's that - before jproductImage ?
$('img.productImage').each(function(){
    var jproductImage = $(this);

    jproductImage.css({
    'margin-left' : '-'+jproductImage.width()/2 + 'px',
    'margin-top': '-'+jproductImage.height()/2 + 'px'
    });

});

Is this what are you looking for?


text:
Q: Multi-colored data bound Pushpin template? I am writing an app for WP7/WP8 for tracking buses.
This is the template that I am currently using for a bus stop pushpin -
<ControlTemplate  x:Key="StopPin" TargetType="my:Pushpin" >
    <Ellipse Fill="Green" Width="10" Height="10" />
</ControlTemplate>

How do I change this template so that I can color the stop circle based on the routes that
are currently serviced at the stop? Is there a way I can databind the ellipse color to a list of colors?


text:
Q: Typing individual properties in an object with generics Given the following types:
type A = {
  name: 'a';
  id: string;
};

type B = {
  name: 'b';
  url: string;
};

type C = {
  name: 'c';
  id: string;
};

I want to manually create an object that looks like so:
{
  a: {
    pk: 'id'
  },
  b: {
    pk: 'url'
  },
  c: {
    pk: 'id'
  }
}

But I want it typed so that it will automatically know the allowed top level property names (the "name" value from each type) as well as possible values for pk (basically any property names in that type other than "name" are acceptable).
I can do it for one type like so:
type ABC = A | B | C;

type MyObject<T extends ABC> = {
  [Key in T['name']]: {
    pk: keyof Omit<T, 'name'>;
  };
};

const x: MyObject<A> = {
  a: {
    pk: 'id',
  },
};

That type will accept any one of the ABC types. But I don't know how to make it so that the object can contain all of the ABC types.
What I want is to type "a", and then when I go to enter its "pk" value, it knows the only potential value is "id". Then I add the "b" key to the same object, and it knows the only potential "pk" value is "url".
These are just sample types, the real ones have a lot more fields and there are a lot more types.

A: I would take advantage of key remapping in mapped types to iterate over each member of your input union, like this:
type MyObject<T extends { name: string }> = {
  [U in T as U['name']]: { pk: Exclude<keyof U, "name"> }
};

For A | B | C, that evaluates to:
type M = MyObject<A | B | C>;
/* type M = {
    a: {
        pk: "id";
    };
    b: {
        pk: "url";
    };
    c: {
        pk: "id";
    };
} */

Playground link to code


text:
Q: MYSQL: filtering via HAVING in some case does not work I have a problem in a MYSQL query ran from a php script.
In my sql statement I need to filter all the users that are too far away so:
SELECT
...
ROUND(ACOS(SIN(RADIANS($Lat)) *
    SIN(RADIANS(s.Latitude)) +
    COS(RADIANS($Lat)) *
    COS(RADIANS(s.Latitude)) *
    COS(RADIANS(s.Longitude) -
    RADIANS($Lon))) * $unitKm, 2) AS "Distance"
...
HAVING "Distance" <= $Dis

Now, there's a user that is 440.55 Km away but, if I pass 334 as "Dis", it's not filtered.
333 is ok, but when bigger than 333, the HAVING clause does not work.
I pass $Dis as a number and get it from php via a:
$Dis = filter_input(INPUT_GET, 'Dis');

How could I solve the problem ?

A: Not "Distance" that is a string; you need to use backtics `Distance` in the HAVING clause.


text:
Q: WPF listView Getting Checked Item I have a list view, of which the first column is checkboxes to enable/disable the item which represents said row. The problem is, when I change the checkbox, it does not select the row. Thus, when inside my checkBox checked/unchecked event I do listView.SelectedItem, it is null and crashes. Is there any way to fix this behavior so the listView check will select the item? Or, if there is an equivalent CheckedItems property in WPF like there is in WinForms?
XAML:
<Grid>
    <ListView x:Name="listView1" HorizontalAlignment="Left" Height="300" Margin="10,10,0,0" VerticalAlignment="Top" Width="375">
        <ListView.View>
            <GridView>
                <GridViewColumn x:Name="StatusHeader" Header="Status" Width="50">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox Margin="5, 0" IsChecked="{Binding loaded}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked"/>
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>
                <GridViewColumn x:Name="NameHeader" Header="Name" Width="130" DisplayMemberBinding="{Binding name}" />
            </GridView>
        </ListView.View>
    </ListView>
</Grid>

C#:
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
    module v = (module)listView1.SelectedItem; // crash
    _client.AddClientModule(v.path);
}

private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
{
    module v = (module)listView1.SelectedItem; // crash
    _client.RemoveClientModule(v.name);
}

A: You can use the DataContext to access the ViewModel and manually select it (if it is desired).
private void CheckBox_Checked(object sender, RoutedEventArgs e)
{
    var cb = (CheckBox)sender;
    var v = (module)cb.DataContext;

    _client.AddClientModule(v.path);

    // Select manually
    listView1.SelectedItem = v;
}

private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
{
    var cb = (CheckBox)sender;
    var v = (module)cb.DataContext;

    _client.RemoveClientModule(v.path);

    // Select manually
    listView1.SelectedItem = v;
}


text:
Q: add border-bottom to nested list items I want to add a bottom border to every list item with css. Here is my CSS code:
ul,ol{
    li{
        list-style-type: none;
        margin: 0;
        padding: 0;
        padding-top: 3px;
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid #eeeeee;

        ul,ol{
            margin-left: 2em;
                li{
                    border-bottom: 1px solid #eeeeee;
                }
        }
    }
}

It gives an output like this:
Screenshot url: http://oi34.tinypic.com/ih1eea.jpg
The css code is working fine on top level item. But not on the sublists. Please see the screenshot and help me, Thanks in advance.

A: Demo
Give a class to your ul say demo
.demo li {
   border-bottom: 1px solid #000;
}

If you want each and every li in your website should get border-bottom which won't be a great idea than use
ul li {
   border-bottom: 1px solid #000;
}

If you want to indent your nested li you can use text

A: The syntax you have posted in the question is wrong. (you cannot do nesting in CSS rules)
The equivalent correct syntax is
li{
    list-style-type: none;
    margin: 0;
    padding: 0;
    padding-top: 3px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eeeeee;
}

 li ul,
 li ol{
    margin-left: 2em;
}

A: i'm not sure i understund you very well, but there is simple code for You:
HTML

Item 1

Item 1-1

Item 2

Item 3

CSS
ul.list-1 li.item-1, ol.list-1 li.item-1 {
        list-style-type: none;
        margin: 0;
        padding: 0;
        padding-top: 3px;
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid #eeeeee;
}
ul.list-1 li.item-1 ul.list-1-1 , ol.list-1 li.item-1 ul.list-1-1 {
    margin-left: 2em;
}
ul.list-1-1 li {
    border-bottom: 1px solid #eeeeee;
}

DEMO
http://jsfiddle.net/jVcFb/1/


text:
Q: An attempt at showing that function is lipschitzian Let $X$ be normed space and let $B$ denote the closed unit ball in $X$. Suppose we have map $T_0: B \rightarrow B$ which satisfies Lipschitz condition with some constant $k > 1$. We extend this map to $T_1: 2B \rightarrow B$ in the following way:
$$ T_1x = \begin{cases} T_0x, & \text{for } \|x\| \leq 1, \\
(2-\|x\|)T_0(Px), & \text{for } 1 < \|x\| \leq 2,
\end{cases}$$
where $Px = \frac{x}{\|x\|}$ for $\|x \| > 1$ and $Px = x$ for $\|x\| \leq 1$ ($P$ is radial projection onto unit ball). Im reading a paper where the author claims this extended map still satisfies Lipschitz condition, this time with constant $2k + 1$. I tried to verify this.
$\textbf{Case 1}:$ If $x,y \in B$, then $\|T_1x - T_1y\| = \|T_0x - T_0y\| \leq k\|x - y\|$.
$\textbf{Case 2}:$ Let $x \in B$ and $y \in 2B \setminus B$. Then
\begin{equation}
\begin{split}
\|T_1x - T_1y\| & = \|T_0x - (2-\|y\|)T_0(Py)\| \\
&\leq \Bigl\|T_0x - T_0(Py) - T_0(Py) + \|y\|T_0(Py) \Bigr\| \\
&\leq \|T_0(Px) - T_0(Py)\| + (\|y\| - 1)\|T_0(Py)\| \\
&\leq k\|Px - Py\| + \|y\| - \|x\| \\
&\leq 2k\|x - y\| + \|x - y\| \\
& = (2k + 1)\|x - y\|.
\end{split}
\end{equation}
Here I used the fact that in every normed space projection $P$ is Lipschitz with constant $2$.
$\textbf{Case 3}:$ Now this is where I can't finish the job. Let $x,y \in 2B \setminus B$. I only managed to show that this map is Lipschitz with constant $8k + 1$.
\begin{equation}
\begin{split}
\|T_1x - T_1y\| & = \Bigl\|(2-\|x\|)T_0(Px) - (2-\|y\|)T_0(Py) \Bigr\| \\
& = \Bigl\|2T_0(Px) - 2T_0(Py) - \|x\|T_0(Px) + \|y\|T_0(Py) \Bigr\| \\
& \leq 2\|T_0(Px) - T_0(Py)\| + \Bigl\| \|x\|T_0(Px) - \|y\|T_0(Px) \Bigr\| + \Bigl \|\|y\|T_0(P_x) - \|y\|T_0(Py) \Bigr\| \\
& \leq 4k\|x - y\| + \Bigl | \|x\| - \|y\| \Bigr | \|T_0(Px)\| + \|y\|\|T_0(Px) - T_0(Py)\| \\
& \leq 4k\|x - y\| + \|x-y\| + 4k\|x-y\| \\
& = (8k + 1)\|x - y\|.
\end{split}
\end{equation}
This is all I can get at the moment. Any help will be appreciated.
$\textbf{Edit}:$ There is extra assumption on map $T_0$ which I didnt mention, because I thought its irrelevant in evaluating Lipschitz constant. Namely, we assume $\inf\{\|x - T_0x\|: x \in B\} > 0$ (such maps exist in infinite dimensional spaces).

A: Suppose, without loss of generality, that $\left\Vert x\right\Vert >\left\Vert y\right\Vert$.
Then we have $$
\begin{align}
\left\Vert T_{1}\left(x\right)-T_{1}\left(y\right)\right\Vert
& =
\left\Vert \left(2-\left\Vert x\right\Vert \right)T_{0}\left(Px\right)-\left(2-\left\Vert y\right\Vert \right)T_{0}\left(Py\right)\right\Vert
\\ & =
\left\Vert \left(2-\left\Vert x\right\Vert \right)T_{0}\left(Px\right)-\left(2-\left\Vert x\right\Vert +\left\Vert x\right\Vert -\left\Vert y\right\Vert \right)T_{0}\left(Py\right)\right\Vert
\\ & =
\left\Vert \left(2-\left\Vert x\right\Vert \right)T_{0}\left(Px\right)-\left(2-\left\Vert x\right\Vert \right)T_{0}\left(Py\right)-\left(\left\Vert x\right\Vert -\left\Vert y\right\Vert \right)T_{0}\left(Py\right)\right\Vert
\\ & \leq
\left\Vert \left(2-\left\Vert x\right\Vert \right)T_{0}\left(Px\right)-\left(2-\left\Vert x\right\Vert \right)T_{0}\left(Py\right)\right\Vert +\left\Vert \left(\left\Vert x\right\Vert -\left\Vert y\right\Vert \right)T_{0}\left(Py\right)\right\Vert
\\ & =
\left(2-\left\Vert x\right\Vert \right)\left\Vert T_{0}\left(Px\right)-T_{0}\left(Py\right)\right\Vert +\left(\left\Vert x\right\Vert -\left\Vert y\right\Vert \right)\left\Vert T_{0}\left(Py\right)\right\Vert
\end{align}
$$
for $x,y \in 2B/B$.
Since
$\left\Vert x\right\Vert >\left\Vert y\right\Vert$
we have
$\left\Vert x\right\Vert -\left\Vert y\right\Vert =\left|\left\Vert x\right\Vert -\left\Vert y\right\Vert \right|\leq\left\Vert x-y\right\Vert $
, since
$ 1 < \left\Vert x\right\Vert $
we have
$ 2-\left\Vert x\right\Vert < 1 $
and since
$ T_{0}\left(Py\right)\in B $
we have
$ \left\Vert T_{0}\left(Py\right)\right\Vert \leq 1 $.
Therefore
$$
\begin{align}
\left(2-\left\Vert x\right\Vert \right)\left\Vert T_{0}\left(Px\right)-T_{0}\left(Py\right)\right\Vert +\left(\left\Vert x\right\Vert -\left\Vert y\right\Vert \right)\left\Vert T_{0}\left(Py\right)\right\Vert
& <
\left\Vert T_{0}\left(Px\right)-T_{0}\left(Py\right)\right\Vert +\left\Vert x-y\right\Vert
\\ & \leq
k\left\Vert Px-Py\right\Vert +\left\Vert x-y\right\Vert
\\ & \leq
2k\left\Vert x-y\right\Vert +\left\Vert x-y\right\Vert
\\ & =
\left(2k+1\right)\left\Vert x-y\right\Vert
\end{align}
$$
as claimed.


text:
Q: codeigniter session expires frequently I'm using codeigniter for my app
what my problem is session is expiring even though user is active on the site.
These are the session settings.. i'm using DB session
$config['sess_cookie_name']     = 'ci_session';
$config['sess_expiration']      = 7200;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']      = 'edu_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 300;

any solution for this.
help me i have to fix it
here is the codeigniter  forum link

A: As mentioned in the first answer, there is a race condition in the session library which has since been somewhat mitigated in the latest versions of CodeIgniter, including the 'develop' branch.  This implements an isAjax check on session rotation, but it doesn't really fix the underlying problem.

A: are you sure that the session is destroyed? I think that it's just not getting updated as supposed and it creates a new one on every page request. (common Codeigniter's setting issue)
here's my suggestions:
double check your Application/Config/config.php file to ensure that the part of session domain looks like that if you host the site on the main directory:
$config['cookie_prefix']    = "";
$config['cookie_domain']    = "yourdomain.com";
$config['cookie_path']  = "var/sessions/";
$config['cookie_secure']    = FALSE;

and like that if you host the site on a sub-directory:
$config['cookie_prefix']    = "";
$config['cookie_domain']    = "yourdomain.com";
$config['cookie_path']  = "siteSubDirectory/var/sessions/";
$config['cookie_secure']    = FALSE;

and also make sure that the 2 directories are writable by fixing their permissions to 755 or so, and I strongly recommend that you enable database session, it's more secure and will help you find out the real problem by checking the session table. good luck :)

A: I will add a workaround for this issue.
if an ajax call is made then do not update the session
extend the session class by adding this file to the libraries folder:
    class MY_Session extends CI_Session {

    // --------------------------------------------------------------------

    /**
     * sess_update()
     *
     * @access    public
     * @return    void
     */
    public function sess_update()
    {
        $CI =& get_instance();

        if ( ! $CI->input->is_ajax_request())
        {
            parent::sess_update();
        }
    }

}

A: I've had issues with CI sessions expiring randomly.  Do you have AJAX or dynamic resources loading the session library?  If so, imagine this scenario:
I submit an ajax request (which passes in my CI session id with the cookie), and it returns the results, BUT I'm also submitting some other request (loading a dynamic image, another AJAX request, etc.) that immediately follows the first request.  The first request might trigger the 300 second "it's time to update" event, and pass back a new cookie, but the additional request is sending the old session id, right?
So, CodeIgniter says "hey you, you can't do that" and creates a new session, invalidating both cookies my browser now doesn't know what to do with.
Here's a forum link I posted a while back that goes into more detail:
http://codeigniter.com/forums/viewthread/172415/

A: Just change ci_sessions table encode to MyISAM:
ALTER TABLEci_sessionsENGINE = MyISAM;

A: Remove bellow line from config.php
$config['cookie_path']      = '/';

A: You may need to set the cookie domain in ,/application/config/config.php
  PHP Code:
    $config['cookie_prefix']   = '';
    $config['cookie_domain']   = '.domainname.com';
    $config['cookie_path']     = '/';
    $config['cookie_secure']   = FALSE;
    $config['cookie_httponly'] = FALSE;

cookie_domain as your host name, this resolve my session expire issue


text:
Q: "Cannot convert null to "int" because it is a non-nullable value type"  void GetMessages()
    {
        var _HttpRequest = new HttpRequest();
        string Response = HttpRequest.Get("https://api.vk.com/method/messages.getLastActivity?user_id=" + tbID.Text + "&access_token=" + ACCESS_TOKEN + "&v=5.68").ToString();
        dynamic JSON = JObject.Parse(Response);
        int Activity = JSON.online; /* 0 - offline, 1 - online */
    }

Вызов метода должен отправить такой ответ:
{"response":{"online":0,"time":1503753794}}

Где независимо от параметров я получаю ошибку, указывающая на строку:
int Activity = JSON.online;

A: У вас получается JObject, у которого есть свойство response, а уж в нём содержится JObject со свойством online.
При обращении к JSON.online JObject «на лету» создаёт пустое свойство со значением null, которое невозможно превратить в int.
Используйте
JSON.response.online


text: Q: measure for two different network I want to distinguish two networks. One of two has some conspicuous hub node like that. The other is randomly conneted. In this case, is there appropriate measure to distinguish between two networks?


text:
Q: Read and Edit Configuration Properties in Java Jersey Web Service I have a simple Java web service written using Maven-Jersey. It has two functions - getallusers and getuser
@Path("/UserService")
public class UserService
{
    UserDao userDao = new UserDao(DevMode.DEV_MODE);
    private static final String SUCCESS_RESULT = "{\"result\":\"success\"}";
    private static final String FAILURE_RESULT = "{\"result\":\"failure\"}";

    @GET
    @Path("/users")
    @Produces(MediaType.APPLICATION_JSON)
    public List<User2> getUsers()
    {
       return userDao.getAllUsers();
    }

    @GET
    @Path("/users/{userid}")
    @Produces(MediaType.APPLICATION_JSON)
    public User2 getUser(@PathParam("userid") int userid)
    {
       return userDao.getUser(userid);
   }
}

UserDao is reading from a user.json file. Now I want to set the DevMode.DEV_MODE in the configuration file. Something like deployment_mode="Dev" So that I can change it during deployment or when running unit tests. I am using the DevMode to read from different files like userdev.json or usertest.json.
Is there a way to read this configuration file when UserService is getting started? Or Is there a way I can modify those configuration parameters once UserService is up?
UPDATE: Still I don't know how to read or modify a configuration properties for a web service. As a work around, in the unit test I have added @Before and @After. In @Before function, I am manually moving the actually db file that is user.json to temp and creating a test user.json file. In @After function I am moving back the temp file to replace the test user.json. This is definitely a dirty way to fix this.


text:
Q: How to fixed Multiple commands produce when starting archive the application (XCode) I have current problem on my application, the project already release on google play and we want to upload or go live this application to the App Store however when I tried to archive the application I got alot of errors.
Platform: React Native
React Native Version: 0.68.1

Multiple commands produce
'/Users/project/Library/Developer/Xcode/DerivedData/projects-damsthqiwzugpcfgjcsrtaoeutbv/Build/Intermediates.noindex/ArchiveIntermediates/projects/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle':

*

*Target 'React-Core-60309c9c-AccessibilityResources' has create
directory command with output
'/Users/project/Library/Developer/Xcode/DerivedData/project-damsthqiwzugpcfgjcsrtaoeutbv/Build/Intermediates.noindex/ArchiveIntermediates/project/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'

*Target 'React-Core-AccessibilityResources' has create directory
command with output
'/Users/project/Library/Developer/Xcode/DerivedData/project-damsthqiwzugpcfgjcsrtaoeutbv/Build/Intermediates.noindex/ArchiveIntermediates/project/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/AccessibilityResources.bundle'

I read different articles to solved the problem but still not works:

*

*Try to look Build Phases -> Copy Bundle Resources (If there is duplicated item)

Inside Pod File:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"

platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false

target 'Projects' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'Project Test' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end


text:
Q: other languages in flash music player i am using this code for playing music for my website way2enjoy.com .it playes all songs nicely whose source is in english language but when the source file is in other language say for example arabic it wont play. i have checked the source code using firebug it was 100% corrrect for one flash player and in other flash player it was showing arabic character as ??????????
here is my existing source code .you can see the third div which is arabic. first two will play nicely in the below link but third will not play however everything is just right.
live example    http://way2enjoy.com/try/musictest/drplayer/index.html

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="Stylesheet" href="drplayer.css" type="text/css" />

 - Shut up and let me

Metallica - Nothing else matters

Arabic song - Arabic song

Prev
Next

Pause
Play

here is link for other player i tried
http://way2enjoy.com/music/viewstory/3406

A: ارجعلي.mp3 is not a valid URL, that may well be your problem. If that is true, you will have to URL encode it or use a latin-only URL.
Here is an on-line URL encoder:
http://meyerweb.com/eric/tools/dencoder/
it turns the file name into
%D8%A7%D8%B1%D8%AC%D8%B9%D9%84%D9%8A.mp3

which should be displayed okay in most browsers (ie. as ارجعلي.mp3), and always work.


text:
Q: Mistake in proof that $f$ is holomorphic iff $df$ is $\mathbb{C}$-linear Let $f: \mathbb{C} \rightarrow \mathbb{C}$ differentiable. I have already seen the proof here that $f$ is holomorphic (by definition meaning that $\partial_{\overline{z}}f = 0$) iff $d_p f: T_p\mathbb{C} \rightarrow T_{f(p)}\mathbb{C}$ is $\mathbb{C}$-linear, so it's not a proof that I'm asking for, but rather where does my attempt of a proof go wrong?
For a fixed point $p$ in the manifold $\mathbb{C}$, identify $\frac{\partial}{\partial x}, \frac{\partial}{\partial y} \in T_p\mathbb{C}$ with $1:=\frac{\partial}{\partial x}, i:=\frac{\partial}{\partial y}$. Then for any $v=v_x+iv_y \in T_p\mathbb{C}$, $d_p f(v_x + i v_y) = v_x \frac{\partial f}{\partial x}(p) + i v_y \frac{\partial f}{\partial y}(p)$. $\mathbb{C}$-linearity means that $d_p f( (a+bi)(v_x+iv_y)) = (a+bi)d_p f(v_x +iv_y)$.
$$
LHS=(av_x-bv_y)\frac{\partial f}{\partial x}(p) + i (av_y + bv_x) \frac{\partial f}{\partial y}(p)
$$
$$
RHS = av_x \frac{\partial f}{\partial x}(p) - bv_y \frac{\partial f}{\partial y}(p)
+ i (bv_x \frac{\partial f}{\partial x}(p) + av_y \frac{\partial f}{\partial y}(p))
$$
So we have $\mathbb{C}$-linearity $\Leftrightarrow$ $\frac{\partial f}{\partial y}(p) = \frac{\partial f}{\partial x}(p)$, which is clearly false. Where am I being a fool?


text:
Q: Table column partially dependent on another column? I want to have two type :boolean columns, let's say X and Y, where Y is partially dependent on X. When X is true, Y can be either true or false, but when X is false, Y must be false. Is this possible?
class AddPrivacyColumnsToPosts < ActiveRecord::Migration
  def change
    add_column("posts", "public", :boolean, :default => true)
    add_column("posts", "collectable", :boolean, :default => true)
  end
end

where public is X, and collectable is Y, i.e. only public posts can be collected. If a post is set to private (when public is false), then collectable should automatically be set to false.

A: I would add a before save call back to Post
before_save :set_collectable

def set_collectable
  if !public?
    self.collectable = false
  end
end


text:
Q: How to correctly use Webpack async imports I'm trying to make a website with multiple components where each one is loaded with async import because I don't need every component (and maybe the user hasn't even access to it).
This is an example file structure (mine look somehow like that):
src/
  utils/
    ...
  index.ts
  components/
    home/
      ...
      index.ts
    about/
      ...
      index.ts
    contact/
      ...
      index.ts

Now I import the needed component somewhere in src/index.ts (I'm using TypeScript). Everything is fine until here.
Now the problem: When I need to use files from utils in a component which is loaded with lazy-loading, is that file bundeled twice? So the first time with the main chunk and the second time with the component chunk? How can I tell Webpack that this file is already included and doesn't have to be bundeled again? So I want to use the same cached version again in a component that is lazy-loaded.


text:
Q: Routing to ClusterIP via VPN I have the following IP range as ClusterIP from Kubernetes cluster.
$ gcloud beta container clusters describe CLUSTER_NAME | grep servicesIpv4Cidr
servicesIpv4Cidr: 10.86.240.0/20

I want to allow this IP range accessible from my DC via VPN.
After adding the "Remote peer IP address" to the next hop from my DC

How should I create the route on GCE?
According to the doc of gcloud compute routes create command

Exactly one of --next-hop-address, --next-hop-gateway,
  --next-hop-vpn-tunnel, or --next-hop-instance must be provided with this command.

If I set one of the NODE to --next-hop-instance, what if this NODE is down?
How can I implement a route without single-point-of-failure?

A: As mentioned here there is not elegant solution at this point. I believe Kubernetes itself will take care of the nodes health in case of failure. Nevertheless,  you can still add multiple routes to different nodes.  The lowest route will take preference, but if the node ceases to exist the second route will take over.


text:
Q: How to use Bootstrap 4 in ASP.NET Core I want to update Bootstrap in ASP.NET Core with NuGet. I used this:
Install-Package bootstrap -Version 4.0.0

It did add the dependencies but how do I add it to my project now? What is the path for local NuGet dependencies?

A: Libman seems to be the tool preferred by Microsoft now. It is integrated in Visual Studio 2017(15.8).
This article describes how to use it and even how to set up a restore performed by the build process.
Bootstrap's documentation tells you what files you need in your project.
The following example should work as a configuration for libman.json.
{
  "version": "1.0",
  "defaultProvider": "cdnjs",
  "libraries": [
  {
    "library": "twitter-bootstrap@4.2.1",
    "destination": "wwwroot/lib/bootstrap",
    "files": [
    "js/bootstrap.bundle.js",
    "css/bootstrap.min.css"
    ]
  },
  {
    "library": "jquery@3.3.1",
    "destination": "wwwroot/lib/jquery",
    "files": [
      "jquery.min.js"
    ]
  }
]
}

A: Looking into this, it seems like the LibMan approach works best for my needs with adding Bootstrap. I like it because it is now built into Visual Studio 2017(15.8 or later) and has its own dialog boxes.
Update 6/11/2020: bootstrap 4.1.3 is now added by default with VS-2019.5 (Thanks to Harald S. Hanssen for noticing.)
The default method VS adds to projects uses Bower but it looks like it is on the way out. In the header of Microsofts bower page they write:

Following a couple links lead to Use LibMan with ASP.NET Core in Visual Studio where it shows how libs can be added using a built-in Dialog:

In Solution Explorer, right-click the project folder in which the
  files should be added. Choose Add > Client-Side Library. The Add
  Client-Side Library dialog appears: [source: Scott Addie 2018]

Then for bootstrap just (1) select the unpkg, (2) type in "bootstrap@.." (3) Install. After this, you would just want to verify all the includes in the _Layout.cshtml or other places are correct. They should be something like href="~/lib/bootstrap/dist/js/bootstrap...")

A: Unfortunately, you're going to have a hard time using NuGet to install Bootstrap (or most other JavaScript/CSS frameworks) on a .NET Core project. If you look at the NuGet install it tells you it is incompatible:

if you must know where local packages dependencies are, they are now in your local profile directory. i.e. %userprofile%\.nuget\packages\bootstrap\4.0.0\content\Scripts.
However, I suggest switching to npm, or bower - like in Saineshwar's answer.

A: We use bootstrap 4 in asp.net core but reference the libraries from "npm" using the "Package Installer" extension and found this to be better than Nuget for Javascript/CSS libraries.
We then use the "Bundler & Minifier" extension to copy the relevant files for distribution (from the npm node_modules folder, which sits outside the project) into wwwroot as we like for development/deployment.

A: As others already mentioned, the package manager Bower, that was usually used for dependencies like this in application that do not rely on heavy client-side scripting, is on the way out and actively recommending to move to other solutions:

..psst! While Bower is maintained, we recommend yarn and webpack for new front-end projects!

So although you can still use it right now, Bootstrap has also announced to drop support for it. As a result, the built-in ASP.NET Core templates are slowly being edited to move away from it too.
Unfortunately, there is no clear path forward. This is mostly due to the fact that web applications are continuously moving further into the client-side, requiring complex client-side build systems and many dependencies. So if you are building something like that, you might already know how to solve this then, and you can expand your existing build process to simply also include Bootstrap and jQuery there.
But there are still many web applications out there that are not that heavy on the client-side, where the application still runs mainly on the server and the server serves static views as a result. Bower previously filled this by making it easy to just publish client-side dependencies without that much of a process.
In the .NET world we also have NuGet and with previous ASP.NET versions, we could use NuGet as well to add dependencies to some client-side dependencies since NuGet would just place the content into our project correctly. Unfortunately, with the new .csproj format and the new NuGet, installed packages are located outside of our project, so we cannot simply reference those.
This leaves us with a few options how to add our dependencies:
One-time installation
This is what the ASP.NET Core templates, that are not single-page applications, are currently doing. When you use those to create a new application, the wwwroot folder simply contains a folder lib that contains the dependencies:

If you look closely at the files currently, you can see that they were originally placed there with Bower to create the template, but that is likely to change soon. The basic idea is that the files are copied once to the wwwroot folder so you can depend on them.
To do this, we can simply follow Bootstrap's introduction and download the compiled files directly. As mentioned on the download site, this does not include jQuery, so we need to download that separately too; it does  contain Popper.js though if we choose to use the bootstrap.bundle file later—which we will do. For jQuery, we can simply get a single "compressed, production" file from the download site (right-click the link and select "Save link as..." from the menu).
This leaves us with a few files which will simply extract and copy into the wwwroot folder. We can also make a lib folder to make it clearer that these are external dependencies:

That's all we need, so now we just need to adjust our _Layout.cshtml file to include those dependencies. For that, we add the following block to the <head>:
<environment include="Development">
    <link rel="stylesheet" href="~/lib/css/bootstrap.css" />
</environment>
<environment exclude="Development">
    <link rel="stylesheet" href="~/lib/css/bootstrap.min.css" />
</environment>

And the following block at the very end of the <body>:
<environment include="Development">
    <script src="~/lib/js/jquery-3.3.1.js"></script>
    <script src="~/lib/js/bootstrap.bundle.js"></script>
</environment>
<environment exclude="Development">
    <script src="~/lib/js/jquery-3.3.1.min.js"></script>
    <script src="~/lib/js/bootstrap.bundle.min.js"></script>
</environment>

You can also just include the minified versions and skip the <environment> tag helpers here to make it a bit simpler. But that's all you need to do to keep you starting.
Dependencies from NPM
The more modern way, also if you want to keep your dependencies updated, would be to get the dependencies from the NPM package repository. You can use either NPM or Yarn for this; in my example, I'll use NPM.
To start off, we need to create a package.json file for our project, so we can specify our dependencies. To do this, we simply do that from the "Add New Item" dialog:

Once we have that, we need to edit it to include our dependencies. It should something look like this:
{
  "version": "1.0.0",
  "name": "asp.net",
  "private": true,
  "devDependencies": {
    "bootstrap": "4.0.0",
    "jquery": "3.3.1",
    "popper.js": "1.12.9"
  }
}

By saving, Visual Studio will already run NPM to install the dependencies for us. They will be installed into the node_modules folder. So what is left to do is to get the files from there into our wwwroot folder. There are a few options to do that:
bundleconfig.json for bundling and minification
We can use one of the various ways to consume a bundleconfig.json for bundling and minification, as explained in the documentation. A very easy way is to simply use the BuildBundlerMinifier NuGet package which automatically sets up a build task for this.
After installing that package, we need to create a bundleconfig.json at the root of the project with the following contents:
[
  {
    "outputFileName": "wwwroot/vendor.min.css",
    "inputFiles": [
      "node_modules/bootstrap/dist/css/bootstrap.min.css"
    ],
    "minify": { "enabled": false }
  },
  {
    "outputFileName": "wwwroot/vendor.min.js",
    "inputFiles": [
      "node_modules/jquery/dist/jquery.min.js",
      "node_modules/popper.js/dist/umd/popper.min.js",
      "node_modules/bootstrap/dist/js/bootstrap.min.js"
    ],
    "minify": { "enabled": false }
  }
]

This basically configures which files to combine into what. And when we build, we can see that the vendor.min.css and vendor.js.css are created correctly. So all we need to do is to adjust our _Layouts.html again to include those files:
<!-- inside <head> -->
<link rel="stylesheet" href="~/vendor.min.css" />

<!-- at the end of <body> -->
<script src="~/vendor.min.js"></script>

Using a task manager like Gulp
If we want to move a bit more into client-side development, we can also start to use tools that we would use there. For example Webpack which is a very commonly used build tool for really everything. But we can also start with a simpler task manager like Gulp and do the few necessary steps ourselves.
For that, we add a gulpfile.js into our project root, with the following contents:
const gulp = require('gulp');
const concat = require('gulp-concat');

const vendorStyles = [
    "node_modules/bootstrap/dist/css/bootstrap.min.css"
];
const vendorScripts = [
    "node_modules/jquery/dist/jquery.min.js",
    "node_modules/popper.js/dist/umd/popper.min.js",
    "node_modules/bootstrap/dist/js/bootstrap.min.js",
];

gulp.task('build-vendor-css', () => {
    return gulp.src(vendorStyles)
        .pipe(concat('vendor.min.css'))
        .pipe(gulp.dest('wwwroot'));
});

gulp.task('build-vendor-js', () => {
    return gulp.src(vendorScripts)
        .pipe(concat('vendor.min.js'))
        .pipe(gulp.dest('wwwroot'));
});

gulp.task('build-vendor', gulp.parallel('build-vendor-css', 'build-vendor-js'));

gulp.task('default', gulp.series('build-vendor'));

Now, we also need to adjust our package.json to have dependencies on gulp and gulp-concat:
{
  "version": "1.0.0",
  "name": "asp.net",
  "private": true,
  "devDependencies": {
    "bootstrap": "4.0.0",
    "gulp": "^4.0.2",
    "gulp-concat": "^2.6.1",
    "jquery": "3.3.1",
    "popper.js": "1.12.9"
  }
}

Finally, we edit our .csproj to add the following task which makes sure that our Gulp task runs when we build the project:
<Target Name="RunGulp" BeforeTargets="Build">
  <Exec Command="node_modules\.bin\gulp.cmd" />
</Target>

Now, when we build, the default Gulp task runs, which runs the build-vendor tasks, which then builds our vendor.min.css and vendor.min.js just like we did before. So after adjusting our _Layout.cshtml just like above, we can make use of jQuery and Bootstrap.
While the initial setup of Gulp is a bit more complicated than the bundleconfig.json one above, we have now have entered the Node-world and can start to make use of all the other cool tools there. So it might be worth to start with this.
Conclusion
While this suddenly got a lot more complicated than with just using Bower, we also do gain a lot of control with those new options. For example, we can now decide what files are actually included within the wwwroot folder and how those exactly look like. And we also can use this to make the first moves into the client-side development world with Node which at least should help a bit with the learning curve.

A: Try Libman, it's as simple as Bower and you can specify wwwroot/lib/ as the download folder.

A: BS4 is now available on .NET Core 2.2. On the SDK 2.2.105 x64 installer for sure.  I'm running Visual Studio 2017 with it.  So far so good for new web application projects.

A: Why not just use a CDN? Unless you need to edit the code of BS, then you just need to reference the codes in CDN.
See BS 4 CDN Here:
https://www.w3schools.com/bootstrap4/bootstrap_get_started.asp
At the bottom of the page.

A: What does the trick for me is:
1) Right click on wwwroot > Add > Client Side Library
2) Typed "bootstrap" on the search box
3) Select "Choose specific files"
4) Scroll down and select a folder.  In my case I chose "twitter-bootstrap"
5) Check "css" and "js"
6) Click "Install".
A few seconds later I have all of them wwwroot folder. Do the same for all client side packages that you want to add.

A: Use nmp configuration file (add it to your web project) then add the needed packages in the same way we did using bower.json and save. Visual studio will download and install it. You'll find the package the under the nmp node  of your project.


text:
Q: Linux - group member cannot delete file with rw permission Below shows a file, /tmp/testfile, owned by user1 with group changed to wheel that also includes user2. The file has rw permission for the group. So shouldn't any member of the group be able to delete it? The example output below shows that user2 is not able to delete the file. Why?
[user2@files ~]$ ls -l /tmp/testfile
-rw-rw-r-- 1 user1 wheel 0 Jul 18 18:54 /tmp/testfile
[user2@files ~]$ groups
user2 wheel
[user2@files ~]$  rm /tmp/testfile
rm: cannot remove `/tmp/testfile': Operation not permitted

A: First, you're looking at the wrong permissions. When you move/rename/delete a file, you're only modifying the parent directory – the file's own permissions are not checked. You only remove an entry from the directory's list of files. Therefore you should check the permissions of the parent directory (in this case /tmp).
$ ls -ld /tmp
drwxrwxrwt 15 root root 460 Jul 19 15:18 /tmp/

Second, /tmp is special. On practically all systems, it's writable by anyone (ugo=rwx), so at first glance, it looks like anyone could rename or delete any file in it. This would of course make it easy (well, even easier) to create problems for other users, therefore /tmp always has the "sticky" aka "restricted deletion" mode set (o+t). With this mode set, only the file's owner can move or delete files in that directory, regardless of any permissions.
(On GNU coreutils, the chmod(1) manual page has a section about the "restricted deletion flag or sticky bit".)