text:
Q: Scrollview doesnt work when scrolled on webview on android version lower than 16 <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fbutton="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/progressBarLL"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:background="@color/app_background_color"
        android:gravity="center"
        android:visibility="visible">

        <ProgressBar
            android:id="@+id/progressBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <ScrollView
        android:id="@+id/scrollableContent"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentTop="true"
        android:scrollbars="none">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="4dp">

            <LinearLayout
                android:id="@+id/navigationControlLinearLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:padding="5dp"
                android:weightSum="4">

                <ImageView
                    android:id="@+id/previousPageImageView"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:src="@drawable/previous_page_darken" />

                <TextView
                    android:id="@+id/dealsPageNumberStatus"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:gravity="center"
                    android:text="1/50"
                    android:textSize="@dimen/text_size_medium" />

                <ImageView
                    android:id="@+id/nextPageImageView"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:src="@drawable/next_page_darken" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/dealsFragmentLinearLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginBottom="@dimen/margin_large"
                android:layout_marginLeft="@dimen/margin_normal"
                android:layout_marginRight="@dimen/margin_normal"
                android:layout_marginTop="4dp"
                android:background="@drawable/background_with_shadow"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="6"
                    android:orientation="horizontal"
                    android:paddingTop="0dp">

                    <ImageView
                        android:id="@+id/dealsFragmentImage"
                        android:layout_width="0dp"
                        android:layout_height="match_parent"
                        android:layout_gravity="center"
                        android:layout_weight="2"
                        android:background="@android:color/transparent"
                        android:minHeight="@dimen/min_image_height"
                        android:padding="5dp"
                        android:src="@drawable/test_logo" />

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="4.00"
                        android:orientation="vertical"
                        android:padding="@dimen/padding_normal">

                        <TextView
                            android:id="@+id/dealsFragmentTitle"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:ellipsize="end"
                            android:maxLines="2"
                            android:text="This text is intentionally made larger to go beyound 2 lines"
                            android:textSize="@dimen/text_size_medium"
                            android:padding="@dimen/padding_normal" />

                        <TextView
                            android:id="@+id/dealsTimeSubmitted"
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            android:layout_gravity="center"
                            android:layout_weight="1"
                            android:ellipsize="end"
                            android:maxLines="2"
                            android:text="about an hour ago "
                            android:textColor="@color/light_grey"
                            android:textSize="@dimen/text_size_small"
                            android:padding="@dimen/padding_normal" />

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            android:layout_weight="2"
                            android:orientation="horizontal"
                            android:padding="@dimen/padding_normal">

                            <TextView
                                android:id="@+id/dealsCurrentPrice"
                                android:layout_width="wrap_content"
                                android:layout_height="match_parent"
                                android:gravity="left|center"
                                android:padding="4dp"
                                android:text="Rs. 135"
                                android:textColor="@color/deals_blue"
                                android:textSize="@dimen/text_size_large"
                                android:textStyle="bold" />

                            <TextView
                                android:id="@+id/dealsOffPercent"
                                android:layout_width="wrap_content"
                                android:layout_height="match_parent"
                                android:gravity="left|center"
                                android:padding="4dp"
                                android:text="(90% off)"
                                android:textColor="@color/deals_blue"
                                android:textSize="@dimen/text_size_medium" />

                            <TextView
                                android:id="@+id/dealsOriginalPrice"
                                android:layout_width="wrap_content"
                                android:layout_height="match_parent"
                                android:gravity="left|center"
                                android:padding="4dp"
                                android:text="1235698"
                                android:singleLine="true"
                                android:textColor="@color/light_grey"
                                android:textSize="@dimen/text_size_small" />
                        </LinearLayout>

                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="2"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:gravity="left|center"
                        android:paddingLeft="4dp"
                        android:text="@string/submitted_by"
                        android:textColor="@color/light_text"
                        android:textSize="@dimen/text_size_small" />

                    <TextView
                        android:id="@+id/dealsFragmentSubmittedBy"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:gravity="left|center"
                        android:text=" aniket007"
                        android:textColor="@color/deals_blue"
                        android:textSize="@dimen/text_size_small" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:gravity="left|center"
                        android:text=" in "
                        android:textColor="@color/light_text"
                        android:textSize="@dimen/text_size_small" />

                    <TextView
                        android:id="@+id/dealsCategory"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:ellipsize="end"
                        android:gravity="left|center"
                        android:maxLines="1"
                        android:paddingRight="4dp"
                        android:text="Mobiles and Mobile Accessories"
                        android:textColor="@color/deals_blue"
                        android:textSize="@dimen/text_size_small" />
                </LinearLayout>

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:layout_marginTop="10dp"
                    android:background="@color/item_separator"
                    android:layout_marginLeft="@dimen/margin_normal"
                    android:layout_marginRight="@dimen/margin_normal" />

                <WebView
                    android:id="@+id/dealDetail"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="10dp"
                    android:contentDescription="@string/top_deals"
                    android:textSize="@dimen/text_size_medium" />

                <include
                    layout="@layout/list_item_deal_footer"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
           />
            </LinearLayout>

            <!--<LinearLayout
                android:id="@+id/dealsFragmentCommentLinearLayout"
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:background="@color/deals_footer"
                android:orientation="horizontal">

                <View
                    android:layout_width="1dip"
                    android:layout_height="fill_parent"
                    android:background="@color/flat_grey" />

                <ImageView
                    android:id="@+id/dealsFragmentLikeImage"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginRight="5dp"
                    android:layout_weight="1"
                    android:src="@drawable/comment_icon" />

                <View
                    android:layout_width="1dip"
                    android:layout_height="fill_parent"
                    android:background="@color/flat_grey" />

                <ImageView
                    android:id="@+id/dealsFragmentDislikeImage"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginRight="5dp"
                    android:layout_weight="1"
                    android:src="@drawable/comment_icon" />

                <View
                    android:layout_width="1dip"
                    android:layout_height="fill_parent"
                    android:background="@color/flat_grey" />

                <ImageView
                    android:id="@+id/dealsFragmentShareImage"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_weight="1"
                    android:src="@drawable/popularity_icon" />

                <View
                    android:layout_width="1dip"
                    android:layout_height="fill_parent"
                    android:background="@color/flat_grey" />
            </LinearLayout>

            <info.hoang8f.widget.FButton
                android:id="@+id/viewCommentsButton"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_margin="10dp"
                android:minHeight="@dimen/fb_button_min_height"
                android:text="@string/viewComments"
                android:textColor="@android:color/white"
                android:textSize="@dimen/text_size_medium"
                fbutton:buttonColor="@color/fbutton_default_color"
                fbutton:cornerRadius="5dp"
                fbutton:shadowColor="@color/fbutton_default_shadow_color"
                fbutton:shadowEnabled="true"
                fbutton:shadowHeight="2dp" />-->

            <info.hoang8f.widget.FButton
                android:id="@+id/buyNowButtonPlaceHolder"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:minHeight="@dimen/fb_button_min_height"
                android:text="@string/buy_now"
                android:textColor="@android:color/white"
                android:textSize="@dimen/text_size_medium"
                android:visibility="invisible"
                fbutton:buttonColor="@color/fbutton_default_color"
                fbutton:cornerRadius="5dp"
                fbutton:shadowColor="@color/fbutton_default_shadow_color"
                fbutton:shadowEnabled="true"
                fbutton:shadowHeight="2dp" />
        </LinearLayout>
    </ScrollView>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#ccffffff">

        <info.hoang8f.widget.FButton
            android:id="@+id/buyNowButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_margin="10dp"
            android:minHeight="@dimen/fb_button_min_height"
            android:minWidth="@dimen/buy_now_button_width"
            android:text="@string/buy_now"
            android:textColor="@android:color/white"
            android:textSize="@dimen/text_size_medium"
            fbutton:buttonColor="@color/fbutton_default_color"
            fbutton:cornerRadius="5dp"
            fbutton:shadowColor="@color/fbutton_default_shadow_color"
            fbutton:shadowEnabled="true"
            fbutton:shadowHeight="2dp" />
    </RelativeLayout>

</RelativeLayout>

I am using WebView inside ScrollView and it does work correctly on android versions higher than 16. But on lower version page do not get scrolled when scrolled on webview. Page does get scrolled from right side of page. Links too do not open when clicked on left side but does open from right side.
found few solutions like android:hardwareAccelerated="true", but not working.


text:
Q: How do I change another program's window's size? How can I change another program's -- let's say Skype's -- window's size, from my C# program?

A: You need to get the window handle of the other program, use Process.MainWindowHandle or FindWindow.
Having this, you can PInvoke SetWindowPos() to move, resize, change the Z-order or the min/max/restore state of the window.

A: You can use MoveWindow (Where hWnd is the window you want to move):
[DllImport("user32.dll", SetLastError = true)]
internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

MoveWindow(ApplicationHandle, 600, 600, 600, 600, true);

If you don't know the window pointer, you can use the FindWindow functionality.
Also worth a read is MSDN SetWindowPos (Very similar to MoveWindow).

A: I would use the Windows Api SetWindowPos
check this one out: Using SetWindowPos in C# to move windows around
of course first you should know the handle of the window you want to resize, this can be done in many ways like getting the process by name then the MainWindow of that process or with EnumWindow or FindWindow APIs

redpajama_set_name: RedPajamaStackExchange


text:
Q: Styles and Resources in App.xaml won't apply to controls at run-time in Visual Studio Extension I'm building a visual studio extension and i'm trying to use some application wide styles i created. Usually, in a visual studio generated WPF application there would be an App.xaml in which you can specify application resources.
When creating the extension, one of these documents was not created. I assumed i would be able to add my own and be able to use resources from it as i pleased. I made one and i am able to access its resources in other .xaml's (see a small snippet below)
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         x:Class="Applcation.App">
<Application.Resources>
    <BitmapImage x:Key="CrossIcon" UriSource="Resources/CrossIcon.png" />
    <BitmapImage x:Key="ErrorIcon" UriSource="Resources/ErrorIcon.png" />
    <BitmapImage x:Key="FlareLogo30" UriSource="Resources/Flare Logo H30.png" />
    <BitmapImage x:Key="PlussIcon" UriSource="Resources/PlussIcon.png" />
    <BitmapImage x:Key="WarningIcon" UriSource="Resources/WarningIcon.png" />
    <BitmapImage x:Key="ThumbsUpIcon" UriSource="Resources/ThumbsUpIcon.png" />

</Application.Resources>

I can then go ahead and use these in the designer, and they will display correctly.
<Image Grid.Row="0" Grid.Column="0" Name="Image" Source="{DynamicResource WarningIcon}" Margin="10,10,10,10"/>

The issue comes when i launch the visual studio debug instance, and load up my extension, none of these resources appear to be accessible, as images wont show up, and styles wont be applied. These images are also specified as resources in their build action.
Presumably there is something else i have to do in order to register my global resources. I have Google'd around but have not been able to find any documentation on the subject. What do i have to do in order to get these resources recognizable at run-time?

A: In the end i have gone with using a basic ResourceDictionary which i have included in all of my xaml's. This loads the images and styles correctly.


text:
Q: Integrating PayPal Smart Payment API with old Express Checkout API We currently have a system in place to process PayPal payments. It is done using the Express Checkout API. The method DoAuthorization accepts a 17 char TransactionID as a parameter.
I'm trying to implement the new PayPal Smart Payment Buttons API. I have the flow programmed with the intent=AUTHORIZE but I can only grab the Authorization ID and Order ID (both 17 char values) from the Auth response once its completed.
When I try and authorize the order and pass one of the 2 values into the DoAuthorization method, returns with an error: TransactionID invalid (10609).
My question is it possible to use the Smart Payments API Authorization ID and Order ID and pass it into the Express Checkout DoAuthorization method and still make the 2 systems work?
Could it be possible that I'm getting the 10609 error because the intent=Authorize already authorizes the order and I need to call the DoCapture method?

A: It is possible to use the SPB user interface, but not its API (actually it's built on the v2/orders REST API)
You can't mix v2/order API payment setups, with classic captures.
So, so long as you are using classic API calls to capture (this is a very unfortunate requirement that I would advise eliminating ASAP, but it's in your question) -- then, you need to also keep using classic API calls to set up the payment.
See the server demo pattern: https://developer.paypal.com/demo/checkout/#/pattern/server
The createOrder portion will do an XHR fetch to your server, which will then call the classic SetExpressCheckout and return an EC token.  SPB will use the classic EC token, but show its new UI.


text:
Q: How to fix "Add to Favorites" menu item when adding Konsole to Gnome 3 favorites Normally in Gnome 3 to add an Application the Favorites, you can launch it, then right click the app icon in the doc and select "Add to Favorites".
But on Ubuntu 16.04 specifically for the "Konsole" application, the "Add to Favorites" option is missing from the context menu.
I can drag the Konsole application the application launching menu, but this creates a dock entry that only launches new Konsole windows, which generate a second menu entry. If it matters I'm using the "Dash to Dock" extension.
Thanks.


text:
Q: Cannot theme windows in Advanced Settings in GNOME 3.2 I am running gnome 3.2.1 and am trying to configure my themes under the Advanced Settings Menu. All of the options, (Shell theme, cursor, icon, GTK) work correcly and are themed accept for the Window theme section.
No matter what I choose, nothing changes and my window ui is simply a dark grey box with a white x on the top right.
Any suggestions?

A: You have to restart the shell after changing it, to apply the new theme:
Alt+F2, write r and press Enter.
If it's still not working, launch the advanced settings from the terminal (gnome-tweak-tools) and look if there's some sort of problem reported.


text:
Q: Find only increasing values from one line to the next I would like to print out values (or identify lines) that do not increase from one line to the next.
Perl, Awk/Sed, bash, or python...any will do.
1001

1002

1003

1004

1005

1006

1007

1004

1008

1009

This should locate from "1007" to the next line "1004" and identify one line or the other or both.

A: This can be a way:
awk 'prev>=$1 {print $0, "<----"; a[$1]=NR; next} prev=$1;
    END{print "** repeated lines **";
        for (i in a) print "line "a[i]" value",i; printf "\n"}' file

Test
$ awk 'prev>=$1 {print $0, "<----"; a[$1]=NR; next} prev=$1; END{print "** repeated lines **"; for (i in a) print "line "a[i]" value",i; printf "\n"}' a
1001
1002
1003
1004
1005
1006
1007
1004 <----
1008
1009
** repeated lines **
line 8 value 1004

With other input:
$ cat a
1006
1007
1004
1008
1009
133
1333
123
$ awk 'prev>=$1 {print $0, "<----"; a[$1]=NR; next} prev=$1; END{print "** repeated lines **"; for (i in a) print "line "a[i]" value",i; printf "\n"}' a
1006
1007
1004 <----
1008
1009
133 <----
1333
123 <----
** repeated lines **
line 8 value 123
line 6 value 133
line 3 value 1004

A: if you have sort, it can give all you need. with the option -c check man page.
for example, with your data:
kent$  echo "1001
1002
1003
1004
1005
1006
1007
1004
1008
1009"|sort -c
sort: -:8: disorder: 1004

so you got line number and that line.

A: Perl solution:
perl -ne 'print $previous if $_ < $previous; $previous = $_' input.txt

Just remember the previous line, compare, print if needed.

A: Python based solution using the data from @fedorqui's solution:
>>> from itertools import tee, izip
with open('abc1') as f:
    t1, t2 = tee(f)
    next(t2)
    for line1, line2 in izip(t1, t2):
        if int(line1) > int(line2):
            print line1, line2
...
1007
1004

1009
133

1333
123


text:
Q: Shopify public app with MVC views not working Simple .net MVC app. After installing my app I see the welcome screen (embedded) within the Shopify admin panel. For some reason Shopify will NOT load any View that contains a <form> tag
<form asp-action="Login" asp-controller="Account" method="post" class="form-horizontal" role="form">
 ... blah blah blah
</form>

How can I make this work with Views that have forms?

A: Doing it like this works:
<form action="/Account/Login" method="post" class="form-horizontal" role="form">


text:
Q: how to defaults.removeObjectForKey("") properly swift I have the following:
                let defaults: NSUserDefaults = NSUserDefaults.standardUserDefaults()
                let phone = defaults.objectForKey("phone") as String
                println(phone)
                defaults.removeObjectForKey("phone")
                println("phone2\(phone)")

The prints are showing the same result despite attempted unset, results such as "5" or "6".

A: You're printing the variable phone, removeObjectForKey is not going to update the variable phone. So, you've to get the updated value from NSUserdefaults,
let defaults: NSUserDefaults = NSUserDefaults.standardUserDefaults()
defaults.setObject("Hello", forKey: "phone")
let phone = defaults.objectForKey("phone") as String
// This will save your value in `phone`
// Do not synchronize after removing the key, if you want 'value' for your key 'phone' after your application terminated
defaults.synchronize()
println(phone)
defaults.removeObjectForKey("phone")

// Get the updated value,
let updatedPhone = defaults.objectForKey("phone") as String?
// This will save nil in your `phone` key, make sure that what you want
defaults.synchronize()
println("phone2\(updatedPhone)")

Like @Lyndshey said, you don't have to Synchronize, because it'll happen automatically at periodic intervals. But if you can't wait for it and your app is going to exit, you can Synchronize, but really this is performance issue.
Please check Apple Documentation, and also check this Stackoverflow answer

A: Answer is simple. You are printing the previously assigned phone variable. You need to again retrieve the value from NSUserDefaults to check whether it exists or not.
let defaults: NSUserDefaults = NSUserDefaults.standardUserDefaults()
var phone = defaults.objectForKey("phone") as String
println(phone)
defaults.removeObjectForKey("phone")
if let phone = defaults.objectForKey("phone") as? String
{
        println("phone2\(phone)")
}
else
{
        println("Value is nil")
}


text:
Q: Why won't my OCE c360 print on upgrade to 14.04 Our office uses OCE c360 by Konica Minolta and the generic driver (PCL 5e) only prints black and white, so we use the Linux driver provided by Konica Minolta, but that won't print at all and sometimes makes the printer hang so that it needs to be unplugged.
In 13.10 it worked fine to have one printer as the generic B/W printer, and install a new printer using the KOC360opn.ppd and this was great (even though it would only print one sided).
Upon upgrade to 14.04, the generic driver is unreliable and the KOC360 driver won't print at all.
Do I need a different driver?

A: Instead of using the Konica PPD, use the Generic - PDF option. When choosing the options, instead of using PCL5e, choose PDF and most if not all of the regular options for duplex, color, page size are all available and work well.
It only took me 4 years to find it.


text:
Q: Importing Delimited File to Excel with Macro; Run-time error '1004' I have a list of CSV files I want to import into a blank Excel spreadsheet.
I tried to import one file using the code shown below, but I get a run time error:
Run-time error '1004': Application-defined or object-defined error

The error is triggered by the following line:
With ActiveSheet.QueryTables.Add(Connection:=strConnexn, Destination:=Range("$A$1"))

I saw the StackOverflow example at "Importing Delimited File to Excel with Macro (.CommandType = 0)"
The line of code where my macro "subImportIntermediaCSVCallLogs_aaa" chokes seems to my ignorant mind be identical to the StackOverflow example; but obviously I am mistaken.
Although I usually can figure out Word's vba, I have no experience coding in Excel vba, and I do not know where to look for an explanation.
Once I get the macro "subImportIntermediaCSVCallLogs_aaa(strCSV_Fullname)" running, my plan is to use the macro "subRunMacroOnSeveralCSV_files()" to import a bunch of CSV files into the same spreadsheet, with each import beginning 4 lines beneath the previous import.
Please let me know if you think that that is unwise.
Any help would be much appreciated.
Here is my code:
Sub subImportIntermediaCSVCallLogs_aaa(strCSV_Fullname)
'
    Dim strConnexn As String

    strConnexn = Chr(34) & "TEXT;" & strCSV_Fullname & Chr(34)
    MsgBox strConnexn

    Application.CutCopyMode = False
    With ActiveSheet.QueryTables.Add(Connection:=strConnexn, Destination:=Range("$A$1"))
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = 437
        .TextFileStartRow = 1
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = False
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = True
        .TextFileSpaceDelimiter = False
        .TextFileOtherDelimiter = False
        .PreserveFormatting = True
        .FieldNames = True
        .TextFileColumnDataTypes = Array(1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
        .TextFileParseType = xlDelimited
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
    End With
    Range("A1,1:1048576").Select
    Columns("A:A").EntireColumn.AutoFit
    Columns("B:B").EntireColumn.AutoFit
    ActiveCell.SpecialCells(xlLastCell).Select

    ActiveSheet.Cells(ActiveSheet.Rows.Count, Selection.Column).End(xlUp).Select
    ActiveCell.Offset(4, 0).Select

End Sub ' End of subImportIntermediaCSVCallLogs_aaa(strCSV_Fullname)

Sub subRunMacroOnSeveralCSV_files()
    Dim strCSV_Fullname As String
    strCSV_Fullname = "E:\Intermedia\CallHistory\callhistory01.csv"
    strCSV_Fullname = "E:\Intermedia\CallHistory\callhistory02.csv"
    strCSV_Fullname = "E:\Intermedia\CallHistory\callhistory03.csv"
    subImportIntermediaCSVCallLogs_aaa strCSV_Fullname

End Sub ' End of subRunMacroOnSeveralCSV_files()


text:
Q: Error con un botón de agregar a favoritos en react estoy realizando una aplicación web con react y redux y tengo problemas con un boton:
La pagina  tiene 3 screen (home, favoritos , login) y un search dentro del home para buscar los personajes y puedes colocar el nombre de ellos y buscarlos si el nombre que colocaste en el search coincide con el de algunos de los personajes se mostrará una card, la cual contiene un BOTON (este es el del problema), este botón tiene una condición la cual verifica si este personaje se encuentra dentro de los favoritos, de ser así el botón figurará como delete y ejecuta una función para eliminar de favoritos y si NO está en favoritos el boton figurará como add y ejecutará una función para agregar a favoritos:
El Boton FUNCIONA BIEN en primera instancia puedo eliminar  y agregar a favoritos con un  solo click y cambia su apariencia (esto lo hace las veces que el usuario desee) , EL PROBLEMA APARECE CUANDO:
[escenario]
-una vez que dí click al botón agregar (el personaje se agregó correctamente) y luego me muevo a otra sección del sitio
-luego me vuelvo a colocar en el search y  vuelvo a colocar el nombre del mismo personaje que anteriormente lo habia agregado a fav : AHORA EL BOTON APARECE COMO DELETE PERO NO EJECUTA NINGUNA FUNCIÓN SIMPLEMENTE SE QUEDA Y NO EJECUTA NINGUNA FUNCIÓN.

Codigo:
import React from 'react';
import { connect } from 'react-redux';
import styles from '../home/home.module.css';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faStar, faTrash} from '@fortawesome/free-solid-svg-icons';
import {removePoke, addFavPoke} from '../../actions/actions'
function Pikacard({stado, addFavPoke,removePoke, movies}){
console.log(movies.filter(x => x.names === stado.names).length);
    return (
        <>

{stado.names}

{stado.valordepelea}

{stado.type}

{stado.habilidad}

{stado.moves}

No pierdas tiempo y añade a {stado.names} a tu lista de favoritos

Todos el universo Pokemon te está esperando solo tienes que buscarlos

    {movies.filter(x => x.names === stado.names).length > 0 & <button onClick={()=>removePoke(stado)} className="btn btn-danger btn-sm"><FontAwesomeIcon icon={faTrash}/> remove</button>}
    : <button  className="btn btn-success btn-sm" onClick={(e)=>addFavPoke(stado)} ><FontAwesomeIcon icon={faStar}/> Fav</button>

        </>
    )

}
const mapStateToProps = (state) => {
    return {
        movies: state.moviesfav
    };
};

export default connect(mapStateToProps, { removePoke, addFavPoke })(Pikacard);

Para ser más especifico el error con el boton estaria sucediendo acá
{movies.filter(x => x.names === stado.names).length > 0 & <button onClick={()=>removePoke(stado)} className="btn btn-danger btn-sm"><FontAwesomeIcon icon={faTrash}/> remove</button>}
    : <button  className="btn btn-success btn-sm" onClick={(e)=>addFavPoke(stado)} ><FontAwesomeIcon icon={faStar}/> Fav</button>

[aclaración movies es el array con los personajes favoritos que se encuentra dentro de mi store de redux]
[stado son los datos del pokemon que recibe la card entre las propiedades]
[removepoke y addpoke son las actions creators que realizan el dispatch]
[names es el nombre de la propiedad que tienen los personajes , la cual su valor es el nombre del personaje]

A: Parece que el problema esta en el operador condicional ternario y en el cierre de la expresión JSX, dentro de la pieza de código del botón:
{movies.filter(x => x.names === stado.names).length > 0 & <button onClick={()=>removePoke(stado)} className="btn btn-danger btn-sm"><FontAwesomeIcon icon={faTrash}/> remove</button>}
    : <button  className="btn btn-success btn-sm" onClick={(e)=>addFavPoke(stado)} ><FontAwesomeIcon icon={faStar}/> Fav</button>

Aquí, el simbolo & no es válido:
{movies.filter(x => x.names === stado.names).length > 0 &

Debería ser ?:
{movies.filter(x => x.names === stado.names).length > 0 ?

Luego, el cierre de los curly braces se hace despúes de ...remove</button>} : <button...:
{...<FontAwesomeIcon icon={faTrash}/> remove</button>}
        : <button  className="btn btn-success btn-sm" onClick={(e)=>addFavPoke(stado)} ><FontAwesomeIcon icon={faStar}/> Fav</button>

Y debería ir al final de toda al expresión que usa el operador condicional ternario:
{...<FontAwesomeIcon icon={faTrash}/> remove</button>
        : <button  className="btn btn-success btn-sm" onClick={(e)=>addFavPoke(stado)} ><FontAwesomeIcon icon={faStar}/> Fav</button>}

Entonces, esa pieza de código debería ir de esta forma:
 {
  movies.filter(x => x.names === stado.names).length > 0 ? <button onClick=    {()=>removePoke(stado)} className="btn btn-danger btn-sm"><FontAwesomeIcon icon={faTrash}/> remove</button>
        : <button  className="btn btn-success btn-sm" onClick={(e)=>addFavPoke(stado)} ><FontAwesomeIcon icon={faStar}/> Fav</button>
}

Dime si esto fue de ayuda, estoy tratando de emular el problema de mi lado y noté este pequeño detalle antes de pasar a construir las funciones connect.


text:
Q: how to send an email in nodejs I read the following, Sending emails in Node.js? but I'm looking for a way to send an email, not through an smtp server. As in the linux envirement you have different options such as sendmail and others
I could ofc use the environment I'm in to make use of the already existing functionality, but I would be interested to learn how one would dispatch the email using only js, if even possible..

I set up an smtp server using the smtp module: https://github.com/andris9/smtp-server why I'm interested in the delivery part of a server I already setup.

A: Take a look at node-mailer. You can set it up without smtp server. https://github.com/nodemailer/nodemailer

A:      var nodemailer = require('nodemailer');
     var send = require('gmail-send');
     var mailserverifo = nodemailer.createTransport({
     service: 'gmail',
     host : "smtp.gmail.com",
     port : "465",
     ssl : true,
     auth: {
     user: 'email@gmail.com',
     pass: 'password@'
    }
    });
      var Mailinfo = {
      from: 'email@gmail.com',
      to: 'email@info.com',
      subject: 'Testing email from node js server',
      text: 'That was easy!'
     };

    mailserverifo.sendMail(Mailinfo, function(error, info){
    if (error) {
     console.log(error);
    } else {
     console.log('Email Send Success: ' + info.response);
    }
    });

   Enable less secure app form setting -
   https://www.google.com/settings/security/lesssecureapps
   Disable Captcha  -
   https://accounts.google.com/b/0/displayunlockcaptcha

A: You can use sendmail in Node js. I'v using it and it's working fine for me.
npm install sendmail --save

const sendmail = require('sendmail')();

sendmail({
    from: 'no-reply@yourdomain.com',
    to: 'test@qq.com, test@sohu.com, test@163.com ',
    subject: 'test sendmail',
    html: 'Mail of test sendmail ',
  }, function(err, reply) {
    console.log(err && err.stack);
});

https://www.npmjs.com/package/sendmail

A: First:Install nodemailernpm install nodemailer
Then put this into your node file:
var nodemailer = require('nodemailer');
var http = require('http');
var url = require('url');
console.log("Creating Transport")
var transporter = nodemailer.createTransport({
    service:'Hotmail',
    auth: {
        user:'salace2008765@outlook.com',
        pass: 'alice123@'
   }
});
var mailOptions = {
    from:'salace2008765@outlook.com',
    to: 'jerome20090101@gmail.com',
    subject: 'This is a test: test',
    text:'TgK'
}
console.log("Sending mail")
transporter.sendMail(mailOptions, function(error, info) {
    if (error) {
        console.log(error);
    } else {
        console.log('Email sent: ' + info.response)
    }
})

It usally works
Sources:W3Schools and Nodemailer's official site


text:
Q: CSS in the html is not having any effect on the html page which I am converting into pdf using mpf I have one html page which I am converting into pdf using mpdf. The conversions works fine but the pdf is not reading the css in the html page.
The following is the mpdf class
class M_pdf {

    public $param;
    public $pdf;

    public function __construct($param = '"en-GB-x","A4","","",10,10,10,10,6,3')
   // public function __construct($param = "'c','A4','','' , 0 , 0 , 0 , 0 , 0 , 0")
    {
        $this->param =$param;
        $this->pdf = new mPDF();
    }

The HTML page has the following style codes
<style>
     body{
                    width: 21cm;
                    height: 29.7cm;
                    margin-left:auto;
                    margin-right:auto;
                    font-family: 'Montserrat'
                }
                .quotation--summary--head{
                    color: #616161;
                    text-transform: uppercase;
                    font-size:30px;
                    padding-top: 14px;
                    padding-bottom: 10px;
                }
                .heading h4{
                    color: #616161;
                    background-color: #ebedef;
                    padding: 20px 0px;
                    text-align: center;
                    font-size: 25px;
                    text-transform: uppercase;
                    margin-top: 0px;
                    margin-bottom: 0px;
                    letter-spacing: 1px;
                }
</style>

The HTML page is okay it shows everything in the way I want it to be like. The problem arises when it gets converted to pdf.
This is how it shows in the pdf:
ELECTRICAL
ROOM1
241000
1
Case 1 NOTE : note for case1BRAND : brand1
500Sq.Ft x 100
50000
2
Case 2 NOTE : note for case2BRAND : brand2
500Sq.Ft x 120
60000
3
Case 3 NOTE : note for case3BRAND : brand3

Whereas the real HTML page looks like this and this is how I want the pdf to look like as well.

Any help to sort out the issue is welcome.


text:
Q: Como carregar script e ccs externo em uma url blob javascript Quero usar paginas temporarias com o blob mas não está carregando os arquivos externos, é possível fazer isso com o blob? Se não, teria outra maneira de fazer paginas temporárias sem cria-las no servidor, apenas do lado do cliente?
https://codepen.io/markvaaz/pen/ZEEbvMz

function urlBlob(text){
  var blob = new Blob([text], {type: "HTML"});
  var url = window.URL.createObjectURL(blob);
  var a = document.createElement("a");
  a.href = url;
  a.innerHTML = "Clica"
  document.body.appendChild(a)
}
urlBlob(document.body.innerHTML)
<link rel="stylesheet" href="https://app.sollic.com/style-1.0.9.css">

Alguma coisa aqui


text:
Q: Pattern matching repeated arguments of Times I am trying to match against products of elements with a specific pattern. Since a product of symbols A B C is just Times[A,B,C], I figured this could be done by treating Times like any other symbol (here f):
MatchQ[ f[a,b,c], f[_Symbol..] ]
>>> True

Woe, such a pattern doesn't seem to work for Times:
MatchQ[ a b c, Times[_Symbol..] ]
>>> False

MatchQ[ Times[a, b, c], Times[_Symbol..] ]
>>> False

I suspect this may be due to some property of Times related to its commutativity, though there's no auto-commuting in this example!
a b c // FullForm
>>> Times[a, b, c]

How can I produce the desired pattern for matching repeated-pattern arguments of Times?

A: You need wrap the pattern Times[...] with HoldPattern  or Verbatim to prevent Times[_Symbol ..] evaluating to _Symbol.. before MatchQ does its work:
MatchQ[a b c, HoldPattern[Times][_Symbol ..]]

True

MatchQ[a b  c, Verbatim[Times][_Symbol ..]]

True

MatchQ[Times[a, b, c], HoldPattern[Times][_Symbol ..]]

True

MatchQ[Times[a, b, c], Verbatim[Times][_Symbol ..]]

True


text:
Q: producing a installable python module using hg archive vs wheel I wonder if I would release my python modules using:

*

*hg archive and sourceforge download

*wheel and a PyPy hosting

I was using 1 for years now, but I think the right pythonic way to do is 2
Any piece of advice ?
wheel requires pip, wheel, setuptools... it looks quite complicated for a simple module compared to a simple tar extract and a setup.py install.
on the other hand, it seems the pip/wheel is now being somewhat required?

A: It's actually quite simple.
And yes Python wheels are the recommended approach going forward as well as the use of pip to install and maintain installations of packages.
Example: (packaging your module)

*

*Create a setup.py:

*Install wheel

*Register and Upload this to PyPi

Example:
setup.py:
from setuptools import setup, find_packages

setup(
    name="mypackage",
    version="0.0.1",
    description="my description",
    long_description=open("README.rst", "r").read(),
    author="You",
    author_email="Your Email Address",
    packages=find_packages("."),
)

Note: This is a bare minimum example of a setup.py. See Writing the setup script for more infirmation about other "metadata" you can include.
Install wheel so you can build wheels:
$ pip install wheel

Register and Upload your proejct/module to PyPi:
$ python setup.py bdist_wheel register upload

I recommend you have a read of Python Packaging User Guide

Also if you do not have [pip]1[] installed you can eaisly do so using the bootstrap script (as long as you also have Python isntalled):
$ python <(curl -q -o https://bootstrap.pypa.io/get-pip.py)


text:
Q: Hilbert Schmidt norm Suppose $Q \in L(U)$ is non negative operator with $Tr Q < \infty$ where $(U, \langle,\rangle)$ is Hilbert space. Suppose that $e_k, k=0...$ is an orthonormal base of $U$ consisting of eigenvectors of $Q$ with $\lambda_k$ eigenvalues.
Suppose that $U_0=Q^{1/2}(U)$ is the Hilbert space with scalar product
$$\langle u,v\rangle_0=\langle Q^{-1/2}u,Q^{-1/2}v\rangle$$
Call $(L_2^0=L_2(U_0,H),||\cdot||_{L_2^0})$ the Hilbert Schmidt operators from $U_0$ to $H$ where $H$ is another Hilbert space.
Then by the Parseval identity
$$||\Psi||_{L_2^0}^2=\sum_{k,h}^\infty |\langle\Psi g_h,f_k\rangle|^2=\sum_{k,h}^\infty \lambda_h |\langle\Psi e_h,f_k\rangle|^2=\sum_{k,h}^\infty  |\langle\Psi Q^{1/2} e_h,f_k\rangle|^2=||\Psi Q^{1/2} ||_{L_2(U,H)}^2$$
Now why does the following hold [Da prato - Stochastic equations in infinite dimensions 1999] ?
$$||\Psi||_{L_2^0}^2=Tr (\Psi Q \Psi^*)$$
where $g_k=\sqrt{\lambda_k}e_k, k=0...$ is an orthonormal base of $U_0$ and $f_k,k=0...$ is an orthonormal base of $H$

A: Using the definition:
\begin{align}
\|\Psi\|^2_{L_2^0}&=\|\Psi Q^{1/2}\|^2_{L_2(U,H)}=\operatorname{Tr}((\Psi Q^{1/2})^*\Psi Q^{1/2})\\[0.3cm]&=\operatorname{Tr}(Q^{1/2}\Psi^*\Psi Q^{1/2})=\operatorname{Tr}(\Psi Q\Psi^*).
\end{align}
In case the problem is the apperance of the trace,
$$
\sum_{h,k}|\langle \Phi g_h,f_k\rangle|^2=\sum_h\|\Phi g_h\|^2=\sum_h\langle \Phi^*\Phi g_h,g_h\rangle=\operatorname{Tr}(\Phi^*\Phi).
$$


text:
Q: Create Dynamic Field Names based on nested arrays MongoDB I need to flatten out our data structure so that Elastic Search is more easily able to index the documents (I'm also looking at MongoDB Atlas Search for this).
Our current structure is
{
  "_id": {
    "$oid": "60f83d3cd66842301905aa77"
  },
  "id": 527438,
  "name": "CryptoPunk #4050",
  "asset_contract": {
    "name": "CryptoPunks",
    "address": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb"
  },
  "traits": [
    {
      "trait_type": "type",
      "value": "Male",
      "display_type": null,
      "max_value": null,
      "trait_count": 6039,
      "order": null
    },
    {
      "trait_type": "accessory",
      "value": "Mohawk",
      "display_type": null,
      "max_value": null,
      "trait_count": 441,
      "order": null
    },
    {
      "trait_type": "accessory",
      "value": "Earring",
      "display_type": null,
      "max_value": null,
      "trait_count": 2459,
      "order": null
    },
    {
      "trait_type": "accessory",
      "value": "Frown",
      "display_type": null,
      "max_value": null,
      "trait_count": 261,
      "order": null
    }
  ],
  "token_id": "4050",
}

What I'd like to do is flatten out the structure to look like
{
  "_id": {
    "$oid": "60f83d3cd66842301905aa77"
  },
  "id": 527438,
  "name": "CryptoPunk #4050",
  "asset_contract": {
    "name": "CryptoPunks",
    "address": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb"
  },
  "traits_type": "Male",
  "traits_accessory": ["Mohawk", "Earring", "Frown"],
  "token_id": "4050",
}

The contents on the traits array will vary. Sometimes there will be 1 trait within the array, sometimes there will be multiple items of the same trait type (like accessory in this example), and other times there could be 10 items in there each with their own trait_type.
The basic rule I think I want to follow is...

*

*When there traits, create a new field using traits_"$trait_type" as the field name, and use the $value as the new field name value.

*If there are multiple matches for traits_"$trait_type", then $push them into an array (as in the example above).

I've looked at this solution MongoDB Aggregation: add field from an embedded document via a dynamic field path but I'm having trouble getting it to go a level deeper.
EDIT FOR FURTHER CLARIFICATION
Here is another document example that should be transformed using the same logic.
{
    "_id": {
        "$oid": "60f83d3cbc3f0161da2141f7"
    },
    "id": 17736625,
    "name": "OJ Simpson",
    "asset_contract": {
        "name": "Hashmasks",
        "address": "0xc2c747e0f7004f9e8817db2ca4997657a7746928"
    },
    "traits": [
        {
            "trait_type": "Character",
            "value": "Male",
            "display_type": null,
            "max_value": null,
            "trait_count": 8659,
            "order": null
        },
        {
            "trait_type": "Mask",
            "value": "Doodle",
            "display_type": null,
            "max_value": null,
            "trait_count": 2187,
            "order": null
        },
        {
            "trait_type": "Eye Color",
            "value": "Dark",
            "display_type": null,
            "max_value": null,
            "trait_count": 7419,
            "order": null
        },
        {
            "trait_type": "Item",
            "value": "No Item",
            "display_type": null,
            "max_value": null,
            "trait_count": 14533,
            "order": null
        },
        {
            "trait_type": "Skin Color",
            "value": "Dark",
            "display_type": null,
            "max_value": null,
            "trait_count": 3784,
            "order": null
        },
        {
            "trait_type": "Token ID",
            "value": 3535,
            "display_type": "number",
            "max_value": null,
            "trait_count": 0,
            "order": null
        },
        {
            "trait_type": "Background",
            "value": "Doodle",
            "display_type": null,
            "max_value": null,
            "trait_count": 5538,
            "order": null
        }
    ],
    "token_id": "3535"
}

This document comes from a different document contract but maintains the same stucture, albeit with a different set of and number of traits.  The change to fields remains the same process though...

*

*rename the trait type to traits_$trait_type

*set the value of this new field to the $value of that trait

*include this field on the top level

Here is how this should look after the transform
{
    "_id": {
        "$oid": "60f83d3cbc3f0161da2141f7"
    },
    "id": 17736625,
    "name": "OJ Simpson",
    "asset_contract": {
        "name": "Hashmasks",
        "address": "0xc2c747e0f7004f9e8817db2ca4997657a7746928"
    },
    "traits_character": "Male",
    "traits_mask": "Doodle",
    "traits_eye_color": "Dark",
    "traits_item": "No Item",
    "traits_skin_color": "Dark",
    "traits_token_id": 3535,
    "traits_background": "Doodle",
    "token_id": "3535"
}

The structure of the document will always be similar in that there is always a traits array, and we want to move that array up onto the top level with the name relating to the trait_type and the value relating to the value. Where there are multiple instances of the same trait_type we want to push those values into an array.

A: Saving data on keys, makes it more complicated, because we have to do things like $objectToArray see this also
For each trait in traits array adds 1 field to the eternal document.
{"trait_$value" : ["$value1" "$value2"]} if trait had many values
of
{"trait_$value" : "$value1"} if trait had 1 value only
("trait_$value" gets lower-case and replace spaces with "_" also)
Query (works on your data and produce results with data on keys)
If you look at the code example we have 2 collections, your collection, and one dummy c2=[{}], we need this to make the $lookup
so we can use the stage operator like $group dont delete it, just add this dummy 1 empty document collection to the database.
Because we had to do things like $group it was not possible to do it with update, there are 2 solutions

*

*add an $out stage to the aggregation (output to new collection and replace it)

*add a $merge stage to the aggregation, that works like an update

Example data1
Test code here
Example data2 (i added 1 eye_color to make an array)
Test code here
Query

*

*$lookup with a dummy collection [{}] reason to do that is to use stage operators inside 1 document to avoid things like unwind-group (we need to group that traits array)

*Inside the lookup pipeline (in the pipeline its just the ROOT doc)

*unwind traits (each traite separate document)

*group by trait_type, collect the values
{"_id" : type1 "values" [value1 ...]}
{"_id" : type2 "values" [value1 ...]}

*now on that we change
{"_id" : type1 "values" [value1 ...]}
to (object to array $$ROOT)
[["traits_type1" [value1 ...]]]  (if 1 value we dont have array)
to (array to object $$pair)
{"traits_type1" : [value1 ...]}

*the next is making that array "traits" output of lookup to object

*and add it back to the root

db.c1.aggregate([
  {
    "$lookup": {
      "from": "c2",
      "let": {
        "traits": "$traits"
      },
      "pipeline": [
        {
          "$addFields": {
            "traits": "$$traits"
          }
        },
        {
          "$project": {
            "traits": 1
          }
        },
        {
          "$unwind": {
            "path": "$traits"
          }
        },
        {
          "$group": {
            "_id": "$traits.trait_type",
            "values": {
              "$push": "$traits.value"
            }
          }
        },
        {
          "$replaceRoot": {
            "newRoot": {
              "$let": {
                "vars": {
                  "r": {
                    "$map": {
                      "input": {
                        "$objectToArray": "$$ROOT"
                      },
                      "as": "m",
                      "in": [
                        "$$m.k",
                        "$$m.v"
                      ]
                    }
                  }
                },
                "in": {
                  "$let": {
                    "vars": {
                      "pair": [
                        [
                          {
                            "$replaceAll": {
                              "input": {
                                "$concat": [
                                  "traits_",
                                  {
                                    "$toLower": {
                                      "$arrayElemAt": [
                                        {
                                          "$arrayElemAt": [
                                            "$$r",
                                            0
                                          ]
                                        },
                                        1
                                      ]
                                    }
                                  }
                                ]
                              },
                              "find": " ",
                              "replacement": "_"
                            }
                          },
                          {
                            "$let": {
                              "vars": {
                                "v": {
                                  "$arrayElemAt": [
                                    {
                                      "$arrayElemAt": [
                                        "$$r",
                                        1
                                      ]
                                    },
                                    1
                                  ]
                                }
                              },
                              "in": {
                                "$cond": [
                                  {
                                    "$eq": [
                                      {
                                        "$size": "$$v"
                                      },
                                      1
                                    ]
                                  },
                                  {
                                    "$arrayElemAt": [
                                      "$$v",
                                      0
                                    ]
                                  },
                                  "$$v"
                                ]
                              }
                            }
                          }
                        ]
                      ]
                    },
                    "in": {
                      "$arrayToObject": "$$pair"
                    }
                  }
                }
              }
            }
          }
        }
      ],
      "as": "traits"
    }
  },
  {
    "$addFields": {
      "traits": {
        "$arrayToObject": {
          "$map": {
            "input": "$traits",
            "as": "t",
            "in": {
              "$arrayElemAt": [
                {
                  "$map": {
                    "input": {
                      "$objectToArray": "$$t"
                    },
                    "as": "m",
                    "in": [
                      "$$m.k",
                      "$$m.v"
                    ]
                  }
                },
                0
              ]
            }
          }
        }
      }
    }
  },
  {
    "$replaceRoot": {
      "newRoot": {
        "$mergeObjects": [
          "$traits",
          "$$ROOT"
        ]
      }
    }
  },
  {
    "$project": {
      "traits": 0
    }
  }
])


text:
Q: How to prevent resizing in Chrome on Android in CSS during keyboard show I am having a weird issue with Chrome on Android, where in portrait mode the keyboard on input focus forces resize event, which is then picked up by media query styles, the whole layout breaks and then... because on the media query the input field itself is not visible - Chrome decides to blur the input field, and the whole thing reverses - resulting in brief keyboard flick, and then repaint.
The layout is quite simple:

    Top Panel

    <input type='text' />
    Bottom Panel

You can see the problem I am having in action here
Interestingly, it doesn't cause any problems on iOS in both Safari and Chrome, but it only seems to be affecting Android/Chrome combination.
Also, 'hiding of the input in landscape mode' is the desired requirement, so I'm looking for pointers how to tell Chrome not to 'know better' :)
For clarity what I want to achieve:

*

*Orientation change to landscape hides input field

*Chrome portrait mode doesn't trigger layout change and behaves in the same way as safari/ios does

I could use different positioning, combining it with flex, extending media query to be more specific, but I've tried all those and no luck so far, as long as the desired functionality remains unchanged I'm flexible.
Also, couldn't find an answer to this, but can I maybe ideally foce the keyboard to appear before the whole layout so the layout remains unchanged altogether?
Thanks in advance,
G.


text:
Q: Set a custom entry file for Metro dev server in React Native build I'm writing some scripts that do custom React Native builds for unit testing and such, specifying a custom entry file for the react-native-xcode.sh script using the ENTRY_FILE env variable. This is super useful and great. I'm able to do release builds no problem, and they work just fine, so basically I can build a RN app from any entry file at will. However, when I try a Debug variant build, metro doesn't seem to know about my special custom entry file, and gives me this error:
None of these files exist:
  * index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  * index/index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
    at ModuleResolver.resolveDependency (/Users/justin/dev/enmesh/testutilsnative/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:165:15)
    at ResolutionRequest.resolveDependency (/Users/justin/dev/enmesh/testutilsnative/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (/Users/justin/dev/enmesh/testutilsnative/node_modules/metro/src/node-haste/DependencyGraph.js:285:16)
    at /Users/justin/dev/enmesh/testutilsnative/node_modules/metro/src/lib/transformHelpers.js:267:42
    at Server.<anonymous> (/Users/justin/dev/enmesh/testutilsnative/node_modules/metro/src/Server.js:841:41)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/justin/dev/enmesh/testutilsnative/node_modules/metro/src/Server.js:99:24)
    at _next (/Users/justin/dev/enmesh/testutilsnative/node_modules/metro/src/Server.js:119:9)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
IN RESOLVER
Error: Unable to resolve module `./index` from ``:

Does anyone know how I can get the Debug build of the app to interface properly with the Metro development server, so I can debug my app builds better? Any guidance here would be greatly appreciated!
Metro is just getting launched automatically by the xcodebuild process, which I'm calling like this:
const args = {
  simulator: device,
  configuration: variant,
  scheme,
  projectPath: xcodeProjectPath,
  device: undefined,
  uuid: undefined,
  packager: true,
  verbose: true,
  port: 8081,
  terminal: undefined,
};

const xcodebuildSpawnOptionsArgs: any = {
  ...args,
  cwd: folder,
  env: {
    PLATFORM: 'ios',
    ENTRY_FILE: builtEntryFilePath,
  },
};

const buildProcess = spawn(
  'xcodebuild',
  xcodebuildArgs,
  getProcessOptions(xcodebuildSpawnOptionsArgs),
);


text:
Q: How do I make portrait mode in Firefox also work with the behaviors in Chrome, and Opera? I am working on a responsive image viewer in which I would like to use flexbox, jQuery and bootstrap.  So far, I am working on getting the viewer to re-map when the screen is resized. (Later I plan to put it in a modal dialog.) The page is at: outtopastureenterprises.com/exper/modal/view2.html
I would like the page to have a large black box surrounded by some buttons.  It does this in landscape mode but portrait mode is broken. The min-height property doesn't seem to do anything.
Anyway, I am new at flexbox and would be very grateful for any advice or help.  Thanks.
  <!DOCTYPE html>

      <meta  charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <title>VIEWER</title>

      <input id='comment' type='text' value='comment goes here'></input>

A: The problem seems to be do to the fact that in portrait mode, the #display div is the only thing on the top row.  Specifying the lengths using viewport dimensions, vh and vw, solves the problem.


text:
Q: How to interrupt the "Data Store Garbage Collection" or make it faster? with "Data Store Garbage Collection" I mean the Apache Jackrabbit one
I'm working on an application having a huge database repository, its default_bundle Oracle table is 55G big
In that application, the data store garbage collector has been disabled for years, so if you know Jackrabbit you know we have a lot of gigabytes of trash in the global datastore in file-system.
So the Datastore Garbage Collection should be the only solution, but I'm worried that it will run for days, maybe weeks scanning the whole repository, so I would like to be able to interrupt it but I have no idea how to do it or I would like to run it in an alternative faster way, step by step for example, that is scanning partially repository for example.
Thanks


text:
Q: .htaccess, conflict in rules I am just trying to understand how .htaccess work and what is right way of dealing with it and I have one problem.
Here is part of my .htaccess file:
RewriteEngine on
RewriteRule ^(.*)/css/(.*)$ /css/$2
RewriteRule ^(.*)/img/(.*)$ /img/$2
RewriteRule ^(.*)/js/(.*)$ /js/$2

Everything is looks fine and have worked ok, till I'll try to use TinyMCE that I have copied to js directory. It contain a lot of different subfolders, including img subfolders, and because of my rule RewriteRule ^(.*)/img/(.*)$ /img/$2 it doesn't work properly. I know that I can just rename folders in TinyMCE, but I think that I am not dealing with .htaccess in right way.
Help me please.

A: Instead of matching any character in your rule, you can match one folder (allow every character except for /). That'll ensure that deep nested folders (e.g. modules/tinymce/js/) do not conflict with en/js/.
RewriteEngine on
RewriteRule ^([^/]*)/css/(.*)$ /css/$2
RewriteRule ^([^/]*)/img/(.*)$ /img/$2
RewriteRule ^([^/]*)/js/(.*)$ /js/$2


text:
Q: Hint and InputType on Included EditText I have a custom EditText declared in an XML file and I'm including it like so:
<include layout="@layout/my_edit_text"
        android:id="@+id/passwordField"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/passwordHint"
        android:inputType="textPassword" />

and here is my_edit_text.xml:
<?xml version="1.0" encoding="utf-8"?>
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:textColor="@color/gray"
    android:textSize="@dimen/editTextFontSize"
    android:padding="@dimen/editTextPadding"
    android:background="@drawable/edit_text_background"
    android:ellipsize="end" />

However, I can't set the hint or inputType this way, for some reason. If I set it in my_edit_text.xml, it works fine, but I would like to be able to set each reference individually.
The reason that I have the custom EditText is to avoid having to rewrite all of the common values in every one of my EditTexts.
Do I have to do something similar to what this person has? If I do, will I need to actually build a .java subclass and extract the attributes that way? That just seems excessive.

A:
The reason that I have the custom EditText is to avoid having to rewrite all of the common values in every one of my EditTexts.

Step #1: Delete my_edit_text.xml.
Step #2: Delete all references to my_edit_text.xml.
Step #3: Define a style resource (e.g., in res/values/styles.xml) akin to:
<style name="rileyText">
  <item name="android:textColor">@color/gray</item>
  <item name="android:textSize">@dimen/editTextFontSize</item>
  <item name="android:padding">@dimen/editTextPadding</item>
  <item name="android:background">@drawable/edit_text_background</item>
  <item name="android:ellipsize">end</item>
</style>

Step #4: Add style="@style/rileyText" to all EditText widgets that you want to have those particular attributes applied to.


text:
Q: Number of ways pitchers can be selected for a baseball game . In my Probability & Statistics class, my professor put a question on the quiz and $95 \% $ of the class got the question wrong (putting the same answer as me). I understand why my professor said our answer was wrong, but I think the wording of question allows people to interpret the problem in different ways.
"For a baseball game, the managers plans to use one starter and two relievers. If he has $3$ starting pitchers and $6$ relievers available, in how many ways can he select pitchers for the game$?$"
Let me know what you think and then I'll tell you what my professor said and what most students put. Thank you!

A: I'm guessing that the issue is whether it's an ordered or unordered selection of the relief pitchers.  In a case such as this, it would be good to ask for a clarification, if that is possible.

A: Depends on whether the order of the relievers matters or not.  If having Smith as the first relief pitcher and Jones as the second is different from having Jones first and Smith second, then there are 3*6*5 = 90 ways to pick the pitchers.  If the order doesn't matter, then the answer is half this, or 45 different ways.
I don't know enough about baseball to know whether this distinction (between "first relief" and "second relief") is actually one that's made in practice.


text:
Q: ExecuteReader requires an open and available Connection. The current status of the connection is Open This is the code I use:
  StringBuilder cmdTekst = new StringBuilder();
  SqlCommand cmd;
  cmd = Cnn.CreateCommand();
  cmd.Connection = Cnn;
  if (Cnn.State != ConnectionState.Open)
  {
    Cnn.Open();
  }
  cmd.CommandType = CommandType.Text;
  cmdTekst.AppendLine("SELECT * FROM tblNummering WHERE type = 1 AND EindPer IS NULL;");
  cmd.CommandText = cmdTekst.ToString();
  Log.Debug("sql tekst = '" + cmd.CommandText + "'");
  SqlDataReader reader = cmd.ExecuteReader();

The code is simplified.
This is the exception I get
"ExecuteReader requires an open and available Connection. The current status of the connection is Open."
As far as I know the connection is available and open.
I can not switch to use using. That would take several days of refactoring.
Several other connections are open before this one.
Setting the number of connection higher does not solve the problem.
Anyone a clue how to solve this problem?

A: ... and available Connection <= that is also important. Just because it is open does not mean it is not already being used by another thread (for example). The solution is to not reuse database connections, these types should be short lived. Created them as needed and dispose of them as soon as you are done. The underlying framework will handle connection pooling  for you so there is no benefit to trying to do it for the application.
If you can't dispose of the global connection then create a new one when you experience race conditions like this.
using (var connection = new SqlConnection(Cnn.ConnectionString)) // use same connection string as your Global instance
using (var cmd = connection.CreateCommand())
{
  cmd.CommandType = CommandType.Text;
  cmd.CommandText = "SELECT * FROM tblNummering WHERE type = 1 AND EindPer IS NULL;"
  connection.Open();
  using(SqlDataReader reader = cmd.ExecuteReader())
  {
    while(reader.Read())
    {
      // fetch results
    }
  }
}


text:
Q: How to determine why Bazel external dependencies are always downloaded when running sync using the Intellij Bazel plugin I'm using Bazel 5.3.0 with the Intellij IDEA plugin. When running sync it's re-downloading things from the WORKSPACE, particularly nodejs packages which is taking a long time. This causes sync to take ~7mins every time it runs, but if I set bazel to not fetch external dependencies it runs in about ~1min. This doesn't occur when running the same bazel commands from the command line.
How do I debug this? I've tried the steps in https://bazel.build/remote/workspace and I've also tried looking at the various logs that bazel produces, however they only really tells me what happened, not why bazel is doing the things it's doing.


text:
Q: Donation options in an app - Are any of these allowed? Are any of these options allowed regarding accepting donations through an iPhone app, without "losing" 30% of the money to Apple?

*

*A button which links to a web page that accepts donations with credit card payments?

*Instructions on how to donate by sending an SMS message?

*Call a IVR service where you can bill the people donating on their phone bill?

A: 2014 - please note all answers here are years out of date.
2014 - hopefully someone will post updated facts.

I'm pretty sure you are not allowed to do this currently - although these policies change frequently.
If you're interested in spam, donations (however well meaning), or viruses, that "android" system which google launched to allow that sort of thing, is exactly what you're looking for.
Sorry, I was wrong, you ARE currently allowed to do this:

21. Charities and contributions

21.1 Apps that include the ability to make donations to recognized charitable organizations must be free
21.2 The collection of donations must be done via a web site in Safari or an SMS

That's the answer, April 2011.  You must use one of the two methods in 21.2.
For the convenience of future readers: Trydis, who asked the original question, has helpfully supplied this great URL link: https://developer.apple.com/app-store/review/guidelines/

A: From what I know, Apple doesn't allow you to include a donation button in your application.
AppMakr quoted:
"Apple tends to reject Apps that have content related to donations or charity. We have issued you a coupon "REMOVED" which will enable you to rebuild your App for free, minus the tab related to donations."


text:
Q: redirect to example.com when trying to sign in with Capybara, Cucumber, RSpec and Devise Trying to get a very simple scenario passing using Cucumber and Devise -  Signing in user... (EPIC FAIL)
I have a step like this:
user = create(user_sym)
user.confirm!

visit new_user_session_path
fill_in 'Email',:with => user.email
fill_in 'Password',:with => attributes_for(user_sym)[:password]
click_button 'Sign in'
page.should have_content('Sign out')

The logs show me all is good (confirm email sent, UPDATE inserts correct confirm flags), and then I see the redirect to
www.example.com

Lots of posts here and other places mention this and use login_user with :callback => false to make it work, but I want to use "visit".
What can be causing this. The actual error is the failing TEST i.e. that the Sign Out text doesn;t appear. What is being rendered is the Rails Homepage i.e.
 expected there to be text "Sign out" in "Browse the documentation Rails Guides Rails API Ruby core Ruby standard library Welcome aboard

I can't figure out which part of the stack is throwing this (as I'm NEW!). Presumably Capybara is redirecting? I've seen people get this is to work, and in my Dev stack it clearly redirects to the Users index page as you would expect.
Any light much appreciated.

A: I fixed this by returning specific path in after_sign_in_path_for in ApplicationController
  def after_sign_in_path_for(resource)
    xxxxx_path
  end

Somehow root route in cucumber tests gets redirected to "example.com"


text:
Q: no sound on ubuntu 16.04.In setting it says dummy sound no sound on ubuntu 16.04 .In setting it say dummy sound after downloading on to a mini pc it says dummy sound what does that mean .what can i try ?

A: Try pulseaudio -k && sudo alsa force-reload

A: I just had this problem a couple hours ago. Usually just switching to a different device fixes it but not this time. So I used:
rm ~/.pulse/           # In my case this directory was empty
rm ~/.config/pulse/*
pulseaudio -k

There was a link I followed: https://askubuntu.com/a/15226/307523


text:
Q: How to update IOptions after having built the configuration? Context:
In Integration Testings, we need to test different cases with different options. I dont want to create a TestServerFixture different for each test.
Request:
I m looking for a possibility to update globally the IOptions.
TestServerFixture:
public Dictionary<string, string> Data {get; set;} = new Dictionary<string, string>
        {
            {"identity:claimsidentity:roleclaimtype", roleClaimType},
            {"identity:claimsidentity:usernameclaimtype", usernameClaimType},
            {"identity:claimsidentity:useridclaimtype", useridClaimType},
            {"identity:claimsidentity:securitystampclaimtype", securityStampClaimType},
            {"identity:user:requireUniqueEmail", "true"},
            {"identity:password:RequiredLength", "10"},
            {"identity:password:RequireNonAlphanumeric", "false"},
            {"identity:password:RequireUpperCase", "false"},
            {"identity:password:RequireDigit", "false"},
            {"identity:password:RequireLowerCase", "false"},
            {"identity:lockout:AllowedForNewUsers", "FALSe"},
            {"identity:lockout:MaxFailedAccessAttempts", "1000"}
        };

[..]

var hostBuilder = new HostBuilder()
    .ConfigureAppConfiguration((hostingContext, builder) =>
    {
        builder
            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
            .AddEnvironmentVariables()
            .AddInMemoryCollection(Data);
    })
    [..]

Tests:
    [Fact]
    public async Task Should_Do_Something()
    {
        // When I do a call to the server, identity:user:requireUniqueEmail will be true

        TestServerFixture.Data = //New Data with identity:user:requireUniqueEmail  = false;

        // When I do a call to the server, identity:user:requireUniqueEmail will be false
    }

So each time I set a new value to the property Data, automatically it will update the current configuration.
Do you have any idea how to do that?


text:
Q: .NET Stopwatch Class limitations This may not be an entirely not a .NET related question.
I am writing a .NET application to control some gadgets. I send commands to the gadget periodically (say every 500 milliseconds). As soon as I send the command I start a timer. (.NET stopwatch class)
If the gadget not respond within say, 10 milliseconds, I send the command again. If it does respond, I continue to monitor the gadget status by sending more commands and processing the responses.
I have 2 or 3 stopwatch timers running in parallel to do other things for this one gadget.
Now, I want to monitor and control potentially thousands of these gadgets (could be as high as 5000). If I create one object for a gadget, I will looking at 10000 to 15000 stopwatch objects running in parallel. I am not sure how the stopwatches work but I assume they rely on a hardware timer or some such thing to keep track of time.
My question is, can windows handle such a large number of stopwatches simultaneously?

A: I would recommend rethinking this design.  First off, Stopwatch just does what it says - it acts like a stopwatch.  If you want an event to fire at specific intervals, you'll want to look at the various Timer classes.
That being said, I would recommend sharing your Timers across the gadgets.  You will find that everything performs much better, and is probably simpler to write and comprehend if you have fewer timers which are used by a single scheduler you create, and the scheduler manages the gadgets.

A: A stopwatch is nothing but a variable holding the result of Windows API call QueryPerformanceCounter(), it has no overhead while it's "running". Stopping it calls QueryPerformanceCounter() once more, so performance should be okay. That said, I agree with Reed Copsey, you need to rethink your design. With such a large number of gadgets, I'd start thinking about a device driver.

A: I think the question should be if you can handle some many timers; you will waste much time just reading thousands of timers and doing no functionality.
I am not aware of the implementation behind the Stopwatch class, but I can imagine that they just read the value of a timer on start and on stop again. So a Stopwatch instance might need allmost no resources.
But just try it out; generate an array of some thousend instances in a loop, start them, and look what happens.

A: Think of global queue which holds gadgets responses and one or a few threads that query the queue and resents messages if needed. It would perform better.

A: use one time source to schedule events at specified intervals

A: The stopwatch class is pretty simple.  It's not something that "runs" all the time.  When you tell it to start, it looks at the system time, and when you tell it to pause, stop, reset, etc is just looks at the system time each time you do this.  Asking the ElapsedMilliseconds is equivalent to saying (Processor.CurrentTicks - StartTicks) / TicksPerMillisecond.  It's pretty simple, really.  The system can handle a very large number of these.
I'm not commenting on whether or not this is the right design for your problem, just answering your question: the system can handle thousands of stopwatches with no problem.


text:
Q: Repeatition of copying setup tables I have a customer has over 400 databases and creates new ones every week.  I use the export/import took to copy setup tables.  The problem is that the wizard is time consuming.  I have been trying to create a script to do this as the tables are always the same for every company.
USE HH885
TRUNCATE TABLE GL00100
GO
----Create new table and insert into table using SELECT INSERT
INSERT INTO HH885.dbo.GL00100
FROM HH001.dbo.GL00100

This gives me the message that the table already exists.

A: It appears you must be using the SELECT... INTO ... clause (despite the code snippet you have provided) which attempts to create a new table, but TRUNCATE does NOT delete (i.e. DROP) a table, it merely empties it. In other words change the TRUNCATE TABLE to DROP TABLE and then your script should work.

A: if I drop the table it does not work because of how dynamics gp works.  I get errors.
Using this one I am making baby steps.  using the script below I get an error (Msg 8101, Level 16, State 1, Line 1
An explicit value for the identity column in table 'HH421.dbo.GL00100' can only be specified when a column list is used and IDENTITY_INSERT is ON.)
use HH421
GO
truncate table gl00100
GO
insert into HH421.dbo.GL00100
select * from HH125.dbo.GL00100


text:
Q: PHP: what's an alternative to empty(), where string "0" is not treated as empty?
Possible Duplicate:
Fixing the PHP empty function

In PHP, empty() is a great shortcut because it allows you to check whether a variable is defined AND not empty at the same time.
What would you use when you don't want "0" (as a string) to be considered empty, but you still want false, null, 0 and "" treated as empty?
That is, I'm just wondering if you have your own shortcut for this:
if (isset($myvariable) && $myvariable != "") ;// do something
if (isset($othervar  ) && $othervar   != "") ;// do something
if (isset($anothervar) && $anothervar != "") ;// do something
// and so on, and so on

I don't think I can define a helper function for this, since the variable could be undefined (and therefore couldn't be passed as parameter).

A: if(isset($var) && ($var === '0' || !empty($var)))
{
}

A:
if ((isset($var) && $var === "0") || !empty($var))
{

}

This way you will enter the if-construct if the variable is set AND is "0", OR the variable is set AND not = null ("0",null,false)

A: This should do what you want:
function notempty($var) {
    return ($var==="0"||$var);
}

Edit: I guess tables only work in the preview, not in actual answer submissions. So please refer to the PHP type comparison tables for more info.

notempty("")       : false
notempty(null)     : false
notempty(undefined): false
notempty(array())  : false
notempty(false)    : false
notempty(true)     : true
notempty(1)        : true
notempty(0)        : false
notempty(-1)       : true
notempty("1")      : true
notempty("0")      : true
notempty("php")    : true

Basically, notempty() is the same as !empty() for all values except for "0", for which it returns true.

Edit: If you are using error_reporting(E_ALL), you will not be able to pass an undefined variable to custom functions by value. And as mercator points out, you should always use E_ALL to conform to best practices. This link (comment #11) he provides discusses why you shouldn't use any form of error suppression for performance and maintainability/debugging reasons.

See orlandu63's answer for how to have arguments passed to a custom function by reference.

A: function isempty(&$var) {
    return empty($var) || $var === '0';
}

The key is the & operator, which passes the variable by reference, creating it if it doesn't exist.

A: The answer to this is that it isn't possible to shorten what I already have.
Suppressing notices or warnings is not something I want to have to do, so I will always need to check if empty() or isset() before checking the value, and you can't check if something is empty() or isset() within a function.

A: function Void($var)
{
    if (empty($var) === true)
    {
        if (($var === 0) || ($var === '0'))
        {
            return false;
        }

        return true;
    }

    return false;
}

A: If ($var != null)


text:
Q: Working from home: ensuring file security? Would it be possible to ensure that documents used on a personal PC connected to the internet, could be used securely without the danger of an eavesdropper obtaining access to the file or the danger of files being created in the temp folder and being accessible to someone else who logs in later?
I've considered keeping the files in a Truecrypt container and using a virtual keyboard to enter the password. But if I access a Word file in the container, won't temporary files be created in the temp directory? Would using a sandbox help in this case?
What if I access the file from a Truecrypt container in Linux instead?
In short, what would be a good way to ensure that any confidential files will be secure even if the system is compromised?

A: Use an encrypted home folder/Truecrypt and keep your files there.
Using compression inside TrueCrypt has slight to none impact on security, so yes, the extra password and protection layer would be of no harm.
Do not forget data is still accessible when on RAM (in process of being encrypted or decrypted). still, Linux has a kernel feature that only allows a small portion (1MB) of RAM to be read for security reasons... so yes, I believe you will be safe.
If you find it an option (which you said not to be in comments) , use SSH to connect to your computer at the company and VNC 127.0.0.1 (your company pc itself) so you can work on it as if you were there. SSH connections are encrypted.
will Truecrypt ensure that the data is not stored temporarily anywhere else other than in the RAM (Windows and Linux)
the answer is no, it won't ensure. programs that require to store stuff in /tmp will do so. so, unless your root partition (assuming you mount /tmp in same partition) is TrueCrypted it will be accessible without encryption.
regarding windows, same applies to your %temp% folder.

A: Your question actually contains three questions:
1 Protecting local files
To protect your files from others using the same computer, create use a different user account than them and protect it with a password. Windows will by default deny them access to your user folders.
To protect your files from users with administrative privileges or physical access to the disk you also need to encrypt them. The most simple way would be the Encrypting Filesystem options of NTFS (screencast tutorial).
2 Protecting network traffic
Encrypt your files and data before sending them over the wire. The easiest way would be a file archive program like 7-zip or WinRAR, because they support symmetric encryption with a password.
3 Protecting your computer from malicious programs
Even if you do 1 and 2 correctly, an attacker may still run a malicious program on your computer, which can circumvent the above security measures. Keep your software (operating system, browser, browser plug-ins, document reader) up to date and don't open programs or documents from unknown or shady sources. Use an anti-virus program.


text:
Q: Homeomorphic map that doesn't imply smoothness
Let $S= \{x\in \mathbf{R^3} \mid x_3 = \sqrt{x_1^2+x_2^2} \}.$ Construct a $C^1$ homeomorphism $\varphi : \mathbf{R^2} \to S.$ Explain why the constructed homeomorfism doesn't imply that $S$ is smooth?

So I would need to construct a map $\varphi : \mathbf{R^2} \to S$ that is a continuous bijection whose inverse is also continuous.
If I let $\varphi(x_1,x_2) =(x_1,x_2, \sqrt{x_1^2+x_2^2})$ which is essentially a parametrization for the graph of $S$ right? Is this map a homeomorphism?
If I would have constructed $\varphi(x_1,x_2)=(x_1^3,x_2^3, \sqrt{x_1^6+x_2^6})$ this would at least be homeomorphic since $x \mapsto x^3$ is homeomorphic.
Now I would be left to show that $\varphi$ is a $C^1$ that is, it has continuous partials, which isn't that hard to show, however how can I show that this doesn't imply that $S$ is smooth?


text:
Q: Group child nodes based on the values of their siblings I've got this XML:
<RECORDS>
    <RETREC>
        <heading>Green Fruits</heading>
        <message>Kiwi</message>
    </RETREC>
    <RETREC>
        <heading>Green Fruits</heading>
        <message>Apple</message>
    </RETREC>
    <RETREC>
        <heading>Red Fruits</heading>
        <message>Apple</message>
    </RETREC>
    <RETREC>
        <heading>Red Fruits</heading>
        <message>Strawberry</message>
    </RETREC>
</RECORDS>

And I want to create a XSLT 1.0 template to get this HTML:

Green Fruits

Kiwi

Apple

Red Fruits

Apple

Strawberry

I've got this so far based on another Stack Overflow post but I haven't been able to find one where the original data matches this structure, and I don't understand it enough to know how to modify it to work.
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    <xsl:key name="heading" match="RECORDS" use="@heading" />

    <xsl:template match="/">

        <xsl:choose>
            <xsl:when test="count(/RECORDS/RETREC)>=1">

                    <xsl:template match="RECORDS">

                            <xsl:apply-templates select="/RETREC/heading[generate-id(.)=generate-id(key('heading',@heading)[1])]"/>

                    </xsl:template>

                    <xsl:template match="heading">

                            <xsl:for-each select="key('heading', @heading)">

                                    <xsl:value-of select="heading" disable-output-escaping="yes"/>

                                <xsl:for-each select="RETREC">

                                    <xsl:value-of select="message" disable-output-escaping="yes"/>

                                </xsl:for-each>

                            </xsl:for-each>

                    </xsl:template>

            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="/text()"/>

No Records

            </xsl:otherwise>
        </xsl:choose>

    </xsl:template>

</xsl:stylesheet>

A: The output you show can be generated simply by:
XSlT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:key name="heading" match="RETREC" use="heading" />

<xsl:template match="/RECORDS">

        <xsl:for-each select="RETREC[generate-id(.)=generate-id(key('heading', heading)[1])]">

                    <xsl:value-of select="heading"/>

            <xsl:for-each select="key('heading', heading)">

                        <xsl:value-of select="message" />

            </xsl:for-each>
        </xsl:for-each>

</xsl:template>

</xsl:stylesheet>