text:
Q: How to make PostgreSQL accurately increment by year fractions using interval? I'm attempting to increment a date by a fraction of a year, but when I compare the difference of the incremented time, it doesn't add up to the right fraction of the year (I'm using a non-leap year in this example)
This first example is incorrect from the third decimal place:
select ((extract(epoch from '2022-07-01'::timestamp + interval '1 year' * 0.45283595)) - extract(epoch from '2022-07-01'::timestamp)) / 31536000
--= 0.454851895890408

I would expect it to be adding the equivilant of this, where I have calculated the number of seconds:
select ((extract(epoch from '2022-07-01'::timestamp + interval '1 second' * (31536000 * 0.45283595))) - extract(epoch from '2022-07-01'::timestamp)) / 31536000
--= 0.45283595000000276

A: Adrian was on the right track. See below outputs, addings seconds doesn't yield the same results as adding a fraction of a year as it's computing it in terms of months (e.g. if we ask for 0.5 years, it adds 6 months, which isn't the same thing as splitting the year in half to the nearest second). Thanks for the responses.
select '2022-07-01'::timestamp + (interval '1 year' * 0.5) --2023-01-01 00:00:00
select '2022-07-01'::timestamp + (interval '1 month' * 12 * 0.5) --2023-01-01 00:00:00
select '2022-07-01'::timestamp + (interval '1 seconds' * (31536000 * 0.5)) --2022-12-30 12:00:00


text:
Q: In a Telerik ListView in Xamarin Forms, how do I handle a right click event for an element on Windows? My company has a cross-platform application primarily used on mobile devices using Xamarin with some controls by Telerik. Recently, we have been putting more work in to get it to work properly on all platforms (it was originally a port of an Android Java application). The sticking point at the moment is Windows: while almost everything works fairly well, a Telerik ListView is giving us trouble.
We currently use a long press event to show UI for deleting an item. This works perfectly. This is using a GestureRecognizer within a Telerik ListView. The problem is that we cannot find a way to get similar behavior with a mouse: clicking on the item has an effect that we wish to preserve, and it already contains an irreplaceable checkbox. Ideally, I'd set a right click event and be done with it, but there is no right click event available on the Telerik ListView control. Since the control is not a UIElement, I cannot locate its children in any of the ways I'm used to, and the nodes themselves seem to be replaced at runtime in the live visual tree.
I can see an ExtendedListViewItem control, which seems to be the one I'd like to give a mouse event handler, but I don't know any way to refer to those nodes from the top. It gets even trickier, because these pages are all within a .NET Standard 2.0 class library, so any platform-specific code (like say VisualTreeHelper) can only be added to the UWP application and then somehow abstracted back to this library of shared UI.
I know that this is a very specific question and may be difficult to answer, but searching for any of the parts of what I'm trying to do seems to get me a large amount of irrelevant guides and information.

A: I evaluated the approach to create 'RightClicked' event in the UWP part of the RadListView component and provide that notification to the XamarinForms part of the control. Technically this is possible but at the time of writing the UWP related class that should provide the notification is internal. This means that using the UWP ListViewItems to provide that notification is not possible.
Since, most likely you have already set a custom ItemTemplate to the RadListView in XamarinForms, you can consider creating a custom XamrinForms control (e.g. Grid, Frame, Border, Label...) which has custom renderer for UWP. That renderer can subscribe to the UIElement.RightTapped Event and retransmit the notification to the XamarinForms part of the control.
public class MyRightClickGridRenderer : ViewRenderer<MyRightClickGrid, Grid>
{
    protected override void OnElementChanged(ElementChangedEventArgs<MyRightClickGrid> e)
    {
        if (this.Element != null)
        {
            if (this.Control == null)
            {
                var uwpGrid = new Grid { IsRightTapEnabled = true, Background = new SolidColorBrush(Colors.Transparent) };
                uwpGrid.RightTapped += UwpGrid_RightTapped;
                this.SetNativeControl(uwpGrid);
            }
        }
        if (this.Element == null)
        {
            if (this.Control != null)
            {
                ((Grid)this.Control).RightTapped -= UwpGrid_RightTapped;
            }
        }
    }

    private void UwpGrid_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
    {
        ((MyRightClickGrid)this.Element).RaiseRightClicked(sender);
    }
}

and in the XamarinForms project you could create something similar
public class MyRightClickGrid : Grid
{
    public event EventHandler<TappedEventArgs> RightTapped;
    public void RaiseRightClicked(object sender)
    {
        this.RightTapped?.Invoke(this, new TappedEventArgs(null));
    }
}

Once you create this control you can use it in XAML like this:
<telerikListView:RadListView>
  <telerikListView:RadListView.ItemTemplate>
    <DataTemplate>
      <telerikListViewPrimitives:ListViewTemplateCell>
        <telerikListViewPrimitives:ListViewTemplateCell.View>
          <MyNamespace:MyRightClickGrid >
            ***
          </MyNamespace:MyRightClickGrid >
        </telerikListViewPrimitives:ListViewTemplateCell.View>
      </telerikListViewPrimitives:ListViewTemplateCell>
    </DataTemplate>
  </telerikListView:RadListView.ItemTemplate>
</telerikListView:RadListView>

Let me know if this works for you.
P.S. One advantage to this approach is that you can use the same renderer to retrieve the position where the click originated. This feature is still not supported by XamarinForms and you should create similar logic for each platform to get that information.

redpajama_set_name: RedPajamaStackExchange


text:
Q: php mysqli_query error numbers I'm executing MySQL database querys in my PHP scrpt like this:
function doStuffInDB(){
    ...
    if (($r = mysqli_query($db_conn, $q)) === false) {
        throw new Exception(mysqli_error($db_conn));
    } else {
       //get result
    }
    ...
}

When I call the function which executes the query, I call it like this:
function doStuff(){
    try{
        doStuffInDB();
    }catch(Exception $e){
        echo $e->getMessage();
    }
}

I would like to write a generic error handler that takes the error number of the error that occurred and returns an error message to the user. Something like:
function doStuff(){
    try{
        doStuffInDB();
    }catch(Exception $e){
        echo $feedback = handleError($e->getErrorNumber());
    }
}

For me to do this, I need a list of error numbers which can occur while calling mysqli_query() but I can not find any such list. Where can I find this documentation? Any tip on how this error handler (a php function) would look like?


text:
Q: Determining recurrence of running time of algorithm I have a Computer Science assignment to determine recurrence of algorithm given as:
public void foobar(int n)
if n < 0
   return
foobar (n/3)
for (int i = 1; i <= n; i = i+1)
    for (int j = n; j >= 1; j = j/2)
        print(i+j)
foobar(2n/3)
for (int i = 1; i >= 5000; i = i+1)
    print(i)

I know about basic relation like:

T(n) = T(n/3) + T(2n/3) + time for other stuff

I am unable to determine the running time of loops at each recursive call . Any help would be much appreciated and would greatly help in my studies, Thank you!


text:
Q: Is Web Browser "Discrimination" Okay? Is it acceptable to add "special," but unnecessary, content based on a user's web browser?  For example, is it okay to display this:

at the top of my webpage for all IE users?

A: It will certainly irritate visitors. And they probably won't understand what Firefox is and how to use it.

A: It depends on the type of "discrimination" and the reason for doing so.
Paypal blocks old browsers as a security measure.  This, to me, is entirely valid--particularly when dealing with financial transactions.
At the other end of the spectrum I have visited sites with IE only to have a constant invasive popup saying "We think you should upgrade to Firefox, it's a much better browser".  No reason for it.  Just snobbery.  That site got closed real fast.

A: No. It's inappropriate, presumptive and arrogant. What especially ticks me off are websites that display a holier-than-thou ad for Firefox when I visit it with IE, extolling the wonders of the free software movement while vilifying anyone who dares to release proprietary software. It drives me nuts. I do not continue to visit such websites.

A: Suggesting your user to download an alternative browser is a bad idea, they are on your site to read about the subject of the site, not to get commanded to get an alternative browser. When they get bad experience with that browser, it will be the fault of your site suggesting that and you might lose those customers. (Also, each external link draws visitors from your site away)
As an example: I hate to see "Get a better browser! Download Firefox." messages, wether I be using IE8 Partner Build, Firefox 3.1 Beta 2 or another browser like Opera, Safari. Those browsers are all fine and there is no reason to switch between them. You end up irritating people, sending them away with the link to something they have totally no experience with.
Please note that there are computer-savy people out their, that will have completely no benefit by downloading Firefox/Linux/... ;-)

A: That depends on what the site is, and who the target audience is.
If it's for a business then I'd definitely say no, that looks amateurish.  It's also pretty poor for a professional site not to function properly regardless of the capabilities of the user's browser, particularly when some of those users might be using screen readers to help visually-impaired users.

A: It depends what your site is designed for and why you are doing the targetting of certain browsers.
If you're building something like an internal web application then it's likely that users will have a restricted browser anyway so designing for a particular browser isn't a real problem.
But if you're doing a public website it's not a good idea. FireFox still doesn't have a large enough market share to be the targeted browser.
It's not realistic that your site is 100% perfect in every browser, but targetting the big ones should always be done:

*

*IE6+

*Firefox 2+

*Safari 3

Any good JavaScript library should work (or at least degrade nicely) over the three major browsers.
As an Opera user I find there is nothing more annoying that going to a website and finding it fails completely and I have to bring out another one. Generally I wont and that site looses my traffic.

A: Discriminating against the major browsers is unnecessary and completely unacceptable.  I'm not even sure how this is a question, unless you want to annoy users.  People may visit your site that do not use your choice browser.  This is something you will have to live with.  Unless you're website is The Greatest Website in the World(tm) people will not change browsers to accommodate you.

A: Acceptable to whom?  I personally think it's a sign of a rather lame site -- it's up there with that little construction guy sign from 1998 (remember that one?).
You sure can, if you want, but it's better to make your site as compliant as possible, and to use tools like YUI and jQuery to make your site more browser-agnostic.

A: These are two different things. Almost every professional web application is somewhat aware of the users's browser, and accommodates them so the experience is pretty much the same. Displaying "works better" disclaimers is a kind of confession that you were not able to make your site work with most browsers.

A: In terms of adding 'special content' for certain browsers I'd recommend using an approach known as progressive enhancement (http://en.wikipedia.org/wiki/Progressive_Enhancement). The basic principle is that it's fine to build particular features for more modern web browsers as long as the core content is available to other users on older or less capable browsers.
Yahoo have coined a browser support philosophy know as Grade Browser Support (http://developer.yahoo.com/yui/articles/gbs/) which is derived from the principles of progressive enhancement.

A: It's not necessarily wrong. But things like that are an artifact of an older world, where browsers were day and night between each other.
There is no excuse to not strive for perfect compliance with IE6 and above.
If you want a message like that, be kind in your word. Introduce the user to Firefox instead of telling him that his method of browsing is inferior.

A: First of all, user discrimination should be handled VERY carefully.
You may prefer Firefox/Opera/Safari because it's safer, technologically superior or whatever, but you may lose several users that way(remember Firefox has only recently reached 20% of usage share).
But assuming you are aware of this, it depends on the kind of user discrimination you're considering.
"**.com works better with modern browsers like Firefox" should be just fine(but provide a download link for Firefox), if the page worked for Internet Explorer users anyway.
Also, you may want to consider restricting users to the latest versions. Since you don't want to support IE, you could add support only for IE7, and then have support only for IE8 once it's released, forcing users to either update their browser version or switch to Firefox. This may also be the less dangerous model for Internet Explorer discrimination.
It all comes to this:

*

*How many users would be discriminated?

*Would that discrimination prevent them from using your service?

Try to discriminate as few users as possible, and try to provide an alternative service for those users, so they'd use your site anyway.
After all, YOU want users to use your site, right?
In that case, web browser discrimination is as acceptable as the loss of users it'd cause. If no users are lost, that's fine. If not, just see if the number is big enough to harm you.

A: While I'm an avid user of Firefox (or Chrome) and sympathize with the underlying sentiment, I think you should be careful about how you describe the problem.  The 'modern browser' term is loaded.  I would consider using a phrase such as

Some features of this web site are not available because of the web browser you are using.  Click here for more information.
Some features of this web site do not work with your web browser.  Click here for more information.

It is crucial to give them somewhere to go to get more information.  That page can give them information about where to download alternative browsers, and so on.  It is important not to be derogatory about their browser.  Many people are not allowed to change their browser.  (I'm lucky: I don't have to run MSIE more than once, maybe twice, in a month.  The rest of the time, I use Firefox - or Chrome at SO.)
Ideally, the web site works the same for everyone.  If there are bits that simply cannot be made to work for archaic versions of MSIE or Netscape Navigator or whatever it is, then go with a carefully neutral wording and a source of explanation.

A: imho - yes, but be careful how you word it, say so only when it's true, and do your best to make sure it isn't true first i.e. your site should be x-browser safe
And you probably can't say choose to do this on anything professionally written.

A: Of course it is.  It is your web site.  If people don't like it they won't come back.
You may want them to come back or use your site properly so you might want to think about how to support that.

A: I think that anyone who's going to get Firefox has already. Sadly, due to so many factory-made computers running Windows, with IE renamed to "Internet", many people who aren't running Firefox, Chrome, Safari (or any other modern browsers I've neglected to mention) don't understand what a browser is. Therefore putting "runs better in firefox" is going to tick them off, as they don't know what Firefox is. I think the open source movement has become a bit religious, preaching about different browsers and the like.

A: Browser discrimination, IMO is bonkers, appropriate handling of the browser version, esp. if the user is on a really old version of their browser, might be useful / constructive.

A: I'm looking at discrimination in another way.  I have an online banking account, and they've recently discriminated against me, on ANY browser, by checking my IP-address, and if it isn't the same as the last time, they claim they don't "recognize my computer" and force me through a complex scheme to get an Identification Code to enter in order to proceed.  I have Dynamic IP-address assignment, which changes daily.  This bank could check the first two bytes of the IP-address to see that it's always the same "signature" defining my ISP.  But NO, they check the entire IP-address, so I'm being "discriminated" against BECAUSE I use DHCP with Dynamic IP-addresses.  To me, this is another form of discrimination.


text:
Q: Getting the Device File for a USB Device with IOKit Following the tutorials on the Apple Developer website, I managed to figure out how to enumerate either serial ports or connected USB devices, with the former giving me the information I need about which device file to read and write from and the latter giving me the device's name. Unfortunately, I'm not sure how to go about figuring out which device file corresponds to which USB device.
Ideally, I would create an USB device iterator, create an interface for each one to get the information I need, and then do something to get the path to the device file corresponding to the USB device. I have everything implemented, except for this mysterious something.
Any ideas? Thanks!


text:
Q: Send a single email with multiple data I have a script that looks at overloaded tables on an application.
If the table exceeds 90% of the maximum of the table then the script sends an email with the overloaded tables.
To do that, I created a function that analyze the table :
# elemt is the current data and Max is the maximum of the table
$elemt = @($PcaDos, $PcaMal, $PcaRdv, $Pc2Tpt, $Pc2Dti, $Pc2His, $PcaLigFact)
$tableMax =  @($PcaDosMax, $PcaMalMax, $PcaRdvMax, $Pc2TptMax, $Pc2DtiMax, $Pc2HisMax, $PcaLigFactMax)

#   calculates 90% of the maximum of the table
$total = @()
Foreach($item in $tableMax){
 $value = $item * 0.9
 $total += $value
}

function OverloadTable{
    param(
        $variable,
        [int]$num,
        [String]$table
    )
if($Variable -gt $total[$Num]){
    $path = "The $path table is overloaded"
    $path
    echo 'sending mail'
 }else{
    echo "The $table table is not overloaded"

 }
}

OverloadTable -Variable $PcaDos -Num 0 -Table PcaDos
OverloadTable -Variable $PcaMal -Num 1 -Table PcaMal
OverloadTable -Variable $PcaRdv -Num 2 -Table PcaRdv
OverloadTable -Variable $Pc2Tpt -Num 3 -Table Pc2Tpt
OverloadTable -Variable $Pc2Dti -Num 4 -Table Pc2Dti
OverloadTable -Variable $Pc2His -Num 5 -Table Pc2His
OverloadTable -Variable $PcaLigFact -Num 6 -Table PcaLigFact

This function works but it sends an email for each overloaded table whereas I want it to send a single email for each overloaded table. I tried to make a list in the function but the functions don't save the previous variables. I also tried setting the elemt list to 1 for each overloaded table and 0 for the others and send mail for the tables to 1 but it doesn't work too. I'm a beginner in function. I know it's possible but maybe I'm not using the right way

A: This may work for you. probably least amount of edits, but I'm sure not best way...

*

*Correct to $Table like @zett42 suggested.

*Remove your email execution from the function.
Assuming "echo 'sending mail'" is an actual execution.

*Since you're expressing $Path within the function, though your could also use return $Path. Remove the echos you do not want in your Email body. Then wrap your function calls with a Subexpression Operator like this...
$(
    OverloadTable -Variable $PcaDos -Num 0 -Table PcaDos
    OverloadTable -Variable $PcaMal -Num 1 -Table PcaMal
    OverloadTable -Variable $PcaRdv -Num 2 -Table PcaRdv
    OverloadTable -Variable $Pc2Tpt -Num 3 -Table Pc2Tpt
    OverloadTable -Variable $Pc2Dti -Num 4 -Table Pc2Dti
    OverloadTable -Variable $Pc2His -Num 5 -Table Pc2His
    OverloadTable -Variable $PcaLigFact -Num 6 -Table PcaLigFact
) | Foreach-Object { $EMAILBODY += $_ + "`r`n" }

*The ForEach-Object section will concatenate you a string from each function outputted $Path and will add line breaks, so remove if you don't want.

*Execute your email (outside of function) with $EMAILBODY.

Subexpression Operator


text:
Q: Active or Inactive on Button click in ASP.Net MVC? I am getting return json  data from server,every  value  is  inserted  in  table  except  status.

}
if item.Status == "N" means InActive image will display and if item.Status == "Y" means Active image will display
But in my code Status Value i didn't get any idea.?
Controller:
public ActionResult ViewModules(int id)
        {
            Domain_Bind();
            dynamic mymodel = new ExpandoObject();
            userType type = new userType();

            List<ViewRoleModules> EmpList = type.GetRoleModulesViews(id);
            List<ViewRoleModules> RoleList;
            List<ViewRoleModules> role = new List<ViewRoleModules>();
            foreach (ViewRoleModules emp in EmpList)
            {
                RoleList = type.GetSiteRoleModulesViews(emp.ModuleID);
                foreach (ViewRoleModules vip in RoleList)
                {
                    role.Add(new ViewRoleModules
                    {
                        RoleName = vip.RoleName,
                        ModuleID = vip.ModuleID
                    });
                }
            }

            var data = new { EmpList = EmpList, role = role };

            return Json(data, JsonRequestBehavior.AllowGet);

        }

A: Your code is a bit of a mess to be honest with several syntax errors. Hope this helps:
       $.ajax({
            type: 'POST',
            url: '@Url.Action("ViewModules")',
            dataType: 'json',
            data: { id: id },
            success: function (data) {
                $.each(data.EmpList, function (i, item) {
                    $("#findValue").show();
                    var roleName = $(data.role).filter(function (index, item) {
                        return item.ModuleID == item.ModuleID
                    });

                    var moduleName = item.ModuleName;
                    if (item.ParentModuleID == -1) {
                        moduleName = " -- " + moduleName;
                    }

                    var status = '';
                    if (item.Status == "Y") {
                        status = '';
                    } else {
                        status = '';
                    }

                    var row = "
" +
                    "" + (i + 1) + "	" +
                    "" + moduleName + "	" +
                    "" + item.Url + "	" +
                    "" + roleName[i].RoleName + "	" +
                    "" + status + "	" +
                    "
";
                    $('#example tbody').append(row);
                });
            },
            error: function (ex) {
                var r = jQuery.parseJSON(response.responseText);
                alert("Message: " + r.Message);
                alert("StackTrace: " + r.StackTrace);
                alert("ExceptionType: " + r.ExceptionType);
            }
        });


text:
Q: Can't fire click event for coloredText I have method to create colored and clickable text inside textview. I can't fire onClick when click colored text. I can't see why it doesn't work.
MainFragment.kt
        textview.text = formatTextWithColorAndClickableSpan(
            requireContext(), getString(R.string.about_private_data_save), "Aydınlatma Metnini", onClickDescription
        )

private val onClickDescription = fun() {
        PermissionDialogType.PRIVATE_DIALOG
 }

Method:
fun formatTextWithColorAndClickableSpan(
    context: Context,
    fullText: String,
    coloredText: String,
    onClick: () -> Unit
): SpannableString {
    val spannableString = formatTextWithColor(context, fullText, coloredText)

    val startIndex = fullText.indexOf(coloredText)
    val endIndex = startIndex + coloredText.length
    val clickableSpan = object : ClickableSpan() {
        override fun onClick(p0: View) {
            onClick()
        }

        override fun updateDrawState(ds: TextPaint) {
            super.updateDrawState(ds)
            ds.isUnderlineText = true
        }
    }
    spannableString.setSpan(clickableSpan, startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

    return spannableString
}

I tried these also:
      textview.text = formatTextWithColorAndClickableSpan(
            requireContext(), getString(R.string.about_private_data_save), "Aydınlatma Metnini", ::onClickDescription
        )

private fun onClickDescription() {
    PermissionDialogType.PRIVATE_INFO
}

A: I solved problem with this code line.
    textview.movementMethod = LinkMovementMethod.getInstance()


text:
Q: Display DISQUS on homepage I have installed disqus and I want it to show up on my homepage. It replaced the old wordpress comments system on pages and posts but I also want it to appear on index.php
my index.php file now - > http://i.imgur.com/TxaroMC.png
I added <?php comments_template(); ?>  but nothing happend. What should I do ? I want to put it at the bottom of my website
Thanks

A: Hook it in from your child themes functions file or add the template tag to a front-page.php file
Untested
add_action('loop_end','disqus_front_page_after_loop');

function disqus_front_page_after_loop() {

if (is_front_page() && function_exists( 'comments_template' ) ) {

comments_template();

    }
}

Change the loop_end hook to another WordPress or theme specific hook.
If using the template tag, you might want to try adding it before the footer rather than before the end of the loop if it works outside the loop.


text:
Q: MySQL query in Inno Setup Before knowing about Inno Setup used IzPack to do my installer, due to the need to verify if the port of the service that was about to create was in use, towards a query to the database with the driver jdbc, so if the connection was valid then send a error message to change the port.
So this is the way I did before, but I do not know how to do it in Inno Setup:
try {
    Class.forName("com.mysql.jdbc.Driver");

    Connection conn =
        DriverManager.getConnection(
            "jdbc:mysql://" + server + ":" + port + "/database", "root", password);

    if (conn.isValid(0)) {
        error = "A server-type installation already exists in: " + server;
        return Status.ERROR;
    }
} catch (ClassNotFoundException ex) {
    Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
    Logger.getLogger(Conexion.class.getName()).log(Level.SEVERE, null, ex);
}

Thank you very much.

A: You will have to execute a command-line MySQL client (mysql).
For some examples of executing an executable and checking its exit code and/or inspecting its output, see:

*

*Using Process Exit code to show error message for a specific File in [Run];

*How to get an output of an Exec'ed program in Inno Setup?

A: found an easy way to discover port from answer How to check if port is usable in Inno Setup?
function CheckPortOccupied(Port:String):Boolean;
var
  ResultCode: Integer;
begin
  Exec(ExpandConstant('{cmd}'), '/C netstat -na | findstr'+' /C:":'+Port+' "', '', 0,
       ewWaitUntilTerminated, ResultCode);
  if ResultCode <> 1 then
  begin
    Log('this port('+Port+') is occupied');
    Result := True;
  end
    else
  begin
    Result := False;
  end;
end;


text:
Q: Создание Custom View в Android Начал делать свою custom view (через код, наследуясь от класса EditText (хочу сделать свой edittext под свои нужды)). Материала достаточно мало. Что посоветуйте в качестве изучения данного метода создания custom view. Может быть, есть какие-либо книги или интернет источники.

A: Я думаю эта статья с примером вам поможет:
https://m.habr.com/ru/post/273589/


text:
Q: Two logos and text in the footer I'm trying to put two images and some text in my document footer, all aligned side by side with the page number, something like this:

I could get to the basics using fancyhdr, but it obviously doesn't work as expected.
I'm a beginner in LaTeX so I'm having a really hard time adapting some answers I've seen that cover either side by side figures or aligning texts and figures in the footer:
\documentclass[onecolumn]{article}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\lfoot{\includegraphics[scale=0.3]{example-image} \includegraphics[scale=0.15]{example-image} Some text to go in the footer}
\rfoot{\thepage}

\begin{document}

\lipsum

\end{document}

I know that I can solve the footer limits with footskip, but I can't figure how to make sure that all items are placed side by side and correctly aligned in my footer.
Thanks,
Bernardo

A: Some thing like this?

\documentclass[onecolumn]{article}

\usepackage{fancyhdr}
\usepackage[export]{adjustbox}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\lfoot{\includegraphics[scale=0.3,valign=c]{example-image}
       \includegraphics[scale=0.15,valign=c]{example-image}
       Some text to go in the footer}
\rfoot{\thepage}

\begin{document}

\lipsum

\end{document}

Or this
\documentclass[onecolumn]{article}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\lfoot{%
  \begin{minipage}{\textwidth}
  \parbox{0.23\linewidth}{\includegraphics[width=\linewidth]{example-image}}\hfill
  \parbox{0.23\linewidth}{\includegraphics[width=0.5\linewidth]{example-image}}\hfill
  \parbox{0.46\linewidth}{Some text to go in the footer Some text to go in the footer}\hfill
  \parbox{0.02\linewidth}{\raggedleft \thepage}%
  \end{minipage}
  }

\begin{document}

\lipsum

\end{document}

A: Didn't know whether the red box was part of the notation or the footer itself (I assumed the latter).  I put the text in a \parbox, added some vertical buffer around the \fbox, and I spaced out the items in the footer.
If you need actual boxes around the text and page number, let me know.
\documentclass[onecolumn]{article}
\usepackage{stackengine,xcolor}
\fboxrule=2pt
\newcommand\cincludegraphics[2][]{%
  \setbox0=\hbox{\includegraphics[#1]{#2}}%
  \abovebaseline[-.5\ht0]{\includegraphics[#1]{#2}}}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\lfoot{\textcolor{red}{\addstackgap[3pt]{\fbox{\color{black}
  \makebox[\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax]{%
  \cincludegraphics[scale=0.3]{example-image}\hfil
  \cincludegraphics[scale=0.15]{example-image}\hfil
  \parbox[c]{1in}{Some text to go in the footer}\hfil
}}}}}
\rfoot{\thepage~}

\begin{document}

\lipsum

\end{document}


text:
Q: Get PoweredOn VM count in Vmware using VI Java How to get the PoweredOn VM count in Vmware using the VI Java SDK? Is there a way to filter the VMs based on the power state?
The following code gives the VMs reference objects.
 ManagedEntity[] vms = new InventoryNavigator(clusterEntity).searchManagedEntities("VirtualMachine");

To filter the PoweredOn state VMs, we have to loop through the managed entities and retrieve the VM object, which is a time-consuming operation. Hence is there a way to get the count information alone?

A: One way of doing this is via the PropertyCollector's RetrievePropertiesEx method.
Note that the PropertyCollector is a fairly complex beast - very briefly you need to provide it with a recursion strategy (e.g. recurse into child folders) as well as the properties you wish to extract. If you've never worked with the PropertyCollector before then you should look up a sample program online and modify it.
The nice thing about the PropertyCollector is that it is a single call that can retrieve a specific piece of information for a large number of entities. So it's quite efficient in that respect. You can also get the count pretty easily.
As you noted, the alternative is to query for each VM one by one, performing multiple queries and receiving much more data you have to process. Depending on the number of VMs you have/expect to have, and your performance requirements, you can select the best approach for you.
If you're on vSphere 6.5, then consider using the REST API. It has a list operation for VMs that accepts query parameters, and the power state is among the few properties that are exposed via that API. So you can get a list of powered on VMs by using the URL GET https://{server}/rest/vcenter/vm?filter.power_states.1=POWERED_ON. Note that this is limited to 1000 VMs.


text:
Q: How to remove dictionaries with duplicate values from a nested dictionary I have a dictionary that contains key value pairs where the values are also dictionaries:
{
    'item1':{'name':'filename', 'size':1024},
    'item2':{'name':'filename', 'size':1024},
    'item3':{'name':'diff_filename', 'size':1024},
    'item4':{'name':'diff_filename', 'size':1024}
}

I want to remove items in the dictionary that have duplicate 'filename' fields in their values giving me the result:
{
    'item1':{'name':'filename', 'size':1024},
    'item3':{'name':'diff_filename', 'size':1024}
}

A: Use an auxiliary set to track what filenames you have seen already:
seen = set()
{k: v for k, v in yourdict.iteritems()
    if v['name'] not in seen and (seen.add(v['name']) or True)}

Or, more readable as a loop:
seen = set()
filtered = dict()
for k, v in yourdict.iteritems():
    if v['name'] in seen:
        continue
    seen.add(v['name'])
    filtered[k] = v


text:
Q: Out-of-view inbox items can still be selected in mobile view This bug is weird and hard to describe, so I'll demonstrate instead. These screenshots are of the stock Android browser. You can click any of these screenshots for a full view.
Here's my inbox (left), and scrolled down a little (right). You can see that the fourth and fifth items are a comment and the Arqade elections notification. Notice that in the left screenshot, these are out of view (except for the very top of the comment notification).

However, if I touch the area below the inbox - where the questions are! - I can still select these inbox items, and I will be directed to that comment and the Arqade elections. Regardless of whether the inbox has already ended, the browser still considers the items to be there.


text:
Q: Speed up MSAccess 2003 and MSSQL I want to move my current DB from MDB to a MSSQL server. When I have done this through ODBC, queries became particularly slow.
I have red that it's caused ODBC, that doesn't support group by and JOIN, join and so it has to do multiple queries and process datas on the current machine.
How can I switch to something faster ( for MSAccess 2003 )?

A: Actually, in most cases Access does a decent job. If your query has some joins, but ESPECIALLY has some aggregate group by, then simply create a view, and then link to that view. It will likely run as fast as a pass-through query, but without the hassle and effort on the Access side.
So in most cases, you should be able obtain excellent performance when using Access as a front end to SQL server.
So, for calling store procedures, or for some reports, you can consider using pass-through query.
However, to save time and effort on your part, then for quires with a join and especially those with aggregates like group by or count, then just create a view server side and then link to that.
You find the performance first rate when you do this.

A: just one basic and stupid question: did you define all needed indexes on your SQL database?

A: Have you tried this approach: http://www.packtpub.com/article/transferring-data-ms-access-2003-to-sql-server-2008 ?
To make it repeat itself, at the very last step, tick "save SSIS package" and schedule it appropriately.
This is the by Microsoft for Microsoft approach, so unless there are known issues with it, I'd use it as the optimal approach.

A: While using MS Access, you can use an Access Data Project. This gives you a MS Access front end with a SQL Server backend. The primary benefits of an Access Data Project are (a) you get the stability, scalability, and security of a real SQL database, while (b) still using the well-known MS Access front-end and programming.
See this stackoverflow question for an in-depth discussion: Pros and Cons of Access Data Project (MS Access front end with SQL Server Backend)


text:
Q: How can I run my function for some number of minutes? I am writing a simple program to keep clicking my screen (for roblox clicking simulator). But is there a way to run my function autoclicker for 20 minutes using a while loop? The while true makes the function run infinitely and I only want it to run for 20 minutes.
    import time
    import mouse

    def autoclicker(n):
        time.sleep(5)
        while True:
            for i in range(1, 13):
                mouse.click('left')
            time.sleep(1)

A: Change the while True to test for the limit:
end = time.time() + 20 * 60
while time.time() < end:
    for i in range(1, 13):
        mouse.click('left')
    time.sleep(1)

A: We can try this
import time
import mouse

def autoclicker(n):

    time_1 = datetime.strptime(datetime.now().strftime("%H:%M:%S"),"%H:%M:%S")  #getting initial time

    minPass = 0
    while minPass < 20:  #check if required time ellapesed

        time.sleep(5)
        for i in range(1, 13):
            mouse.click('left')
        time.sleep(1)

        time_2 = datetime.strptime(datetime.now().strftime("%H:%M:%S"),"%H:%M:%S") #getting current time
        minPass = int(str(time_2 - time_1).split(':')[1])  #extracting minute part from time difference


text:
Q: Erlang SASL AUTH PROTOCOL implementation Many Systems are beginning to use this SASLAuthProtocol (see RFC4422) for authenticating Clients in RESTFUL interactions. Examples are: Couchbase Server 2.0, Memcached e.t.c. I wonder if there is an erlang complete implementation of this authentication protocol. A Java implementation is a good example of what i am looking for. This Python Code seems to be the python implementation of this protocol. Is there an Erlang library i can quickly use to have SASLAuth support in my Application ?

A: I've not tried this, but it looks like it implements SASL for Erlang:
https://github.com/mikma/esasl
When searching for this kind of thing, take care to avoid the SASL in Erlang, which is System Architecture Support Libraries - "these are not the SASL you're looking for"...


text:
Q: Transformation Matrix of a function I have the following:
(Note: $V^{*}$ is defined as: $V^{*} = \{ L: V \rightarrow \mathbb{R} | \text{L is linear} \}$)
Let $V$ be an $\mathbb{R}$-Vectorspace. Let $\phi \in V^{*} \text{ \ } \{0 \}$ and $h \in V\text{ \ } \{0 \}$ with $h \in \ker{\phi}$. Let now $F: V \rightarrow V$ be given as $F(v) := v + \phi(v)  h$, where $B = (h, v_2, v_3 ... v_n)$ is a basis of $V$ with its first basis-vector $h$. Calculate the Transformation-Matrix $M_B(F)$.
Well, what I did was the trivial. I've applied $F(b_j) =  \sum_{i = 1}^n \lambda_i e_i$ with $b_j \in B$ and $j = 1,2,3 ... $
I will present the first two; $F(b_1)$ and $F(b_2)$. Note that $h\in ker(\phi) \Rightarrow \phi(h) = 0$:
$$f(h) = h + \phi(h)h = h = \lambda_1 e_1 + \lambda_2 e_2 + .. + \lambda_n e_n$$
$$f(v_2) = v_2 + \phi(v_2)h = \lambda_1 e_1 + \lambda_2 e_2 + .. + \lambda_n e_n$$
So what do I do next? I don't know how I can calculate the $\lambda$'s to be able to put them as entries into the matrix...

What if I said $h = \left(h_1, h_2, h_3, .... ,h_n \right)$ and defined every other vector $v_i = (v_{i,1}, v_{i,2}, ... ,v_{i,n})$.
Then I could write for $h$, that $h = h_1e_1 + h_2e_2 + h_3e_3 ... h_n e_n$ and for $v_2 + \phi(v_2)h = v_{2,1} + \phi(v_{2,1})h_1 e_1 + v_{2,n} + \phi(v_{2,2})h_2 e_2 + ... + v_{2,n} + \phi(v_{2,n})h_n e_n $...
Is that possible?

Thank you very much for your help.
FunkyPeanut


text:
Q: Type '[String:Any]' has no subscript members in Swift I am trying to get information from a json result and append and access certain key values. However, I am getting the error "Type '[String:Any]' has no subscript members.
        let json = try? JSONSerialization.jsonObject(with: data!, options: []) as! [String: Any]
        for case let studentsInfo in json["results"] {
            if let studentInfo = StudentResults(json: result) {
                let name = firstName + " " + lastName
                StudentsResults.append(name)
            }

This is also the struct that I have placed in an extension.
struct StudentResults{
    let firstName: String
    let lastName: String
    let latitude: Double
    let longitude: Double
    let mapString:String
    let mediaURL: String
    let objectID:String
    let uniqueKey: String
    let updatedAt: String
}

convenience init?(json: [String: Any]) {
    guard let firstName = json["firstName"] as? String,
          let lastName = json["lastName"] as? String
        else {
            return nil
    }
    return nil

This is also my GitHub page for this project if you would like to take a look at it
https://github.com/SteveBurgos95/UdacityMapProject

A: It appears to me that the problem is with this line of code:
let json = try? JSONSerialization.jsonObject(with: data!, options: []) as! [String: Any]
Whilst you are force casting it here as! [String: Any], the try? is giving you an optional value.
You have two options. You can be a crazy person and change try? to try!, or you can take the safer approach and wrap the code like so:
do {
    guard let json = try JSONSerialization.jsonObject(with: data!, options: []) as [String: Any] else { return }
    …
} catch {
    // HANDLE ERROR
}


text:
Q: In pinescript alerts is there any way to detect what the timeframe of the chart and then send alerts based on that? I have a tradingview indicator through which I send alerts to discord, the alerts are like this
msgr1=syminfo.ticker + ',' + timeframe.period + ', Crossed Resistance 1'

if srLines==true and close > h10
    alert(msgr1)

The problem is timeframe.period sends alerts in multiples of 60, so if timeframe of the chart is 2 hours it sends 120, and 3 hours is 180, and so on. This is confusing to interpret for discord members, so I thought that if I could detect if timeframe.period is under a 1 day period then I could return timeframe after doing its modulus with 60
So I tried to do this
if timeframe.period < 1D
    timeframe=timeframe.period%60
else
    timeframe=timeframe.period
msgr1=syminfo.ticker + ',' + timeframe+ ', Crossed Resistance 1'

if srLines==true and close > h10
    alert(msgr1)

This does not work, but is there any way I can code this in pinescript?

A: string timeframe = na

if timeframe.isintraday and timeframe.multiplier >= 60
    timeframe := tostring(timeframe.multiplier / 60) + "H"
else if timeframe.isintraday and timeframe.multiplier < 60
    timeframe := tostring(timeframe.multiplier) + "m"
else
    timeframe := timeframe.period


text:
Q: Change the header and the menu colour on scroll I'm starting from scratch with javascript and want to ask you for some advices upon that pieces of code. I'm developing Joomla 3.2 website with Gantry template as default. My mission is to achieve the following. When a user access submenu (01, 02, 03 e.g.) derived from the parent item128 and scroll down the "rt-header" and the ""rt-block menu-block""should change the background colour. For example accessing menu 02, scroll down and the header menu goes yellow.
Here is my HTML:

        Services::after

Submenu1

Submenu2

Submenu3

Submenu1

Submenu2

Here is it the CSS: (when child item is active the header and the menu blocks inherit those colours)
.gf-menu.l1 li.item1.active.last {background-color:#abcf39;}
.gf-menu.l1 li.item2.active.last {background-color:#f39512;}
.gf-menu.l1 li.item3.active.last {background-color:#f16e68;}
.gf-menu.l1 li.item4.active.last {background-color:#7ecde9;}
.gf-menu.l1 li.item5.active.last {background-color:#878787;}

...and the jQuery function: (header-color.js)
    function changeColor(){
var t = jQuery('.item142').offset().top - 100;

jQuery(window).scroll(function () {
    var x = jQuery(this).scrollTop(),
        item141 = jQuery('.item141'),
        item142 = jQuery('.item142'),
        item143 = jQuery('.item143'),
        item144 = jQuery('.item144'),
        item152 = jQuery('.item152');

    if (x >= item141.offset().top && x < (item141.offset().top + item141.height())) {
        jQuery('rt-header').css("background-color", "#990");
    }
    if (x >= item142.offset().top && x < (item142.offset().top + item142.height())) {
        jQuery('rt-header').css("background-color", "#ccc");
    }
    if (x >= item143.offset().top && x < (item143.offset().top + item143.height())) {

        jQuery('rt-header').css("background-color", "#949494");
    }
    if (x >= item144.offset().top && x < (item144.offset().top + item144.height())) {
        jQuery('rt-header').css("background-color", "orange");
    }
    if (x >= item152.offset().top && x < (item152.offset().top + item152.height())) {
        jQuery('rt-header').css("background-color", "purple");
    }
});
}

I'm loading the .js document in the index.php file of my template into the "head" section:
<?php $gantry->addScript("header-color.js");?> But on tracking I recieve the following message:
"Uncaught TypeError: Cannot read property 'top' of undefined " Is it my function written wrong ?

A: It seems to me that you have a mixup in classes and ids. Your jquery looks for an item with an ID, but your html gives only a class, but no ID
item1 = jQuery('#item1'); // Looking for an item with ID "item1"

And then in your html, you have

...

To fix the issue, you need to either use ID both places or use classes both places.

A: You are taking id in item1 = jQuery('#item1') whereas in your html you have given class names.
Try this in your js file
    item1 = jQuery('.item1'),
    item2 = jQuery('.item2'),
    item3 = jQuery('.item3'),
    item4 = jQuery('.item4'),
    item5 = jQuery('.item5');


text:
Q: win32com.client.gencache.EnsureDispatch("Outlook.Application") not working I am trying to send email using my Outlook client through a Python script. When the below Python script is executed separately from IDLE editor, it is working fine. But when the same lines of codes are put at the end of another Python script (so that after the logic execution email is triggered) and the Python script is called from a Web application hosted in Tomcat server, it is not working.
Code Snippet:
#!/Python36/python.exe -u

import win32com.client`

mail_subject = "Test Mail Subject"

mail_body    = "Test Mail Body"

Outlook      = Win32com.client.gencache.EnsureDispatch("Outlook.Application")
mail         = Outlook.CreateItem(0)
mail.To      = 'xxx@abc.com'
mail.Subject = mail_subject
mail.Body    = mail_body
mail.Send()

To check where it is failing, I had printed some comments after each line. It was found that the line:
Outlook = win32com.client.gencache.EnsureDispatch("Outlook.Application")
was failing when the Python script was executed from the Web application. Can anyone help with the resolution.

A: According to your question description of the problem, you can use try the following two ways alternatively:
1.Please include the code below before win32com.Client.Gencache.EnsureDispatch("Outlook.Application")
from win32com.client.gencache import EnsureDispatch

2.You should use the following code replace the code The win32com. Client.Gencache.EnsureDispatch("Outlook.Application")
Gencache. EnsureDispatch ("Outlook.Application")

Please refer to the website below for details:
https://www.programcreek.com/python/example/103552/win32com.client.gencache.EnsureDispatch
If you have any question, please reply to me.


text:
Q: 'CFURLCreateStringByAddingPercentEscapes' deprecated in STTwitter Library I'm using the STTwitter Library in my App and it's been throwing a deprecation warning that says the following:
 'CFURLCreateStringByAddingPercentEscapes' is deprecated: first deprecated
in iOS 9.0 - Use [NSString stringByAddingPercentEncodingWithAllowedCharacters:]
instead, which always uses the recommended UTF-8 encoding, and which encodes
for a specific URL component or subcomponent (since each URL component or
subcomponent has different rules for what characters are valid).' deprecated
error.

Here's the code that is causing the problem in STTwitter:
@implementation NSString (RFC3986)
- (NSString *)st_stringByAddingRFC3986PercentEscapesUsingEncoding:(NSStringEncoding)encoding {

    NSString *s = (__bridge_transfer NSString *)(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
                                                                                (CFStringRef)self,
                                                                                NULL,
                                                                                CFSTR("!*'();:@&=+$,/?%#[]"),
                                                                                kCFStringEncodingUTF8));
    return s;
}
@end

The question is how to replace this with equivalent code using 'stringByAddingPercentEncodingWithAllowedCharacter'.

A: Here's valid replacement code:
@implementation NSString (RFC3986)
- (NSString *) st_stringByAddingRFC3986PercentEscapesUsingEncoding: (NSStringEncoding) encoding {

   NSMutableCharacterSet *allowed = [NSMutableCharacterSet alphanumericCharacterSet];
   [allowed addCharactersInString: @"-._~"];

   return( [self stringByAddingPercentEncodingWithAllowedCharacters: allowed] );
   }
@end

I've tested the new code verses the old and in all cases, thus far, the strings they generate are equal.
In the original code, the idea was to escape a specific named set of characters. They were:
!*'();:@&=+$,/?%#[]

When you switch to using 'stringByAddingPercentEncodingWithAllowedCharacters', the logic reverses and only characters not named are escaped. So, the new code specifies 'alphanumericCharacterSet' and a small group of additional characters are added to it.  The added characters are:
-._~

Those characters not named in the new code are the same set set of characters explicitly named in the old code..
As an aside, it is not clear to me that that the passed encoding parameter in the original code was ever used.


text:
Q: "Even more worth reading" v "worth reading even more" A Meta.SE post was recently edited (by an ELU member I respect), with the reason "grammar":
Before:

resigned: Aza on Literature, worth reading, predates other events;
later wrote an update that's even more worth reading

After:

resigned: Aza on Literature, worth reading, predates other events;
later wrote an update that's worth reading even more.

I didn't understand why the edit was made and would like to understand the considerations for such an edit.  So here are my questions:
Was the edit an improvement?  If so, was it necessary?  Did it make things worse?  If so, how much worse?
Bonus question: Would either of the following be a helpful edit of the original sentence?

A resigned: Aza on Literature, worth reading, predates other events;
later wrote an update that's even more so.
B resigned: Aza on Literature, worth reading, predates other events;
later wrote an update that's even more worthwhile.

A:

*

*Aza on Literature, worth reading, predates other events; later wrote an update that's even more worth reading.

*Aza on Literature, worth reading, predates other events;
later wrote an update that's worth reading even more.

The original, (1) was fine as it was, even if some people might find it clunky. The edited version, (2) is positively damaging because it is syntactically ambiguous. The reason for this is that because of its position, the adverb phrase even more could easily be modifying the verb phrase reading rather than the adjective phrase worth reading. There is no grammatical way of disambiguating it. Of course, if this phrase  modifies reading then it implies that it would be of value to read it several times. However, what is clearly intended by the original writer is that it is of even greater benefit to read it (than the previously mentioned posts). This reading is available from (2), but not immediately so, and the reader might have to read it twice to get the intended meaning. After all, the reader might well surmise that if the writer had intended the meaning in (1), they would have chosen that unambiguous phrasing.
There can be no helpful edit to a clearly written and grammatical sentence, unless one feels it is helpful to impose one's own sense of style on someone else. This might be ok if you're an editor, but not if you're just another SE member. De gustibus non est disputandum as they say in English!


text:
Q: Durandal 2.0 Dialog Repositioning At the bottom of the durandal docs for dialogs / modals (http://durandaljs.com/documentation/Showing-Message-Boxes-And-Modals.html) there's some syntax for repositioning a dialog.  The dialog I have gets gradually bigger as the user selects stuff, so every time a selection is made, I'd like to call reposition().  I tried following along with this:
vm.compositionComplete = function (child, parent, context) {

        var addEditDialog = dialog.getDialog(context.model); // resolves

        // whenever something is selected:
        addEditDialog.context.reposition(vm); // no method 'reposition'

}

But I get an error - there is no function reposition.  What am I doing wrong?

A: You can set up a custom dialog context that responds to a reposition message (using Durandal's app.trigger()).  You would trigger the message upon some event in your dialog (such as, as you say, the user's selecting stuff).
Also in that custom dialog context, create a method call reposition.  In the activate or attached handler of that custom dialog context, subscribe to the message you use to trigger a reposition.
I'm advocating a messaging approach because you may wish to isolate your "selection viewModel" in its own viewModel, and then compose it into your custom dialog context.  With this approach, your selection viewModel and your custom dialog context would be loosely bound.  That way, you could use your selection viewModel elsewhere in your code (and even have some other viewModel, instead of the custom dialog context, respond to the reposition message).


text:
Q: Remove/alter object reference in dictionary created with vars() or __dict__ I am working on a way to serialize complex objects into JSON. This includes objects that have other objects as attributes. I have run into a problem with my current approach that has piqued my interest:
When I have an object with at least one attribute that is also a custom object and I call the vars() function on it, it returns the object as a dictionary containing a reference to the object in the attribute rather than - what I naively expected - the representation as string (i.e. {"attribute": <object object at ...>} as opposed to {"attribute": "<object object at ...>"}. While this is expected behavior it has lead me to a problem:
If I now want to delete the entry with the object reference as value from the dictionary or alter it in any way, all actions taken on it of course affect the referenced object as well. That means any action taken onto the dictionary also affect the original object from which the dictionary was created. For example using object.vars().pop("attribute") deletes the attribute not only in the dictionary, but in object as well. I have a small minimal example below.
My question is the following: is there an elegant way to still change and/or delete the entry for the object attribute in the dictionary without changing/deleting the original object that the dictionary points to?
I am aware that I can use the deepcopy function from the copy module to circumvent the issue by creating a deep copy and altering only this copy - that is what I am currently doing. But the question piqued my interest as I thought there might be a clever, more "pythonic" way to deal with this.
Minimum working code example:
class A:
    def __init__(self):
        self.attribute = object()

a = A()  # create an object with object attribute
print(a.attribute)  # prints <object object at ...>

d = vars(a)  # contains key "attribute" with reference to a as value
d.pop("attribute")
print(a.attribute)  # raises AttributeError


text:
Q: List of Dictionaries to DataFrame I have a data like this and I want the data to be written in a dataframe so that I can convert it directly into a csv file.
Data =
[ {'event': 'User Clicked', 'properties': {'user_id': '123', 'page_visited': 'contact_us', etc},
{'event': 'User Clicked', 'properties': {'user_id': '456', 'page_visited': 'homepage', etc} , ......
{'event': 'User Clicked', 'properties': {'user_id': '789', 'page_visited': 'restaurant', etc}} ]

This is How I am able to access its values:
for item in list_of_dict_responses:
            print item['event']
            for key, value in item.items():
                if type(value) is dict:
                    for k, v in value.items():
                        print k,v

I want it in a dataframe where event is a column with value of User Clicked and properties is a another column with sub column of user_id, page_visited, contact_us and then respective values of sub column.

A: flatten the nested dictionaries & then just use the data frame constructor to create a data frame.
data = [
  {'event': 'User Clicked', 'properties': {'user_id': '123', 'page_visited': 'contact_us'}},
  {'event': 'User Clicked', 'properties': {'user_id': '456', 'page_visited': 'homepage'}},
  {'event': 'User Clicked', 'properties': {'user_id': '789', 'page_visited': 'restaurant'}}
]

The flattened dictionary may be constructed in several ways. Here's 1 method using a generator that is generic & will work with arbitrary-depth nested dictionaries (or at least until it hits the max recursion depth)
def flatten(kv, prefix=[]):
    for k, v in kv.items():
        if isinstance(v, dict):
            yield from flatten(v, prefix+[str(k)])
        else:
            if prefix:
                yield '_'.join(prefix+[str(k)]), v
            else:
                yield str(k), v

Then using list comprehension to flatten all the records in data, construct the data frame
pd.DataFrame({k:v for k, v in flatten(kv)} for kv in data)
#Out
          event properties_page_visited properties_user_id
0  User Clicked              contact_us                123
1  User Clicked                homepage                456
2  User Clicked              restaurant                789

A: You have 2 options: either use a MultiIndex for columns, or add a prefix for data in properties. The former, in my opinion, is not appropriate here, since you don't have a "true" hierarchical columnar structure. The second level, for example, would be empty for event.
Implementing the second idea, you can restructure your list of dictionaries before feeding to pd.DataFrame. The syntax {**d1, **d2} is used to combine two dictionaries.
data_transformed = [{**{'event': d['event']},
                     **{f'properties_{k}': v for k, v in d['properties'].items()}} \
                    for d in Data]

res = pd.DataFrame(data_transformed)

print(res)

          event properties_page_visited properties_user_id
0  User Clicked              contact_us                123
1  User Clicked                homepage                456
2  User Clicked              restaurant                789

This also aids writing to and reading from CSV files, where a MultiIndex can be ambiguous.


text:
Q: Can Facebook app developers count the number of comments people make to posts made by those facebook apps on users' newsfeed For instance, if you have seen the Nike running app it posts on the users stream every time they finish a run. In many occasions these posts receive comments or likes from that users friends. Does nike as the developer have access to the number of comments and likes that are generated to posts made by their application? And on that subject, do they have access to the number of impressions these posts receive?
Thanks a lot!

A: definitivly not the number of impressions, that's not given out by facebook. But the facebook graph api gives you access to the number of comments and number of likes of a post, see here: https://developers.facebook.com/docs/reference/api/post/.
[Update] For a post made by the app through the graph api, you will receive the postid, which in turn should allow you to read the information you've asked for. BUT you're still required to have read_stream permission to read all the necessary information.
Got me curious, and i just tested: you can post with an application to the users wall and won't be able to read this post back from the users wall. If you have the correct permissions, it's however pretty easy. Just save the post_id or query it.
Finally, to answer your question: if the nike apps asks for read_stream permission , it will be able to read all information. Otherwise it's a fire-and-forget setting


text:
Q: How to make sure, files are shared and transferred via ethernet rather than WiFi? I have two ubuntu machines, that are both connected to a local network via WiFi. But at the same time they are also directly linked with an ethernet cable.
Now on one machine I am sharing a folder by properties->Local Network Share->Share this folder. On the other machine I access that folder by clicking "other locations" in nautilus and then clicking on the machine that is sharing the folder and then I mount that folder. Now when I am copying files out of the folder I get extremely low data rates (between 0.2MB/s and 3MB/s).
However, when I unactivate the WiFi adapter on one of the machines and unmount and mount the folder again, I get transfer rates in the 50MB/s range. So apparently ubuntu prefers using WiFi for file tranfer over ethernet. How can I change this behaviour or how can I tell the system to always use the ethernet network to access this folder?
Some extra information:
I set up the IP-addresses of the ethernet network manually. The sharing computer is 10.0.0.1 and the other one is 10.0.0.2.


text:
Q: CRM 2011: How to let a processing workflow run very long I have a crm 2011 workflow with a assembly which will run about 1-3h depending on the amount of data. How can I make this happen in the sandbox?
thanks

A: The sandbox service has a processing limit of 2 minutes, so this certainly won't be possible for CRM Online. You may be able to update the sandbox processing limit if you are on-premise, but I don't recommend it for a 1-3 hour process, because you'll quickly run out of worker processes and other workflows and plugins will fail.
You should probably set up an external web service that does this work. Then in your workflow assembly, fire off the external web service. That way you can explicitly control timeouts in a separate web application.


text:
Q: Dynamic OPENROWSET in SSIS OLE DB Source Script Fellow S.O. Gurus,
I am building an SSIS driven ETL solution to parse daily JSON files, each file located in a network share drive, each file date-stamped (ie: myjsonfile-20221026.json)
This solution will be deployed to a dedicated ETL Server with SQL Server 2019 optimized for SSIS Catalog.
The script I used to work on the dynamically built Path works on the server (It fails on my desktop due to the "Kerberos Double Hop" problem).
    DECLARE @json   NVARCHAR(MAX)
    DECLARE @Path   NVARCHAR(500)
    DECLARE @sql    NVARCHAR(MAX)

    --SET @Path = ?
    SET @Path = N'\\Sharepath\to\my\location\myjsonfile-20221026.json'
    SET @sql = N'
    SELECT @json = BulkColumn
        FROM OPENROWSET(BULK ''' + @Path + ''', SINGLE_CLOB) AS j;'

    EXEC sp_executesql @sql, N'@json nvarchar(max) out', @json OUT
    -----------------------------
    WITH RESULT SETS
    ((
        [id]                [NVARCHAR](100)
    ,   [type]              [NVARCHAR](100)
    ,   [as-of]             [DATETIMEOFFSET](7)
    ,   [as-of-date]            [DATE]
    ,   [bankruptcy-chapter]        [SMALLINT]
    ,   [bankruptcy-date]           [DATE]
    ,   [borrower-fees-remitted]        [DECIMAL](19, 4)
    ,   [borrower-fees-unpaid]      [DECIMAL](19, 4)
    ,   [charged-off-amount]        [DECIMAL](19, 4)
    ,   [charged-off-date]          [DATE]
    ,   [charged-off-interest]      [DECIMAL](19, 4)
    ,   [charged-off-principal]     [DECIMAL](19, 4)
    ,   [charged-off-reason]            [NVARCHAR](100)
    ,   [creditor-name]         [NVARCHAR](100)
    ,   [creditor-ownership-start-date]     [DATE]
    ,   [days-past-due]         [INT]
    ,   [debt-settlement-acceptance-date]   [DATE]
    ,   [debt-settlement-agreement-date]    [DATE]
    ,   [debt-settlement-amount]        [DECIMAL](19, 4)
    ,   [debt-settlement-amount-paid]   [DECIMAL](19, 4)
    ,   [debt-settlement-breached-date] [DATE]
    ,   [debt-settlement-completed-date]    [DATE]
    ,   [debt-settlement-flag]      [BIT]
    ,   [debt-settlement-status]        [NVARCHAR](100)
    ,   [final-payment-date]            [DATE]
    ,   [interest-rate]         [DECIMAL](19, 4)
    ,   [interest-rate-at-origination]      [DECIMAL](19, 4)
    ,   [interest-remitted]         [DECIMAL](19, 4)
    ,   [legal-entity-name]         [NVARCHAR](100)
    ,   [loan-id]               [NVARCHAR](100)
    ,   [loan-modified-flag]            [BIT]
    ,   [loan-status]           [NVARCHAR](100)
    ,   [loan-term]         [INT]
    ,   [loan-term-at-origination]      [INT]
    ,   [matured-date]          [DATE]
    ,   [maturity-date-at-origination]      [DATE]
    ,   [monthly-payment]           [DECIMAL](19, 4)
    ,   [monthly-payment-at-origination]    [DECIMAL](19, 4)
    ,   [next-scheduled-due-date]       [DATE]
    ,   [originating-lender]            [NVARCHAR](100)
    ,   [origination-principal]     [DECIMAL](19, 4)
    ,   [outstanding-principal]     [DECIMAL](19, 4)
    ,   [partially-charged-off-date]        [DATE]
    ,   [payment-frequency]     [NVARCHAR](100)
    ,   [principal-remitted]            [DECIMAL](19, 4)
    ,   [purchase-price]            [DECIMAL](19, 4)
    ,   [recovery-remitted]         [DECIMAL](19, 4)
    ,   [remaining-term]            [DECIMAL](19, 4)
    ,   [risk-grade]            [NVARCHAR](100)
    ,   [scra-modified-flag]            [BIT]
    ,   [unpaid-accrued-interest]       [DECIMAL](19, 4)

    ))
    -----------------------------
    IF ISJSON(@json)=1
        BEGIN TRY
            SELECT
                d.[id]
            ,   d.[type]
            ,   a.*

            FROM OPENJSON(@json, N'$.data')
            WITH(
                    [id]                [NVARCHAR](100)         '$.id'
                ,   [type]              [NVARCHAR](100)         '$.type'
                ,   [attributes]            [NVARCHAR](MAX)         AS JSON
                ) AS d --data
            CROSS APPLY OPENJSON(d.attributes)
                WITH
                (
                    [as-of]             [DATETIMEOFFSET](7)     '$."as-of"'
                ,   [as-of-date]            [DATE]              '$."as-of-date"'
                ,   [bankruptcy-chapter]        [SMALLINT]          '$."bankruptcy-chapter"'
                ,   [bankruptcy-date]           [DATE]              '$."bankruptcy-date"'
                ,   [borrower-fees-remitted]        [DECIMAL](19, 4)            '$."borrower-fees-remitted"'
                ,   [borrower-fees-unpaid]      [DECIMAL](19, 4)            '$."borrower-fees-unpaid"'
                ,   [charged-off-amount]        [DECIMAL](19, 4)            '$."charged-off-amount"'
                ,   [charged-off-date]          [DATE]              '$."charged-off-date"'
                ,   [charged-off-interest]      [DECIMAL](19, 4)            '$."charged-off-interest"'
                ,   [charged-off-principal]     [DECIMAL](19, 4)            '$."charged-off-principal"'
                ,   [charged-off-reason]            [NVARCHAR](100)         '$."charged-off-reason"'
                ,   [creditor-name]         [NVARCHAR](100)         '$."creditor-name"'
                ,   [creditor-ownership-start-date]     [DATE]              '$."creditor-ownership-start-date"'
                ,   [days-past-due]         [INT]               '$."days-past-due"'
                ,   [debt-settlement-acceptance-date]   [DATE]              '$."debt-settlement-acceptance-date"'
                ,   [debt-settlement-agreement-date]    [DATE]              '$."debt-settlement-agreement-date"'
                ,   [debt-settlement-amount]        [DECIMAL](19, 4)            '$."debt-settlement-amount"'
                ,   [debt-settlement-amount-paid]   [DECIMAL](19, 4)            '$."debt-settlement-amount-paid"'
                ,   [debt-settlement-breached-date] [DATE]              '$."debt-settlement-breached-date"'
                ,   [debt-settlement-completed-date]    [DATE]              '$."debt-settlement-completed-date"'
                ,   [debt-settlement-flag]      [BIT]               '$."debt-settlement-flag"'
                ,   [debt-settlement-status]        [NVARCHAR](100)         '$."debt-settlement-status"'
                ,   [final-payment-date]            [DATE]              '$."final-payment-date"'
                ,   [interest-rate]         [DECIMAL](19, 4)            '$."interest-rate"'
                ,   [interest-rate-at-origination]      [DECIMAL](19, 4)            '$."interest-rate-at-origination"'
                ,   [interest-remitted]         [DECIMAL](19, 4)            '$."interest-remitted"'
                ,   [legal-entity-name]         [NVARCHAR](100)         '$."legal-entity-name"'
                ,   [loan-id]               [NVARCHAR](100)         '$."loan-id"'  --tracking 87
                ,   [loan-modified-flag]            [BIT]               '$."loan-modified-flag"'
                ,   [loan-status]           [NVARCHAR](100)         '$."loan-status"'
                ,   [loan-term]         [INT]               '$."loan-term"'
                ,   [loan-term-at-origination]      [INT]               '$."loan-term-at-origination"'
                ,   [matured-date]          [DATE]              '$."matured-date"'
                ,   [maturity-date-at-origination]      [DATE]              '$."maturity-date-at-origination"'
                ,   [monthly-payment]           [DECIMAL](19, 4)            '$."monthly-payment"'
                ,   [monthly-payment-at-origination]    [DECIMAL](19, 4)            '$."monthly-payment-at-origination"'
                ,   [next-scheduled-due-date]       [DATE]              '$."next-scheduled-due-date"'
                ,   [originating-lender]            [NVARCHAR](100)         '$."originating-lender"'
                ,   [origination-principal]     [DECIMAL](19, 4)            '$."origination-principal"'
                ,   [outstanding-principal]     [DECIMAL](19, 4)            '$."outstanding-principal"'
                ,   [partially-charged-off-date]        [DATE]              '$."partially-charged-off-date"'
                ,   [payment-frequency]     [NVARCHAR](100)         '$."payment-frequency"'
                ,   [principal-remitted]            [DECIMAL](19, 4)            '$."principal-remitted"'
                ,   [purchase-price]            [DECIMAL](19, 4)            '$."purchase-price"'
                ,   [recovery-remitted]         [DECIMAL](19, 4)            '$."recovery-remitted"'
                ,   [remaining-term]            [DECIMAL](19, 4)            '$."remaining-term"'
                ,   [risk-grade]            [NVARCHAR](100)         '$."risk-grade"'
                ,   [scra-modified-flag]            [BIT]               '$."scra-modified-flag"'
                ,   [unpaid-accrued-interest]       [DECIMAL](19, 4)            '$."unpaid-accrued-interest"'
                ) AS a --Attributes
            ORDER BY d.id;
        END TRY
        BEGIN CATCH
            SELECT ERROR_NUMBER(), ERROR_MESSAGE()
        END CATCH
    ELSE
    BEGIN
            PRINT 'malformed loans json at Script Task Source'
    END

This script is used as a OLE DB Source task in an SSIS data flow.  If I use the WITH RESULT SETS in the Script Task, SSIS does not complain and the project builds but when I execute it from the ETL server, it returns an error:
    Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has
    occurred. Error code: 0x80040E14.
    An OLE DB record is available.  Source: "Microsoft SQL Server
    Native Client 11.0"  Hresult: 0x80040E14  Description: "EXECUTE
    statement failed because its WITH RESULT SETS clause specified
    1 result set(s), but the statement only sent 0 result set(s) at
    run time.".
    An OLE DB record is available.  Source: "Microsoft SQL Server
    Native Client 11.0"  Hresult: 0x80040E14  Description: "Cannot
    bulk load because the file
    "\\Sharepath\to\my\location\myjsonfile-20221026.json" could not
    be opened. Operating system error code 5(Access is denied.).".

If I remove the 'WITH RESULT SETS' from the Source Task, SSIS kicks up a fuss:
    Exception from HRESULT: 0xC020204A
    Error at dft - myFlow [JSON Source Loans [2]]: SSIS Error Code
    DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code:
    0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server
    Native Client 11.0"  Hresult: 0x80004005  Description: "The
    metadata could not be determined because statement 'EXEC
    sp_executesql @sql, N'@json nvarchar(max) out', @json OUT'
    contains dynamic SQL.  Consider using the WITH RESULT SETS
    clause to explicitly describe the result set.".

    Error at dft - myFlow [JSON Source Loans [2]]: Unable to
    retrieve column information from the data source. Make sure
    your target table in the database is available.

It seems no matter which direction I go, I get an error.  I can set the Script Task Property ValidateExternalMetadata=FALSE, and compile but I still get the same error when executing from the SSIS Catalog (as a SQL Agent Job).
If one of you kind peeps has some insight into the proper method to use dynamic SQL, OPENROWSET inside of an SSIS OLEDB (as sql script) Source with or without "WITH RESULT SETS", I would appreciate your guidance.


text:
Q: In a transformer why do we consider the lost voltage to resistance negligible? In my text book it says:
"The induced emf in the primary coil opposes the pd applied to the primary coil,$V_p$. Assuming the resistance of the primary coil is negligible, so all the applied pd acts against the induced emf in the primary coil, the applied pd is $V_p = \frac{\Delta \phi}{\Delta t}$."
Now I have some worries about this, consider a circuit containing only the primary coil and the ac supply. In this circuit the only resistance is across the wires in the coil, if this resistance is tiny we would expect that the current is huge since the product of the resistance and this current must be equal to the voltage. Now lets say we turn it off and add in the other components of our transformer and then switch it back on. Now we get a back emf and we get losses in voltage thanks to the resistance in our coil. Since all voltage must be lost across this coil we can say that:
$V_p -I_pR_p= \frac{\Delta \phi}{\Delta t}$
And we know $R_p$ is small but I dont see how we know $I_p$ is not a large number, because in order to know that we would have to determine somehow that $\frac{\Delta \phi}{\Delta t}$ is really close to $V_p$ or we'd need some kind of extra information. Because I would think it might be possible from just this information that there would be large losses to just like in the circuit with just the primary coil alone in it. I'm probably missing something and I'll post the page in the book so you can call me out on being stupid when it is inevitably right there.  Thankyou! -Michael PAGE IMAGE HERE

A: "[C]onsider a circuit containing only the primary coil and the ac supply. In this circuit the only resistance is across the wires in the coil, if this resistance is tiny we would expect that the current is huge since the product of the resistance and this current must be equal to the voltage."
You seem to be thinking that the primary has a back-emf induced in it only when there is a secondary. But the primary, with an alternating current in it, will produce an alternating magnetic flux in the core, and that will induce a back-emf in the primary. The effect is called self-inductance. The resultant emf in the primary circuit will therefore be small, and the current will be small, despite the low resistance of the primary coil.
[When we do add a secondary coil, and connect a load resistance to it, so an there is now an alternating current in the secondary coil, this will produce its own flux in the core, resulting, it turns out, in a larger current in the primary. This is getting quite complicated, and the operation of a loaded transformer isn't usually analysed in terms of flux changes before university.]


text:
Q: Monitor for dynamic changes to HTML Div using JQuery I have a browser based chat application where individual div's are created for each chat.
The whole chat is managed by an external module and I don't have access to their code.
Note that there are no ids anywhere, only css class names for the divs created dynamically for chat windows.
Whenever a new chat conversation starts, a new div for that chat (with css class:chat_incoming) is created under the parent div (with css class:'tabcontent').
Using jQuery, how do I monitor the parent (with css class:tabcontent) div for any changes like new child addition (with css class:chat_incoming) ??
I don't have a click event here that I can use to monitor the div and neither do I have the div loaded up right after the chat messenger window loads up. The chat initiation may happen anytime after the user logs in and until then the parent div would not have a child div created for chat.
I did some homework myself that went no where.
With jQuery, I kind of understood that I may have to use '.on' to be able to monitor events for divs already available / created dynamically, but I dont have a click event here to use with the JQuery .on().
My next guess was to use
$('tabcontent').bind('DOMNodeInserted DOMNodeRemoved', function(event) {alert('hi')});

but for some reason this doesn't seem to work either? (see fiddle here)
Any guidance appreciated.
Thank you.

A: Your jQuery is looking for tabcontent, not .tabcontent. As in a tag called tabcontent, not a class called tabcontent
Change that and it should start working (hopefully, if everything else is fine in the script)
$('.tabcontent').bind('DOMNodeInserted DOMNodeRemoved', function(event) {alert('hi')});

A: You can try this..
$(".tabcontent").bind("DOMSubtreeModified", function() {
    alert("tree changed");
});

Hope this helps


text:
Q: How to stop LocationDisplayManager listening to location updates ESRI ArcGiS Android 10.2.9?  LocationDisplayManager lDisplayManager = null;

    lDisplayManager = mMapView.getLocationDisplayManager();
    lDisplayManager.setAutoPanMode(LocationDisplayManager.AutoPanMode.OFF);

    lDisplayManager.setLocationListener(new LocationListener() {

        @Override
        public void onLocationChanged(Location location) {

            double locy = location.getLatitude();
            double locx = location.getLongitude();

            SetMyLocationPoint(locx, locy);

        }

        @Override
        public void onStatusChanged(String provider, int status, Bundle extras) {

        }

        @Override
        public void onProviderEnabled(String provider) {

        }

        @Override
        public void onProviderDisabled(String provider) {

        }
    });

Using the above code  i was able to retrieve users current location and display it on Map . Its works perfectly , the problem comes in when user moves from one location to another location , the map also gets updated . In my application scenario the location are meant to be fetched only one time when use hits the LOCATE ME button where as there is no need to get continues location from user .
I did tried following codes
this.lDisplayManager.stop();
mMapView.getLocationDisplayManager().stop();
lDisplayManager.setLocationListener(null);

Above code works but i have to call them manually to stop continues location updates . Is there any alternative way to fetch location only single time instead of continues .


text:
Q: Show div on mouse click and scroll div into view within a scrollable container? I have rows of data contained within a scrollable div, and a user can expand a row to show more information if they click on DIV 1 which is contained within each row. DIV 2 which contains more information is then displayed/toggled using jquery.
So my design looks like so:
|- - - - - - -
|Row 1
|Row 2
|Row 3
|Row 4
|etc..
 - - - - - - - - -

the segregated lines around my rows is my scrollable div container.
When a user clicks Div 1 this then shows Div2
|- - - - - - - - - - - -
| Row 1
|Div 2 (Now Showing)
|Row 2
|Row 3
|Row 4
 - - - - - - - - - - -

as you can see in this example my scrollable container is at the top so div 2 is in view in this instance when the user has clicked on div 1 within row 1. however if a user then clicks on DIV 1 contained within row 4, which would then show div 2 underneath row 4, without the user having to manually scroll down they can not see DIV 2 as it is displayed outside of the scrollable container.
The user would have to manually have to scroll down, which could be exhausting depending on which row they are clicking on.
So my question is, how do I get my DIV2 to always scroll into view to the user?
so in effect what we would have is:
|- - - - - - - - - - - -
| Row 1                    <--- User does not scroll the outer container
|Div 2 (Now Showing)            up or down.
|Row 2                              |
|Row 3                       < - - -|
|Row 4  <---- User clicks on DIV 1 within Row 4 without scrolling.
 - - - - - - - - - - -

Then...
|- - - - - - - - - - - -
|Row 4                  <--- Without the user needing to scroll the
|Div 2  (Now Showing)        outer container.
|Row 5    /\                          |
|Row 6    |                    < - - -|
|Row 7    |--- Div 2 automatically scrolls into view.
     - - - - - - - - - - -

I'm brand new to jquery so would appreciate it if someone could show me where i'm going wrong, thanks in advance.
<script>

$(".details").click(function()
{
    $(this).parent().next('.request_details').toggle();

});

</script>

<script>
    $(".request_details").ready(function(){
    $("html, body").delay(2000).animate({
        scrollTop: $('#search_results').offset().top
    }, 2000);
});
</script>


text:
Q: WebView getDrawingCache() always returning null I'm just fooling around with a webView on API17 and I've come to this problem.
Here's the code:
WebView webView = (WebView) convertView.findViewById(R.id.webView1);

webView.loadUrl("file:///android_asset/www2/info.htm");
if (webView.getProgress()==100){
       webView.setDrawingCacheEnabled(true);
       webView.buildDrawingCache();
       Bitmap bitmap =    Bitmap.createBitmap(webView.getDrawingCache());
       webView.setDrawingCacheEnabled(false);
    }

After this, I will just play around with the bitmap. The problem is an null pointer exception at the .getDrawingCache. info.htm is displayed correctly in the web view when the progress is at 100. I don't know why the getDrawingCache gives nothing back.
I looked up all stackexchange threads to this problem, but none of the solutions helped me.
Anyone got an idea?
greetings