text:
Q: in Subversion, Confusing about revision numbering of Branch I have been using Clear Case, and I started to use Subversion.
Now I'm confused if a branch's revision number starts from 0
or if it
starts from the trunk's HEAD revision number.
And another question,
after I commit on Trunk, I'm confused if the latest revision of branch is same as the Trunk's HEAD revision.
Thanks in advance.

A: The revision numbers in a Subversion repository are global, i.e. they apply to the whole repository including trunk, tags and branches.
This Section of the book "Version Control with Subversion" might be useful to you:

*

*http://svnbook.red-bean.com/en/1.7/svn.basic.in-action.html#svn.basic.in-action.revs

A: You should not apply any of ClearCase experience (apart from the concept of systematic change management) when thinking of versioning, branching, and merging in Subversion. It is completely different.
Trunk and branches in subversion are symmetric independent folders. When one is branched off another it is in fact a lightweight copy-on-write.
Revision is a global state of the repository rather than a state of individual element, that's why you see "the latest revision of the branch is the same as the trunk head revision".

A: Within Subversion, each new repository will start at revision 1 when it is created.
All revisions are unique and incremental for each repository, regardless of whether you commit to the trunk, branch or create a tag.
So you would get revision numbers like this:
Commit to Trunk - rev 1
Commit to Trunk - rev 2
Commit to Branch - rev 3
Commit to Trunk - rev 4

A: Subversion revision numbers are strictly monotonous. If your commit gets revision number n then the next commit will be revision n+1 regardless of where in the repo something gets committed. It could even be to a different project in the same repo.


text:
Q: Is there a quota / limit of 1500 for google contacts api sync? I am using a Thunderbird mail plugin "gContactSync"
This week myself & 10+ other users found the plugin can only sync 1500 contacts.
Nothing has changed in the plugin or thunderbird.
We believe Google API contacts has changed.
Can anyone please advise what the 1500 limit / quota for syncing contacts is?
How do we resolve?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Protect E-mail address from scraping on a static site generated by Gatsby I have a static website that was written in Gatsby. There is an E-mail address on the website, which I want to protect from harvester bots.
My first approach was, that I send the E-mail address to the client-side using GraphQL. The sent data is encoded in base64 and I decode it on client-side in the React component where the E-mail address is displayed. But if I build the Gatsby site in production and take a look at the served index.html I can see the already decoded E-mail address in the html code. In production there seems to be no XHR request at all, so all GraphQL queries were evaluated while the server-side rendering was running.
So for the second approach, I tried to decode the E-mail address when the react component is mount.
This way the server-side rendered html page does not contain the E-mail address. But when the page is loaded it is displayed.
The relevant parts of the code look following:
import React, { useState, useEffect } from "react"
import { useStaticQuery, graphql } from "gatsby"

const Contacts = () => {
    const { site } = useStaticQuery(
        graphql`
          query {
            site {
                siteMetadata {
                    email
              }
            }
          }
        `
    )
    function decode(s) {
        var e = {}, i, b = 0, c, x, l = 0, a, r = '', w = String.fromCharCode, L = s.length;
        var A = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
        for (i = 0; i < 64; i++) { e[A.charAt(i)] = i; }
        for (x = 0; x < L; x++) {
            c = e[s.charAt(x)]; b = (b << 6) + c; l += 6;
            while (l >= 8) { ((a = (b >>> (l -= 8)) & 0xff) || (x < (L - 2))) && (r += w(a)); }
        }
        return r;
    };

    const [email, setEmail] = useState("");
    useEffect(() => decodeData(), []);
    function decodeData() {
        setEmail(() => decode(site.siteMetadata.email), []);
    }

    return (
        //...
        {email}
        //...
    )
}

export default Contacts

Does this approach make any difference? I mean can I protect this way the E-mail address from the bots?
This way at least the requested html page does not contain the E-mail address hard coded.
If you would like to take a look at the page in the developer tools of a browser, it can be found here: https://www.barbaraapartmanheviz.hu/en/

A: Have you tried/considered https://www.npmjs.com/package/react-obfuscate ?
It doesn't encode data (e.g. email, tel) but reverses it in the DOM (and re-reverses with css).
Maybe not super secure but at least some obfuscation with minimal effort.

A: That should work. useEffect is not executed on the server side so the email won't be decoded before it's sent to the client.
It seems a bit needlessly complicated maybe. I'd say just put {typeof window !== 'undefined' && decode(site.siteMetadata.email)} in your JSX.
Of course there is no such thing as 100% protection. It's quite possible Google will index this email address. They do execute JavaScript during indexing. I'd strongly suspect most scrapers do not, but there might be some that do.


text:
Q: How to display the databases content in a popover by ID (with Foreach) I have a table containing list of users, when i hover selector button "myuser" it is necessary that a popover is displayed with the mail of user select.
The problem is if I click on button: the popover displays the email of all users each time.
<td
  class="classgroup"
  tabindex="0"
  id="classgroup"
  data-html="true"
  data-toggle="popover"
  data-trigger="hover"
  data-trigger="focus"
  title="<?php foreach ($client as $person): ?><?php echo $person->nom; ?><?php endforeach;?>"
  data-content="<?php foreach ($client as $person): ?><?php echo $person->email; ?><?php endforeach;?>">
  myuser

A: <?php foreach ($client as $person): ?>
<td
  class="classgroup"
  tabindex="0"
  id="classgroup"
  data-html="true"
  data-toggle="popover"
  data-trigger="hover"
  data-trigger="focus"
  title="<?php echo $person->nom; ?>"
  data-content="<?php echo $person->email; ?>">
  myuser

<?php endforeach;?>

moving the foreach loop out will create as many table cells as items in the array you are looping. Adapt it to your desired output (like splitting in multiple lines)


text:
Q: ASP.NET: Repeater does not work for me My C# Code
public partial class Message : System.Web.UI.Page
{
    String strconn = ConfigurationManager.ConnectionStrings["db"].ConnectionString;
    protected void Page_Load(object sender, EventArgs e)
    {
        members();
    }

    public void members()
    {
        SqlConnection con = new SqlConnection(strconn);
        con.Open();
        try
        {
            string str = "Select Users.Username,Users.Name,ProfilePic.Pathh From Users FULL OUTER JOIN ProfilePic ON Users.username = ProfilePic.Username ORDER BY Users.Sno";
            SqlCommand cmd = new SqlCommand(str,con);
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);
            repMembers.DataSource = ds;
            repMembers.DataBind();
            GridView1.DataSource = ds;
            GridView1.DataBind();
            cmd.Dispose();
            con.Close();
        }
        catch(Exception ex) {
            lbMembers.Text = ex.ToString();
        }
    }
}

And My HTML Code
   <asp:Repeater ID="repMembers" runat="server" >
                           <asp:ItemTemplate >

 <asp:Image ID="Image4" runat="server" ImageUrl='<%#Eval("Pathh") %>' width="60px" Height="60px"/> <asp:Label ID="lb" runat="server" Text='<%#Eval("Username") %>'></asp:Label>
<asp:Label ID="lbname" runat="server" Text='<%#Eval("Name") %>'></asp:Label>

                           </asp:ItemTemplate>
                        </asp:Repeater>

My Table is absolutely correct and is working, i checked it with Grid View. It gives me the "Name","Username", and "Path" Stored.
I checked it with SQL query and displayed it in grid view.
This is the Photo of my table,it is the combination of two tables

A: Use ItemTemplate instead of asp:ItemTemplate. There's also a typo with the word "Pathh", does this solve your issue?
<ItemTemplate >

        <asp:Image ID="Image4" runat="server" ImageUrl='<%#Eval("Path") %>' width="60px" Height="60px"/>

        <asp:Label ID="lb" runat="server" Text='<%#Eval("Username") %>'></asp:Label>

        <asp:Label ID="lbname" runat="server" Text='<%#Eval("Name") %>'></asp:Label>

</ItemTemplate>


text:
Q: Count rows of duplicate concatenated fields I have a table with data:
    ID Version     Major       Minor       Revision
    1  00000000004 00000000000 00000000012 0000000015
    2  00000000004 00000000000 00000000012 0000000015
    3  00000000004 00000000000 00000000013 0000000001
    4  00000000004 00000000000 00000000013 0000000002
    5  00000000004 00000000000 00000000013 0000000008
    6  00000000004 00000000000 00000000013 0000000008
    7  00000000004 00000000000 00000000014 0000000007
    8  00000000004 00000000000 00000000014 0000000008
    9  00000000004 00000000000 00000000014 0000000009
    10 00000000004 00000000000 00000000014 0000000009
    11 00000000004 00000000000 00000000014 0000000009
    12 00000000004 00000000000 00000000014 0000000009
    13 00000000004 00000000000 00000000014 0000000009
    14 00000000004 00000000000 00000000014 0000000009
    15 00000000004 00000000000 00000000014 0000000010
    16 00000000004 00000000000 00000000014 0000000011

I want to concatenate the Version, Major, Minor and Revision fields and count the duplicate rows of the versions:
    DB Version   Count
    V4.0.12.15   2
    V4.0.13.01   1
    V4.0.13.02   2
    V4.0.13.08   2
    V4.0.14.07   1
    V4.0.14.09   6
    V4.0.14.10   1
    V4.0.14.11   1

So far I can concatenate the DB Version using:
    SELECT CONCAT (
        'V'
        RIGHT(LTRIM(Version) 1)
        '.'
        RIGHT(LTRIM(Major) 1)
        '.'
        RIGHT(LTRIM(Minor) 2)
        '.'
        RIGHT(LTRIM(Revision) 2)
        ) AS 'DB Version' FROM DBversion;

But I am struggling with how to extract the count for the DB Versions.

A: You solved the hard part.  The rest is just aggregation:
SELECT CONCAT(
        'V'
        RIGHT(LTRIM(Version) 1)
        '.'
        RIGHT(LTRIM(Major) 1)
        '.'
        RIGHT(LTRIM(Minor) 2)
        '.'
        RIGHT(LTRIM(Revision) 2)
        ) AS "DB Version",
       COUNT(*)
FROM DBversion
GROUP BY "DB Version";

Note:  don't put a space between concat and (.  MySQL doesn't like that.

A: Something like that

select
    version,
    count(*)
from (
    select
        concat('V', concat_ws('.',
            Version + 0,
            Major + 0,
            Minor + 0,
            Revision + 0)
        ) version
    from DBversion
) concatenated
group by version

However it is highly not recommended to go this way, as such query will have very poor performance.
The better solution would be to create intermediate table, calculate the version numbers and then make a query with group by from that intermediate table.


text:
Q: Installing CKAN 2.8.2 in Ubuntu 18.04 I am trying to install CKAN 2.8.2 in Ubuntu 18.04 following these instructions.
I have followed all steps successfully, until step 4.2 with sudo ckan db init.
I get the following error:
Traceback (most recent call last):
  File "/usr/bin/ckan", line 4, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 84, in <module>
    __import__('pkg_resources.extern.packaging.requirements')
  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/extern/__init__.py", line 61, in load_module
    "distribution.".format(**locals())
ImportError: The 'packaging.requirements' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.

Any ideas on what is wrong?

A: The error is pretty clear about it

ImportError: The 'packaging.requirements' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.

The link you have in the question states

but it requires Ubuntu 16.04 64-bit or Ubuntu 14.04 64-bit

So that excludes 18.04 what you are installing.
As stated in the error: take it up with the maintainer to adjust the package to include the requirements for 18.04
As a general guide: packages outside of the Ubuntu system that belong to a lower LTS tend to NOT work since we switch a lot of the core features between LTS releases (the switch from unity to gnome for instance happened in between 16.04 and 18.04)


text:
Q: Fastlane Snapshot – Blank Screenshot I am currently trying to automate the process of capturing screenshots of my app. The problem I am facing is, that Snapshot just creates some blank 2x2px Images like this one:

Yes, I have configured Snapshot in the setUp Method:
override func setUp() {
    super.setUp()
    app = XCUIApplication()
    setupSnapshot(app)
    app.launch()
}

My UITest method::
    func testExample() {
    //Screenshot
    snapshot("01Screen")

    let tablesQuery = app.tables
    tablesQuery.cells.element(boundBy: 0).tap()
    //Screenshot
    snapshot("02Screen")

    tablesQuery.cells.element(boundBy: 1).tap()
    //Screenshot
    snapshot("03Screen")
    app.navigationBars.buttons.element(boundBy: 0).tap()
    app.navigationBars.buttons.element(boundBy: 0).tap()

    tablesQuery.cells.element(boundBy: 2).tap()
    tablesQuery.cells.element(boundBy: 0).tap()
    //Screenshot
    snapshot("04Screen")
    app.navigationBars.buttons.element(boundBy: 0).tap()
    app.navigationBars.buttons.element(boundBy: 0).tap()
    app.navigationBars.buttons.element(boundBy: 0).tap()
}

Has anyone of you experienced the same problem? The UITest can be completed successfully on simulator and physical device.
Best regards schuetzii
EDIT:
I have found out, that this problem may associate with the fact, that I have included some pods. I have no idea how to solve this.
I did
fastlane init

and also
snapshot init

and copied the SnapshotHelper.swift to the UITest-Class. Have I missed anything? New screenshot from the web page, which generates fastlane by itself:

A: Okay I have solved this ridiculous problem by myself. It is currently not possible to use Cocoapods and Snapshot at the same time. If I use both I get 2x2px images. Now I have added the SDK's (Firebase and GoogleSignIn) by hand and everything runs smooth. There are no hints about how to use Snapshot with Pods, hopefully it will work one time.


text:
Q: Getting string from variable (from imported JS) as key in object How can I make a variable the key to an object?
I am importing constants from definitions.js and these constants I need to use as keys:
import * as cons from '../scripts/definitions.js'

export default {
  data () {
    return {
      cons: cons,
      obj: {
        cons.FILENAMEA: {},
        cons.FILENAMEB: {
          children: [
            cons.CHILDFILENAME1,
            cons.CHILDFILENAME2,
            cons.CHILDFILENAME3
          ]
        }
      }
    }
  },

With above codes, I am getting error:
Parsing error: Unexpected token, expected ","

Because of the dot (.) in cons.FILENAMEA. How to do this??
Please note that I need to get these variables/constants from an external file. Not possible to just declare it on the same file.
Thanks!

A: You can use es6 computed properties:
obj: {
  [cons.FILENAMEA]: {},
  [cons.FILENAMEB]: {
    children: [
      cons.CHILDFILENAME1,
      cons.CHILDFILENAME2,
      cons.CHILDFILENAME3
    ]
  }
}

The expression inside the brackets will be evaluated and used as the property name

A: An alternative to @Dan's answer is to declare the object before hand and add the key/value pairs to it
export default {
  data () {
    const obj = {}
    obj[cons.FILENAMEA] = {}
    obj[cons.FILENAMEB] = {
          children: [
            cons.CHILDFILENAME1,
            cons.CHILDFILENAME2,
            cons.CHILDFILENAME3
          ]
     }
    return {
      cons: cons,
      obj
     }
    }
  }


text:
Q: Making specific text bold in a string in C# asp.net I want make some specific part of a  string in bold and bigger in size. Given below is the string.
{
-----
-----
    string body = "TICKET \n";body += "Category : " + Category + "\n";
    body += "Priority : " + priority + "\n";body += "Type : " + type + "\n";
    var smtp = new System.Net.Mail.SmtpClient();
    {
    smtp.Host = "smtp.gmail.com";
    smtp.Port = 587;
    smtp.EnableSsl = true;
    smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
    smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
    smtp.Timeout = 20000;
    }
    // Passing values to smtp object
    smtp.Send(fromAddress, toAddress, subject, body);
}

From the above string, I want to make specific part bold and larger in size. I want TICKET should be bolder and bigger. Help me to find a proper solution. Thank you.

A: Here it is,
string body = "TICKET \n";body += "Category : " + Category + "\n";
body += "Priority : " + priority + "\n";body += "Type : " + type + "\n";

I have update your code, please use it.
string body = "TICKET \n"; body += "Category : " + "Category" + "\n";
    body += "Priority : " + "priority" + "\n"; body += "Type : " + "type" + "\n";

    MailMessage objMailMessage = new MailMessage();
    System.Net.NetworkCredential objSMTPUserInfo = new System.Net.NetworkCredential();
    SmtpClient objSmtpClient = new SmtpClient();

    objMailMessage.From = new MailAddress(fromAddress);
    objMailMessage.To.Add(new MailAddress(toAddress));
    objMailMessage.Subject = subject;
    objMailMessage.Body = body;
    objMailMessage.IsBodyHtml = true;

    objSmtpClient.Host = "smtp.gmail.com";
    objSmtpClient.Port = 587;
    objSmtpClient.EnableSsl = true;
    objSmtpClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
    objSmtpClient.Credentials = new NetworkCredential(fromAddress, fromPassword);
    objSmtpClient.Timeout = 20000;

    objSmtpClient.Send(objMailMessage);

A: Simple.
From the '\n' character beside your "TICKET", I presume you want to make it the title text of your document.
To do this, I would simply surround the title text with a 'h4' HTML tag like below:
string body = "
TICKET
";body += "Category : " + Category + "\n";
body += "Priority : " + priority + "\n";body += "Type : " + type + "\n";

A: It all depends on what your trying to display it in. If you are trying to display the string in a label, textbox, etc. You can use the properties window, in visual studio, select the label, textbox etc, then click on the font cell, click on the ... next to it and it lets you bold/change font style/size. Hope this helps.


text:
Q: Is there any way of moving to HTML 5 and still promise multi browser compatibility? I am a designer whose main marketing strategy is multi browser compatibility. I assure my clients that the site will work even in IE6 (!).
Of late i have been pondering over the question of moving to HTML 5. The reason behind my apprehension is that IE6 is still a major player in terms of market share and i don't want to lose it.
Is there any way of moving to HTML 5 and still promise multi browser compatibility?
Thank you.

A: "To HTML5" is a fairly broad statement. Even if you have the new HTML5 doctype set (the simple <!DOCTYPE html>) you don't have to go all out and use every aspect of HTML5, only what is appropriate to your project.
If you are keen to get on board with HTML5, I recommend reading "How to use HTML5 in your client work right now" for examples of how you can use certain aspects of HTML5 with few (if any) drawbacks.
Disclaimer: I am one of the curators of HTML5 Doctor.
From there it boils down to whether or not your project will benefit from the features of HTML5 and if you can afford to implement these features. For example, if all of your IE users also have JavaScript enabled you can use html5shiv to get IE to recognise the new elements, enabling you to use them and style them.
As for the new JS APIs and CSS properties that people often group with the term "HTML5", unless your site absolutely requires that you use the technology (perhaps something like geolocation), then it could simply be a matter of progressive enhancement. If webkit/firefox users get rounded corners from CSS3 and IE users don't, is that really such a big deal?

A: Yes, by taking baby steps.
To start with, you can switch to the HTML5 doctype: <!DOCTYPE html>. This switches just about every browser out there into "standards" mode, the same as an HTML 4 strict doctype.
Then there's the new elements. Internet Explorer can't natively style them, but a handy little bit of javascript fixes that up: http://code.google.com/p/html5shiv/
If you or your tools aren't ready for that (e.g. some CMSs strip out HTML tags they don't understand), then in the interim you could use classes, e.g. instead of <article>, use <div class="article">.
As for the new form controls, they're backwards compatible too. So <input type="email"> will work exactly the same way as <input type="text"> in browsers that don't support it. If necessary you can use javascript to fill in the gaps. See http://diveintohtml5.ep.io/forms.html for more on that.
As for <video> and <audio>, you can fall back to <object> for older browsers - e.g. http://camendesign.com/code/video_for_everybody. Meanwhile <canvas> can be emulated in javascript, e.g. http://code.google.com/p/explorercanvas/.

A: As a rule of thumb I would not develop a site purely in HTML 5 but would consider using it for certain, richer, parts of the site. Remember that it is still not recommended by W3C and IE barely supports it at all.
This blog has a good discussion on it: http://blogs.forrester.com/ronald_rogowski/10-05-10-what_should_customer_experience_professionals_do_about_html5

A: yes there are several ways.
but if you DONT need html5 elements like video tags, or html5 api's like browser databases, stay at XHTML,because it is still not recommended by W3C. There you can use simple fallbacks for ie6.
do you need html5 elements and apis?

A: As a last resort you could use Chrome Frame: http://code.google.com/chrome/chromeframe/
As for "a major player in terms of market share", that really depends on your audience. Even Microsoft is marketing its new IE versions rather aggressively. And I don't think there's shame in charging your IE 6 users an extra plugin installation fee. After all, their browser is 10 years old, which is about 100 Internet years, isn't it?


text:
Q: Radio button: only check one button at a time I'm using images like radiobuttons.
While I'm clicking on an image, the previous one remains still checked;
it becomes unchecked only when I stop clicking on the other.
Is there a way to make the others "unchecked" as soon as I click on one of them?
Thank you all.

[type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

[type=radio]:checked + img {
    border:2px solid blue;
}

    <input type="radio" name="test" value="trasl">

A: Using the same name on every radio button and a different value works. Also each input/img pair must be in its own label.

[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

[type=radio]:checked + img {
  border:2px solid blue;
}

  <input type="radio" name="test" value="trasl">

  <input type="radio" name="test" value="tras2">

  <input type="radio" name="test" value="tras3">

A: Make sure all your radio buttons have the same name attribute. Also ensure that each radio button and img are wrapped in their own label tag, making it so that when you click on the image, your radio button also gets checked.
See working example below:

img {
  height: 100px;
  width: 100px;
}

[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

[type=radio]:checked+img {
  border: 2px solid blue;
}

  <input type="radio" name="test" value="trasl">

  <input type="radio" name="test" value="trasl2">

A: <input id='radID' type='radio'> &

*

*Make sure all radio name attributes match. This makes a radio group share a mutually exclusive state (one is active and the others must be inactive.

*Also, give the radios unique ids and pair them off with label that have corresponding for attributes that'll provide a larger striking area for users.

*BTW if you don't want a jarring twitch from the buttons when you click them, replace the borders with outlines. Borders just like padding and margins take space but outlines don't.

Demo

[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

img {
  display: block;
  width: 200px;
  height: auto
}

[type=radio]:checked+label img {
  outline: 2px solid blue;
}
<input id='t1' name="test" type="radio" value="tras1">

<input id='t2' name="test" type="radio" value="tras2">

A: SOLVED: solution was a jQuery:
$(".image").click(
     function() {
       $(".insert").stop().fadeTo( "slow" , 1, function() {
     });
});


text:
Q: How to pre-load JS files? So I have a website, that has a configurator, where you can configure your own product. The configurator website needs additional .js files, like dist.js and libs.js. Both of those files are around 2mb's each.
My question is: how can I start downloading those files on the landing page, so that when user goes to /configuration.html, he already started downloading those files?

A: You need define the file in your HTML:
    <script src="yourfilename.js"></script> Be sure to put .js at the end otherwise it wont work.


text:
Q: Select text for copying Android EditText I want to select some text inside an EditText which is the child element of a ListView. The selected text has to be set on a clipboard. I am unable to find any examples regarding this. How should i go about this? selectionStart and selectionEnd don't work on this.
Thanks.

A: here is the possible solution . in getView method of listview perform following operation:
enter code here:

public View getView(final int position, View convertView, ViewGroup parent) {
            // A ViewHolder keeps references to children views to avoid unneccessary calls
            // to findViewById() on each row.
            final ViewHolder holder;

            if (convertView == null) {
                convertView = mInflater.inflate(R.layout.main, null);

                // Creates a ViewHolder and store references to the two children views
                // we want to bind data to.
                holder = new ViewHolder();

                holder.subText = (TextView) convertView.findViewById(R.id.subTxt);

                convertView.setTag(holder);
            } else {
                // Get the ViewHolder back to get fast access to the TextView
                // and the ImageView.
                holder = (ViewHolder) convertView.getTag();
            }

            //TEXT BOX position is 0 then
            if(position == 0) {

                ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); clipboard.setText(txtEdit.getText().toString());
            }
            return convertView;
        }

A: Use this code on list selection event
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);  clipboard.setText(txtEdit.getText().toString());

A: EditText already provide this functions on long press....means pressing a long touch on editText it pops up with context menu asking select all, select text, copy all.

A: You can open one dialog on editText long click event inlistView custom adapter and display two option copy and paste in them
you can copy text programically using
ClipboardManager clipboard =
                              (ClipboardManager) c1.getSystemService(c1.CLIPBOARD_SERVICE);

                         clipboard.setText("Text to copy");

and get Text Using
System.out.println(clipboard.getText());

A: InputConnection ic = getCurrentInputConnection();
ExtractedText extracted = ic.getExtractedText(
                    new ExtractedTextRequest(), 0);
            /*If selection start and end are not equal then selected text
             * needs to be deleted and updated to core*/
            if (extracted!= null && extracted.selectionStart != extracted.selectionEnd) {
}

Use api given by ExtractedText


text:
Q: NGinx Block all Wordpress Files except wp-login and wp-admin How can I deny all; access to all front-facing wordpress files, except wp-login.php and wp-admin?
What I currently have blocks access to all wp-* including the wp-admin
location ~ ^/(index\.php|wp-.*\.php) {
    deny all;
}

Tried Code Block:
# Deny Access to all of Wordpress Front End files except wp-login.php, wp-admin, and default.php
location ~* !^/(default.(.*)$)|!^/(wp-login.(.*)$)|!^/(wp-admin/) {
    deny all;
}

all are still accessible

A: I do it this way:

location ~ ^/(wp-admin/install.php|wp-cron.php|foo.php|bar.txt|etc.foo) {
      rewrite ^ / permanent;
    }

Anyway. After a few experiences with the so called software Wordpress, I heavily recommend, using a read-only live-plattform, if possible.


text:
Q: Generating Buttons in Rows and Columns with empty places I want to generate a grid with views. I need from 1 row, 1 column up to 3 rows, 6 columns.
my code now is working if i want, that all views are in their place:
*  *  *  *  *
*  *  *  *  *
*  *  *  *  *

but i want to leave some places empty, for example i want to do things like:
*  *  *  *  *
*           *
*  *  *  *  *

or:
*  *    *  *
   *    *
*          *

my code:
.m
-(void) generateCardViews {
int positionsLeftInRow = CARDS_PER_ROW;
int j = 0; // j = ROWNUMBER (j = 0) = ROW1, (j = 1) = ROW2...

for (int i = 0; i < [self.gameModel.cards count]; i++) {
NSInteger value = ((CardModel *)self.gameModel.cards[i]).value;

CGFloat x = (i % CARDS_PER_ROW) * 121 + (i % CARDS_PER_ROW) * 40 + 285;
if (j == 1) {
    x += 80; // set additional indent (horizontal displacement)
}
if (j == 2) {
    x -= 160;
}

CGFloat y = j * 122 + j * 40 + 158;
CGRect frame = CGRectMake(x, y, 125, 125);

CardView *cv = [[CardView alloc] initWithFrame:frame andPosition:i andValue:value];

}

how can i do this?
EDIT:
Now with my Code:
if gameModel.cards count = 18 (get this from my model) and if CARS_PER_ROW = 6 i get:
*  *  *  *  *  *
*  *  *  *  *  *
*  *  *  *  *  *

if gameModel.cards count = 12 (get this from my model) and if CARS_PER_ROW = 5 i get:
*  *  *  *  *
*  *  *  *  *
*  *

A: I think you can create all the frame's in an arrary, and then generate buttons from the arrary.


text:
Q: how to append font awesome icon to paragraph on click Good day, please I want to append a font awesome icon to paragraph inner text when the p tag is clicked.
I have four p tags with same class .ptn, if any is clicked, I want to append the font awesome to the clicked one, and remove it from others.
The problem is instead of displaying the font awesome arrow, its displaying the tag text instead, also, the first p tag is removed once I click on any of the other p tags.
This is my code below,
Html:

Compliance

Summary

Station Audit

Analysis Format

Jquery:

A: I will do that this way:

document.querySelector('div[data-acting]').onclick = e =>
  {
  if (!e.target.matches('p.ptn')) return
  e.currentTarget.dataset.acting = e.target.id
  }
div[data-acting] > p.ptn > i.fas { display : none }
div[data-acting="compliance"] > p#compliance > i.fas,
div[data-acting="summary"]    > p#summary    > i.fas,
div[data-acting="audit"]      > p#audit      > i.fas,
div[data-acting="analysis"]   > p#analysis   > i.fas {
  display : inline-block
  }

div[data-acting="compliance"] > p#compliance,
div[data-acting="summary"]    > p#summary,
div[data-acting="audit"]      > p#audit,
div[data-acting="analysis"]   > p#analysis {
  background-color : lightgreen;
  }
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css"  />

Compliance

Summary

Station Audit

Analysis Format

A: As neatlysliced says, you can't append strings and have them automatically turned into elements.
This example fixes the bugs in your code for removing and adding the required elements.
var btns = document.getElementsByClassName("ptn");
var icon = document.createElement('i');
icon.className = 'fas fa-chevron-right pl-4';

for (var i = 0; i < btns.length; i++) {
  btns[i].addEventListener("click", function () {
    var current = document.getElementsByClassName("acting");
    current[0].className = current[0].className.replace(" acting", "");
    var chevron = current[0].querySelector(".fas.fa-chevron-right");
    if (chevron) {
      chevron.remove();
    }
    this.className += " acting";
    this.append(icon)
  });
}

A: you can also do that:

const btns  = document.querySelectorAll('p.ptn')
  , chevron = document.querySelector('p.ptn > i.fas.fa-chevron-right')
  ;
btns.forEach(btn => {
  btn.onclick = e => {
    btns.forEach(bt => bt.classList.toggle('acting', (bt===btn))) // add or remove class upon condition
    btn.appendChild( chevron )  // move it on correct place
  }
})
.acting { background-color : lightgreen; }
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css"  />

Compliance

Summary

Station Audit

Analysis Format

A: Your solution would work wonderfully with jQuery but with vanilla JS we need to create the HTML elements before we append them.
Since you are only working with 1 icon at a time, you could give an id to your element and find/remove it by document.getElementById.

let parent = document.getElementById("hello");
let p = document.createElement("p");
p.append("Hi there");
p.setAttribute("id","swapping-icon");
parent.append(p);

A: Here is a pure JS option that uses querySelectorAll to create a nodeList, then a forEach loop to iterate over the list. Add an event listener for a click. We remove the button with classList containing acting and remove the fa element  by checking if the parent element does not return undefined on children. Then add the class acting to the clicked element, create an  tag and add the classes for font awesome. Append the fa element to the target.

const btns = document.querySelectorAll(".ptn");

btns.forEach(btn => {
  btn.addEventListener("click", function(e) {
    btns.forEach(button => {
      if (button.classList.contains('acting')) {
        button.classList.remove('acting')
      }
      if (button.children[0] !== undefined) {
        button.children[0].remove()
      }
    })
    e.target.classList.add("acting");
    const fa = document.createElement('i');
    fa.className += 'fas';
    fa.className += ' fa-chevron-right';
    fa.className += ' pl-4';
    e.target.append(fa);
  })
})
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css"  />

Compliance

Summary

Station Audit

Analysis Format


text:
Q: PartialChain: A certificate chain could not be built to a trusted root authority error in performancepoint dashboard designer when access PerformancePoint dashboard designer I got below error message in event viewer and unable to connect to SharePoint site collection.
An operation failed because the following certificate has validation errors:
Errors:
 PartialChain: A certificate chain could not be built to a trusted root authority.
RevocationStatusUnknown: The revocation function was unable to check revocation for the certificate.
OfflineRevocation: The revocation function was unable to check revocation because the revocation server was offline.
site collection URL: https://www.siteurl.com
I open above url one of application server where performance point service run
when I did fiddler it is going to digcert site and how I avoid in the local server it is not checked certificate validation for with this site?


text:
Q: String IndexOf and Substring C# I'm working on to read a textfile which contains this line of string. And to fetch its value to my integer variables.. I want to try to avoid using Class or Arrays.
string cont = "[]val1:1val2:0val3:1";

int split = cont.IndexOf("val3:");
int val3 = Int32.Parse(cont.Substring(split + 5)); // this line successfully convert string to int
cont.Remove(split);
Console.WriteLine("Value3: " + val3 + " Content: " + cont);

split = cont.IndexOf("val2:");
int val2 = Int32.Parse(cont.Substring(split + 5)); // LINE 21
cont.Remove(split);
Console.WriteLine("Value2: " + val2 + " Content: " + cont);

split = cont.IndexOf("val1:");
int SilverCoins = Int32.Parse(cont.Substring(split + 5));
cont.Remove(split);
Console.WriteLine("Value1: " + val1 + " Content: " + cont);

When I run this code, I get an Unhandled Exception which states Input string was not in a correct format, at System.Int32.Parse(String s), line 21. :(
So, my desired output should be
Value3: 1 Content: []val1:1val2:0
Value2: 0 Content: []val1:1
Value1: 1 Content: []

A: Your problem is in this code cont.Remove(split);
Strings are immutable, so you need to reassign new value.
In order to fix it you need to write
cont = cont.Remove(split);

A: You aren't putting the remove result back into the string, try doing this:
cont = cont.Remove(split);

A: When we perform some action on string it does not make changes in the same string instance. Instead it returns a new string instance. This concept is known as Immutability.
When you do
cont.Remove(split);

it does not update cont. Instead it returns updated string which you need to capture like this
cont = cont.Remove(split);

A: 0val3:1 is not a valid number, therefore int.Parse fails. If you need to extract the 0 from the beginning of this string, you can refer to Parse an integer from a string with trailing garbage .
Also, the result of cont.Remove(split); is never used in your code snippet, and thus does nothing but waste CPU cycles. Considering you notice this behavior in the Console.WriteLine, and simply complain about an exception, I can only assume this was intentional?

Note that it looks like you're trying to extract key-value pairs from a string. A regular expression similar to val([^:]+):([0-9]+) might be a better tool here.
Alternatively, you can split on val and take the left/right of the colon. Something like:
var vals = cont.Split(new[] {"val"}, StringSplitOptions.None)
               .Skip(1) //ignore any garbage at the beginning
               .Select(x => x.Split(':'))
               .ToDictionary(x => x[0], x => int.Parse(x[1]));

A: Restoring the cont value after calling the Remove method is missing.
Modified Code:
string cont = "[]val1:1val2:0val3:1";

int split = cont.IndexOf("val3:");
int val3 = Int32.Parse(cont.Substring(split + 5)); // this line successfully convert string to int
cont = cont.Remove(split);
Console.WriteLine("Value3: " + val3 + " Content: " + cont);

split = cont.IndexOf("val2:");
int val2 = Int32.Parse(cont.Substring(split + 5)); // but this line fails to convert from string to int..
cont = cont.Remove(split);
Console.WriteLine("Value2: " + val2 + " Content: " + cont);

split = cont.IndexOf("val1:");
int val1 = Int32.Parse(cont.Substring(split + 5));
cont = cont.Remove(split);
Console.WriteLine("Value1: " + val1 + " Content: " + cont);

A: Two ways you can fix the problem.
C# strings are immutable, so you have to modify your code to
cont = cont.Remove(split);

Another approach(might be best for your case), when using the SubString specify length, so you get specified number of characters.
split = cont.IndexOf("val2:");
int val2 = Int32.Parse(cont.Substring(split + 5, 1));


text:
Q: Is there a proverb, idiom for "those only who in line of fire only understand the agony"? Is there a proverb, idiom for Those who are in line of fire only understand the agony. For the freewheeling back-seaters it is far too easy to sit back and say "Why do you worry so much?"
Example:

Jim: I think I made a big blunder in our report to the client today, think my boss will sack me tomorrow when he finds out. I am feeling suffocated due to the stress.
Joana (his wife): Relax Jim, you take too much stress. Nothing will happen. Come let's go for shopping you will feel pumped up.
Jim: How can I feel pumped up with your twisted logic. I am sure to lose this job. It is only those in the line of fire, who understand the agony".

Indians have a saying in marathi language "Jayachi jale tyala kale" which means "who is burnt only understands the pain"

A: Jim might say to his wife,

once bitten, twice shy
  said when you are frightened to do something again because you had an unpleasant experience doing it the first time

Cambridge Dictionary

A: How about:
Joana (his wife): Relax Jim ---
Jim: Relax? That's easy for you to say. You're not in my shoes.
or alternatively "You couldn't possibly say that if you were in my shoes.
"That's easy for you to say" isn't an idiom, it just conveys to another person that they can't understand how you're feeling because they're not in your position.
"You're not in my shoes" is an idiom, it basically means to experience the position or feelings of someone else.

in someone's shoes in (one's) shoes Sharing a particular
  experience or circumstance with one.  It's easy to mock someone
  else until you've lived in their shoes for a while. Farlex
  Dictionary of Idioms
in someone's shoes Acting for another person or experiencing
  something as another person might; in another's position or
  situation American Heritage Dictionary of idioms
in someone's shoes COMMON If you talk about being in someone's
  shoes, you are describing how you would feel or act if you were in the
  same situation as them. "Stop and think how you would feel if you
  were in his shoes." Collins COBUILD Idioms Dictionary

There are also the variations "to put oneself in someone's shoes" and "walk a mile in someone's shoes."
In your example the first variation is probably most fitting. However if you want to make a point of soldiers' bravery or hardships in service to their country, you might say something like "We couldn't understand the sacrifices they make without walking a mile in their shoes."
As an aside there's a funny joke about the last one:

"Before you criticize a man, walk a mile in his shoes. That way, when
  you do criticize him, you'll be a mile away and have his shoes." ―
  Steve Martin

A: This has something of the flavour of what you're looking for:

Each heart knows its own bitterness, and no one else can share its joy.
  - Proverbs 14:10, NIV (Bible)


text:
Q: Where does Nautilus store bookmark names? If I create a bookmark with Nautilus, its location is stored on ~/.gtk-bookmarks, but not its name.
I've created a test bookmark named weirdy, and tried to do a grep on my home for that name, and I found nothing.
Where does Nautilus store bookmark names?

A: They are stored in the ~/.config/gtk-3.0/bookmarks file
In older versions of Ubuntu they are stored in the ~/.gtk-bookmarks file.
The format is:
file:///path/to/folder Bookmark_name

You can also specify other location protocols such as SFTP, FTP, or SMB:
sftp://username@hostname/path/to/folder Bookmark_name

A: A GUI method is to open a document from an application such as LibreOffice. Do a Save As and when the window opens, drag the folder into the left column.
I haven't a clue as to why the Preference gear was removed from Nautilus, but it should be restored IMHO.


text:
Q: JQuery append li to exist ul I searched a lot and made lots of changes, but I still cannot find a solution.
What I want to do is after clicking a button, remove all li in ul and append some other new li in this ul.
HTML is:

foot

hand

I first use following code to remove all li:
$('#wordPrediction li').each(function(){
    $("#wordPrediction li").fadeOut(500, function(){
        $("#wordPrediction li").remove();
    });
});

Then I try to append all elements in nextWordArray to this ul, I tried:
for (var i=0;i<nextWordArray.length;i++){
    $('#wordPrediction').append($("
"+nextWordArray[i] +"
"));
}

But I failed, specifically, when I have nextWordArray = ['actor'], which means my nextWordArray.length = 1. I cannot append successfully.

A: I don't see any problem with your code. Did you put your for loop in the fadeOut callback, after the $("#wordPrediction li").remove(); line ?
You need to put your loop after the remove else your new elements will get removed by the remove.
Here is a working fiddle :
https://jsfiddle.net/eh1snor1/1/
Is this not the expected behavior ?

A: I am not seeing what is wrong with the code you have posted, maybe you need to provide more information? Please see working fiddle.
var nextWordArray = ["toe", "finger", "thumb", "nose", "elbow"];
$("#removeListItems").on("click", function(){
    $('#wordPrediction li').each(function(){
    $("#wordPrediction li").fadeOut(500, function(){
        $("#wordPrediction li").remove();
    });
    });
});

$("#addNewListItems").on("click", function(){
  for (var i=0;i<nextWordArray.length;i++){
      $('#wordPrediction').append($("
"+nextWordArray[i] +"
"));
  }
});

foot

hand

 <button id="removeListItems">
 Remove
 </button>

  <button id="addNewListItems">
 Add New
 </button>


text:
Q: How to write a few EXTJS Grids data into one request? For example I have 2 models:
Ext.define('Order', {
    extend   : 'Ext.data.Model',
    fields   : [
            {name : 'id',          type : 'int'},
            {name : 'customer_id', type : 'int'},
            {name : 'date',        type : 'date'}
    ],
    hasMany: [{model: 'Product', name: 'Products'}]
});

Ext.define('Product', {
    extend   : 'Ext.data.Model',
    fields   : [
            {name : 'id',          type : 'int'},
            {name : 'name',        type : 'string'},
            {name : 'description', type : 'string'},
            {name : 'price',       type : 'float'}
    ],
    belongsTo: 'Order'
});

these models displayed in 2 grids. Then when changes made I need post them to server. But the trick in I need post both model in one request, e.g.:
{"order":{"id":1, "date":'2011.09.01', "Products": [{"id":1, "name":"product name", ... }]}}

In this way I think both grids should use one Store and before write store in must be filled with grid changes ( maybe some internal stores without ability to write to server ).
How to implement it ? Any ideas ?

A: The solution is store data in memory and on Save fill synced store manually and call Save method:
Ext.define('OrderStore', {
    extend: 'Ext.data.Store',

    storeId: 'orderStore',
    proxy: {
        type: 'ajax',
        api: {
            read: 'Order/Load',
            create: 'Order/Add',
            update: 'Order/Update',
            destroy: 'Order/Delete'
        },
        reader: {
            type: 'json',
            root: 'orders',
            totalProperty: 'total',
            messageProperty: 'message',
            successProperty: 'success'
        },
        writer: {
            type: 'json',
            listful: true,
            writeAllFields: true,
                    getRecordData: function (record) { return record.data; },
            root: 'order',
            allowSingle: true
        },
        headers: { 'Content-Type': 'application/json; charset=UTF-8' }
    },
    autoLoad: true,
    listeners: {
        // commit changes
        write: function (store, operation, eOpts ) {
            var orderItemsStore = OrderEdit.store;
            orderItemsStore.each( function (item) {
                item.commit();
            });

            // ...
        }
    }
});

where:
Ext.define('OrderEdit', {
    // ...
    orderStore: Ext.create('OrderStore', {model: 'Order', owner: this}),
    store: Ext.create('OrderItemStore')

and
Ext.define('OrderItemStore', {
    extend: 'Ext.data.Store',

    model: 'Order',
    proxy: {
        type: 'memory'
    }
});

and then save changes:
saveButtonClick: function (button) {
    var order = OrderEdit.orderStore.getRange()[0];
    res = order.data;
    res.Items = [];
    OrderEdit.store.each(function (record, index) {
            res.Items[index] = record.data;
    });
    // ...

    OrderEdit.orderStore.removeAll();
    OrderEdit.orderStore.add(res);
    OrderEdit.orderStore.save();
}

A: I have tackled the same problem by creating a custom Writer (extending Ext.data.writer.Json in my case). In your scenario this would used as the writer for the Order store. My Product store is read only (I never sync it with the server).
My writer overrides the getRecordData() function. First it performs the standard getRecordData() processing to get the Order data, it then iterates over the Product store's entries to create an array of product records. I then add this array to the order's data (with a key of 'Products'.


text:
Q: How to correct my PHP Code to extract JSON "source" Key Value with is the Image URL? I am trying to retrieve image url having source json key. With my following PHP Code:
$url = "https://fr.wikipedia.org/w/api.php?action=query&format=json&formatversion=2&prop=pageimages%7Cpageterms&piprop=original&titles=Mark_Zuckerberg";
$data = json_decode(file_get_contents($url), true);
echo "
";
print_r($data);
echo "
";

$data = current($data['query']['pages']);
$firstWikipediaImage = $data["original"][0]["source"];
echo $firstWikipediaImage."

";

This is how the Debug appears:
Array
(
    [batchcomplete] => 1
    [query] => Array
        (
            [normalized] => Array
                (
                    [0] => Array
                        (
                            [fromencoded] =>
                            [from] => Mark_Zuckerberg
                            [to] => Mark Zuckerberg
                        )

                )

            [pages] => Array
                (
                    [0] => Array
                        (
                            [pageid] => 2674966
                            [ns] => 0
                            [title] => Mark Zuckerberg
                            [original] => Array
                                (
                                    [source] => https://upload.wikimedia.org/wikipedia/commons/c/c4/Mark_Zuckerberg_F8_2018_Keynote_%28cropped%29.jpg
                                    [width] => 2024
                                    [height] => 2025
                                )

                            [terms] => Array
                                (
                                    [label] => Array
                                        (
                                            [0] => Mark Zuckerberg
                                        )

                                    [description] => Array
                                        (
                                            [0] => entrepreneur américain
                                        )

                                )

                        )

                )

        )

)

When I try to display the $firstWikipediaImage variable, I get the following error:
Notice:  Undefined offset: 0 in C:\laragon\www\test3.php on line 215

Notice:  Trying to access array offset on value of type null in C:\laragon\www\test3.php on line 215

In need your help to extract the source json key.


text:
Q: HTML double left quote, htmlentities Hi I am having trouble with a certain character in PHP. the character is " which should return
"

but when I do
echo htmlentities('"');

I get
�

What Am I doing wrong??

A: It looks like your file is in utf-8 and version of php is less than 5.4 so tell htmlentities this.
echo htmlentities('"', ENT_COMPAT | ENT_HTML401, "UTF-8");

A: Try using online interpreter like this one codeonline.
It returned the quote (") without an issue in my case. For further documentation, check documentation:
http://php.net/manual/en/function.htmlentities.php
(FYI, more sandbox tools can be found in this thread).


text:
Q: How to change the audio input device while the java program is executing? I already can get the bytestream of the operation system standard input device. I now want to change the input device while the program is already running.
That is the code to get the targetDataLine/input stream of the standard input device (it works):
dataLineInfo = new DataLine.Info( TargetDataLine.class , getAudioFormat() ) ;
targetDataLine = (TargetDataLine)AudioSystem.getLine( dataLineInfo  ) ;
targetDataLine.open( getAudioFormat() );
targetDataLine.start();

I also can get the list of all available input devices and give them out in a combobox to select another input device (it works):
Mixer.Info[] mixerInfo;
mixerInfo = AudioSystem.getMixerInfo();
Line.Info targetDLInfo = new Line.Info(TargetDataLine.class);

for(int cnt = 0; cnt < mixerInfo.length; cnt++) {
    Mixer currentMixer = AudioSystem.getMixer(mixerInfo[cnt]);

    if( currentMixer.isLineSupported(targetDLInfo) ) {
        combo1.addItem(mixerInfo[cnt].getName());
    }
}

That is the code how I change the input device (it doesn't work)
    if(e.getSource() == combo1){
        System.out.println("Gewählter Input: " + combo1.getSelectedItem());

        Mixer.Info[] mixerInfo;
        mixerInfo = AudioSystem.getMixerInfo();
        Line.Info targetDLInfo = new Line.Info(TargetDataLine.class);

        for(int cnt = 0; cnt < mixerInfo.length; cnt++) {
            Mixer currentMixer = AudioSystem.getMixer(mixerInfo[cnt]);

            if( mixerInfo[cnt].getName() ==  combo1.getSelectedItem().toString()) {
                System.out.println("Gewählter Input gefunden");

                targetDataLine.close();

                dataLineInfo = new DataLine.Info( TargetDataLine.class , getAudioFormat() ) ;
                try {
                    targetDataLine = (TargetDataLine) currentMixer.getLine(dataLineInfo) ;
                    targetDataLine.open( getAudioFormat() );
                    targetDataLine.start();

                } catch (LineUnavailableException e1) {
                    e1.printStackTrace();
                }
            }}
    }

In fact I think I only made a small mistake with the last part but I don't know what mistake. If I switch to another audio input device I just hear a small beep and then nothing. If I switch back to the primary audio device I can hear the input again. I don't get any errors.
What did I do wrong?

A: On the line with the following code
if( mixerInfo[cnt].getName() ==  combo1.getSelectedItem().toString()) {

You've not compared the strings correctly. When comparing strings use the String.equals(String) method, like this:
if( mixerInfo[cnt].getName().equals(combo1.getSelectedItem().toString())) {

If you use the == operator on any two non-primitive objects, only the pointers of the two objects will be compared. String objects will in the vast majority of cases have different pointer values, like any other dynamically allocated object, regardless if the locations they point to contain the same arrangement of bytes.


text:
Q: Improve list of lists? I have a list of lists defined like this
List<List<String>> tblActuaciones = IntStream
        .rangeClosed(1, 6)
        .mapToObj(i
                -> getList(i)
                .stream()
                .map(HtmlElement::asText)
                .collect(Collectors.toList())
        )
        .collect(Collectors.toList());

Then, to use the data in the list I use
for (int i = 0; i < tblActuaciones.get(0).size(); i++) {
    for (int j = 0; j < tblActuaciones.size(); j++) {
        ps.setString(j + 2, tblActuaciones.get(j).get(i));
    }
    ps.executeUpdate();
}

The question is: Is there a better (performance related) way to store and manipulate the data?
Note: I know all the lists returned by getList(i) have the same size

A: The current implementation executes a statement for each iteration of the external (i) loop. You could use batch executions to send them all in bulk to the database, which would probably slightly improve performance:
for (int i = 0; i < tblActuaciones.get(0).size(); i++) {
    for (int j = 0; j < tblActuaciones.size(); j++) {
        ps.setString(j + 2, tblActuaciones.get(j).get(i));
    }
    ps.addBatch();
}
ps.executeBatch();


text:
Q: Not working return in jquery ajax this is my code:
$("#MainContent_btnSave").click(function () {
            if (($("#MainContent_txtFunc").val() == "") || ($("#MainContent_cmbLoc").val() == "")) {
                alert("Please fill options.");
                return false;
            }
            else {
                $("#msgbox-loading").show();
                $.ajax({
                    type: "POST",
                    url: "Ajax.aspx",
                    data: { func: "getexist", catfunc: $("#MainContent_txtFunc").val(), catdes: $("#MainContent_txtDesc").val() },
                    success: function (data) {
                        var parsed = $(data);
                        var exist = parsed.filter("[id=exist]").text();
                        if (exist == "NO") {
                            return true;
                        }
                        if (exist == "Yes") {
                            alert("already defined.");
                            $("#msgbox-loading").hide();
                            return false;
                        }
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        $("#msgbox-loading").hide();
                        HidePopup('popup');
                        alert(xhr.status + " " + thrownError);
                    }
                });
            };
        });

My code is check mandatory and If empty mandatory, an error message display and or if not empty mandatory, first display the loading and then Ajax run.
After running Ajax i want if page send "NO" run button postback and if page send "Yes" stop button postback.
but Unfortunately, after run ajax and page send "Yes" run button post back.
please help.

A: you can use .ajaxComplete() for commands that you want to fire after ajax completed


text:
Q: Why do I get a NoMethodError in my ActionMailer? I am trying to trigger emails with ActionMailer when users complete various actions within the website, such as creating a new status.
When I try to call the mailer in the create method of the Statuses controller, I get a NoMethodError:
undefined method 'email' for nil:NilClass
Can anyone help me figure out what is wrong?
Here is my code from within the statuses controller:
def create
  @status = current_user.statuses.new(params[:status])

  respond_to do |format|
    if @status.save
      UserMailer.status_confirmation(@user).deliver
      format.html { redirect_to @status, notice: 'Status was successfully created.' }
      format.json { render json: @status, status: :created, location: @status }
    else
      format.html { render action: "new" }
      format.json { render json: @status.errors, status: :unprocessable_entity }
    end
  end
end

Here's my UserMailer code:
class UserMailer < ActionMailer::Base

  default :from => "myemail@gmail.com"

  def status_confirmation(user)
    mail(:to => user.email, :subject => "Status Posted")
  end
end

A: You're passing in a null user (@user):
def create
  @status = current_user.statuses.new(params[:status])
  respond_to do |format|
    if @status.save
      # There's no @user here, unless it's initialized in a filter, etc.
      UserMailer.status_confirmation(@user).deliver

Did you mean current_user instead, or did you forget to initialize it (or forget some code)?


text:
Q: PHP7.3 on eregi Already i try preg_match
if (is_file("$Path/$file") && eregi("$Filter", $file))
on
if (is_file("$Path/$file") && preg_match("$Filter", $file))
My Problem no output zip files.

#

Original code

#

<?php
    function getDirArray($Path="./",$Filter=".*",$Sorted="True")
        {
                $handle=opendir($Path);
                while ($file = readdir($handle))
                    {
                        if (is_file("$Path/$file") && eregi("$Filter", $file))
                            {
                                $dirArray[] = $file;
                            }
                    }
                closedir($handle);
                if (!is_array($dirArray))
                    {
                        return 0;
                    }
                if (strcasecmp($Sorted,"True"))
                    {
                        shuffle($dirArray);
                    }
                else
                    {
                        sort($dirArray);
                    }
                return $dirArray;
        }
?>


text:
Q: How to control a 3D camera using a single quaternion representation for its orientation? I am creating a 3D camera for my game engine and I want to represent the camera by a single quaternion for its orientation. The local up,front and side camera axis are generated by converting this quaternion into a rotation matrix. The first row of this matrix gives me the camera's X axis(side vector), the 2nd row gives me the UP vector and the 3rd row gives me the FRONT vector. To move the camera my function takes in the direction to move in and the amount and the position is updated and the view matrix() is updated. To rotate the camera, my function gets the axis to rotate around and the angle. A temporary quaternion is created from this axis and angle and is applied to my camera's current orientation. I rotate about the world Y axis for yaw and about the camera's side vector to pitch. This pitching doesn't work properly when my camera's axis are not aligned with world axis. If I instead pitch about global X axis then it works fine but I know that's not what I want. Also when my camera's axis are not aligned with world axis the movement also screws up. I am using the basic "wasd" movement. My movement and pitch functions use the local axis and hence I have a hunch that the way I extract the local axis from the quaternion is not correct but I am not able to figure out what is going wrong.
Camera class:
#include "stdafx.h"

Camera * Camera::m_currentCamera = NULL;
    Camera::Camera(vec3 position , double distToNear , double distToFar , double fovy)
{
    m_position = position;
    m_distToNear = distToNear;
    m_distToFar = distToFar;
    m_fovy = fovy;
    // generate the view and projection matrices
    updateViewMatrix();
    projection = glm::perspective(m_fovy, 4.0/3.0, m_distToNear, m_distToFar);
    // in radians
    m_deltaAngle = 10.0 * PIOVER180;

    if(m_currentCamera != NULL)
    {
        delete m_currentCamera;
    }

    m_currentCamera = this;
}

Camera::Camera()
{

}

Camera::~Camera()
{
    // empty for now
}

Camera* Camera::getCurrentCamera()
{
    return m_currentCamera;
}

/** set and get camera position */
vec3 Camera::getPosition()
{
    return m_position;
}

void Camera::setPosition(vec3 pos)
{
    m_position = pos;
}

/** set and get near plane distance */
double Camera::getNearPlaneDist()
{
    return m_distToNear;
}

void Camera::setNearPlaneDist(double dist)
{
    m_distToNear = dist;
}

/** set and get far plane distance */
double Camera::getFarPlaneDist()
{
    return m_distToFar;
}

void Camera::setFarPlaneDist(double dist)
{
    m_distToFar = dist;
}

/** set and get camera field of view */
double Camera::getFovy()
{
    return m_fovy;
}

void Camera::setFovy(double angle)
{
    m_fovy = angle;
}

mat4 Camera::getViewMatrix()
{
    return view;
}

mat4 Camera::getProjectionMatrix()
{
    return projection;
}

Quaternion Camera::getOrientation()
{
    return m_rotation;
}

void Camera::setOrientation(Quaternion *q)
{
    m_rotation.setQuaternion(q);
}

/** this function will be called whenever the camera's position, up vector or lookat vector changes */
void Camera::updateViewMatrix()
{
    mat4 orientation = m_rotation.toMatrix();
    mat4 translation = translate(mat4(1.0f),vec3(-m_position.x,-m_position.y,-m_position.z));
    view = orientation * translation;
}

/** Control Functions */

void Camera::rollCamera(float theta)
{
    Quaternion tempRotation;
    tempRotation.quaternionFromAxis(getFront(), theta);
    tempRotation.normalise();
    m_rotation = m_rotation * &tempRotation;
    m_rotation.normalise();
    updateViewMatrix();
}

void Camera::pitchCamera(float theta)
{
    Quaternion tempRotation;
    // INSTEAD OF LOCAL AXIS IF (1.0,0.0,0.0) GLOBAL X AXIS IS USED THIS WORKS FINE!!!
    tempRotation.quaternionFromAxis(getSide(), theta);
    tempRotation.normalise();
    m_rotation = m_rotation * &tempRotation;
    m_rotation.normalise();
    updateViewMatrix();
}

void Camera::yawCamera(float theta)
{
    Quaternion tempRotation;
    tempRotation.quaternionFromAxis(vec3(0.0,1.0,0.0), theta);
    tempRotation.normalise();
    m_rotation = m_rotation * &tempRotation;
    m_rotation.normalise();
    updateViewMatrix();
}

void Camera::moveCamera(vec3 dir, float amt)
{
    normalize(dir);
    m_position += dir * amt;
    updateViewMatrix();
}

vec3 Camera::getFront()
{
    m_rotation.normalise();
    mat4 orientation = m_rotation.toMatrix();
    vec3 front(orientation[2][0], orientation[2][1], orientation[2][2]);
    normalize(front);
    cout << "FRONT " << front.x << " " << front.y << " " << front.z << endl;
    return front;
}

vec3 Camera::getSide()
{
    m_rotation.normalise();
    mat4 orientation = m_rotation.toMatrix();
    vec3 side(orientation[0][0], orientation[0][1], orientation[0][2]);
    normalize(side);
    cout << "SIDE " << side.x << " " << side.y << " " << side.z << endl;
    return side;
}

vec3 Camera::getUp()
{
    m_rotation.normalise();
    mat4 orientation = m_rotation.toMatrix();
    vec3 up(orientation[1][0], orientation[1][1], orientation[1][2]);
    normalize(up);
    cout << "UP " << up.x << " " << up.y << " " << up.z << endl;
    return up;
}

Function's to move and rotate the camera:
void specialKeyboard(int key, int x, int y)
{
    switch(key)
    {
    case GLUT_KEY_LEFT:
        Camera::getCurrentCamera()->yawCamera(1.0 * PIOVER180);
        break;

    case GLUT_KEY_RIGHT:
        Camera::getCurrentCamera()->yawCamera(-1.0 * PIOVER180);
        break;

    case GLUT_KEY_UP:
        Camera::getCurrentCamera()->pitchCamera(1.0 * PIOVER180);
        break;
    case GLUT_KEY_DOWN:
        Camera::getCurrentCamera()->pitchCamera(-1.0 * PIOVER180);
        break;
    }

    glutPostRedisplay();
}

void keyboard(unsigned char key, int x, int y)
{
    switch(key)
    {
    case 'w':
        Camera::getCurrentCamera()->moveCamera(Camera::getCurrentCamera()->getFront(), -0.1f);
        break;
    case 's':
        Camera::getCurrentCamera()->moveCamera(Camera::getCurrentCamera()->getFront(), 0.1f);
        break;
    case 'a':
        Camera::getCurrentCamera()->moveCamera(Camera::getCurrentCamera()->getSide(), -0.1f);
        break;
    case 'd':
        Camera::getCurrentCamera()->moveCamera(Camera::getCurrentCamera()->getSide(), 0.1f);
        break;
    }
    glutPostRedisplay();
}

This is my first post on stack overflow so please let me know if any more information is needed. Please help if you find any errors in my code and approach. Thanks!


text:
Q: Boostrap 3 : ordering elements for different size I have 3 divs of 3, 3, 6 width in bootstrap. I want them to be horizontally aligned all the time except for the xs. I want the first 2 div's is one line and the last divs to come below them in small devices. How can I achieve it.

A: I'm guessing you want something like this:


text:
Q: Access the Web Server Extensions folder? I am trying to import a SharePoint web part. A guide I am following to import it refers adding .dll files to a Web server Extensions folder in the Microsoft Shared folder. I don't have that folder. I assume I need a server-connected application for that folder to be created have IIS enabled. There is no indication that the computer I'm using ever had that folder. How is the Web Server Extensions folder created?
I have access to SharePoint and Project servers, but not those Server apps themselves. I have Project 2010 and SharePoint Designer installed. I do not have Windows Server.
**EDIT 7/21/14: **I do not have the web server extensions folder because I do not "have" the actual SharePoint server on my computer. So my question should be, how can I point to the web server extensions folder in the computer that does house the server?
**EDIT 8/5/14: **I can access the server via RDP and see the Web Server Extensions folder. Incidentally, I also have that folder on my computer, with subfolders 15 and 16, despite not running any servers on it. My questions now are:
1) What is the significance of the numbers?
2) How do I copy the extensions to the server's extensions folder if I am connected via RDP?

A: They are referring to the "web server extensions" folder. The folder is created when any version of SharePoint (foundation or enterprise) is installed. The folder is on your SharePoint server in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\. Web parts will add files into `%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\FEATURES' directory (for SharePoint 2010). For more information:
http://msdn.microsoft.com/en-us/library/office/ms460318(v=office.14).aspx
EDIT:
Here is one way to view the contents of the folder:

*

*Connect to your SharePoint server via Remote Desktop (RDP)

*Click On The Start Menu then Computer to open Windows Explorer

*Double click the drive SharePoint was installed on. Most commonly it's your C: drive. It may be labeled Local Disk (C:)

*Click the following folders:

*

*Program Files

*Common Files

*Microsoft Shared

*web server extensions

Another way to view the contents of the folder would be to connect to the server via RDP, click Start - Run (or press WIN+R), type the following into the run dialog box, then press enter:
%ProgramFiles%\Common Files\Microsoft Shared\web server extensions
If you provide the steps in the guide you are following I may be able to provide more specific assistance.


text:
Q: Z3 / c++ API for quantifiers I am using z3 with the C++ API for the example:
context c;
sort I = c.int_sort();
sort B = c.bool_sort();

expr x = c.int_const("x");
expr x1 = c.int_const("x1");

func_decl p1 = function("p1", I, B);
func_decl p2 = function("p2", I, B);

solver s(c);

s.add(forall(x, (implies(p1(x), ((p2(x)))))));

s.add(p1(x1));

The generated model is:
sat
  (define-fun x1 () Int
   0)
  (define-fun p1 ((x!1 Int)) Bool
   true)
  (define-fun p2 ((x!1 Int)) Bool
   true)

The imagined to have the model p1(x1) and p2(x1). I tried also with the options:
    p.set("mbqi", true);
    p.set("smt.mbqi.max_iterations", "10000000");
    p.set("auto-config", true);
But, I have the same result. Am I missing something?
Thank you.

A: Z3 produces a correct model, so I'm not exactly sure what the problem is. I can only imagine that there is some confusion about the argument names of the functions.
Per declaration, p1 is a function that takes an int and returns a Boolean. When Z3 builds an interpretation for this function, it names the first argument x!1 which has nothing to do with the constant function x1 (no bang). The model returned states
(define-fun x1 () Int
   0)
(define-fun p1 ((x!1 Int)) Bool
   true)

which means x1 is a constant function that always returns zero, i.e., x1() := 0. Additionally, p1 is a function with one argument (called x!1) and which returns true regardless of the input, i.e., for all x!1, p1(x!1) := true.


text:
Q: Easiest way to schedule callout on failure I have a class that places an order to an external API. This order sometimes takes a few minutes to complete. When the order is placed, I immediately get an Order Id in return, and the only way to see if the order completed is to make another query using this Order Id.
Ideally, this is how the flow would normally go:
public class CalloutClass() {
    public static void Walkthrough() {
        string orderId = PlaceOrder();
        DoSomethingWithOrder(orderId);
    }

    public static string PlaceOrder() {
        //Make REST call here.
        return orderId;
    }

    public static void DoSomethingWithOrder(string OrderId) {
        if(VerifyOrderComplete(OrderId)) {
            //Do other stuff
        }

        else {
            //Try again after 30 seconds
            //If it has been two minutes, send an email
        }
    }

    public static boolean VerifyOrderComplete(string OrderId) {
        //Make another REST call with the OrderId to verify
        //the order is complete
        return true;
    }
}

So I place the order, get an Id back, then check if the order is complete using that Id. If the order is not complete, I would like to wait a certain amount of time (30 seconds), then try again. Once I've tried for 2 minutes and the order still isn't ready, then send an email.
What would be the best way to accomplish this waiting period? Would I need to create some class that interacts with the Scheduler or something?
Thank you!

A: There are many possible alternatives, depending on your circumstances.
Long Timeout
If your API has a synchronous callout that will wait until the order is complete, you can set the timeout to 120 seconds on the callout, thus eliminating the need to do any theatrics.
Visualforce
You can use an apex:actionPoller to call the server every 30 seconds.
JavaScript (LWC, Aura, Visualforce)
You can use the client to call the service every 30 seconds, either directly or by proxy (Apex).
Asynchronous Code
This one is a bit tricky, but a Scheduled job may be appropriate. Note that you can only have a total of 100 scheduled jobs, so this might prove limiting.
Scheduled Actions
The Process Builder can trigger an asynchronous action, but you may need to wait more than 2 minutes and a record to update to trigger the action.
Paused Flow
If you do this from a Flow, the Pause action can wait a period of time, then call some Apex. Also requires a lot of setup, but technically feasible. You can also call Flows directly from Apex.
Queueable
Queueable can execute for 60 seconds of CPU per transaction, so it is technically possible that you could spin-wait for 30 seconds and then call the service, and if not ready, chain to another call to Queueable. Be aware that this will eat up some of your org's "long running transaction" slots, so if you do this too frequently, users may be denied access to some resources while your code runs.
Outside Help
You could easily spin up a Heroku app or other cloud-container service to do the polling. This is arguably a bit easier since those services allow more control over CPU time and other resources. A simple $5/month Heroku app could easily cover thousands of requests per month without breaking a sweat (or the bank).
Other (?)
I'm probably missing a few ideas, but this should be enough to get you started.


text:
Q: Trigger screen-reader when button clicked I have a button that when clicked removes an image from the screen. I would like to have screen reader announce: "image removed" when this happens. What is the easiest way to this using ARIA?
Thank you!

A: In my head I'm imagining you have a grid of 3 images that the user has uploaded. Each of these images most likely sit in DIV. The user then has the ability to click an "delete" button/link that removes the image.
Assuming that's the case, my suggestion is to replace the deleted image with a new element that has role="alert" and some form of "This image was deleted" text. This will allow visual users to see the image was deleted and give your screen reader something to read back.
The following example will say "The image was deleted" when clicking the 'delete' link.
NOTE: With NVDA, this doesn't work too well in IE because NVDA/IE seem to ignore role=alert.
    <!DOCTYPE html>

            <form>

Delete

Delete

Delete

            </form>


text:
Q: How to add a down block for Sequel add_unique_constraint migration I have a Sequel migration in PostgreSQL, which works up, but not down:
Sequel.migration do
  change do
    alter_table(:files) do
      add_unique_constraint [:name, :folder]
    end
  end
end

When trying to migrate down from this block, Sequel's error message says this is an "irreversible migration" and suggests writing my "own down method".
How do I write the down method for this particular migration?

A: Per the docs:
Sequel.migration do
  up do
    alter_table(:files) do
      add_unique_constraint [:name, :folder]
    end
  end

  down do
    alter_table(:files) do
      drop_constraint(:your_constraint_name, :type=>:unique)
    end
  end
end

You will have to figure out the name of your uniqueness constraint. It should appear in your schema, and it should be something like index_files_on_name_and_folder.


text:
Q: exit handler for express to close all open connections I have a node-express app and via node child process i run a binary and make requests that would bring back streaming data which is send to the browser via SSE in stdout.on('data') handler. I have a child.on('exit') handler and whenever the binary goes down the exit handler gets invoked and i could see the appropriate exitCode, in addition to that i would like to close all the open connections and make express server not to accept any new requests and gracefully close it out.
Is there a way to grab all the open connections and close them out in the exit handler.

A: app.listen returns a wrapped HTTP server, on which you can call .close(), which will gracefully close open connections and stop allowing incoming connections.
Something like:
let server = app.listen(9000)
child.on("exit", () => server.close())


text:
Q: Tweepy can't detect elevated access I already have elevated access in my twitter developer account. I already have regenerated the api keys and access token, yet, when I'm trying out this code, I'm still getting an error that I still need elevated access.
auth = tweepy.OAuthHandler(api_key, api_key_secret)
auth.set_access_token(access_token, access_token_secret)

api = tweepy.API(auth)

public_tweets = api.home_timeline()

The error I'm getting:
tweepy.errors.Forbidden: 403 Forbidden
453 - You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you'll need to apply for Elevated access via the Developer Portal. You can learn more here: https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api#v2-access-leve

It has been hours since I got my elevated access and all I'm getting when I'm searching this error is to get an elevated access.
I can access the twitter api when using tweepy.client but I'm hoping that I can use the perks of an elevated access,


text:
Q: Mockito To Verify ArrayList Size My Adapter has getItemCount method in which ArrayList returns size of items. How to i verify it with Mockito as i don't have any view in that method?
static class SongAdapterPresenter implements SortedSongSelectionContract.SongAdapterContract.Presenter {
.....
....
 @Override
        public int getItemCount() {
            return songs != null ? songs.size() : 0;
        }
}

My Mockito Class code
@RunWith(PowerMockRunner.class)
@PrepareForTest(Log.class)
public class SongAdapterPresenterTest {

    private SortedSongSelectionPresenter.SongAdapterPresenter songAdapterPresenter;

    @Mock
    private SortedSongSelectionContract.SongAdapterContract.Adapter adapter;

    @Mock
    private SortedSongSelectionContract.Presenter presenter;

    @Mock
    private Song song;
    private List<Song> songList;

    @Before
    public void setUp(){
        songList=new ArrayList<>(1);
        songList.add(song);
        songAdapterPresenter=new SortedSongSelectionPresenter.SongAdapterPresenter(adapter,presenter);
    }

    @Test
    public void testGetItemCount(){

        songAdapterPresenter.getItemCount();
        verify(songList.size()).equals(1);
    }

    @Test
    public void testonBindView(){

    }

}

When i run the testGetItemCount method i get org.mockito.exceptions.misusing.NotAMockException:
Any help would be greatly appreciated

A: The verify method of Mockito is used to interact with a mock, and make sure it was used as intended. For example, you could write verify(song).something() to make sure that the something method was called on the song mock.
In your case it looks like you are just looking for a way to verify (assert) the returned value. As this has nothing to do with your song mock, you should use a framework like Hamcrest with its assertThat method:
@Test
public void testGetItemCount() {
    int count = songAdapterPresenter.getItemCount();
    assertThat(count, is(1));
}

You can write assertions in any way you feel comfortable. As you're not interacting with a mock (song in your case), this is not the place to use Mockito.


text:
Q: LaTex MarkUp - align equations I'm very elated by the fact that it has LaTeX support. I would like to know whether the \begin{align} \end{align} environment could be used, because it looks very good since the equations are aligned. If not how can i make this LaTeX command look better?
\begin{align*}
\int \frac{1}{(2x^{2}+4x-2)^{-\frac{3}{2}}} \ \textrm{dx} &= \frac{\sqrt{2}}{8} \int\frac{\sec{t} \cdot \tan{t}}{\tan^{3}{t}} \ \textrm{dt} \\\ &= \frac{\sqrt{2}}{8} \int\frac{\cos{t}}{\sin^{2}{t}} \ \textrm{dt}
\end{align*}

A: As mentioned, WordPress does not provide general LaTeX support, but usually only mathmode support. Thus you have to use something that works from within mathmode, and not its own environemnt. In this case, there is a very useful one called 'aligned' (with the 'ed' at the end). To render the above in your default WordPress.com LaTeX (or even in MathJax-LaTeX plug-in), use the following code:
$latex
\begin{aligned}
\int \frac{1}{(2x^{2}+4x-2)^{-\frac{3}{2}}} \ \textrm{dx} &= \frac{\sqrt{2}}{8} \int\frac{\sec{t} \cdot \tan{t}}{\tan^{3}{t}} \ \textrm{dt} \\ &= \frac{\sqrt{2}}{8} \int\frac{\cos{t}}{\sin^{2}{t}} \ \textrm{dt}
\end{aligned}
$

A: From the link t31os has provided you can clearly see that:

One thing to keep in mind is that WordPress puts all of your \LaTeX code inside a \LaTeX math environment. If you try to use \LaTeX that doesn't work inside the math environment (such as \begin{align} ... \end{align}), you will get an error.

so no you can't but, you can use Youngwhan's Simple Latex
plugin that has an align option.
Update
following Jan's comment you can use google chart api
http://chart.apis.google.com/chart?cht=tx&chl=\begin{align*}%20\int%20\frac{1}{%282x^{2}+4x-2%29^{-\frac{3}{2}}}%20\%20\textrm{dx}%20&=%20\frac{\sqrt{2}}{8}%20\int\frac{\sec{t}%20\cdot%20\tan{t}}{\tan^{3}{t}}%20\%20\textrm{dt}%20\\%20&=%20\frac{\sqrt{2}}{8}%20\int\frac{\cos{t}}{\sin^{2}{t}}%20\%20\textrm{dt}%20\end{align*}

and isert it as the img src.
Hope this helps

A: This would work out of the box with the QuickLaTeX plugin (which I believe is only available for self-hosted WP blogs so I'm not sure this applies to the OP). The input
[latex][+preamble]\usepackage{amsmath}[/preamble]
\begin{align*}
  \int \frac{1}{(2x^{2}+4x-2)^{-\frac{3}{2}}} \textrm{d}x
    &= \frac{\sqrt{2}}{8} \int\frac{\sec{t} \cdot \tan{t}}{\tan^{3}{t}} \textrm{d}t \\
    &= \frac{\sqrt{2}}{8} \int\frac{\cos{t}}{\sin^{2}{t}} \textrm{d}t
\end{align*}[/latex]

gives me on my blog


text:
Q: realloc int pointer present in a structure [C] I want to malloc an integer pointer present inside a structure.
If in future I need to expand the array, I use realloc.
something like this:
typedef struct {
   int *temp,count
}foo;

main()
{
    foo *fake = (foo*)malloc(1*sizeof(foo));
    fake.count = 0;

    ++(fake.count);
    fake.temp = (int*)malloc((fake.count)*sizeof(int));

    /* I do something */

    /*now i want to realloc "temp" to ++(fake.count) */

Is this way of doing that correct?
    ++(fake.count);
    fake.temp = (int*)realloc(fake.temp,(fake.count)*sizeof(int));

A: In principle, yes.
However, you should make sure that your code survives possible errors in realloc, like so:
int * p = realloc(fake->temp, (fake->count + 1) * sizeof(int));
if (p) { fake->temp = p; ++fake->count; }
else   { /* error! But fake was untouched. */ }

Also, you should say int main(void) for your main function declaration. Finally, you shouldn't cast the result of malloc or realloc, since a void* is implicitly convertible to any other object pointer.
One more: Your coding style is really difficult for others to read. I'd write the struct definition like this:
typedef struct foo_
{
    int * temp;
    int   count;
} foo;

And even one more: Do you need to allocate fake dynamically? If not, an automatic variable foo fake; may be easier to maintain. In any event, if you do want to allocate it dynamically, don't cast and don't repeat the type, like so:
foo * fake = malloc(sizeof *fake);
// or:       calloc(1, sizeof *fake);      // this will zero out the memory

A: *

*You don't need to cast the return value from malloc or realloc in a C program.

*Don't directly assign the result of your realloc call to the same variable.  If it fails, you'll leak the original allocation.  Do something like this instead:
void *err = realloc(pointer, newSize);
if (err != NULL)
{
    pointer = err;
}

*Nitpick - multiplying by 1 looks weird.

A: Its difficult to say if it will be OK to do realloc that way without knowing what is I do something. But you can start with this....
#include <stdio.h>
#include <stdlib.h>

typedef struct {
 int *temp,count;
 }foo;

extern char etext, edata, end;
int main()
{
   printf("Heap before first malloc %p\n", sbrk(0));

   foo *fake = malloc(1*sizeof(foo));

   printf("heap after first malloc %p\n", sbrk(0));

   fake->count = 0;
   ++(fake->count);
   fake->temp = malloc((fake->count)*sizeof(int));
   printf("heap after second malloc %p\n", sbrk(0));

   fake->count += 2;
   fake->temp = realloc(fake->temp, (fake->count) * sizeof(int));
   printf("count %d\n", fake->count);

   printf("heap after realloc %p\n", sbrk(0));
   printf("program text segment(etext)      %10p\n", &etext);
   printf("initialized data segment(edata)  %10p\n", &edata);
   printf("uninitialized data segment (end) %10p\n", &end);

   return 0;
}

This will output your heap addresses also.
Heap before first malloc 0x239b000
heap after first malloc 0x23bc000
heap after second malloc 0x23bc000
count 3
heap after realloc 0x23bc000
program text segment(etext)        0x400816
initialized data segment(edata)    0x600bc4
uninitialized data segment (end)   0x600bd8

*

*You don't need a cast for malloc().

*Considering calloc() to clear out your memory. As you are reallocating, you can get wrongly initialized memory block. (like recently free'd blocks).

*Always check the return value of realloc() before using it. chance of failed realloc() is pretty high then malloc().


text:
Q: Управляемый frame Добрый день!
Помогите, пожалуйста решить задачу.
Требуется реализовать открытие страницы во фрейме на всю ширину окна с возможностью гулять по ссылкам, но при истечении определенного времени должна возвращаться исходная страница. Можно конечно сделать вот так:

        <meta http-equiv="content-type" content="text/html" />
        <meta name="author" content="" />

        <meta http-equiv="Refresh" content="60" />

        <title></title>

">

Но важно, чтобы при переходе по любой ссылке время начиналось сначала.
Можно ли вообще такое реализовать?

A: Можно почему нет.С помощью яваскрипта,при загрузке фрейма устанавливаете таймер,которые после окончания перезагрузит страницу. Функция setTimeout()


text:
Q: Bundling and Minification without using tools in ASP.NET MVC Core 2.2 web application Do we have any way to implement Bundling and Minification without using any tools like Grunt, Gulp, WebOptimizer etc. in ASP.NET MVC Core 2.2 web application similar to ASP.NET MVC?

A: ASP.NET supports bundling and minification out of the box, but same is not true for ASP.NET Core.
If you intend for css and javascript files, ASP.NET Core comes with a built in BundlerMinifier.In ASP.NET Core 2.1 or later, add a new JSON file, named bundleconfig.json, to the MVC or Razor Pages project root like this
[
{
  "outputFileName": "wwwroot/css/site.min.css",
  "inputFiles": [
    "~/lib/bootstrap/dist/css/bootstrap.css",
    "~/css/*.css"
  ]
},
{
  "outputFileName": "wwwroot/js/site.min.js",
  "inputFiles": [
    "~/js/*.js"
  ],
  "minify": {
    "enabled": true,
    "renameLocals": true
  },
  "sourceMap": false
}
]

Refer to Bundle and minify static assets in ASP.NET Core


text:
Q: Outlook not expanding M365 Groups Good morning Folks. I am having some issues and I am going to try and explain this to the best of my ability.
I am reorganizing our Azure environment and part of that is converting mail enabled security groups to dynamic M365 groups. There is about 1600 groups. My PowerShell script to do this has been created and is working as expected. I have not made these changes to all 1600 groups my D-DAY is the 22nd.
This brings me to my issue. When I created my test groups, I noticed that when I pull up the new group in the "To" field in outlook (pulled from the GAL, not using the autocomplete) I noticed that when I hover over the new group email in the "To" field I get a pop up saying there are no members in that group. I checked in Azure and o365 and I have all my 10 users in there, pulled in using my dynamic rule syntax. I do not know why it is showing no members. Being able to see who is in those groups will be well used by our users and something like this will generate a whole bunch of support calls\tickets.
When I try to expand the group, I get an error saying "Cannot perform the requested operation. The command selected in not valid for this recipient. The operation failed"
If anyone has any ideas I would love to hear them.
Thank you Johan

A: I see some disussion about the similar issue as yours:
Outlook Error Message: Cannot perform the required operation. The command selected is not valid for this recipient. there was an error while expanding the list. The list was not fully expanded
I found another workaround to try. Open a new message, select To:, change address book from "offline address book" to "distribution list", select the list giving errors and press ok so it updates into the To: line
Try expanding
Delete entry and retype distribution list to verify functionality
Expand
And this one:
Distribution List problem - Outlook 2016
When I've seen this error in the past it's been due to a corrupted autocomplete entry. Open a new email and begin typing the group name until you see it suggested in the drop-down. Then click the X to delete the autocomplete entry. Then either finish typing the group name and hit Check Names to link it, or add it in from the address book by clicking on the To button. You'll now be able to send the email.


text:
Q: Hacer winkear el texto de la consola de Node.js Me gustaría conseguir que el texto de la consola de Node.js parpadeara (winkeara), algo similar a cambiarle el color que ya  he visto como se hace:
console.log("%cSoy de color azul", "color: blue; font-style: italic");
console.log("%cEspaña","background: red; color: yellow");
Muchas gracias


text:
Q: Не работает каскадность в ActiveAndroid Использую ORM ку ActiveAndroid в своем проекте. Возникала проблема, что не работает каскадность. Мало того, что я не нашел каскадного инсерта, так и существующие каскадности обновления и удаления так же не работают. Например так я указываю каскадность:
@Column(name = "purchaseCalculation", onDelete = Column.ForeignKeyAction.CASCADE, onUpdate = Column.ForeignKeyAction.CASCADE)

Но по факту каскадность срабатывает только для вложенности на 1 уровень. Например есть класс User, он содержит в себе массив объектов Item, которые в свою очередь содержат Info. Я удаляю User и ожидаю, что удалятся все связанные объекты, но по факту удаляются только Item, а Info остается.
А так же есть ли способ делать каскадный инсерт?

A: Ответ найден. Это не возможно. делать надо так ссылка


text:
Q: Stat operation on AWS Cloudwatch insight query to get field value from JSON Array I have below JSON in Cloudwatch logs, wanted to get the timestamp value of all the records in this.
"records": [
        {
            "timestamp": "2020-10-16T18:00:24Z",
            "temp": "-65.0",
            "temp1": 0,
            "temp2": -64
        },
        {
            "timestamp": "2020-10-16T19:00:24Z",
            "temp": "-65.0",
            "temp1": 0,
            "temp2": -64
        }
}

tried with the below queries, didn't help
fields @message
| parse @message '"records":[*]' as recordList
| parse recordList '{*}' as recordLine
| parse recordLine '"timestamp":"*"' as recordTime
| stat count() by recordTime

This results in only the first record time in the query results, i need all the timestamp.


text:
Q: when i run the playbook through putty to start httpd service am getting following error [ec2-user@tower1 ~]$ systemctl status httpd.service -l
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2021-10-28 12:13:49 UTC; 5min ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 12139 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 12137 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 12137 (code=exited, status=1/FAILURE)
Oct 28 12:13:49 tower1.12c2.internal httpd[12137]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Oct 28 12:13:49 tower1.12c2.internal httpd[12137]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Oct 28 12:13:49 tower1.12c2.internal httpd[12137]: no listening sockets available, shutting down
Oct 28 12:13:49 tower1.12c2.internal httpd[12137]: AH00015: Unable to open logs
Oct 28 12:13:49 tower1.12c2.internal systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Oct 28 12:13:49 tower1.12c2.internal kill[12139]: kill: cannot find process ""
Oct 28 12:13:49 tower1.12c2.internal systemd[1]: httpd.service: control process exited, code=exited status=1
Oct 28 12:13:49 tower1.12c2.internal systemd[1]: Failed to start The Apache HTTP Server.
Oct 28 12:13:49 tower1.12c2.internal systemd[1]: Unit httpd.service entered failed state.
Oct 28 12:13:49 tower1.12c2.internal systemd[1]: httpd.service failed.


text:
Q: Avoid line break I want to keep * in same line as question.
div inside first span is generated from code,cannot apply any css for that!

Where is ur pen?

*

.nobr {
  border: 1px solid blue;
  display: inline;
  width: 100%;
  float: left;
}

.main {
  width: 100px;
  border: solid 1px #000;
}

.ast {
  display: inline;
  border: 1px solid red;
}

http://jsfiddle.net/ByGVE/41/
The inner div(it can contain nested divs) is a dynamically generated code( html from backend-SharePoint list rich text field). I have to add an asterisk after the question.

A: You can put you text in span instead of div.
http://jsfiddle.net/ByGVE/42/

    Where is ur pen?
    *

Or if div is generated dynamically You can update following css
.nobr > div {
    display:inline;
}

A: You can try this:

.nobr {

  display: inline;
  width: 90%;
  float: left;
}

.main {
  width: 150px;
  border: solid 1px #000;
  border: 1px solid blue;
}

.ast {
  display: inline;
  color: red;
}

    Where is ur pen?

  *


text:
Q: MikTex Package Updates via Proxy Server My employer has a proxy server. I have gone to settings and input my proxy server settings as https:...... , the appropriate port, am asked for authentication settings, and the package update fails with error code 4. AS the proxy server is requesting autthenitication, I am assuming that I am inputting the settings correctly (but, maybe, indeed, not).
I have verified the proxy server settings, can hit that URL in a browser, but it fails via the MikTeX console.
Sorry, new MikTex user here, and am unable to update via a proxy server.
Is there a way to DL the required files, and update manually.


text:
Q: Ruby on Rails selecting multiple rows for 2 id's I want to create a private messages system and I am having a bit trouble with selecting all the messages between two users.
if I have a table named messages with:
id - message id
content - message content
user_id - sender id
to_id - to id
Messages Controller:
@from_user = User.find_by(username: params[:name])
@messages = Message.where(user: [@from_user, current_user], to_id: [current_user, @from_user])

Thank you!

A: Try this:
from_id = @from_user.id
to_id = current_user.id

Message.where("
  (user_id = #{from_id} AND to_id = #{to_id})
  OR
  (user_id = #{to_id} AND to_id = #{from_id})
")


text:
Q: Fast Refreshable MView creation ORA-12015: cannot create a fast refresh materialized view from a complex query I want to create m-view which keeps the aggregates of cash from transaction history.
The query is as follows.
CREATE MATERIALIZED VIEW MV_CASH_STATS

BUILD IMMEDIATE REFRESH FAST ON DEMAND
AS

( -- Total aggregates
    SELECT
        'total' AS CODE
        , COUNT(T.CASH_IN) AS DEPOSITS
        , COUNT(T.CASH_OUT) AS WITHDRAWS
        , SUM(T.CASH_IN) AS DEPOSIT
        , SUM(T.CASH_OUT) AS WITHDRAW
    FROM
        TB_CASH_LOG T
)
UNION ALL
( -- Aggregates by account grades
    SELECT
        'grade-' || T1.GRADE AS CODE
        , COUNT(T.CASH_IN) AS DEPOSITS
        , COUNT(T.CASH_OUT) AS WITHDRAWS
        , SUM(T.CASH_IN) AS DEPOSIT
        , SUM(T.CASH_OUT) AS WITHDRAW
    FROM
        TB_CASH_LOG T
        INNER JOIN TB_ACCOUNT T1 ON
            T.ACCOUNT_ID = T1.ID
    GROUP BY T1.GRADE
)

When i execute this, the following error occurs.
> ORA-12015: cannot create a fast refresh materialized view from a complex query

(I created m-view log tables for both TB_CASH_LOG and TB_ACCOUNT)
The Total aggregates part is ok, but the later part - Aggregates by account grades - makes the error.
I've read Oracle basic materialized view docs, and thinking that INNER JOIN or GROUP BY is the error point.
If it is true, fast refresh m-view with inner join and group by is impossible?
What is wrong with my m-view declaration sql?
p.s. I'm working on oracle 18c