text:
Q: How to arrange 15 women and 15 men so no two females are seated next to each other? To a certain conference, each firm can send two employee representatives, on the condition that one of them is a male and the other a female. If 15 firms were represented in this conference, what is the probability that no two females are seated next to each other? (Assume that all 30 members are seated in a single row of seats)
A] 1/2
B] 14!/30!
C] 15!/30!
D] 28/30!
For above question I am trying following: 15 men can be arranged in 15! ways. There are 16 spots among men (-M-M-.....-M-). 16 spots can be taken by 15 women in 16! ways. My answer is (15!*16!)/30!. But it's not listed in answer choices. Am I missing something or answers are incorrect?
My approach is similar to approach in question in below link.
How many ways are there for 10 women and six men to stand in a line

A: $\bf{My\; Solution::}$ If we can represent man by $\bf{M}$ and Women by $\bf{W}$, Then we use Gap Method.
So Arrangements as $$_M_M_M_M_M_M_M_M_M_M_M_M_M_M_M_$$
Above $15$ man can be arrange as $15!$ (Here Man and women all are Different)
Now We can Arrange $15$ Women in These $16$ Gap, Which can be done by $\displaystyle \binom{16}{15}\times 15! = 16!$
So Total no. of Arrangement in which no $2$ woman sit together is $\displaystyle 15! \times 16!$
And Total Probability $\displaystyle = \frac{\bf{Favourable \; cases}}{\bf{Total \; Cases}} = \frac{15!\times 16!}{30!}$
So I Think Your answer is Right.

A: I think the answer is wrong because it doesn't take in account that two men can seat side by side (if you have tow women on te exterior) : WMWMWM..WMMW
Something like ${30*15!*15!\over30!}$


text:
Q: How to find form submit input in Protractor For fun/practice I write a test for Google advanced search and I am looking for a locator that will allow to find the form submit on https://www.google.com/advanced_search:
<input class="jfk-button jfk-button-action dUBGpe"
 style="-webkit-user-select:none;user-select:none;line-height:100%;height:30px;min-width:120px"
 value="Wyszukiwanie zaawansowane" type="submit">

As you can see this submit does not have id nor name defined so by.id() or by.name() cannot be used.

A: by.css locates elements using a CSS selector. It allows you to simply use attribute selectors for locating elements in the DOM.
element(by.css('input[type="submit"]'))

A: To find the form submit the by.xpath locator can be used:
element(by.xpath("//input[@type='submit']"));

A: What locator will suite You depends of the whole page, but here are few locators you can try:
element(by.xpath("//input[@class='jfk-button jfk-button-action dUBGpe']"));
element(by.css("jfk-button.jfk-button-action.dUBGpe"));

redpajama_set_name: RedPajamaStackExchange


text:
Q: Segments not totally off when multiplexing 7 segments display with CD4051BE I'm trying to make a display with several 7 segment displays so I decided to use multiplexing to make it work. I use CD4051BE to do that. The circuit is as follow:
Circuit of the multiplexing
The MCP23017 is then hooked up to a raspberry pi 3 where I code using python and CircuitPython.
The segments look like that, you can see the displays that shouldn't turn on circled in blue.
It seems like it is working at slower speed (when I add delay to the multiplexing).
I think the problem comes from the way I did multiplexing but I really don't know...
My code is the following:
import board
import busio
from digitalio import Direction, DigitalInOut
from adafruit_mcp230xx.mcp23017 import MCP23017
import time

i2c = busio.I2C(board.SCL, board.SDA)

mcp = MCP23017(i2c, address=0x21)

pin0 = mcp.get_pin(8)
pin0.direction = Direction.OUTPUT
pin1 = mcp.get_pin(9)
pin1.direction = Direction.OUTPUT

s1 = DigitalInOut(board.D14)
s1.direction = Direction.OUTPUT
s2 = DigitalInOut(board.D15)
s2.direction = Direction.OUTPUT
s3 = DigitalInOut(board.D18)
s3.direction = Direction.OUTPUT

pin0.value = True

while True:
  for i in range(0, 5):
    if (i % 2) == 0:
      pin1.value = False
    else:
      pin1.value = True
    s1.value = bool(i >> 0 & 1)
    s2.value = bool(i >> 1 & 1)
    s3.value = bool(i >> 2 & 1)

Thanks for any help !
Cyprien


text:
Q: The method multiply(long) from the type BigInteger is not visible I'm trying to run this code:
private static String reverseNumbers(BigInteger binaryBig){
    BigInteger big = new BigInteger("0");
    big.multiply(2);
}

But I get the error message: "The method multiply(long) from the type BigInteger is not visible".
Why do I get this error and how can I avoid it?

A: There is a package-private multiply(long) method in the BigInteger class, and you are attempting to call it from outside the package, so you get the error that the method isn't visible.  It looks from the source code that this method shows up starting in Java 6.
There is a public overload, multiply(BigInteger).  Use it instead.  (Also you'll want to assign the result back to another variable.)
big = big.multiply(new BigInteger("2"));


text:
Q: change inheritance to composition for existing jaxb class structure keeping the current xml structure unchanged In my code base I have B extdnds A but I want to make it: B uses A. This is my try:
@XmlAccessorType(XmlAccessType.NONE)
public class A {

    @XmlElement(name ="aString")
    private String aString;

B class contains A (composition):
@XmlAccessorType(XmlAccessType.NONE)
public class B {

    @XmlElement
    private A a = new A(); // has A

    @XmlElement
    private String bString;

There is Root that contains list of B
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class ABs {

    @XmlElement(name = "b-list")
    private final List<B> bList = Constraints.constrainedList(new ArrayList<B>(), Constraints.notNull());

    public void add(B...bb) {
        for(B b : bb) {
            bList.add(b);
        }
    }
}

My test, marshals Bs to Systetem.out
 ABs abs = new ABs();
        abs.add( new B("bStringValue", "aStringValue"));

        JAXBContext context = JAXBContext.newInstance(ABs.class);

        Marshaller m = context.createMarshaller();
        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);

        m.marshal(abs, System.out);

Result:
<aBs>
    <b-list>
        <a>
            <aString>aStringValue</aString>
        </a>
        <bString>bStringValue</bString>
    </b-list>
</aBs>

But I want result like this: as if I use inheritance. Like as if B extends A :
<aBs>
    <b-list>
        <aString>aStringValue</aString>
        <bString>bStringValue</bString>
    </b-list>
</aBs>

How can I do this?
EDIT:
The question is really about: How to omit/ignore tag <a> for A class when use it in B class. I.e. to not marshal to <a> but to all fields/tags that inside <a>
Like:
@XmlElement(name = "") // empty
private A a = new A();

But this does not work

A: The answer is here:
Is it possible to ignore a wrapper class during JAXB marshalling
The answer is: impossible.
Actually my question is kind of duplication of that one. But my question is related to architectural side of issue.
It seems that JAXB is not the best thing to use If you want to stay with XML structure like it was before (imagine that XML is REST API you not suppose to change, but still you wish to change classes around it) but change the way the classes connect to each other.
It(jaxb) breaks a freedom. The classes become a bit (too much I mean) anemic..

A: try this
@XmlAccessorType(XmlAccessType.NONE)
public class B {

@XmlElement
private String aString;// you don't need to create the class A (aString  is like bString lement)

@XmlElement
private String bString;


text:
Q: Paste selected text on Windows like on Linux (middle mouse button) I really like this feature on Linux systems. I want it too on my Windows systems, but I didn't find a proper solution.
The solutions I found:

*

*True X-Mouse

*AutoclipX

*Autohotkey script

The problems I had with them:

*

*True X-Mouse changes the mouse focus which I don't want to be active on Windows because it only messes with menus like the start menu. Also you can't close tabs with your middle mouse button if it's active.

*AutoClipX just pastes the clipboard content and not the selected text.

*Autohotkey script found here messes with consoles on Windows. If you are switching to your console by clicking on it it will paste a Ctrl+C which is pretty annoying.

Did anybody find a proper solution or a fix for the problems I encountered with those 3 solutions?

A: Copy on select implementation:
Try it this way:
#NoEnv
#SingleInstance Force

mousedrag_treshold := 20 ; pixels

Hotkey mbutton, paste_selection

; #IfWinNotActive ahk_class ConsoleWindowClass

~lButton::
    MouseGetPos, mousedrag_x, mousedrag_y
    keywait lbutton, T0.3
    If (ErrorLevel)
    {
        keywait lbutton
        mousegetpos, mousedrag_x2, mousedrag_y2
        if (abs(mousedrag_x2 - mousedrag_x) > mousedrag_treshold
        or abs(mousedrag_y2 - mousedrag_y) > mousedrag_treshold)
        {
            ; MouseGetPos,,,WindowUnderMouse
            ; WinGetClass, Class, ahk_id %WindowUnderMouse%
            ; If (Class != "ConsoleWindowClass")
                sendinput ^c
            hotkey mbutton, on
        }
    }
return

~lButton Up:: return

; #IfWinNotActive

paste_selection:
    sendinput {lbutton}
    SendInput ^v
return

A: I improved the above script a bit at the end. Just added an if statement to check if the clipboard is occupied or not and also cleared it after pasting. The other improvement is turning off the hotkey mbutton after pasting, so that it will not interfere with middle clicks for closing tabs or scrolling until some text is selected and [automatically] copied next time.
#NoEnv
#SingleInstance Force

mousedrag_threshold := 20 ; pixels

Hotkey mbutton, paste_selection

; #IfWinNotActive ahk_class ConsoleWindowClass

~lButton::
    MouseGetPos, mousedrag_x, mousedrag_y
    keywait lbutton, T0.3
    If (ErrorLevel)
    {
        keywait lbutton
        mousegetpos, mousedrag_x2, mousedrag_y2
        if (abs(mousedrag_x2 - mousedrag_x) > mousedrag_threshold
        or abs(mousedrag_y2 - mousedrag_y) > mousedrag_threshold)
        {
            ; MouseGetPos,,,WindowUnderMouse
            ; WinGetClass, Class, ahk_id %WindowUnderMouse%
            ; If (Class != "ConsoleWindowClass")
                sendinput ^c
            hotkey mbutton, on
        }
    }
return

~lButton Up:: return

; #IfWinNotActive

The changed part:
paste_selection:

    if clipboard!=""
            {
            sendinput {lbutton}
            SendInput ^v
            Sleep, 200 ; Give some time for the text to be pasted.
            clipboard = ; clear the clipboard
            hotkey mbutton, off
            }

    return


text:
Q: Attempting YouTube upload through Python API gives 'Developer key required for this operation' Error I am attempting to upload a video to YouTube using the developer key that I obtained as paired with credentials for a particular user. It seems to me that my YoutubeService object should have the proper developer credentials, but the server comes back with 403: Developer key required for this operation.
import gdata
import gdata.youtube
import gdata.youtube.service
client_id = 'dummy-client'
developer_key = 'xxxxxxx......'
youtube_user = 'sampleuser@gmail.com'
youtube_password = 'passwordgoeshere'
yt_service = gdata.youtube.service.YouTubeService(client_id, developer_key)
yt_service.ssl = True
yt_service.developer_id = developer_key
yt_service.client_id = client_id
yt_service.email = youtube_user
yt_service.password = youtube_password
yt_service.source = client_id
yt_service.ProgrammaticLogin() #Successfully login with the developer key and the user's credentials

my_media_group = gdata.media.Group(
    title=gdata.media.Title(text='video.avi'),
    description=gdata.media.Description(description_type='plain', text='My Video'),
    keywords=gdata.media.Keywords(text=''),
    category=[gdata.media.Category(
    text='Autos',
    scheme='http://gdata.youtube.com/schemas/2007/categories.cat', label='Autos')],
    player=None,
    private=gdata.media.Private()
)
video_entry = gdata.youtube.YouTubeVideoEntry(media=my_media_group)
video_file_location = '/path/to/video.avi'

#Use the supposedly authenticated and developer_id associated YoutubeService object to upload the video
new_entry = yt_service.InsertVideoEntry(video_entry, video_file_location)

#Receive the following error:
#
#Traceback (most recent call last):
#  File "<stdin>", line 1, in <module>
#  File "/usr/lib/python2.7/dist-packages/gdata/youtube/service.py", line 661, in InsertVideoEntry
#    raise YouTubeError(e.args[0])
#gdata.youtube.service.YouTubeError: {'status': 403, 'body': 'Developer key required     for this operation', 'reason': 'Forbidden'}

A: Your developer ID and developer key are different things. You need to put your key (which is associated with your account rather than a specific registered application) into yt_service.developer_key


text:
Q: how to get a windows service information via batch file script first an avowal! i am begginer in batch file scripting!
i want to get information about a running win_service in win_server_2003 and check out who started service and , decide upon, change this value in service config (sc),
first step done with 'sc qc serviceName' and returns this result :
    SERVICE_NAME: W3SVC
    TYPE               : 20  WIN32_SHARE_PROCESS
    START_TYPE         : 2   AUTO_START
    ERROR_CONTROL      : 1   NORMAL
    BINARY_PATH_NAME   : C:\Windows\system32\svchost.exe -k iissvcs
    LOAD_ORDER_GROUP   :
    TAG                : 0
    DISPLAY_NAME       : World Wide Web Publishing Service
    DEPENDENCIES       : WAS
                       : HTTP
    SERVICE_START_NAME : **LocalSystem**

now i want set this marked value in a variable and check it and continue the story...
i have reached this code but i cant check array values then change service info :(
@echo off
setlocal EnableDelayedExpansion
set n=0

rem for set result in a array
for /f "delims=" %%a in ('sc qc service name') do (
   set /A n+=1
   set returnVal[!n!]=%%a
)

rem To show all non-empty lines:
for /F %%i in (1,1,%n%) do echo !returnVal[%%i]!

rem Or:
echo started by : %returnVal[!n!]%

.
.
.
tanx 4 ur help!

A: set "serviceName=dhcp"
set "searchAccount=LocalSystem"
set "replaceAccount=........."
set "password=..........."

sc qc "%serviceName%" ^| find "SERVICE_START_NAME : %searchAccount%" >nul 2>nul
if not errorlevel 1 (
    echo sc config %serviceName% obj= %replaceAccount% password= %password%
)

Configure, test and if output to console is correct, remove the echo command.

A: part 1
for /f "tokens=1*delims==" %a in ('wmic service where "name='W3SVC'" get startname /value') do @for /f "delims=" %c in ("%~b") do @echo "%~c"

part 2
wmic service where "name='W3SVC'" set startname="NSA FLIGHT COMMANDER"

Please note: Part 2 might not work because service.property might be read only.


text:
Q: Where an uploaded image stored? I need to know where an uploaded image usually stored ?  I can't find it in file system. Only what I've got after saving is some changes in AllDocs table of SP database.
To be precise:
Id                                   SiteId                               DirName                                                                                LeafName                                                                                Level ParentId                             DeleteTransactionId                WebId                                ListId                               DoclibRowId Type SortBehavior Size        ETagVersion EffectiveVersion InternalVersion ContentVersion NextBSN              MetadataNextBSN      StreamSchema HasStream   BumpVersion UIVersion   Dirty ListDataDirty DocFlags    ThicketFlag CharSet     ProgId                                                                                TimeCreated             TimeLastModified        NextToLastTimeModified  MetaInfoTimeLastModified TimeLastWritten         SetupPathVersion SetupPath                                                                                SetupPathUser                                                                                CheckoutUserId DraftOwnerId CheckoutDate            CheckoutExpires         VersionCreatedSinceSTCheckout LTCheckoutUserId CheckinComment                                                                                IsCheckoutToLocal VirusVendorID VirusStatus VirusInfo                                                                                VirusInfoEx                                                                                MetaInfo                                                                                MetaInfoSize MetaInfoVersion UnVersionedMetaInfo                                                                                UnVersionedMetaInfoSize UnVersionedMetaInfoVersion WelcomePageUrl                                                                                WelcomePageParameters                                                                                IsCurrentVersion AuditFlags  InheritAuditFlags UIVersionString                                               ScopeId                              BuildDependencySet                                                                                ParentVersion ParentVersionString                                           TransformerId                        ParentLeafName                                                                                CtoOffset Extension                                                                                ExtensionForFile                                                                                ItemChildCount FolderChildCount FileFormatMetaInfo                                                                                FileFormatMetaInfoSize FFMConsistent ListSchemaVersion ClientId
------------------------------------ ------------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ----- ------------------------------------ ---------------------------------- ------------------------------------ ------------------------------------ ----------- ---- ------------ ----------- ----------- ---------------- --------------- -------------- -------------------- -------------------- ------------ ----------- ----------- ----------- ----- ------------- ----------- ----------- ----------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------- ----------------------- ----------------------- ------------------------ ----------------------- ---------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------- ------------ ----------------------- ----------------------- ----------------------------- ---------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------- ------------- ----------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------ --------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------- -------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------- ----------- ----------------- ------------------------------------------------------------- ------------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------- ------------------------------------------------------------- ------------------------------------ -------------------------------------------------------------------------------------------------------------------------------- --------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------- ---------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------- ------------- ----------------- ----------------------------------
5E6A066A-8574-45E3-A1E1-B560C4B8DA02 BC873236-5BA0-4301-8225-64BC2C3EB805 MyTeamSite/PublishingImages/SitePages/Home                                                                                InternerError.png                                                                                1     BB3A78E8-2DDF-463B-94A3-40A7D528BB21 0x                                 ACD5871E-515B-493E-865E-4224FA8721C8 A4D65844-134F-4293-ACFA-9B7D8CF577E8 5           0    0            27725       3           769              769             3              162                  100                  66           1           0           512         0     1             324         0           -2          NULL                                                                                2017-09-01 13:33:34.000 2017-09-01 13:33:45.000 2017-09-01 13:33:34.000 2017-09-04 11:25:18.000  2017-09-01 13:33:34.000 15               NULL                                                                                NULL                                                                                NULL           NULL         NULL                    NULL                    0                             NULL             NULL                                                                                0                 NULL          NULL        NULL                                                                                NULL                                                                                0xA8A930310C00000094030000789C7552ED6E9B3014FD1F29EFD00718C1363601A46982906CA8EB362559D34D9590013758831861930489879F09591A75A9FCC3BEBE9FE79CBB573C567953263BCA0B76E452492FD874AA6ED878B4D7CE8AD692D57B564B2E76DE6AD9413201FA608CC01021154FFFB4294D73965545B3DDD2 541          3               NULL                                                                                NULL                    NULL                       NULL                                                                                NULL                                                                                1                NULL        NULL              1.0                                                           15EBFCE1-3895-4F2C-9465-C0793D3B1F0C NULL                                                                                NULL          NULL                                                          NULL                                 NULL                                                                                NULL      png                                                                                png                                                                                0              0                NULL                                                                                0                      0             31                NULL
725C6131-B32F-445B-9D08-07D2859A80B9 BC873236-5BA0-4301-8225-64BC2C3EB805 MyTeamSite/PublishingImages/SitePages/Home/_t                                                                                InternerError_png.jpg                                                                                1     5126E781-DCE5-418A-8436-81EF01DB7CD1 0x                                 ACD5871E-515B-493E-865E-4224FA8721C8 A4D65844-134F-4293-ACFA-9B7D8CF577E8 NULL        0    0            3130        3           769              513             1              162                  100                  66           1           1           512         1     0             326         0           -2          NULL                                                                                2017-09-01 13:33:34.000 2017-09-01 13:33:34.000 NULL                    2017-09-01 13:33:45.000  2017-09-01 13:33:45.000 15               NULL                                                                                NULL                                                                                NULL           NULL         NULL                    NULL                    0                             NULL             NULL                                                                                0                 NULL          NULL        NULL                                                                                NULL                                                                                0xA8A930310C00000085000000789C2B2BC98C4FCBCF49492DCA2C49CD4DCE2FCD2BB1F20CAA31E0E52A03CA24969664E417590507D5047B3806B906F87BFA85C4C414571603D54254E4E6A764A665A6A62455E25305B1A1B83409BB5500E04B30AE                                                             97           3               NULL                                                                                NULL                    NULL                       NULL                                                                                NULL                                                                                1                NULL        NULL              1.0                                                           15EBFCE1-3895-4F2C-9465-C0793D3B1F0C NULL                                                                                NULL          NULL                                                          NULL                                 NULL                                                                                NULL      jpg                                                                                jpg                                                                                0              0                NULL                                                                                0                      0             31                NULL
15A3E00F-8EE8-4C5D-8472-546513C8114D BC873236-5BA0-4301-8225-64BC2C3EB805 MyTeamSite/PublishingImages/SitePages/Home/_w                                                                                InternerError_png.jpg                                                                                1     C43312F9-8CA5-43C5-B2BE-071964FDAF9C 0x                                 ACD5871E-515B-493E-865E-4224FA8721C8 A4D65844-134F-4293-ACFA-9B7D8CF577E8 NULL        0    0            26951       3           769              513             1              162                  100                  66           1           1           512         1     0             326         0           -2          NULL                                                                                2017-09-01 13:33:34.000 2017-09-01 13:33:34.000 NULL                    2017-09-01 13:33:45.000  2017-09-01 13:33:45.000 15               NULL                                                                                NULL                                                                                NULL           NULL         NULL                    NULL                    0                             NULL             NULL                                                                                0                 NULL          NULL        NULL                                                                                NULL                                                                                0xA8A930310C00000085000000789C2B2BC98C4FCBCF49492DCA2C49CD4DCE2FCD2BB1F20CAA31E0E52A03CA24969664E417590507D5047B3806B906F87BFA85C4C414571603D54254E4E6A764A665A6A62455E25305B1A1B83409BB5500E04B30AE                                                             97           3               NULL                                                                                NULL                    NULL                       NULL                                                                                NULL                                                                                1                NULL        NULL              1.0                                                           15EBFCE1-3895-4F2C-9465-C0793D3B1F0C NULL                                                                                NULL          NULL                                                          NULL                                 NULL                                                                                NULL      jpg                                                                                jpg                                                                                0              0                NULL                                                                                0                      0             31                NULL

For example I go to Home.aspx and click edit and after that upload an imege and save it. How I can retrieve this image ? I've already tried to fetch binary data as string, write bytes to a file. But unfortunatelly it wasn't successeful.
And also I find out some changes at DocStreams table (SP2013)
select s.*
from AllDocs d
     inner join DocStreams s on s.DocId = d.Id
where LeafName like '%MyImage%'

DocId                                SiteId                               Partition BSN                  Size        Content                                                                                RbsId                                                                                Type ExpirationUTC
------------------------------------ ------------------------------------ --------- -------------------- ----------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------- ---- -----------------------
725C6131-B32F-445B-9D08-07D2859A80B9 BC873236-5BA0-4301-8225-64BC2C3EB805 0         162                  4348        0x05640000000011240202FD760144842640994A7749B9DB9DB3230505240200A22808E12869144891DB06708622F74A00052402035DD7F71ED796EBB76E24F98F79DD08B5000524020502FD760144842640994A7749B9DB9DB3000000091502886400220000200E020000031632BA324E2E052400010D0D000524013E000020 NULL                                                                                11   NULL
15A3E00F-8EE8-4C5D-8472-546513C8114D BC873236-5BA0-4301-8225-64BC2C3EB805 0         162                  28173       0x056400000000112402485D2C9589D23349BDEA3C0A31E5966F230505240200B7CA7DC2B5EAB04A95FFEFAC5048286600052402034835823D4A154FB56A001053AFB7D7990005240205485D2C9589D23349BDEA3C0A31E5966F000000091502004D03220000200E020000039C4C03BA324E2E052400010D0D000524013E0000 NULL                                                                                11   NULL
5E6A066A-8574-45E3-A1E1-B560C4B8DA02 BC873236-5BA0-4301-8225-64BC2C3EB805 0         162                  28947       0x0564000000001124020044B3B515D60F4383F7151A171CB8FB2305052402002140656A38629A4693ACA5D0EB68F7DF0005240203DEBF9A95C79D65B96C535A2F1497082000052402050044B3B515D60F4383F7151A171CB8FB000000091502306503220000200E02000003CC6403BA324E2E052400010D0D000524013E0000 NULL                                                                                11   NULL


text:
Q: Permutations: Discrete Math
How many permutations are there of the set $(a,b,c,d,e,f,g)$

My Answer:
Since there are 7 elements in the set, $7! = 7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1 = 5040$
Am I right?

A: Almost right - refine your answer to "$7$ distinct elements".
More generally, given a collection (aka multi-set) of:

*

*$m_1$ identical elements

*$m_2$ identical elements

*$\ldots$

*$m_n$ identical elements

The number of permutations of the elements in it is:
$$\frac{n!}{{m_1!}\cdot{m_2!}\cdot\ldots\cdot{m_n!}}$$


text:
Q: asp.net - build linkedin style photo cropper On linkedin.com, the photo that you can manage for your profile has the ability to select a "region" from the photo to crop and use as your profile picture.
I assume that it uploads the original picture to a server, and then stores the x,y of the top left corner, and the width and height.
Does anyone know of a web example of something like this?  The platform is asp.net 3.5, ideally.

A: check this out - this might be of help
http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/
has a demo at
http://www.defusion.org.uk/demos/060519/cropper.php


text:
Q: How does MVVM fit into WPF when you must refer directly to a control I'm new to WPF and I'm attempting to incorporate MVVM design pattern into my projects. In all the MVVM examples I've seen, the MainWindow.xaml.cs is only used to set the DataContext to the view model.
this.DataContext = viewModel;

Everything is very neat and decoupled away from the UI. events were also replaced with commands. There are two questions that I have regarding this.

*

*I'm wondering about how you are supposed to hook up controls that don't have the command property.

*What am I supposed to do when I would typically interact directly with a control e.g. Perhaps I want to set a combobox's index to -1. How am I supposed to do this on the view model?

A: The collected comments by @EdPlunkett, @Clemens and @BionicCode answered my questions.
To Summarise:

*

*I can interact with controls by binding to their properties through INotificationChanged and ObservableCollection

*Elements that don't have a command property can still have properties bound to an ICommand property in the viewmodel.


text:
Q: one real analysis problem to prove the existence of a sequence and limit of a sequence Question: Suppose that S is a nonempty subset of R that is bounded above and put s = sup S.Show that there is a sequence (xn) such that xn ∈ S for all n and lim as n apporaches infinity  xn = s.
Hi, I am a beginner for real analysis, the question about is the one that I am trying to do on my own, but I don't know how to analyze or solve it after I write the definitions out.
What I am thinking is that,
Given:  S is a non-empty subset of R that is bounded above and s equals to the sup A
Prove: <1> there is a sequence (xn) such that xn belongs to s for all n,
<2> limit of xn as n approaches to infinity is s
Thoughts: since S is a nonempty subset of R that is bounded above, then there exists a number t such that t is greater or equal to s for all s belongs to S, so we know t is an upper bound of s.
Since s = sup S, then s is the least upper bound of S. since t is an upper bound for S, and s is the least upper bound, then t is also greater or equal to sup S. For the limit part, according to the definition of limit, we can write that |an-s|< epsilon.
I stop here because I don't how to do the following steps, I don't know how to use the information that I have so far to explain this questions.
Any help will be super appreciated
Thanks a lot

A: Let $s= \sup S$. We know that:
$$
\text{ for any $\varepsilon>0$, there is $x\in S$ such that $s-\varepsilon < x$}.
$$
Thus for each $n>0$ you can choose $x_n\in S$ such that
$$
s - \frac 1 n < x_n.
$$
Clearly, then, $s - \frac 1 n < x_n\le s$ for all $n>0$, so  $\lim_n x_n$ exists and equals $s$.

A: Hint: Put $s=\sup S$. If $s\in S$, define $x_n\equiv s$ and we are done.
Otherwise $s\notin S$. For each positive integer $n$, select $x_n\in S$ with $x_n\in (s-\frac1n,s)$ (why is this possible?). Then by construction $x_n \to s$ and each $x_n\in S$.

A: There is an alternating definition for $\sup$ will be useful here,  $s=\sup S$ iff 1) $s$ is an upper bound of $S$ and 2) for any $\epsilon>0$, $s-\epsilon$ is NOT an upper bound of $S$. (Try prove it using your definition)
Using above statement, for all $n\in\mathbb{N}$, $s-\frac{1}{n}$ is not an upper bound of $s$, which means $\exists x_n\in S$, such that $x_n>s-\frac{1}{n}$. Also since $s$ is an upper bound of $S$, $x_n\le s$. Hence we have $$s-\frac{1}{n}<x_n\le s,\forall n\in\mathbb{N}$$
Can you continue here to justify $x_n\to s$?

A: Let $s=\sup S$.
We know that:
$\forall ε>0 \;\exists x∈S/\;s−ε<x \;$(By definition of supremum)
$\Rightarrow$ Given $ε_{1} = 1\gt0,\,\exists x_{1}\in S/ s-1\lt x_{1}\le s \;$(By def. of sup)
And
$\Rightarrow$ Given $ε_{2} = \frac{1}{2}\gt0,\,\exists x_{2}\in S/ s-\frac{1}{2}\lt x_{2}\le s \;$(By def. of sup)
And
$\Rightarrow$ Given $ε_{3} = \frac{1}{3}\gt0,\,\exists x_{3}\in S/ s-\frac{1}{3}\lt x_{3}\le s \;$(By def. of sup)
In an iterative way:
$\Rightarrow$ Given $ε_{m} = \frac{1}{m}\gt0,\,\exists x_{m}\in S/ s-\frac{1}{m}\lt x_{m}\le s,\, m\in \mathbb{N},\;$(By def. of sup)
Then, choosing all $x_{m}$ and forming the sequence $(x_{n})_{n}$, we have:
$$s-\frac{1}{n}\lt x_{n}\le s,\forall n\in \mathbb{N},$$
$\Rightarrow \lim\limits_{n \to \infty} x_{n} = s$


text: Q: Multi chain wallet provider(EVM + Solana) I'm trying to find a library or some reference for using both EVM-based wallet provider and Solana Wallet Adapter in a single dApp, but couldn't find any. If anyone could help me find some references, would really help.


text:
Q: How to iterate through $_POST to update multiple recordsets in DB via PDO I'm new to PDO and associative arrays but am making good progress. I've set up this code to save a html form to a single recordset:
$str_sql = "UPDATE tbl_benutzer SET ";
    foreach($_POST as $key=>$value){
        if($key=='id'){continue;}
        $str_sql .= $key." = :".$key.", ";
    }
    $str_sql = substr($str_sql,0,-2)." WHERE id = :id";

    ///////SAVE DATA TO DB///////
    $stmt = $conn->prepare($str_sql);
    $stmt->execute($_POST);

Now I want to adapt the same code to save the contents of a html form to multiple recordsets. Here's the HTML:
<input name="id[]" value="1">
<input name="tarif[]" value="A">
<input name="mitgliedschaft[]" value="X">
<input name="gebuehr[]" value="100">

<input name="id[]" value="2">
<input name="tarif[]" value="B">
<input name="mitgliedschaft[]" value="Y">
<input name="gebuehr[]" value="200">

<input name="id[]" value="3">
<input name="tarif[]" value="C">
<input name="mitgliedschaft[]" value="Z">
<input name="gebuehr[]" value="300">

And here's the $_POST array:
Array ( [id] => Array ( [0] => 1 [1] => 2 [2] => 3 )
[tarif] => Array ( [0] => A [1] => B [2] => C )
[mitgliedschaft] => Array ( [0] => X [1] => Y [2] => Z )
[gebuehr] => Array ( [0] => 100 [1] => 200 [2] => 300 ) )

This is what I've tried so far but my head's just not getting around it!:
$str_sql = "UPDATE tbl_stamm_tarif SET ";
    foreach($_POST as $key=>$value){
        if($key=='id'){continue;}
        $str_sql .= $key." = :".$key.", ";
    }
    $str_sql = substr($str_sql,0,-2)." WHERE id = :id";
    echo $str_sql;

    ///////SAVE DATEN TO DB///////
    $stmt = $conn->prepare($str_sql);
    foreach($_POST as $key=>$value){
        foreach($value as $key2=>$value2){
            $stmt->execute(array($key=>$value2));
        }
    }

Thanks in advance for any help!

A: I'd consider changing your HTML structure to something like:
<input name="**model_name**[**id1**][tarif]" value="A">
<input name="**model_name**[**id1**][mitgliedschaft]" value="X">
<input name="**model_name**[**id1**][gebuehr]" value="100">

<input name="**model_name**[**id2**][tarif]" value="B">
<input name="**model_name**[**id2**][mitgliedschaft]" value="Y">
<input name="**model_name**[**id2**][gebuehr]" value="200">

(for an UPDATE page you shouldn't really be allowed to change the id)
That way you can just iterate through the models as:
foreach($_POST['**model_name**'] as $id=>$model){}

and perform the UPDATE on each iteration as before.
UPDATE
I'd also be wary of your code as it is hugely vulnerable to SQL injection.. you should really check the value of each $key against the known columns before spanking straight it into a statement. Otherwise the user can submit their own $key and open up your database.
UPDATE 2
Either pull the columns from the database, or hard code them into whatever PHP model class you are using as an array (saves a trip, but needs doing if you change the schema).
I'd probably assign the values to a keyed array in the model class from the $_POST array before running the SQL, as you may need them later.
N.B.
A lot of these issues have already been solved in the various frameworks out there; no idea what your project is (could be writing a framework) but for anyone stumbling across this frameworks can save a lot of work and security vulnerabilities!


text:
Q: Displaying your own Error messages in Scala/Play Framework According to the following pages, one can serve one's own error page when encountering server errors.
https://www.playframework.com/documentation/2.2.x/ScalaGlobal
http://alvinalexander.com/scala/handling-scala-play-framework-2-404-500-errors
To do this, you need to override the app.Global.onError() method with something like the following:
override def onError(request: RequestHeader, ex: Throwable) = {
    Future.successful(InternalServerError(
     views.html.errorPage(ex)
    ))
}

However, I would like to not use InternalServerError(), but instead use my own page creation method that creates the entire page: html, head, body tags and all.
So I would like to override the method in the following way:
override def onError(request: RequestHeader, ex: Throwable) = {
    controllers.PageCtrl.render("error", "500")
}

The PageCtrl.render() method creates all my pages. I would like it to create the error page as well. The render() method ensures all pages include all the proper JavaScript and CSS references, the proper header and footer, etc.
However, when I call the render() method, I get the following error:
type mismatch;
 found   : play.api.mvc.Action[play.api.mvc.AnyContent]
 required: scala.concurrent.Future[play.api.mvc.Result]

Question: So how would I go about converting the AnyContent datatype into a Result datatype?

A: I would advise keeping the default error handler in place for local development (because it's useful to see exceptions and compile issues). You can do that and accomplish what you want with the following:
  override def onError(request: RequestHeader, ex: Throwable): Future[Result] = {
    if (play.api.Play.isDev(play.api.Play.current)) {
      super.onError(request, ex)
    } else
      Future {
        InternalServerError(
          views.html.myawesomeerrorpage()
        )
      }
  }


text:
Q: Calling back a crypted password? I hashed my password into the database using the crypt() function.
$cryptpass = crypt($user_pass);

Now when i try to login in with my password that is "test" it wont work.
Here is the PHP from login
$user_name = mysql_real_escape_string($_POST['user_name']);
$user_pass = crypt($_POST['user_pass']);
$user_level = mysql_real_escape_string($_POST['user_level']);

$encrypt = md5($user_pass);
$admin_query = "select * from admin_login where user_name='$user_name' AND user_pass='$user_pass' AND user_level='$user_level'";

Sorry i am kinda new to password hashing , in the whole time i saved my passwords as plain texts.
EDIT: When i echo the query here are the results
crypt = $1$vh4.Mq4.$YaABh9aqRKbKpACTDApWb1 ,select * from admin_login where user_name='testcr' AND user_pass='$1$vh4.Mq4.$YaABh9aqRKbKpACTDApWb1' AND user_level='a' ,the real password is "test" .

A: Try debugging your SQL statement.
$admin_query = "select * from admin_login where user_name='$user_name' AND user_pass='$user_pass' AND user_level='$user_level'";

echo $admin_query;

Run the query in your SQL engine and see if you can spot the differences.

A: You have choosen an extremely unsafe way to store the passwords (DES and MD5 hash without salting). You should think about using PHP's function password_hash(), to create a BCrypt hash.
For verification you will first have to get the hash from the database by username, afterwards you can verify the password with password_verify(). Directly verifying the hash with an SQL query is not possible because of the salt.
// Hash a new password for storing in the database.
// The function automatically generates a cryptographically safe salt.
$hashToStoreInDb = password_hash($password, PASSWORD_BCRYPT);

// Check if the hash of the entered login password, matches the stored hash.
// The salt and the cost factor will be extracted from $existingHashFromDb.
$isPasswordCorrect = password_verify($password, $existingHashFromDb);

If you are interested to read more about this topic, have a look at my tutorial about safely storing passwords.


text:
Q: Laravel 5 Artisan::call dose not work correctly I use Laravel 5.5 and I have Controller like this.
use Illuminate\Support\Facades\Artisan;
---------------------
public function index()
{
    Artisan::call('config:cache');
}

but it  not work correctly and show me this message in browser:

This site can't be reached
The connection was reset.
Try:
Checking the connection
Checking the proxy
  the firewall
Running Windows Network Diagnostics
ERR_CONNECTION_RESET

It already worked but it not work correctly now.
Note1: All commands in Artisan dose not work, for example migrate,seed,...
Note2: I install another laravl 5.5 script and test  Artisan::call method and it work correctly but it dose not work correctly in my script.


text:
Q: Prevent keyboard in webView I want it to be impossible for the soft keyboard to pop up due to an action in the my webView. That's because I have a custom "keyboard" consisting of buttons below the webView. However, I don't want to completely disable the keyboard for my application, as I have to use it in different contexts. It just shouldn't show up when the user clicks on an input field inside the webView. I also don't want the keyboard to show and instantaneously hide again.
I currently have this in my AndroidManifest.xml:
android:windowSoftInputMode="stateAlwaysHidden"

I already tried disabling the focus of the webView, but then I can't enter text with my custom "keyboard" either, as the input field of the webView aren't focused.
I also tried this in onCreate, but it didn't work (the keyboard still showed up):
View focusedView = this.getCurrentFocus();
if (focusedView == null)
    return;
InputMethodManager manager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (manager == null)
    return;
manager.hideSoftInputFromWindow(focusedView.getWindowToken(), InputMethodManager.HIDE_IMPLICIT_ONLY);

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

A: sorry I'm late on this one.
But here is the solution:
Add this in your parent layout:
android:descendantFocusability="blocksDescendants"

Set these two properties of your WebView:
android:focusable="false"
android:focusableInTouchMode="true"

This works for me :)

A: Use this in your WebView
 android:descendantFocusability="blocksDescendants"
 android:focusable="false"
 android:focusableInTouchMode="false"

Try this
<WebView
    android:id="@+id/myWebView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:descendantFocusability="blocksDescendants"
    android:focusable="false"
    android:focusableInTouchMode="false" />

A: getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

call this before everything

A: Paste this in your onCreate method after setContentView
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
Keyboard wont show when you run this activity.


text:
Q: How to specify a Composite Primary Key while defining a Custom Interface as a JpaRepository? I have two Entity class with below attributes:
class Parent {
    @Id
    string columnA;

    string columnB;
}

class Child {
    //confused here: ManyToOne with Parent class

    string columnC;
    string columnD;
}

I want SQL Tables as below:

*

*Parent ( columnA(Primary Key), columnB )

*Child ( columnA(Foreign Key), columnC, columnD ) where,

*

*primary key = (columnA, columnC) and,

*(Child -> ManyToOne -> Parent) relationship.

Question1: How can I create the correct Entity class for the Child?
Question2: I want to have a childRepository interface that extends JpaRepository. I am confused, how to specify the composite primary key?
public interface childRepository extends JpaRepository<Child, 'What to write here?'>{
}

A: Question-1: It depends on your business logic.
Question-2: Create new class in order to store child entity's ids
@Embeddable
public class ChildId implements Serializable{

   private String columnA;
   private String columnC;

   // getters and setters
}

In your child class:
@EmbeddedId
private ChildId childId;

@MapsId(value = "columnA")
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "columnA")
private Parent parent;

In your ChildRepository:
public interface ChildRepository extends JpaRepository<Child, ChildId>{}

PS: you can apply other ways according to business logic


text:
Q: jQuery UI resizable grid with spaces I am using the "resizable" widget of jQuery UI to add a resize functionality to an element.
With the "grid" option, the element can be resized based on a given grid, say 100/80. I want the grid cells to be spaced (say 5) so I made the actual grid 105/85.
I drew the grid in a "canvas" element so that it is easier to see:
http://jsfiddle.net/xpvt214o/584794/
$box.resizable({
    handles: "all",
    grid: [105, 85]
});

Resizing from the right/bottom sides works well but when resizing from the top/left sides, it forces the minimum box size to 105x85.
I understand that within the grid, it tries to set the minimum dimension to a grid cell but since the right/bottom sides work how I need them to, I am looking to have the same behavior for top/left as well.
I am trying to edit the jQuery UI code to make this change so that I don't have to code a complete new resizable functionality on my own.
I searched through the source code of the resizable widget but I cannot locate the code that forces the minimum dimensions on the top/left resize. I am hoping that someone with more experience in working with the jQuery UI code can point me in the right direction.
The source code of the resizable widget can be previewed here:
https://github.com/jquery/jquery-ui/blob/master/ui/widgets/resizable.js
Or it can be downloaded from https://jqueryui.com > "Custom download" and selecting only "Resizable".

A: After searching through the source code of the resizable widget of jQuery UI, I have managed to find the code that makes the left and top resizing be different.
The fix is simple and requires only disabling 2 lines of code:
$.ui.plugin.add( "resizable", "grid", {

    resize: function() {
        ...
        } else {
            if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
                outerDimensions = that._getPaddingPlusBorderDimensions( this );
            }

            if ( newHeight - gridY > 0 ) {
                that.size.height = newHeight;
                that.position.top = op.top - oy;
            } else {
                // newHeight = gridY - outerDimensions.height;
                that.size.height = newHeight;
                that.position.top = op.top + os.height - newHeight;
            }
            if ( newWidth - gridX > 0 ) {
                that.size.width = newWidth;
                that.position.left = op.left - ox;
            } else {
                // newWidth = gridX - outerDimensions.width;
                that.size.width = newWidth;
                that.position.left = op.left + os.width - newWidth;
            }
        }
    }

}


text:
Q: Tradebox 404 - File Not Found Sorry! Cannot seem to find the page you were looking for After I finished the my installation I got this error:

404 - File Not Found
Sorry! Cannot seem to find the page you were looking for.

I don't know how to resolve this error. The .htaccess look like this:
# Disable directory browsing
Options All -Indexes

---------------------------------------------------------------------

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]

    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

<IfModule !mod_rewrite.c>

    ErrorDocument 404 index.php
</IfModule>

ServerSignature Off


text:
Q: Magento 2.3 Error When Accessing Products From Admin Panel Receiving the following error when trying to access/edit Products through the admin panel using Magento 2.3.3:

[DOM] Found 2 elements with non-unique id #fulltext

The page times out and does not display products - only a blank grid. This has occurred after an Akeneo import. There are no errors in the Apache log or Magento system log. Please see attached image for the full error.


text:
Q: Strange behaviour of QML Text When I'm running following simple example:
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Window 2.2
import QtQuick.Layouts 1.3

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Popup {
        width: 100
        visible: true
        contentItem: ColumnLayout {
            Rectangle {
                Layout.fillWidth: true
                implicitHeight: 50
                color: "red"
            }

            Text {
                Layout.fillWidth: true
                text: "some very very very very very very very very very very very very long text"
                wrapMode: Text.WordWrap
            }
        }
    }
}

I'm getting the following warning: qrc:/main.qml:12:5: QML Popup: Binding loop detected for property "contentHeight" and Popup detects height incorrectly:

Maybe problem connected with Text's implicitHeight so it has some dependency on ColumnLayout's implicitHeight but I can't understand why.
Can anybody explain me how binding loop appears and how to solve it?

A: Solution:
Popup {
    width: 100
    visible: true
    contentItem: Column {

        Rectangle {
            width: parent.width
            implicitHeight: 50
            color: "red"
        }

        Text {
            width: parent.width
            text: "some very very very very very very very very very very very very long text"
            wrapMode: Text.WordWrap
        }
    }
}

About the warning:
It looks like a Bug, But I guess it's not. If two rects won't have that warning.
And remove Layout.fillWidth: true of Text also won't have.
So Text's height needs ColumnLayout's width and ColumnLayout expand height by Text's height. Feel like a paradox that two components require the size of each other.
Update:
Popup {
    width: 100
    visible: true
    contentItem: ColumnLayout {
        width: parent.width
        Rectangle {
            Layout.fillWidth: true
            implicitHeight: 50
            color: "red"
        }

        Text {
            Layout.fillWidth: true
            text: "some very very very very very very very very very very very very long text"
            wrapMode: Text.WordWrap
        }
    }
}


text:
Q: Can I use ADD AX. BL or SUB AX, BL in assembly language for 80x86? I am learning assembly language and there are a lot of details that I am not sure about. Do the two operands after ADD and SUB instructions have to be the same number of register bits if they are both registers?
I checked the x86 Instruction Set Reference and it seems to require the same, but I'm not quite sure, so any help would be appreciated.


text:
Q: What size are integers when programming cuda kernels I can't seem to find an answer to this simple question in the Cuda Programming Guide: When compiling a kernel with nvcc, What size integer is declared by short, int, long, and long long? Does it depend on my host architecture, so I should use int16_t, int32_t, and int64_t, or is it always a fixed size?

A: It depends on the host compiler.  Specifically, nvcc's definition of those types will agree with the host compiler's representation.
In practice, the char, short, and int data types have predictable sizes on all platforms that CUDA supports (8, 16, and 32 bits respectively).  However the size of long varies from platform to platform.


text:
Q: Do I need to implement IInterface methods when I create a Delphi TForm that uses an interface I am implementing a solution where I want my Delphi form to implement an interface. Normally, I would use TInterfacedObject but this a TForm. I implemented this without any regard to reference counting. And I did not see memory leaks reported.
TForm = class(TForm, ISomething)
But it seems if I don't inherit from TInterfacedObject, I should be implementing the three methods required.
Am I missing something?


text:
Q: How to Find Link Associated with Keyword using Python, Requests, and Beautiful soup I am very new python requests and beautiful soup so my code is probably really bad.
What I have now:
f = open('sites.txt','r')
sitelist = []
for line in f:
    sitelist.append(line.strip())
getsites = ['']
print(sitelist)
for i in range(len(sitelist)):
    getsites.append(sitelist[i])

for i in range(len(sitelist)):
    temp = requests.get(sitelist[i])
    data = temp.text
    soup = BeautifulSoup(data, "html.parser")
    for url in soup.find_all("Yeezy"):
        print(element.find_previous_sibling('loc'))
        print(url.text)

Example of XML File I am parsing:
<url>
<loc>
https://www.a-ma-maniere.com/products/beanie-502805f16-black-white
</loc>
<lastmod>2016-12-24T22:25:05Z</lastmod>
<changefreq>daily</changefreq>
<image:image>
<image:loc>
https://cdn.shopify.com/s/files/1/0626/9065/products/502805F16-1.jpg?v=1472499019
</image:loc>
<image:title>Alexander Wang: Beanie (Black/White)</image:title>
</image:image>
</url>

What I want to do is grab a keyword via the  then print the link associated with it stored in .

A: For find all you need to give it a tag to look for.  If you only want tags of that type that contain the word "Yeezy" then in your for loop check to see if the text of the tag is the string you are looking for.  If it is the string you are looking for then you have the element want and can print the url.
For most urls this is simply
for url in soup.find_all('a')
    if "Yeezy" in url.get_text():
        print(url['href'])

For yours more like
for url in soup.find_all('url')
    if url.find('image:title') and url.loc:
        if "Yeezy" in url.find('image:title').get_text()
            print(url.find('image:loc').get_text())

For additional information visit get_text()
Because you are trying to get an image at this point you might want to look at this answer as well.  You'll need a library that can read and store images rather than trying to access it as a builtin python object.


text:
Q: MySQL - keep most recent non-null value for each identifier I would like to create a query with the most up-to-date information for each player. The query should return one result per player. If a player has changed his gamertag, the results of the query should return the player's most recent, non-null gamertag. This behavior should extend to the other identifiers like city, state, and country. Here is some sample data for two players:
+-----------+-------------+-----------+--------+-----------+---------------+-------+
| player_id | recorded_at | gamertag  | prefix | city      | country       | state |
+-----------+-------------+-----------+--------+-----------+---------------+-------+
|     26640 |  1461421800 | Wobbaduck | NULL   | Toronto   | Canada        | ON    |
|     26640 |  1484931600 | Wobbaduck | NULL   | Saskatoon | Canada        | SK    |
|     26640 |  1510416000 | Mimic     | NULL   | NULL      | NULL          | NULL  |
|     26640 |  1516388400 | Mimic     | NULL   | NULL      | Canada        | SK    |
|     26640 |  1518278400 | Mimic     | NULL   | NULL      | NULL          | NULL  |
|      4507 |  1491678000 | The Moon  | NULL   | NULL      | NULL          | NULL  |
|      4507 |  1500645600 | The Moon  | MVG    | Buffalo   | United States | NY    |
|      4507 |  1533830400 | La Luna   | NULL   | New York  | United States | NY    |
+-----------+-------------+-----------+--------+-----------+---------------+-------+

The query should produce the result:
+-----------+----------+--------+-----------+---------------+-------+
| player_id | gamertag | prefix | city      | country       | state |
+-----------+----------+--------+-----------+---------------+-------+
|     26640 | Mimic    | NULL   | Saskatoon | Canada        | SK    |
|      4507 | La Luna  | MVG    | New York  | United States | NY    |
+-----------+----------+--------+-----------+---------------+-------+

The field recorded_at is used to keep track of the date in epoch seconds.
My previous attempts at accomplishing this have included both a subquery and a join for each of the identifiers gamertag, prefix, city, country, and state. I would like to avoid doing this, if possible.
I'm using MySQL 8.0.11.
I've created a db-fiddle with the sample data.

A: The sub query effectively fills down and the outer query picks the last recorded_at
drop table if exists t;
create table t( player_id int,  recorded_at int, gamertag varchar(20),  prefix varchar(20), city varchar(20), country varchar(20)
, state varchar(20));
insert into t values
(    26640 ,  1461421800 , 'Wobbaduck' , NULL   , 'Toronto'   , 'Canada'        , 'ON') ,
(    26640 ,  1484931600 , 'Wobbaduck' , NULL   , 'Saskatoon' , 'Canada'        , 'SK' ) ,
(    26640 ,  1510416000 , 'Mimic'     , NULL   ,  NULL       , NULL            , NULL ) ,
(    26640 ,  1516388400 , 'Mimic'     , NULL   ,  NULL       , 'Canada'        , 'SK' ) ,
(    26640 ,  1518278400 , 'Mimic'     , NULL   ,  NULL       , NULL            , NULL ),
(     4507 ,  1491678000 , 'The Moon'  , NULL   ,  NULL       , NULL            , NULL ),
(     4507 ,  1500645600 , 'The Moon'  , 'MVG'  , 'Buffalo'   , 'United States' , 'NY' ),
(     4507 ,  1533830400 , 'La Luna'   , NULL   , 'New York'  , 'United States' , 'NY' );

select *
from
(
select t.player_id,t.recorded_at,

            if(t.gamertag is null,
            (select t1.gamertag from t t1 where t1.gamertag is not null and t1.player_id = t.player_id and t1.recorded_at < t.recorded_at order by t1.recorded_at desc limit 1),
            t.gamertag) gamertag,

            if(t.prefix is null,
            (select t1.prefix from t t1 where t1.prefix is not null and t1.player_id = t.player_id and t1.recorded_at < t.recorded_at order by t1.recorded_at desc limit 1),
            t.prefix) prefix,

            if(t.city is null,
            (select t1.city from t t1 where t1.city is not null and t1.player_id = t.player_id and t1.recorded_at < t.recorded_at order by t1.recorded_at desc limit 1),
            t.city) city,

            if(t.country is null,
            (select t1.country from t t1 where t1.country is not null and t1.player_id = t.player_id and t1.recorded_at < t.recorded_at order by t1.recorded_at desc limit 1),
            t.country) country

 from t
 order by t.player_id, t.recorded_at
 ) s
 where s.recorded_at = (select max(recorded_at) from t t1 where t1.player_id = s.player_id);

+-----------+-------------+----------+--------+-----------+---------------+
| player_id | recorded_at | gamertag | prefix | city      | country       |
+-----------+-------------+----------+--------+-----------+---------------+
|     26640 |  1518278400 | Mimic    | NULL   | Saskatoon | Canada        |
|      4507 |  1533830400 | La Luna  | MVG    | New York  | United States |
+-----------+-------------+----------+--------+-----------+---------------+
2 rows in set (0.00 sec)

A: This isn't exactly what you want, but I think it could work. For the columns, it gets a comma separated list of values for each column. All you would have to do is get just the first value, which will be the most recent for that column.
select *
from player a
JOIN (SELECT MAX(`recorded_at`) as `recorded_at`,
        `player_id`,
        GROUP_CONCAT(`gamertag` ORDER BY `recorded_at` DESC) as `gamertag`,
        GROUP_CONCAT(`prefix` ORDER BY `recorded_at` DESC) as `prefix`,
        GROUP_CONCAT(`city` ORDER BY `recorded_at` DESC) as `city`,
        GROUP_CONCAT(`country` ORDER BY `recorded_at` DESC) as `country`,
        GROUP_CONCAT(`state` ORDER BY `recorded_at` DESC) as `state`
      FROM `player`
      GROUP BY `player_id`) b
    ON a.`player_id` = b.`player_id`
        AND a.`recorded_at` = b.`recorded_at`;

SELECT *
FROM `ideal_player`;

Query #1
select *
from player a
JOIN (SELECT MAX(`recorded_at`) as `recorded_at`,
        `player_id`,
        GROUP_CONCAT(`gamertag` ORDER BY `recorded_at` DESC) as `gamertag`,
        GROUP_CONCAT(`prefix` ORDER BY `recorded_at` DESC) as `prefix`,
        GROUP_CONCAT(`city` ORDER BY `recorded_at` DESC) as `city`,
        GROUP_CONCAT(`country` ORDER BY `recorded_at` DESC) as `country`,
        GROUP_CONCAT(`state` ORDER BY `recorded_at` DESC) as `state`
      FROM `player`
      GROUP BY `player_id`) b
    ON a.`player_id` = b.`player_id`
        AND a.`recorded_at` = b.`recorded_at`;

| player_id | recorded_at | gamertag | prefix | city     | country       | state | recorded_at | player_id | gamertag                                    | prefix | city              | country                     | state    |
| --------- | ----------- | -------- | ------ | -------- | ------------- | ----- | ----------- | --------- | ------------------------------------------- | ------ | ----------------- | --------------------------- | -------- |
| 4507      | 1533830400  | La Luna  |        | New York | United States | NY    | 1533830400  | 4507      | La Luna,The Moon,The Moon                   | MVG    | New York,Buffalo  | United States,United States | NY,NY    |
| 26640     | 1518278400  | Mimic    |        |          |               |       | 1518278400  | 26640     | Mimic,Mimic,Mimic,Mimic,Wobbaduck,Wobbaduck |        | Saskatoon,Toronto | Canada,Canada,Canada        | SK,SK,ON |

View on DB Fiddle


text:
Q: LightGBM - Binary Classification using train API I have a binary classification problem which I'm trying to solve using LightGBM's train and cv APIs.
First I have tuned the hyperparameters by using hyperopt together with an objective function that wraps the LightGBM CV API call. For that, since the target classes are highly unbalanced, I've used the customized focal loss function with f1-score evaluation to find the best fit.
When I try to fit the final model using the optimized parameters, the model doesn't consider it as a binary problem and outputs continuous values at prediction. See the attached image.
Anyone knows what I'm missing ?
Jupyter notebook


text:
Q: Api Version of a UI Component I'm developping an application using ActionBarSherlock component. My goal is to target all devices since level 8 API.
I've got an exception on a device running android 2.2.1 (level 8), when I try to inflate the following xml.
I don't know which component isn't ok. Could you guys help me ?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <ImageView
            android:id="@+id/albumImg"
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:src="@drawable/button" />

        <TextView
            android:id="@+id/albumStatic"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:text="Album :"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/albumTitle"
            style="@android:style/TextAppearance.Holo.Small"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/albumStatic"
            android:layout_toLeftOf="@+id/albumImg"
            android:text="(not found)" />

        <TextView
            android:id="@+id/albumStatic"
            style="@android:style/TextAppearance.Holo.Large"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:text="Album :"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/artistStatic"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/albumTitle"
            android:text="Artiste : "
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/artistName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignRight="@+id/albumTitle"
            android:layout_below="@+id/artistStatic"
            android:text="(not found)" />

    <LinearLayout
        android:id="@+id/tagsContainer"
        android:layout_width="match_parent"
        android:layout_height="35dip"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/albumImg"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <HorizontalScrollView
            android:id="@+id/tagsScrollView"
            android:layout_width="wrap_content"
            android:layout_height="32dip"
            android:layout_below="@+id/albumImg"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:gravity="center_vertical" >

            <LinearLayout
                android:id="@+id/tagsLayout"
                android:layout_width="wrap_content"
                android:layout_height="32dip"
                android:orientation="horizontal"
                android:gravity="center_vertical"
                android:layout_gravity="center_vertical" >

                <TextView
                    android:id="@+id/tags_static"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Tags : "
                    android:textAppearance="?android:attr/textAppearanceLarge" />

                <TextView
                    android:id="@+id/tags_tv"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="(none)" />

            </LinearLayout>
        </HorizontalScrollView>
        <View
            android:id="@+id/vertical_divider"
            android:layout_width="1dip"
            android:layout_height="match_parent"
            android:paddingLeft="16dip"
            android:paddingRight="16dip"
            android:background="?android:attr/dividerVertical" />

            <ImageButton

                android:id="@+id/BT_editTags"
                android:layout_width="wrap_content"
                android:layout_height="32dip"
                android:paddingLeft="8dip"
                android:paddingRight="8dip"
                android:layout_gravity="center_vertical"
                android:background="?android:attr/selectableItemBackground"
                android:src="@android:drawable/ic_menu_edit" />

    </LinearLayout>

        <TextView
            android:id="@+id/tracks_static"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/tagsContainer"
            android:paddingBottom="10dp"
            android:paddingTop="10dp"
            android:text="Tracks"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <ListView
            android:id="@+id/tracksListView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/tracks_static" >

            <!-- Preview: listitem=@android:layout/simple_list_item_1 -->
        </ListView>

        <TextView
            android:id="@+id/dateStatic"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/albumImg"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/artistName"
            android:text="Date : "
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBaseline="@+id/dateStatic"
            android:layout_alignBottom="@+id/dateStatic"
            android:layout_alignRight="@+id/artistName"
            android:layout_toRightOf="@+id/dateStatic"
            android:text="(not found)" />

    </RelativeLayout>

</LinearLayout>

The error log is talking about a scroll bar not found. But I'm pretty sure HorizontalScrollView and listView exists on API 8, don't they ?
Here is the error :
06-27 17:11:20.817: E/AndroidRuntime(2064): FATAL EXCEPTION: main
06-27 17:11:20.817: E/AndroidRuntime(2064): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.micky.scanthings/com.micky.scanthings.ScanView}: android.view.InflateException: Binary XML file line #121: Error inflating class android.view.View
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2753)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.app.ActivityThread.access$2500(ActivityThread.java:129)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2117)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.os.Looper.loop(Looper.java:143)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.app.ActivityThread.main(ActivityThread.java:4717)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at java.lang.reflect.Method.invokeNative(Native Method)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at java.lang.reflect.Method.invoke(Method.java:521)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at dalvik.system.NativeStart.main(Native Method)
06-27 17:11:20.817: E/AndroidRuntime(2064): Caused by: android.view.InflateException: Binary XML file line #121: Error inflating class android.view.View
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at com.actionbarsherlock.internal.ActionBarSherlockCompat.setContentView(ActionBarSherlockCompat.java:857)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at com.actionbarsherlock.app.SherlockFragmentActivity.setContentView(SherlockFragmentActivity.java:251)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at com.micky.scanthings.ScanView.onCreate(ScanView.java:58)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)
06-27 17:11:20.817: E/AndroidRuntime(2064):     ... 11 more
06-27 17:11:20.817: E/AndroidRuntime(2064): Caused by: java.lang.reflect.InvocationTargetException
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.View.<init>(View.java:1850)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at java.lang.reflect.Constructor.constructNative(Native Method)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)
06-27 17:11:20.817: E/AndroidRuntime(2064):     ... 25 more
06-27 17:11:20.817: E/AndroidRuntime(2064): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/scrollbar_handle_vertical.9.png from drawable resource ID #0x0
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.content.res.Resources.loadDrawable(Resources.java:1714)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.view.View.<init>(View.java:1901)
06-27 17:11:20.817: E/AndroidRuntime(2064):     ... 29 more
06-27 17:11:20.817: E/AndroidRuntime(2064): Caused by: java.io.FileNotFoundException: res/drawable-hdpi/scrollbar_handle_vertical.9.png
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.content.res.AssetManager.openNonAssetNative(Native Method)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.content.res.AssetManager.openNonAsset(AssetManager.java:418)
06-27 17:11:20.817: E/AndroidRuntime(2064):     at android.content.res.Resources.loadDrawable(Resources.java:1706)
06-27 17:11:20.817: E/AndroidRuntime(2064):     ... 31 more

Edit: This was due to the ?android:attr/dividerVertical and ?android:attr/dividerVertical (maybe among other thing, like the Holo theme).

A: Look at the very bottom of the stack trace:
Caused by: java.io.FileNotFoundException: res/drawable-hdpi/scrollbar_handle_vertical.9.png

Looks like you're missing a png file in drawable-hdpi folder.


text:
Q: How to increase performance in LWJGL? I'm new to LWJGL. When I try to make a level comprised of 100*100 cubes (I use QUADS to create it) I get about 8 fps on my laptop. When I delete 5 sides of the cube and leave only to render the top, I get 10fps. How can this be? When I was deleting the 5 sides of the cube I was expecting to get 5 or 6 times more performance. What I came to was that the amount of vertex doesn't affect performance ass bad as the amount of objects. I also create new instance of BLOCK class to store some random colors for all 6 sides of the cubes. Can anybody help me with this? How to drastically increase performance? (Just asking in general. Not step by step). The only thing I can think of right is now take a bunch of blocks that are at nearby and if they are the same block (dirt for example) render them as huge single block but changing the texture of it to make it look like a lot of blocks.

A: Hmm, in general, to increase performance, don't use glBegin/glEnd. (I am guessing this is what you are using, if not then disregard this answer). This is what is known as immediate mode, and is substantially slower than creating vertex/index buffers and then rendering from those. If your geometry is static then you should have no problem rendering 10000 cubes at 60 fps on a modern enough GPU. There is a tutorial on the lwjgl site here, and some more information on the opengl wiki here.


text:
Q: WMB8/.NET Compute Node Debug In WebSphere message Broker 8, the new .NET compute node is awesome to interface Windows based services and handle windows things. However, it is non trivial to debug the code. I was hoping any of you have some clues towards this:
Short info:
Message flows in WMB is developed in an eclipse based IDE and there is a debugger to step through the logic. It integrates seamless with Java compute nodes that execute java logic.
.NET compute node logic is actually a method in a class in a .DLL project in Visual C# (could be any Visual XX flavour theoretically). It seems Visual studio is able to start an external program to debug a DLL project. However, in this case, it will be hard to start WebSphere Message Broker as an external application. Is there a way to attach debugging to this specific DLL that is used only by this specific WMB message flow?

A: To step through the .NET compute node in WMB8 do the following.
This is NOT possible in Visual C# Express 2010 (free) edition.

*

*Setup your Visual Studio Build Configuration to Debug

*Make sure your Assembly path in Broker Toolkit points to the /Debug/yourcomputenode.dll and not the /Release/yourcomputenode.dll

*In Visual Studio, point out break points as needed

*Select "Debug", then "Attach to Process"

*You might need to select "Show processes for all users" and "Show processes in all sessions" to find WMB.

*Select the DataFlowEngine process that corresponds to your Execution group (having just one EG will make this easy)

*Run your flow, and it will break inside your .NET compute node, and you can debug as easy as in a Java Compute Node.

*This is independent to any debugging in Broker toolkit, you can choose to debug there as well, or skip it all together.

Debug Party time!


text:
Q: Get profile info from Android LinkedIn SDK How to get profile information from android Linkedin SDK?
I logged in using Linkedin SDK but i'm unable to get profile information.

A: LinkedIn has released latest SDK for all the platform, you can use that and get the profile of users, below is the code of the same,
String url = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name)";

APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.getRequest(this, url, new LinkedInConnection.Callback() {
    @Override
    public void onApiSuccess(ApiResponse apiResponse) {
        // Success!
    }

    @Override
    public void onApiError(LIApiError liApiError) {
        // Error making GET request!
    }
});

Also you can refer following url for detail,
https://developer.linkedin.com/docs/android-sdk


text:
Q: How would I reverse a css transition property width? So I want to make a css animation property where the width extends toward the left but it always extends to the right. I am trying to figure how to make the width extend left instead of the default right. How should I approach this problem? JsFiddle below
Jsfiddle
  Html:

Css:
div
{
    position:absolute;
    bottom:130px;
    left:130px;
    width:100px;
    height:100px;
    background:red;
    -webkit-transition:width 2s;
}

div:hover
{
    width:200px;
}

A: Adjust the left value as well:
Updated Fiddle
div {
    position:absolute;
    bottom:130px;
    left:130px;
    width:100px;
    height:100px;
    background:red;
    -webkit-transition:left 2s, width 2s;
}
div:hover {
    left:30px;
    width:200px;
}

A: You need to override your left side in order to extend the width leftward.
You have used left:130px; is the starting point of your div. And on div:hover you still didn't change the left so it automatically extends to the rightward as you have also sets the bottom:130px;
Your default width:100px; is change on div:hover to width:200px; so you need to decrease your left starting position on div:hover.  Here is a Demo.
div {
    position:absolute;
    bottom:130px;
    left:130px;
    width:100px;
    height:100px;
    background:red;
    -webkit-transition:left 2s, width 2s;
}
div:hover {
    left:30px;
    width:200px;
}


text:
Q: Missing required parameters exception, while param is filled in in URL I'm working on a Laravel project, where I have the following routes:
Route::group(['middleware' => ['web', 'auth'], 'prefix' => 'deliver'], function () {
    Route::get("{pitch}/play", "DeliverController@play")->name("deliver.play");
    Route::get('/', 'DeliverController@index')->name('deliver');
});

The route named deliver.play is being called like this:

As you can see, I pass the $pitch parameter to the route, however, on execution, the following error pops up:
ErrorException in UrlGenerationException.php line 17:
Missing required parameters for [Route: deliver.play] [URI: deliver/{pitch}/play].

Which normally means the {pitch} param isn't given, however, in the URL bar of my browser the param is there, giving me the complete URL of
http://localhost:8000/deliver/empty-pitch-13/play
So how is it possible for Laravel to not see the parameter im passing on to the route? Or is there something that I'm missing?
Thanks.
Edit:
I forgot to add the controller that the route links to. Here it is:
    public function play(Pitch $pitch)
    {
        if ($pitch->hasPresentation()) {
            $presentation = head($pitch->presentations);
            return view("deliver.play.index", $presentation);
        }
        return redirect()->route('slides.create', $pitch);
    }

A: Try this:
    $pitch]) }}">

and add the pitch params to the function like so
   Route::group(['middleware' => ['web', 'auth'], 'prefix' => 'deliver'], function () {
   Route::get("{pitch}/play", "DeliverController@play", function($pitch){
  //
  })->name("deliver.play");
   Route::get('/', 'DeliverController@index')->name('deliver');
   });


text:
Q: How to fix app engine server error when sending mail I import mail with
from google.appengine.api import mail

and send mail with
sender = "bot@myapp.appspotmail.com"
receiver = "email@example.com"
subject = "hi"
body =  "Hi"

mail.send_mail(sender, receiver, subject, body)

When I run the app on localhost, sending mail works fine. But when I try to send mail on the deployed app, I get

Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.

What's wrong??


text:
Q: New Power BI Embedded pricing model - page render I am not sure I understand totally the term page render in new Power BI Embedded pricing model.

We need to measure how often our clients load Power BI in order to charge them properly. But we still got the confusion how page render is counted under the hood.
From the definition:

A page render is counted any time Power BI visuals are loaded on a page. A page refresh counts as a page render, as does any other page interactivity, like slice and dice, filtering, etc. Typically, multiple queries running on the backend cores translate to a page render.

How we can understand Page Render in both cases Import and Direct Query mode for Report Embedding.
Scenario 1 with import mode:
Assume one page in our application embeds an report with import mode. This report has 2 tabs inside and each tab has 5 visual. So, this report has 10 visuals in total.
How many page render if user visits this page: 1 render (based on the whole report), or 2 (based on 2 tabs), or 10 (based on 10 visuals).
If user switches between two tabs in the report, is there any page render is count?
Now assume there is datetime slicer in the tab 1, if user use this slicer to do filtering. One render is counted on this case?
Scenario 2 with direct query:
The same with the scenario 1 with direct query report.

A: Im Aviv the PM for Power BI Embedded. Trying to add clarity and answer the above. A page render could be translated to queries running against the analytical data model. Every time a page is loading, each visual is running at least 1 query against the data model to get the aggregated data back and render the visual based on that data. Each query could be with a different level of complexity. Because it is impossible to make concrete statements on a page render due to the number of visuals on a page plus the complexity of the query ran to render these, we tried providing generic guidance about sizing. A page render == 10 queries ran against the data model. Each page load is a page render, unless it is already cached on the client side. Each time you apply a new filter on a visual/page there is a recalc and therefore a page render.
Hope this helps
Aviv


text:
Q: List of distinct XML element names using BeautifulSoup I am using BeautifulSoup to parse an XML document. Is there a straight-forward way to get a list of distinct element names that are used in the document?
For example, if this is the document:
<?xml version="1.0" encoding="UTF-8"?>
<note>
    <to> Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    Don't forget me this weekend!
</note>

I would like to get:
note, to, from, heading, body

A: You can use find_all() and get the .name for every tag found:
from bs4 import BeautifulSoup

data = """<?xml version="1.0" encoding="UTF-8"?>
<note>
    <to> Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    Don't forget me this weekend!
</note>
"""

soup = BeautifulSoup(data, 'xml')
print [tag.name for tag in soup.find_all()]

Prints:
['note', 'to', 'from', 'heading', 'body']

Note that for this to work, you need to have lxml module installed, since, according to the documentation:

Right now, the only supported XML parser is lxml. If you don't have
  lxml installed, asking for an XML parser won't give you one, and
  asking for "lxml" won't work either.

And, to follow this up, then why don't use a special XML parser directly?
Example, using lxml:
from lxml import etree

data = """<?xml version="1.0" encoding="UTF-8"?>
<note>
    <to> Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    Don't forget me this weekend!
</note>
"""

tree = etree.fromstring(data)
print [item.tag for item in tree.xpath('//*')]

Prints:
['note', 'to', 'from', 'heading', 'body']

To follow this, why use a third-party for such a simple task?
Example, using xml.etree.ElementTree from standard library:
from xml.etree.ElementTree import fromstring, ElementTree

data = """<?xml version="1.0" encoding="UTF-8"?>
<note>
    <to> Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    Don't forget me this weekend!
</note>
"""

tree = ElementTree(fromstring(data))
print [item.tag for item in tree.getiterator()]

Prints:
['note', 'to', 'from', 'heading', 'body']


text:
Q: SQL Server 2008 - find table with most rows Is there a way in SQL Server 2008 to find the table with the most rows in the database?

A: This will get you close:
SELECT
    [TableName] = so.name,
    [RowCount] = MAX(si.rows)
FROM
    sysobjects so,
    sysindexes si
WHERE
    so.xtype = 'U'
    AND
    si.id = OBJECT_ID(so.name)
GROUP BY
    so.name
ORDER BY
    2 DESC

A: Here's basically the same T-SQL that Chris Ballance provided, but using the new Object Catalog Views instead of the compatability views:
SELECT  SchemaName = schemas.[name],
        TableName = tables.[name],
        IndexName = indexes.[name],
        IndexType =
            CASE indexes.type
                WHEN 0 THEN 'Heap'
                WHEN 1 THEN 'Clustered'
            END,
        IndexPartitionCount = partition_info.PartitionCount,
        IndexTotalRows = partition_info.TotalRows
FROM    sys.tables
        JOIN sys.indexes
            ON  tables.object_id = indexes.object_id
                AND indexes.type IN ( 0, 1 )
        JOIN (  SELECT object_id, index_id, PartitionCount = COUNT(*), TotalRows = SUM(rows)
                FROM sys.partitions
                GROUP BY object_id, index_id
        ) partition_info
            ON  indexes.object_id = partition_info.object_id
                AND indexes.index_id = partition_info.index_id
        JOIN sys.schemas ON tables.schema_id = schemas.schema_id
ORDER BY SchemaName, TableName;

A: I just customize my SSMS 2008 to show the following additional columns
for tables
- Row Count
- Data Space Used (KB)
for databases
- Primary Data Location
- Last Backup Date
- Created Date
....
Works quicker for me most of the time without opening a query, I just click on the column header to go ASC or DESC


text:
Q: Crosstab Pivot or not? I am have difficulty wrapping my head around the following issue.  I currently have a set of data in one table as shown below:

As you can see, there is an invoice ref number along with a date, and two value fields.  Each row has either a Y or N for the desired group the record belongs to.
Unfortunately I don't have access to re-format the data (coming out of an ERP system), and ideally I want to pivot the date, Value1, Value2 fields into columns per group.  At the moment I have a rather long winded approach of creating 6 small temp table vars with the InvoiceRef and Date/Value1/Value2 for each of the 3 groups.
I then read the main table, joining (left join) on InvoiceRef to each of the InvoiceRef fields within each of the temp table vars to get the following output:

So as you can see, I get the Date/Value1/Value2 fields for each InvoiceRef in the desired group across the columns..
My question is I feel there is a more efficient way to do this?  although just trying to grapple with pivot/crosstab is proving a challenge - I feel I need some pointers or even confirmation the temp table solution is generally an acceptable solution in this case?
Many thanks in advance.
P.S: For reference I am using MS-SQL 2008 R2

A: This has nothing to do with pivoting, you simply want to replicate your three columns conditionally three times, according to the number of groups. A series of CASE expressions would do the job perfectly:
SELECT
  InvoiceRef,
  Group1Date   = CASE Group1 WHEN 'Y' THEN Date   END,
  Group1Value1 = CASE Group1 WHEN 'Y' THEN Value1 END,
  Group1Value2 = CASE Group1 WHEN 'Y' THEN Value2 END,
  Group2Date   = CASE Group2 WHEN 'Y' THEN Date   END,
  Group2Value1 = CASE Group2 WHEN 'Y' THEN Value1 END,
  Group2Value2 = CASE Group2 WHEN 'Y' THEN Value2 END,
  Group3Date   = CASE Group3 WHEN 'Y' THEN Date   END,
  Group3Value1 = CASE Group3 WHEN 'Y' THEN Value1 END,
  Group3Value2 = CASE Group3 WHEN 'Y' THEN Value2 END
FROM
  dbo.atable
;