text:
Q: Prove $|\arctan x - \arctan y|\leq |x-y|$ I have to prove that $|\arctan x - \arctan y|\leq |x-y|$ for all real numbers $x$ and $y$. I know that it has something to do with the mean value theorem but I just don't know how to solve it.
All help is appreciated
Thanks in advance :)

A: Let $f(t) = \arctan t$. It is differentiable everywhere. Thus, apply MVT on the interval $(x,y)$, that is, we can find some $\xi \in (x,y)$ such that
$$ | \arctan x - \arctan y| \leq | f'( \xi ) | |x- y| $$
Notice, $f'(t) = \frac{1}{1+t^2} = 1 - \frac{t^2}{1+t^2} \leq 1 $ for all $t$. Thus, in particular, for $t = \xi$, $|f'(\xi)| \leq 1$. We conclude that
$$ |\arctan x - \arctan y | \leq | x - y| $$
as desired.

A: The mean value theorem states that for a differntiable function $f$ and given real numbers $u$ and $v$ (where $u<v$) within the function's domain, there exists $c\in (u,v)$ such that $$f'(c)=\frac{f(v)-f(u)}{v-u}$$
Now, consider the function $f(t)=\tan{t}$ over $(-\pi/2,\pi/2)$. Therefore due to the mean value theorem there exists $c$ as explained above that $$1+\tan^2{c}=\frac{\tan v-\tan u}{v-u}$$
Obviously the LHS is always greater that one, so $$1\leq \frac{\tan v-\tan u}{v-u}$$ Or equivalently (since both sides are positive) $$1\leq \frac{|{\tan v-\tan u}|}{|v-u|}$$ Multiplying both sides by $|v-u|\ne 0$ and setting $v=\arctan x$ and $y=\arctan u$, you'll get $$|{\arctan x-\arctan y}|\leq |x-y|$$


text:
Q: How to Populate a Multi-column Combobox via code? On my Access form I have an empty combobox with it's Row Source Type set to Table/Query, and Bound Column set to 1.
What I want to do is via code, to fill this combobox with two columns, where it displays the first column to the user and then in code I'll fetch the value from the second column.
My question is, how do I fill the columns?  I know how to fill the combobox if the Row/Source is set to Value List - but that's just a flat list; I want two columns here.
I cannot use a separate query/table for the column data because I am generating it dynamically.  Basically, I am filling the combobox with a list of edit field control names and their captions.  The user selects the caption name from the combobox and then I can fetch the control name.
I just need to know how to add data to columns in the combobox.
So, I figure something like this (I know this is incorrect, but you can see what I am trying to accomplish):
Me.mycombobox.AddItem("column 1 data";"column2 data")

A: If you add this into to your event that will trigger the combobox being filled it should shed some light on your question:
Me.Combo0.RowSource = "Row1Column1;Row1Column2;Row2Column1;Row2Column2"

Make sure that your Column Count is set to 2 for this example. Basically you will just build a string formatted like the one in the example filled with the contents that you want to be filled into the combobox. Then just assign it to your Combobox's RowSource.
Basically when you input 6 items as the RowSource:
Item1, Item2, Item3, Item4, Item5, Item6

It will shift based on what you have the Column Count is set to, for example if the column count is set to 3, the above list will turn into:
Item1 Item2 Item3
Item4 Item5 Item6

If the column count is set to 2 then it will turn into:
Item1 Item2
Item3 Item4
Item5 Item6

Note: Make sure that you set the Row Source Type to "Value List".

redpajama_set_name: RedPajamaStackExchange


text:
Q: Can not Edit Address Book Record from iphone app I want to edit record from address book in my iphone app. But I can not edit any record. Here is my code
 // In my First View Controller

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
   DetailViewController *detailViewController=[[DetailViewController alloc] initWithRecordObject:record];

 [self.navigationController pushViewController:detailViewController animated:YES];
    [detailViewController release];
}

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

#import <UIKit/UIKit.h>
#import <AddressBook/AddressBook.h>
#import <AddressBookUI/AddressBookUI.h>
#import "User.h"

@interface DetailViewController : UIViewController <UITableViewDelegate,UITableViewDataSource,UIActionSheetDelegate,ABPersonViewControllerDelegate> {

    ABRecordRef record;
    // Some other ivars
}
- (id)initWithRecordObject:(ABRecordRef)myrecord;

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

@implementation DetailViewController

- (id)initWithRecordObject:(ABRecordRef)myrecord
{
    self = [super initWithNibName:@"DetailViewController" bundle:nil];
    if (self) {
        record = myrecord;
    }
    return self;
}

#pragma mark - Edit Record Method

-(void)btnEditContactTapped:(id)sender {

    // Fetch the address book
    ABAddressBookRef addressBook = ABAddressBookCreate();

    ABRecordID recID = ABRecordGetRecordID(record);

    ABRecordRef record1 = ABAddressBookGetPersonWithRecordID(addressBook,recID);

    ABPersonViewController *personViewController = [[ABPersonViewController alloc]init];

    // set delegate
    personViewController.personViewDelegate = self;

    // Allow editing info
    personViewController.allowsEditing = YES;

    // Display contact info of selected person
    personViewController.displayedPerson = record1;

    personViewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(returnFromPersonView)] ;

    APP_DELGATE.isContactEdited = YES;

    [self.navigationController pushViewController:personViewController animated:YES];

    [personViewController release];
}

-(void)returnFromPersonView {
    NSLog(@"In %s",__PRETTY_FUNCTION__);
    [self.navigationController popViewControllerAnimated:YES];

}

#pragma mark - ABPersonViewControllerDelegate Method

- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue {

    //[self dismissModalViewControllerAnimated:YES];
    return NO;
}

When I push personViewController , I can't see anything regarding record. Here is a screenshot

Any kind of help is highly appreciated.Thanks

A: Take a look at Apple's Adress Book Programming Guide. A page that would be useful to you is the Direct Interaction: Programmatically Accessing the Database page. I advise you to just look around at those pages, they are quite self explanatory.

A: Changing return to YES may help in last method
- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue {

//[self dismissModalViewControllerAnimated:YES];
return NO; //try changing it to YES
}

A: You are not passing the "Correct Contact ID" as ABRecordRef ;)


text:
Q: how to insert / edit values from repeaters dynamically? .aspx page something like this
<form id="Form1" runat="server">
<asp:Repeater ID="Repeater1" runat="server">
    <HeaderTemplate>

                Subject_Id
                Subject_Name
                Fill_Marks

</HeaderTemplate>

<ItemTemplate>

                <asp:TextBox ID="Subject_Id" runat="Server" Text='<%#Eval("Subject_Id")%>'></asp:TextBox>

                <asp:TextBox ID="Subject_Name" runat="Server" Text='<%#Eval("Subject_Name")%>'></asp:TextBox>

                <asp:TextBox ID="Marks" runat="server"></asp:TextBox>

</ItemTemplate>

    <FooterTemplate>

</FooterTemplate>
</asp:Repeater>

    <asp:Button ID="btnInsert" runat="server" onclick="btnInsert_Click" Text="Insert" CommandArgument="" CommandName=""/>
    <asp:Button ID="btnUpdate" runat="server" onclick="btnUpdate_Click" Text="Update" CommandArgument="" CommandName=""/>

    </form>

C# - Code behind...
  protected void btnInsert_Click(object sender, EventArgs e)
  {
   cn = new SqlConnection(ConfigurationManager.ConnectionStrings["DbConnect"].ConnectionString);
   cn.Open();

  foreach (RepeaterItem item in Repeater1.Items)
  {
      TextBox Subject_Id = (TextBox)item.FindControl("Subject_Id");
      TextBox Subject_Name = (TextBox)item.FindControl("Subject_Name");
      TextBox Marks = (TextBox)item.FindControl("Marks");

      SqlCommand cmd = new SqlCommand("Insert into result VALUES (id='"+@Subject_Id+"',name='"+@Subject_Name+"',marks='"+@Marks+"')", cn);

      Repeater1.DataSource = cmd.ExecuteReader();
      Repeater1.DataBind();

      cn.Close();
      cmd.Connection.Close();
      cmd.Connection.Dispose();
  }
}

Now i want to insert that data into following table.....
result_table
id    varchar(10)
name  varchar(20)
marks varchar(3)

how can i perform insert and update function to retrieve data from to the database... with easy way ? ? thanks...

A: insert some property in your button tags:
CommandArgument="" CommandName=""
Repeater1.ItemCommand +=new RepeaterCommandEventHandler(Repeater1_ItemCommand);

Create a function named protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e){ some code you want to write.........}

A: Implement the btnInsert_Click function with the following
** edited as per your new function
  protected void btnInsert_Click(object sender, EventArgs e)
  {
    String connectionString = ConfigurationManager.ConnectionStrings["DbConnect"].ConnectionString;
    String queryString = "";
     using (SqlConnection connection = new SqlConnection(connectionString))
    {
        foreach (RepeaterItem item in Repeater1.Items)
       {
        TextBox Subject_Id = (TextBox)item.FindControl("Subject_Id");
        TextBox Subject_Name = (TextBox)item.FindControl("Subject_Name");
        TextBox Marks = (TextBox)item.FindControl("Marks");

        queryString = "Insert into result VALUES (id='"+@Subject_Id+"',name='"+@Subject_Name+"',marks='"+@Marks+"')";

        SqlCommand command = new SqlCommand(queryString, connection);

        // execute the query to update the database
        cmd.ExecuteNonQuery();
        }
    }
    //call the function to load the gridview if it is lost on postback.
  }

It is always better to move the database and grid view filling codes to separate functions, so that it is easy to repeat the actions on button clicks.

A: Dim permissionList As New List(Of OPASWCFApp.PROJECT_NOTE_CONTACT_MAP)
  For Each rItem As RepeaterItem In rptProducts.Items
     Dim qty1 As Integer
     Dim qty2 As Integer
     Dim hdnvalue As Integer
     Dim txtBox1 As TextBox = DirectCast(rItem.FindControl("numAdmin1"), TextBox)
     Dim txtBox2 As TextBox = DirectCast(rItem.FindControl("numAdmin2"), TextBox)
     Dim hdnf As HiddenField = DirectCast(rItem.FindControl("hdnContacttype"), HiddenField)
     qty1 = Convert.ToInt32(txtBox1.Text)
     qty2 = Convert.ToInt32(txtBox2.Text)
     hdnvalue = Convert.ToInt32(hdnf.Value)

     If qty1 > 0 Or qty2 > 0 Then
        Dim _d As OPASWCFApp.PROJECT_NOTE_CONTACT_MAP =
                     New OPASWCFApp.PROJECT_NOTE_CONTACT_MAP()
        _d.PROJECT_NOTE_CONTACT_MAP_CONTACT_TYPE_ID = hdnvalue
        _d.PROJECT_NOTE_CONTACT_MAP_DURATION = CInt((qty1 * 60) + qty2)
        _d.PROJECT_NOTE_CONTACT_MAP_CONTACT_TYPE_ID = hdnvalue
        permissionList.Add(_d)
     End If
 Next
 ProcessDataResult.ContactMap = permissionList.ToArray()


text:
Q: R - Starting at a palette color different from the 1st I am plotting points using the code:
with(data, point(x = Longitude, y = Latitude, pch = 21, bg = Fatal, col = cluster)

Where Fatal is a factor with 2 levels (Y, N) and cluster is a factor of 3 levels (1, 2, 3).
I have defined a color palette of 5 colors:
palette(c(rgb(255, 165, 0, alpha = 120, max = 255),
          rgb(211, 211, 211, alpha = 120, max = 255),
          rgb(255, 0, 0, alpha = 120, max = 255),
          rgb(0, 0, 0, alpha = 255, max = 255),
          rgb(255, 255, 255, alpha = 255, max = 255)))

I want to create the points such that the background color will use the first 2 colors in the palette and the border will use the last 3 colors in the palette.
Is there any way to either:
1) create 2 different color palettes to use in a points() command?
2) tell R to use the last 3 colors in the palette for col = cluster?
Thanks!


text:
Q: Powershell - How do I add multiple URLs to an Invoke-Webrequest I'm trying to download multiple PDFs from URLs using invoke-webrequest. I also want the PDFs to have unique names (that I choose) but to be downloaded into a single folder.
This is what I've got so far (for 1 url):
invoke-webrequest -uri "https://www.website.com/fact.pdf" -Outfile $env:TEMPC:\Users\MyPC\Downloads\TEST.pdf
PS; this is literally my first time using powershell and do not have a clue
EDIT: Thanks - was exactly what I was after.
I am wondering if you would be able to help me further. I've to download these PDFs from these URLs on a daily basis. I would already have the previous day's PDFs downloaded, so am now looking to see if I could run a script where:

*

*create an 'archive' folder and move previous day's pdfs (which would be located in different folders) into said folder

*to have unique names for new PDFs (you have already shown me this using hashtable)

*to download PDFs from the URLs, but place them in different locations e.g. 'TEST.pdf' to go to C:\Users\MyPC\Downloads\PDFs\Short and 'ANOTHER.pdf' to go to C:\Users\MyPC\Downloads\PDFs\Long and so on...

A: Organize your URLs and their target file names in a hashtable:
$FilesToDownload = @{
    'TEST.pdf' = 'https://www.website.com/fact.pdf'
    'ANOTHER.pdf' = 'https://other.website.com/somethingElse.pdf'
    <# and so on ... #>
}

Now you just need to repeat the Invoke-WebRequest for each entry in the hashtable:
foreach($file in $FilesToDownload.GetEnumerator()){
    Write-Host "Downloading '$($file.Name)' from '$($file.Value)'"

    # construct output path, then download file
    $outputPath = Join-Path C:\Users\MyPC\Downloads -ChildPath $file.Name
    Invoke-WebRequest -Uri $file.Value -OutFile $outputPath
}


text:
Q: Setting an attribute to only allow doubles in a textbox I remember using some attribute on the getter/setter that would limit the input to a certain datatype, length etc. IE [Attribute something something].
Any ideas?
Thanks

A: One way to do it (if you want to keep using a standard text box) would be to make an event for the text changed event of the text box, and in that, read the text to make sure that it contains only numbers (and an optional period in the case of a double)

A: Did you mean the ValidateInput attribute available in System.Web.Mvc?
Also, you could probably use a MaskedTextBox if you're doing WinForms.

A: Winforms? Have you considered using masked Textbox control?
http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.aspx

A: Winforms? Why not use a NumericUpDown?
http://msdn.microsoft.com/en-us/library/57dy4d56.aspx
http://msdn.microsoft.com/en-us/library/system.windows.forms.numericupdown.aspx
If you need scientific notation you can do :
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
    TextBox tBox = (TextBox)sender;

    if (!((e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9)
       || (e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9)
       || (e.KeyCode == Keys.Decimal && !(tBox.Text.Contains('.'))
           && !(tBox.Text.Length == 0)
           && !((tBox.Text.Length == 1)
              && (tBox.Text.Contains('-') || tBox.Text.Contains('+'))))
       || (e.KeyCode == Keys.OemPeriod && !(tBox.Text.Contains('.'))
           && !(tBox.Text.Length == 0)
           && !((tBox.Text.Length == 1)
              && (tBox.Text.Contains('-') || tBox.Text.Contains('+'))))
       || (e.KeyCode == Keys.Subtract && ((tBox.Text.Length == 0) ||
           tBox.Text.EndsWith("e") || tBox.Text.EndsWith("E")))
       || (e.KeyCode == Keys.OemMinus && ((tBox.Text.Length == 0) ||
           tBox.Text.EndsWith("e") || tBox.Text.EndsWith("E")))
       || (e.KeyCode == Keys.Add && ((tBox.Text.Length == 0) ||
           tBox.Text.EndsWith("e") || tBox.Text.EndsWith("E")))
       || (e.KeyCode == Keys.Oemplus && ((tBox.Text.Length == 0) ||
           tBox.Text.EndsWith("e") || tBox.Text.EndsWith("E")))
       || e.KeyCode == Keys.Delete
       || e.KeyCode == Keys.Back
       || e.KeyCode == Keys.Left
       || e.KeyCode == Keys.Right
       || (e.KeyCode == Keys.E) && !(tBox.Text.Contains('e')) &&
           (tBox.Text.Contains('.') && !tBox.Text.EndsWith("."))))
        {
            e.SuppressKeyPress = true;
        }
    }

This will deny input of any pattern which is not consistent with a numeric value.  Minus signs are only allowed at the beginning of the string (to indicate a negative number) and after an e or E to indicate a negative exponent.  Plus signs follow the same rule as minus.  Only one decimal point is allowed and it must follow at least one number.  Only one e or E is allowed and it must follow a decimal point and at least one number after the decimal point.
You could also allow things like the Help, Tab, etc, keys if it would interfere with other aspects of your program function.
Note that this does not prevent incomplete numbers (ie: 1.37E- or -13. from being entered so you would probably want to check the string in any case.  This at least denies any immediately invalid entries.
You might do something like (in the same handler, before the other logic):
if (e.KeyCode == Keys.Enter)
{
    textBox1_Validating(sender, new CancelEventArgs());
    return;
}

The above only gives the enter key the normal 'feel' for input (force validation).  Leaving the textbox (going out of focus) will also trigger validation where you might do something like :
private void textBox1_Validating(object sender, CancelEventArgs e)
{
    TextBox tBox = (TextBox)sender;
    double tstDbl;
    if (!double.TryParse(tBox.Text, out tstDbl))
    {
        //handle bad input
    }
    else
    {
        //double value OK
        doSomething(tstDbl);
    }
}


text:
Q: How to Specify the Compiler and To Compile Different Main Functions My project is quite simple but I like to keep files in different folders for clarity. For instance I have three folders.

*

*An Output folder that contains all the classes used for the output. (for now only Output.cc and Output.h).

*A Math folder, containing all of the classes related to math. (vector.cc, vector.h, randomgen.h, randomgen.cc, etc)

*A Tests folder where there are different cpp files each containing a main function. (Output_test.cc, vector_test.cc, etc)

How can I create a CMake script that complies all of the different main function of the different test programs using the classes that are in different folders?
In addition, I didn't see where the compiler, and its options, are specified in a CMake file.

A: How to specify the compiler?
There are a few ways to specify the compiler you want to use.  Settings environment variables, defining compiler variables, or designating a generator.
Settings Environment Variables
There are two ways to use environment variables to help CMake determine which compiler to use during a CMake configuration.  Using the PATH variable or the CC and CXX variables.
PATH
Make sure the path to your desired compiler is first in the list.  If you don't want to modify your path, then use the 2nd option.
CC & CXX
CMake reads the variables CC and CXX to determine the path for the C compiler and C++ compiler respectively.  Note that the first time CMake is configured for a project it will cache these paths, and look to the cache first for all future configurations.  So if you wish to change the compiler path, be sure to delete the cache file CMakeCache.txt.  As HughB pointed out, there is a good example of this given by Guillaume
Defining Compiler Variables
Similar to using CC and CXX, there are CMake variables that can be defined at the commandline to choose the desired compiler.  They are CMAKE_C_COMPILER and CMAKE_CXX_COMPILER.  You can set them using the -D option and they use the same values as CC and CXX.  Note, just like CC and CXX these are cached after the first CMake configuration.
Example
cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++4.6/g++ -DCMAKE_C_COMPILER=/usr/bin/gcc4.6/gcc <path to src>

Designating a Generator
The last way to choose the compiler is by using the -G option to select a generator.  There are numerous generators to choose and I recently answered a question about them.  I'm not going to go into too much detail about them in this answer, but you can read my other answer for more details.
Example
cmake -G "Unix Makefile" <path to src>

Don't Hardcode the Compiler
I recommend resisting the urge to "hardcode" the compiler in the CMakeLists.txt files.  CMake is meant to be compiler independent and you should be setting the compiler information external of the CMake files.  Use one of the methods mentioned above to keep your CMake files portable and to avoid confusion if yourself or someone else wants to build the project with a different compiler.
Related references. (Disclaimer: Written by me)

*

*What is a CMake generator

*Understanding the Purpose Behind CMake

How to Compile Multiple Executables?
As HughB mentioned use add_executables.  You could also create separate libraries for each folder group, there are many ways to organize your project.  I'm going to keep it simple and give an example that builds two executables in the same project.
For this example I created 5 files:
include/Helloworld.h
#include <stdio.h>

src/HelloWorld.cpp
#include "HelloWorld.h"

int main()
{
    printf("Hello World!\n");

    return 0;
}

include/HelloWorld2.h
#include <stdio.h>

src/HelloWorld2.cpp
#include "HelloWorld2.h"

int main()
{
    printf("Hello World2!\n");

    return 0;
}

CMakeLists.txt
cmake_minimum_required(VERSION 3.0)

# This is required to compile and must contain the paths to
# all of the header files
include_directories(include)

# These are optional, but are added to be passed to the
# add_executable command so that the headers are accessible
# from within the project
set(HW_INCLUDES include/HelloWorld.h)
set(HW_INCLUDES2 include/HelloWorld2.h)

project(HelloWorlds)

# Required sources
set(HW_SOURCES src/HelloWorld.cpp)
set(HW_SOURCES2 src/HelloWorld2.cpp)

add_executable(HelloWorld ${HW_SOURCES} ${HW_INCLUDES})
add_executable(HelloWorld2 ${HW_SOURCES2} ${HW_INCLUDES2})

When this project is built there will be two executables: HelloWorld.exe and HelloWorld2.exe.

A: Consider putting the code that will be used in different program mains in a library. Use the add_library command to do make a library. You could have a directory hierarchy like this:
TopDir
   CMakeLists.txt
   MyLib
      CMakeLists.txt
      vector.cc
      vector.h
      ....
   MyExe1
      CMakeLists.txt
      main1.cc
   MyExe2
      CMakeLists.txt
      main2.cc

Use add_subdirectory in your top level cmakelists.txt to traverse the directories. In the dirs that build executables, use add_executable and target_link_libraries. If you named the library MyLib then your target_link_libraries command would look like
target_link_libraries( exe1 MyLib )

In regard to overriding the compiler, see how to specify new gcc path for cmake


text:
Q: Closure, interior and boundary point
Prove that a point belongs to $A^{-}$ if and only if it is either an interior or a boundary point of $A$; where $A^-$ is the closure.

To be an interior point: A point $x\in \mathbb{R}$ is the interior point of a set $A\subset \mathbb{R}$ if there is a neighborhood of $x$ which is entirely contained in $A$.
A boundary point follows, which is the set of points with the property that every open set containing the point intersects the interior of $A$ and the interior of $A^c$. To be a closure, which is the intersection of all closed sets containing $A$; to be closed means there is a boundary point. But, how will it follow that it can also be an interior point?

A: A boundary point of a set $A$ cannot be an interior point, but that's not a problem: the theorem is that the closure of $A$ consists of those points that are in the interior of $A$ together with those that are in the boundary of $A$. In symbols,
$$\operatorname{cl}A=\operatorname{int}A\cup\operatorname{bdry}A\;,\tag{1}$$
and in fact the two sets on the righthand side of $(1)$ are disjoint. (By the way, a closed set need not have any boundary points at all: in $\Bbb R$ the only examples of this phenomenon are the closed sets $\varnothing$ and $\Bbb R$, but in more general topological spaces there can be many sets that are simultaneously open and closed and which therefore have empty boundary.)
You know that $x\in\operatorname{int}A$ if and only if $x$ has an open nbhd contained in $A$, and that $x\in\operatorname{bdry}A$ if and only if every open nbhd of $x$ intersects both $A$ and $\Bbb R\setminus A$. To prove $(1)$, I suggest that you first prove that

$\qquad\qquad\qquad\quad x\in\operatorname{cl}A$ if and only if for each open nbhd $V$ of $x$, $V\cap A\ne\varnothing$.

Once you have this, $(1)$ is pretty straightforward.

A: First, being interior point or boundary point or exterior point are mutually exclusive possibilities. So, instead of showing your claim I will show any exterior point could not be an element of closure.Let $x$ be an exterior point of $A$, then $\exists V$ neighbourhood of $x$ so that $V\subseteq A^{c}$. Since every neighbourhood open, then $V^c$ should be close. Also, observe that $A\subseteq V^c$, but then $x\notin A^-$ since $A^-$ is the intersection of all closed set that contains $A$.


text:
Q: Releasing unneeded QImages My application streams webcam images to a QWidget, and then has no need for those images after they've been displayed. The application runs for about a minute or two before giving this error several dozen times and crashing:
QImage: out of memory, returning null image

The QWidget uses a displayImage(QImage) method which gets called several times per second. I have a feeling that the image should take a pointer as a parameter, but I have no reasoning to back that up.
How can I ensure that the QImages are released from memory?
Note: To create the images, I'm using the technique described in the accepted answer of the SO question how to convert an opencv cv::Mat to qimage .

A: The QImage class uses implicit data sharing. Excerpts from the doc:

Many C++ classes in Qt use implicit data sharing to maximize resource
  usage and minimize copying. Implicitly shared classes are both safe
  and efficient when passed as arguments, because only a pointer to the
  data is passed around, and the data is copied only if and when a
  function writes to it, i.e., copy-on-write.
A shared class consists of a pointer to a shared data block that
  contains a reference count and the data.
When a shared object is created, it sets the reference count to 1. The
  reference count is incremented whenever a new object references the
  shared data, and decremented when the object dereferences the shared
  data. The shared data is deleted when the reference count becomes
  zero.
Implicit sharing takes place behind the scenes; the programmer does
  not need to worry about it.

This means that if you pass a QImage object into displayImage() by value then a new QImage will be created but the image data in the first QImage will not be duplicated but only a shared reference counter will be incremented. But this also means that if you would like to release the memory your first QImage object allocated then you need to make sure that both QImage objects go out of scope.

A: As noted in docs regarding implicit sharing:

When a shared object is created, it sets the reference count to 1. The
  reference count is incremented whenever a new object references the
  shared data, and decremented when the object dereferences the shared
  data. The shared data is deleted when the reference count becomes
  zero.

This means that you must have QImage frames referenced somewhere in your code.


text:
Q: Finding out the logarithmic function for the situation below The situation reads as follows:

There are 3000 barbs in a pond and every year 20% of the barbs die and then 1000 new barbs come to the pond. A logarithmic function needs to be plotted to graph this change in population.

I worked through a part of the above situation and arrived at the function:
$$
  y = 3000(0.8^x) + 1000(0.8^{x-1}) + 0.8^{x-2} + \dotsb + 0.8^1 + 0.8^0
$$
How do I convert this above equation into a logarithmic function?

A: If you work out the numbers for about $30$ years you will see that the values get closer and closer to $5000$ from below without reaching it. Another way to find the special value $5000$ is to ask which value of $y$ will cause no change in the population the next year. This gives the equation $y=0.8y+1000$ which has the solution $y=5000$.
So if you consider the "base line" to be $5000$ you can reword the expression as:

Each year $20$% of the difference between the current value and $5000$
  is added.

This leads to the formula
$$y=5000-2000\cdot 0.8^x$$
Note, however, that this is an exponential expression, not a logarithmic one. You do get a logarithm if you solve for $x$, namely
$$x=\log_{0.8}\frac{5000-y}{2000}$$
or perhaps
$$x=\frac{\ln(5000-y)-\ln 2000}{\ln 0.8}$$


text:
Q: Help regarding a shell script I was creating a init.d service, and was reading a few scripts for reference. I found this one in a skeleton:
What does this snippet do? I get that this is a switch:case. I am asking about the case within the case.
case "$1" in
  start)
        echo test
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac

PS: Excuse the title, I couldn't think of a better name
Thanks.

A: Seems like the actual script might have had something more substantial than 'echo test'. $? is the exit code returned by the echo command in this script. The inner case statement prints the log message that is appropriate for the termination code. 0|1 most likely is success. 2 is probably an error.

A: $? holds the exit code of the last executed command.
If 0 - there were no errors.


text:
Q: How to add new list item with "Publishing Image" field in the list through list.asmx web service I have a list called "post" which has the "publishing image" type column  has one of the column on the list.
Issue is need to add new item to list through [List.asmx] web service, need to know how to create soap message for updating the list with "publishing image"
Any ideas? please answer, thanks

A: I'm not totally sure what you are trying to do, but as Neelam shows, SPServices can help you. http://SPServices.codeplex.com

A:    var title="#ctl00_m_g_a681e990_6a42_4591_bfa2_70a90f97cd5b_ff1_new_ctl00_ctl00_TextField";
   var number="#ctl00_m_g_a681e990_6a42_4591_bfa2_70a90f97cd5b_ff2_new";
   var Name="#ctl00_m_g_a681e990_6a42_4591_bfa2_70a90f97cd5b_ff3_new";

      $().SPServices({//default
            operation: "UpdateListItems",//default
            async: false,//default
            listName: "Sample",//change
            updates:"<Batch OnError='Continue'>" +//default
            "<Method  ID='1' Cmd='New'>" +//default
                "<Field Name='Title'>" + $(title).val() + "</Field>" +    //change
                "<Field Name='Number'>" +$(number).val()+ "</Field>"+
                "<Field Name='Name'>"+$(Name).val()+"</Field>"+
                "<Field Name='ID'></Field>" +//default
            "</Method>" +//default
        "</Batch>",//default
            completefunc: function(xData, Status) {
               // alert($(title).val());alert($(number).val());
           var title="";
     $("#ctl00_m_g_a681e990_6a42_4591_bfa2_70a90f97cd5b_ff1_new_ctl00_ctl00_TextField").val(title)
             //  $(ctl00_m_g_4e090343_dad2_40bc_937d_6716d78e4905_ff1_new_ctl00_ctl00_TextField).val()="";
           var number="";
           $("#ctl00_m_g_a681e990_6a42_4591_bfa2_70a90f97cd5b_ff2_new").val(number);
          var Name="";
      $("#ctl00_m_g_a681e990_6a42_4591_bfa2_70a90f97cd5b_ff3_new").val(Name);
                alert("Add new success.");
          }
        });


text:
Q: split function comma separator SQL Server I would like to split the function like two separate columns with the given input string.
If I execute this function, I am getting list of rows values like
select *
from dbo.Split ('sunday,9,monday,8,tuesday,9, wednesday 8, thursday 8,friday,9, saturday,8')

Output like row values
sunday
9
monday
8
tuesday
9
wednesday
8
thursday
8
friday
9
saturday
8

My split function is:
create  function dbo.Split
(
    @String varchar(max)
)
returns @SplittedValues table
(
    Id varchar(50)
)
as
begin
    declare @SplitLength int, @Delimiter varchar(5)

    set @Delimiter = ','

    while len(@String) > 0
    begin
        select @SplitLength = (case charindex(@Delimiter,@String) when 0 then
            len(@String) else charindex(@Delimiter,@String) -1 end)

        insert into @SplittedValues
        select substring(@String,1,@SplitLength)

        select @String = (case (len(@String) - @SplitLength) when 0 then  ''
            else right(@String, len(@String) - @SplitLength - 1) end)
    end
return
end

But I need output like two columns days(list of days first parameter), hours,
+-----------+-------+
|   Days    | Hours |
+-----------+-------+
| Sunday    |    9  |
| Monday    |    8  |
| Tuesday   |    9  |
| Wednesday |    8  |
| Thursday  |    8  |
| Friday    |    9  |
| saturday  |    8  |
+-----------+-------+

How can I solve this?

A: @user3442289  You can use below code as well. I have just altered few statements in your code.
create  function dbo.Split2
(
    @String varchar(max)
)
returns @SplittedValues table
(
    Id varchar(50)  ,
    Id1 int
)

begin
    declare @SplitLength int, @Delimiter varchar(5)

    set @Delimiter = ','

    while len(@String) > 0
    begin
        select @SplitLength = (case charindex(@Delimiter,@String) when 0 then
            len(@String) else charindex(@Delimiter,@String)  end)

        insert into @SplittedValues
        select substring(@String,1,@SplitLength-1) ,SUBSTRING(@string,@SplitLength+1,1)

                select @String = (case (len(@String) - @SplitLength) when 0 then  ''
            else right(@String, len(@String) - @SplitLength-1) end)

            if @string<>''
            begin
            set @string=(select substring(@string,2,len(@string)))
            end

    end
    return
end

A: there might be prettier ways to do it.
create  function dbo.TwoColumnSplit
(
    @String varchar(max)
)
returns @returnTable table
(
    LeftId varchar(50)
    , RightId varchar(50)
)
as
begin

declare @numCols int = 2
declare @itr int = 0
declare @SplittedValues table
(
    rowID int,
    colID int,
    Id varchar(50)

)
    declare @SplitLength int, @Delimiter varchar(5)

    set @Delimiter = ','

    while len(@String) > 0
    begin
        select @SplitLength = (case charindex(@Delimiter,@String) when 0 then
            len(@String) else charindex(@Delimiter,@String) -1 end)

        insert into @SplittedValues(rowID, colID, Id)
        select @itr / @numCols, @itr % @numCols, substring(@String,1,@SplitLength)

        select @String = (case (len(@String) - @SplitLength) when 0 then  ''
            else right(@String, len(@String) - @SplitLength - 1) end)

        set @itr = @itr + 1
    end

insert into @returnTable(LeftId, RightId)
select l.id as LeftId, r.id as RightId
from
(select rowid, id from @SplittedValues where colid = 0) l
join
(select rowid, id from @SplittedValues where colid = 1) r
on l.rowid = r.rowID

return
END

go

select * from  [dbo].[TwoColumnSplit]('sunday,9,monday,8,tuesday,9, wednesday, 8, thursday, 8,friday,9, saturday,8')


text:
Q: Let $U\subset Y$ be open in $(Y,d_Y)$, where $d_Y:Y\times Y \rightarrow \mathbb{R}$ is the metric induced by $(X,d)$. Is $ U$ also open in $X$? Let $(X,d)$ be a metric space and $Y\subset X$.
Let $U\subset Y$ be open in $(Y,d_Y)$, where $d_Y:Y\times Y \rightarrow \mathbb{R}$ is the metric induced by $(X,d)$.
Is $ U$ then also inevitably open in $X$? If not, why?
Thoughts:
If $U$ is open in $(Y,d_Y)$ but not open in $(X,d)$ then there exists an $a\in U$ such that for every $r>0$:
$U_r(a)|_{d_Y}\subset U$ and $U_r(a)|_{d_X}\not\subset U$
with $U_r(a)|_{d_Y}=\{ y\in Y| d_Y(a,y)<r\}$ and $U_r(a)|_{d_X}=\{ x\in X| d(a,x)<r\}$

A: A necessary (and in fact sufficient) condition for every open subset of $Y$ to be open in $X$ is that $Y$ itself be open in $X.$

A: This holds only if $Y$ is an open subset of $X$.
To see it, consider any point $a \in U$. Since $U$ is open in $Y$, there exists $\varepsilon>0$ such that $U$ contains the open $\varepsilon$-ball  in $Y$ about $a$, i.e.
$$
  U \supset B_{\varepsilon,Y}(a) = \{y\in Y: d(y,a)<\varepsilon\}.
$$
However, as $Y$ is open in $X$ and $a\in Y$, there exists $\varepsilon' >0$ such that
$$
  Y \supset B_{\varepsilon',X}(a) = \{x\in X: d(x,a)<\varepsilon\}.
$$
So for any $z\in X$ with $d(z,a)<\delta:=\min\{\varepsilon,\varepsilon'\}$, $z \in U$. In summary, for every $a\in U$ there is $\delta>0$ such that $U$ contains the open ball in $X$ about $a$.  Consequently, $U$ is open in $X$.
To see that your claim does not hold without other assumptions, consider $U=Y={x} \in X$. Then $U$ is open in $Y$, but unless there exists $\varepsilon>0$ such that $B_{\varepsilon,X}(x)=\{x\}$ (which is true for all the standard metrics except for the discrete metric), then $U$ is not open in $X$.

A: No. Let $X = \mathbb R$ with $d(a,b) = \lvert a - b \rvert$ and $Y =\{0\}$. Then $Y$ is open in $Y$, but not open in $X$.


text:
Q: How to serialize FileInfo object using NewtonSoft Json? I want to serialize FileInfo object using json.
Till now, I am getting below result upon serializing file info object using JsonConvert.serializeOjbect() method.
FileInfo finfo = new FileInfo("drive:\\folderpath\\file.txt");
string jsonString = JsonConvert.SerializeObject(finfo);

Of course, finfo holds a lot more properties than the two held by jsonString.
(Properties like Exists, Directory, CreationTime, Extension, IsReadonly, LastAccessTime, etc.)
jsonstring only holds two of these properties.
jsonString = {{
  "OriginalPath": "drive:\\folderpath\\file.txt",
  "FullPath": "drive:\\folderpath\\file.txt"
}}

Is there a way to serialize whole object instead of these two properties using Json?

A: The reason that you're only seeing those two properties is because FileInfo implements the ISerializable interface, and its GetObjectInfo method is being used to override the default serialization behavior.  If you had full control over the FileInfo class (which you don't) then you could apply the [JsonObject] attribute to force normal Json serialization behavior.
I think your only option in this case to write your own wrapper containing the properties that you want.  Your properties can just call the underlying FileInfo properties directly.


text:
Q: Google map cannot display when I install APK that I produced I have produced the apk. After I install it, the google map cannot display.
Before I produced that apk, I have tried to run as Android application in Eclipse and the map can display.
That is the steps I produce the apk :

*

*Click the project  AndroidManifest.xml

*Click Use the Export Wizard to export and sign an APK

*Select my project

*Create new keystore (Location:Desktop / password......)

*Create new key (Alias:project name / password..... / validity: 100 years / First and last name:Liar)

*Destination APK file : Desktop
Is this step wrong? Or another thing that I did not notice?
How can I do to resolve this problem?

A: keytool -list -v -keystore your_keystore_name -alias your_alias_name

Replace your_keystore_name with the fully-qualified path and name of the keystore, including the .keystore extension. Replace your_alias_name with the alias that you assigned to the certificate when you created it.
Create api key correspoding to your release keystore and use it.

A: While creating the
<meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyBoJVDT4W********" /> , for getting the value, the SHA1 and key-store location need to specify properly


text:
Q: Como ler uma matriz de um txt Precisava de imprimir uma matriz que tenho no txt no terminal.
Este é o meu txt:
010009070
300001000
070080000
807000000
050076000
064000510
030200000
092400000
000000023

O que eu já tentei:
int getGrid(char *filename, int lines, int columns, int **mat) {

    FILE *fp;
    fp = fopen(filename, "r");

    for (int i = 0; i < lines; ++i) {
        for (int j = 0; j < columns; ++j) {
            fscanf(fp, "%d", &mat[i][j]);
        }
    }

    fclose(fp);
    return mat;

}

main(){
 int **mat = malloc(N * sizeof(int *));
    for (int i = 0; i < N; ++i) {
        mat[i] = malloc(N * sizeof(int));
    }
    //fillGridRandom(&row, &col, 10);
    char *filename = "C:/SudokuX/InitTab.txt";
    getGrid(filename, N, N, mat);
}

A: Olá! Fiz em um bloco único a sua proposta. Depois divida em função como desejar. Código:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

#define LIN 9
#define COL 9

int main()
{

    int **mat ;
    int i, j ;

    int dado;
    FILE *fp;

    fp = fopen ("tabela.txt", "r+");
    mat = ( int ** ) malloc (LIN * sizeof (int*)) ;
    for (i=0; i < LIN; i++)
    mat[i] = ( int * ) malloc (COL * sizeof (int)) ;
    for (i=0; i < LIN; i++)
    {
        for (j=0; j < COL; j++)
        {
        dado = fgetc(fp);
        mat[i][j] = dado ;
        }
    }

    printf("\nMatriz:\n");
    for(i=0;i<LIN;i++)
    {

       for(j=0;j<COL;j++)
       {
           if ( mat[i][j] == 10 )
           {
               printf("\n");
           }
           else
           {
               /* code */
               printf("%3d\t", mat[i][j]-48);
           }
       }
    }

    // libera a memória da matriz
    for (i=0; i < LIN; i++)
       free (mat[i]) ;
    free (mat) ;

}

Mas, sem malloc existem opções mais simples.
Inclusive em uma proposta ja discutida aqui:
Passando informações de um arquivo para uma matriz
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

#define NLIN 9
#define NCOL 9

void lerMatriz(FILE *arquivo, char out[NLIN][NCOL]){
    int c;
    for(int i=0; i<NLIN; i++){
        for(int j=0; j<NCOL; j++){
            c = fgetc(arquivo);
            if(c == EOF){ /*ERRO*/ }
            out[i][j] = c;
        }
        c = fgetc(arquivo);
        if(c != '\n'){ /*ERRO*/ }
    }
}

int main(){
    FILE *entrada = fopen("tabela.txt", "r");

    char tabuleiro[NLIN][NCOL];
    lerMatriz(entrada, tabuleiro);

    for(int i = 0; i < NLIN; i ++){
        for(int j = 0; j < NCOL; j++){
            printf("%c", tabuleiro[i][j]);
        }
        printf("\n");
    }

    fclose(entrada);
    return 0;
}

Cópia em repositório:
https://github.com/valmorflores/matriz_c_malloc.git


text:
Q: Shell script to copy(scp) and rename I have a folder in my server which contains some PDF files.My problem is, i have to copy to other server and rename it.
Name format is like this "yymmdd_hhmmss_FileNo_PdfNo.pdf"
yymmdd_hhmmss_001_AC1.pdf
yymmdd_hhmmss_001_AC2.pdf
yymmdd_hhmmss_002_AC1.pdf
yymmdd_hhmmss_003_RCY1.pdf

while copying these files i want to rename each file.
Name format is like this "FileNo_PdfNo_yymmddhhmmss.pdf"
001_AC1_yymmddhhmmss.pdf
001_AC2_yymmddhhmmss.pdf
002_AC1_yymmddhhmmss.pdf
003_RCY1_yymmddhhmmss.pdf

I want to write a shell script(bash) for this. Please give me some idea or some sample scripts related to this.

A: With GNU tar:
tar -cf - *.pdf | ssh user@server "tar -xvf - --transform='s/\(.\{6\}\)_\(.\{6\}\)_\(...\)_\(.\{3,\}\)\.pdf/\3_\4_\1\2.pdf/' --show-transformed-names"

If you want to change destination directory use tar's option -C.

See: The Stack Overflow Regular Expressions FAQ

A: With some minor tweaking this should work for you. I put the explanation / comments in the script. You could likely do it without the loop, but it gets tricky transferring and renaming multiple files with scp simultaneously. If you renamed them locally and then transferred them it would be easy to do a single scp call. You could also condense it into a one liner; but I thought this approach might be more expository and easier to modify.
#!/bin/bash -

# associative array to hold new file names
declare -A new;

# local and remote paths terminated with / for laziness
local_path="/lcl/path/to/pdfs/"
remote_path="/remote/path/to/pdfs/"

# user@machine for remote ssh connection
user_mach="username@machinename"

# error accumulator
local lcl_err=0

# Collect list of files to send - you may want this to be
# more discriminating
orig=`find "$local_path" -name "*.pdf" -exec basename {} \;`

# Iterate through the file list
for i in "${orig[@]}"; do
  # sed replacement to rename them appropriately, stored in
  # associative array new
  new["$i"]="`echo $i | sed -ne 's/^\([0-9]\{6,\}\)_\([0-9]\{6,\}\)_\([0-9]\{3,\}\)_\(.*\)\.pdf$/\3_\4_\1\2\.pdf/p'`"

  # if file was renamed (passed regex filter) then scp it to remote host,
  # saving it remotely with new name
  if [ ${new["$i"]} ]; then
    scp "${local_path}$i" "${user_mach}:${remote_path}${new["$i"]}"
    # don't roll over the return value (256 == 0 in 8 bit return value)
    [[ "$lcl_err" -lt "255" ]] && ((lcl_err+=$?))
  else
    echo "Skipping file $i"
  fi
done
exit "$lcl_err"


text:
Q: program that checks if any even number greater than 4 is a sum of two prime numbers I have the following problem:
Given that the even numbers greater than 4 can be obtained by addition of 2 prime
numbers, I have to write an algorithm which check it. The algorithm should take less time that O(n^2).
For example there is a set of numbers from 6 to n. If we have the number 6 the answer is 6=3+3 and for  22=17+5 and so on.
My first idea:
S - set of n numbers
for i=1 to n {
  //removing odd numbers
   if (S[i]%2!=0)
      continue;

   result = false;
   for j=2 to S[i]-2{
       if (j.isPrime) // prime test can be done in O(log^2(n))
          if ((S[i]-j).isPrime)
               result = true;
               break;
          else
               continue;
   }

   if (result == false)
       break;
}

Since I use 2 for-loops, the total running time of this algorithm should be
O(n*n)*O(log^2(n)) = O(n^2*log^2(n)) which is not less than O(n^2).
Does anybody have an idea to reduce the running time to get the required time of less than O(n^2)?

A: If set contains big numbers I've got nothing.
If max(S) < n ^ 2 / log(n) than:
You should preprocess which numbers from interval [1, max(S)] are primes.
For preprocessing you can use sieve of Eratosthenes
Then, you are able to check if number is a prime in O(1) and complexity of your solution becomes O(N^2).

A: This is Goldbach's conjecture. Primality testing is known to be in P (polynomial time), but the break-even is ridiculously high - in practice, you will not be able to do this in anywhere near O(n^2).
If we assume you only need to deal with relatively small numbers, and can precompute the primes up to a certain limit, you still need to find candidate pairs. The prime counting function gives approximately: n / ln(n) primes, less than (n). Subtracting the candidate prime (p) from (n) gives an odd number (q). If you can look up the primality of (q) with a complexity of: n.ln(n), or better - i.e., an O(1) lookup table for all odd numbers less than the limit - you can achieve O(n^2) or better.

A: You can run only until square root of N, this sufficient for determine if the number is prime or not.
this will reduce your running time.
also take a look at the following question - Program to find prime numbers


text:
Q: Git Log Displays Nothing I have a number of git repositories (with commits) and each displays nothing when running git log. If I run the command outside a project directory (without a git repository) I get:

fatal: Not a git repository (or any of the parent directories): .git

I tried re-installing Git (I'm now running 1.7.5.4) and re-cloning my repositories to no avail. Any ideas?

A: I've just experienced the same problem, of git log not displaying anything for a particular file.  The problem turned out to be Windows was displaying the directory name with an upper-case first letter, but git expected the first letter to be lower-case.  So "git log Subdir/file.c" produced no errors and no output.  Whereas "git log subdir/file.c" produced the expected revision history.

A: May be that the pager is not set up correctly with git.
Diagnostics:
git config core.pager

If it gives empty output or something unexpected, it may be the cause of the problem.
Solution
Try one of the following with xxx = more, less or other pager of choice:
git config core.pager xxx
git config --global core.pager xxx

A: git log does not show any commit!
I noticed that not only git log command but also man command does not show anything for me.
It turned out that I just needed to set the PAGER environment variable to less or more programs to solve both problems.
export PAGER=less

A: The fatal error for running a git command outside a project directory is expected. Not getting any log messages at all for running git log is not.
Try running gitk to see if you can see the log history there.

A: If you do not have any commits, it would not show anything and error. Also, if you don't have a current commit in a bare repo, you can still show all commits in a repo with `git log --all'.
You can also see what branches you have with
git branch -a

then you can git checkout branchX. You would be able to get output from git log then - provided you have some commits there. If you have bare repos, you can't checkout.
Hope this helps.

A: I have the same problem (and "git diff" doesn't work either), I still do not know why but  I workaround :
git rev-list --all --reverse

Or better (only 10 last commits with message information) :
git rev-list --all --max-count=10 --reverse --pretty

A: i had the similar issue with a log to a file. 1] get a list of your config files git config --list 2] check this entry core.filemode=false change it to true git config core.filemode true 3] check your files path in gitk 4] i had the wrong path. now it works. git log --  ./Documents/holdMe.txt

A: For those who still don't come up with solution:
Check your firewall, mine (Comodo on windows10) was blocking Git\usr\bin\less.exe.
After removing it from blocked apps it worked fine.


text:
Q: Template Class Assignment Operator Overloading I'm having a little trouble with the following:
I'm writing a map abstract data type for some coursework & I've come across a problem whilst trying to assign an object of my class (MapEntry - below) to an array of the same type in the class MapADT. It tells me that:
Error  1   error C2679: binary '=' : no operator found which takes a right-hand operand of type 'MapEntry *' (or there is no acceptable conversion) c:\users\cross_000\documents\visual studio 2013\projects\objectorientedmethodsasignment1\mapadt\mapadt.h    14
So I thought I would write my own Assignment operator override. I've done this in the MapEntry class definition but the compiler doesn't seem to recognize it when I try to initialize the array in the constructor on MapADT - below.
Any help would be greatly appreciated.
#pragma once

template <class Tk, class Tc>
class MapEntry
{
private:
    Tk key;
    Tc contents;
    bool isPopulated;

public:
    MapEntry() {

    }

    MapEntry(Tk keyInput, Tc contentsInput) {
        key = keyInput;
        contents = contentsInput;
        isPopulated = true;
    }

    MapEntry(Tk keyInput, Tc contentsInput, bool isPopulatedInput) {
        key = keyInput;
        contents = contentsInput;
        isPopulated = isPopulatedInput;
    }

    ~MapEntry() {
        //TODO
    }

    Tk getKey() {
        return key;
    }

    void setKey(Tk keyInput) {
        key = keyInput;
    }

    Tc getContents() {
        return contents;
    }

    void setContents(Tc contentsInput) {
        contents = contentsInput;
    }

    bool getIsPopulated() {
        return isPopulated;
    }

    void setIsPopulated(bool isPopulatedInput) {
        isPopulated = isPopulatedInput;
    }

    MapEntry<Tk, Tc>& operator=(const MapEntry<Tk, Tc> & lst)
    {
        clear();
        copy(lst);
        return *this;
    }
};

MapADT.h
#pragma once
#include "MapEntry.h"

template <class Tk, class Tc>
class MapADT
{
private:
    int mapSize = 1000;
    MapEntry<Tk, Tc> *map;
public:
    MapADT() {
        map = new MapEntry<Tk, Tc>[mapSize];
        for (int i = 0; i < mapSize; i++) {
            map[i] = new MapEntry<Tk, Tc>(NULL, NULL, false);
        }
    }
}

There's more to the MapADT class but I don't think it's relevant. If you need to see the whole thing I can add it.

A: In this line
map = new MapEntry<Tk, Tc>[mapSize];

you allocate an array of MapEntry<Tk, Tc>, and default constructors are called for all of them. There's no need in subsequent for loop at all, you should just write proper initialization in MapEntry::MapEntry(), which is currently empty.

A: map[i] is not an pointer to MapEntry.
Not sure if you want
map[i] = MapEntry<Tk, Tc>(NULL, NULL, false);

or
MapEntry<Tk, Tc>** map;

MapADT() {
    map = new MapEntry<Tk, Tc>*[mapSize];
    for (int i = 0; i < mapSize; i++) {
        map[i] = new MapEntry<Tk, Tc>(NULL, NULL, false);
    }
}

to solve your issue.


text:
Q: Проблема с русским алфавитом Не выполняются много строковых функций, когда передаются русские буквы.
    $data = "авыаВв"
echo ucfirst(strtolower($data)); // не работает
    $data = "fdsfsdDfd"
echo ucfirst(strtolower($data)); //работает

A: Почитайте вот тут как работать с UTF.


text:
Q: WebView: Loading a local website with directories, css's, htmls, etc stored in a folder inside assets It is possible in Android to load a complex website stored in a folder inside assets android folder... with html, javascript, folders with css files, images etc...? Can't find any info about this in google.
Which is the best approach to achieve this?
Which limitations will have this?
Thanks

A: You can and you can download awd IDE to do it. It creates a folder and you allows you to creates html/js/css/php files


text:
Q: Show that the language is regular - Closure For languages $A$ and $B$, let the perfect shuffle of $A$ and $B$ be the language $$L=\{w \ \mid \ w=a_1 b_1 \dots a_k b_k, \text{ where } a_1 \cdots a_k \in A \text{ and } b_1 \cdots b_k \in B, \text{ each } a_i, b_i \in \Sigma\}$$
Show that the class of regular languages is closed under perfect shuffle.
$$$$
I have done the following:
Let $M_A=(Q_A, \Sigma , \delta_A, q_A, F_A)$ the DFA that accepts the language $A$ and $M_B=(Q_B, \Sigma , \delta_B, q_B, F_B)$ the DFA that accepts the language $B$.
Let $M=(Q, \Sigma , \delta, q, F)$ the NFA that accepts the language $L$, with
$Q=Q_A \times Q_B$,
$\delta: (k_A, a_i) \mapsto k_B$, where $k_A, k_B$ states of the machine $M_A$ and $M_B$ resectively
$q=q_A$
$F=F_B$
Is this correct??

A: The way you have written it now is incorrect. Notice that you have said that the states of $M$ are given by $Q = Q_A \times Q_B$, so a state of $Q$ would have the form $(k_A,k_B)$, where $k_A \in Q_A$ and $k_B \in Q_B$.
This means that the transition function should be of the form $\delta : Q_A \times Q_B \times \Sigma \rightarrow Q_A \times Q_B$, whereas your current transition function is $\delta : Q_A \times \Sigma \rightarrow Q_B$. In fact, since you stated that you want an NFA, the transition function should be of the form $\delta: Q_A \times Q_B \times \Sigma \rightarrow \mathcal{P}(Q_A,Q_B)$. Similarly, both $q$ and $F$ must be pairs of states.


text:
Q: How do I configure SSL on IIS 6.0 FTP Server? I am using IIS 6 FTP server for the exchange of files through System.Net.FtpWebRequest.
I want to configure SSL on IIS 6.0's FTP server so that it will allow secure connections.
Is this possible, if so how do I do this?

A: IIS 6 does not support FTP over SSL (FTPS), however IIS 7 (and 7.5) does.  If IIS 7 is not an option for you, you will most likely need to look at third party alternatives.
Here is information about IIS7:
http://learn.iis.net/page.aspx/310/what-is-new-for-microsoft-and-ftp-75/


text:
Q: using js validation on php server side, is secure? I would ask about using javascript function on server side for validation, are is true, secure and truth way ?
I see a website was development like this .. when user post data, php file was call a javascript function and check if valid or no .. so im ask about it.
I think its not secure, for many of cases like XSS, if Im true, can you give me some of issue for this procedure.
thanks a lot.

A: Since you clarified that you mean server side JS:
There are no inherit insecurities when performing input validation on the server, even if you pass the data from one server side program (which could be written in PHP) to another server side program (which could be written in JavaScript).
That does, however, add complexity and complexity is opportunity for bugs to slip in.


text:
Q: Debugging : Keras+tensorflow code to create sequential model crashing with message "Your session crashed for an unknown reason" on Google colab While running the following code on Google colab with 'GPU' runtime (as one of my custom layers performs tensorflow.fft using GPU), my session is crashing -
fc2_shape = 32*32

model = models.Sequential()
model.add(layers.Flatten(input_shape=(32, 32, 2)))
model.add(layers.Dense(fc2_shape, activation='tanh'))
model.add(layers.Dense(fc2_shape, activation='tanh'))
model.add(layers.Reshape((32, 32, 1)))
model.add(conv2d_layer(num_features=32, kernel_size=5, type_conv="complex"))
model.add(layers.Activation('relu'))
model.add(conv2d_layer(num_features=32, kernel_size=5, type_conv="complex", kernel_regularizer=regularizers.l1(0.0001)))
model.add(layers.Activation('relu'))
model.add(complex_conv_transpose_layer(num_features=1, kernel_size=9, strides=1))

model.summary()

It crashes with the message "Your session crashes. Automatically restarting.. Your session restarted after a crash. Debugging.. Your session crashed for an unknown reason. View runtime log"
\newline
The runtime logs are shared below. Could I get some help in understanding what might be causing the crash, as there is not even an error message, but only warnings in the log. Tried many methods suggested for few warnings in the log, but none seem to work. Need to figure out the exact cause. Thanks.
Jan 12, 2021, 9:02:25 AM    WARNING WARNING:root:kernel 96640b1f-78c4-4aee-8612-299bbd2a4d8d restarted
Jan 12, 2021, 9:02:25 AM    INFO    KernelRestarter: restarting kernel (1/5), keep random ports
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.430989: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.256096: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1406] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 13960 MB memory) -> physical GPU (device: 0, name: Tesla T4, pci bus id: 0000:00:04.0, compute capability: 7.5)
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.256008: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:39] Overriding allow_growth setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.255209: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.254277: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.253280: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.247860: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1280] 0: N
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.247846: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1267] 0
Jan 12, 2021, 9:02:20 AM    WARNING 2021-01-12 03:32:20.247794: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1261] Device interconnect StreamExecutor with strength 1 edge matrix:
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.208463: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.205616: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.204824: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203940: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203862: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.7
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203843: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.10
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203825: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.10
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203806: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203787: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203768: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.10
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203743: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.10
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203699: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
Jan 12, 2021, 9:02:16 AM    WARNING coreClock: 1.59GHz coreCount: 40 deviceMemorySize: 14.73GiB deviceMemoryBandwidth: 298.08GiB/s
Jan 12, 2021, 9:02:16 AM    WARNING pciBusID: 0000:00:04.0 name: Tesla T4 computeCapability: 7.5
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.203627: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.202836: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.202313: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.201374: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1862] Adding visible gpu devices: 0
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.197656: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.196404: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:16 AM    WARNING 2021-01-12 03:32:16.196182: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.7
Jan 12, 2021, 9:02:15 AM    WARNING 2021-01-12 03:32:15.708027: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.10
Jan 12, 2021, 9:02:15 AM    WARNING 2021-01-12 03:32:15.691252: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.10
Jan 12, 2021, 9:02:15 AM    WARNING 2021-01-12 03:32:15.439674: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10
Jan 12, 2021, 9:02:15 AM    WARNING 2021-01-12 03:32:15.390009: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10
Jan 12, 2021, 9:02:15 AM    WARNING 2021-01-12 03:32:15.274378: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.10
Jan 12, 2021, 9:02:15 AM    WARNING 2021-01-12 03:32:15.274194: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.10
Jan 12, 2021, 9:02:14 AM    WARNING 2021-01-12 03:32:14.935005: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
Jan 12, 2021, 9:02:14 AM    WARNING coreClock: 1.59GHz coreCount: 40 deviceMemorySize: 14.73GiB deviceMemoryBandwidth: 298.08GiB/s
Jan 12, 2021, 9:02:14 AM    WARNING pciBusID: 0000:00:04.0 name: Tesla T4 computeCapability: 7.5
Jan 12, 2021, 9:02:14 AM    WARNING 2021-01-12 03:32:14.934938: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
Jan 12, 2021, 9:02:14 AM    WARNING 2021-01-12 03:32:14.933915: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:941] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
Jan 12, 2021, 9:02:14 AM    WARNING 2021-01-12 03:32:14.866772: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1
Jan 12, 2021, 9:02:14 AM    WARNING 2021-01-12 03:32:14.865367: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
Jan 12, 2021, 9:02:14 AM    WARNING tcmalloc: large alloc 1228800000 bytes == 0x14210000 @ 0x7f536abaa1e7 0x7f53620a841e 0x7f53620f8c2b 0x7f53620f8cc8 0x7f53621b4d19 0x7f53621b7dec 0x7f53622d6ddf 0x7f53622dcf15 0x7f53622ded9d 0x7f53622e0476 0x5a48ec 0x5a4fb8 0x7f53621bf438 0x59c9f0 0x50ea2d 0x507be4 0x5161c5 0x50a12f 0x50beb4 0x507be4 0x509900 0x50a2fd 0x50beb4 0x507be4 0x509900 0x50a2fd 0x50cc96 0x507be4 0x508ec2 0x594a01 0x59fd0e
Jan 12, 2021, 9:02:06 AM    WARNING 2021-01-12 03:32:06.977597: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
Jan 12, 2021, 9:01:54 AM    INFO    Adapting to protocol v5.1 for kernel 96640b1f-78c4-4aee-8612-299bbd2a4d8d
Jan 12, 2021, 9:01:52 AM    INFO    Kernel started: 96640b1f-78c4-4aee-8612-299bbd2a4d8d
Jan 12, 2021, 9:00:04 AM    INFO    Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Jan 12, 2021, 9:00:04 AM    INFO    http://172.28.0.2:9000/
Jan 12, 2021, 9:00:04 AM    INFO    The Jupyter Notebook is running at:
Jan 12, 2021, 9:00:04 AM    INFO    0 active kernels
Jan 12, 2021, 9:00:04 AM    INFO    Serving notebooks from local directory: /
Jan 12, 2021, 9:00:04 AM    INFO    google.colab serverextension initialized.
Jan 12, 2021, 9:00:04 AM    INFO    Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
Jan 12, 2021, 9:00:04 AM    WARNING Config option `delete_to_trash` not recognized by `ColabFileContentsManager`.

A: This generally happens when you use all the RAM available on google colab since it can't handle very big datasets. You could try upgrading the RAM or use different services.
Try Microsoft Azure, AWS or Google Cloud Services
All of them have pretty good machine learning products but are all paid. Another alternative is running it locally on Jupyter.


text:
Q: Bold of authors list changes style with bibtex This is related to another question I had, but when I try to make an entire entry bold in my bilbiliography, it changes the format of the author list.  I would like to be able to make only some entries in my bibliography bold and retain normal formatting for the rest. Here's my MWE:
\documentclass[notitlepage,groupedaddress]{IEEEtran}
\usepackage{filecontents}
\usepackage{cite}

\begin{filecontents}{\jobname.bib}

@article{BCS,
    title = {Theory of Superconductivity},
    volume = {108},
    number = {5},
    journal = {Physical Review},
    author = {Bardeen, J. and Cooper, L. N. and Schrieffer, J. R.},
    month = dec,
    year = {1957},
    pages = {1175--1204}
}

@article{EPR,
    title = {Can {Quantum-Mechanical} Description of Physical Reality Be Considered Complete?},
    volume = {47},
    number = {10},
    journal = {Physical Review},
    author = {Einstein, A. and Podolsky, B. and Rosen, N.},
    month = may,
    year = {1935},
    pages = {777--780}
}
\end{filecontents}

\begin{document}
Hello world\cite{BCS}\cite{EPR}
\bibliographystyle{IEEEtran}
\bibliography{\jobname}
\end{document}

Without any formatting commands, this file gives me the following output for the BCS paper:
J. Bardeen, L. N. Cooper, and J. R. Schrieffer, "Theory of superconduc-
tivity," Physical Review, vol. 108, no. 5, pp. 1175–1204, Dec. 1957.
Now, if I change the authors portion of the BCS paper to bold:
author = {\textbf{Bardeen, J. and Cooper, L. N. and Schrieffer, J. R.}},

I get different output:
Bardeen, J. and Cooper, L. N. and Schrieffer, J. R., "Theory of
superconductivity," Physical Review, vol. 108, no. 5, pp. 1175–1204, Dec.
1957.
If I try \bf or \bfseries, the bold runs off and encompasses both the BCS and EPR citations.  Is there a way I can highlight the authors list of the BCS paper without changing the style of the initials and names? The paper I'm actually working is far larger scale and I want to avoid hardcoding authors in my desired format. Please note that I'm working with IEEEtran, so I believe biblatex is not an option here as the biblatex IEEE style doesn't produce a format identical for use in publication.

A: The reason you see the behaviour you do is that by adding the text formatting command to your bib file, you remove BibTeX's ability to parse the name field properly.  But the IEEEtran.bst bibliography style is very sophisticated and provides a hook to do what you want.
As outlined in the documentation of the IEEEtran.bst documentation, there is a special method for applying some kinds of customization to the IEEEtran.bst file.  You need to add a special "control record" to your bib file (in fact it can be its own bib file, as I've done in this example.)  The control bib file contains a single record with a number of different fields containing customizations.  In your case, you want to specify a formatting for authors' names.  The control bib file would therefore look like this:
@IEEEtranBSTCTL{IEEE:BSTcontrol,CTLname_latex_cmd = "\textbf"}

where
CTLname_latex_cmd = "\textbf"

is a control sequence that the .bst file knows about which takes one latex command that requires an argument (so it should be \textbf (or similar) rather than a switch.)
In addition to loading this bib file, you also need a special citation command to invoke it:
\bstctlcite{IEEE:BSTcontrol}

where IEEE:BSTcontrol is an arbitrary cite key corresponding to the key of the control record in the control bib file.
You can have more than one control key in your document if you want to make individual items bold.  In the full example below, I've created two control keys: IEEE:bold and IEEE:plain.  All citations following \bstctlcite{IEEE:bold} will be bold, and and all
citations following \bstctlcite{IEEE:plain} will be plain.
Here's the complete example:
\documentclass[notitlepage,groupedaddress]{IEEEtran}
\usepackage{filecontents}
\usepackage{cite}

\begin{filecontents}{\jobname.bib}

@article{BCS,
    title = {Theory of Superconductivity},
    volume = {108},
    number = {5},
    journal = {Physical Review},
    author = {Bardeen, J. and Cooper, L. N. and Schrieffer, J. R.},
    month = dec,
    year = {1957},
    pages = {1175--1204}
}

@article{EPR,
    title = {Can {Quantum-Mechanical} Description of Physical Reality Be Considered Complete?},
    volume = {47},
    number = {10},
    journal = {Physical Review},
    author = {Einstein, A. and Podolsky, B. and Rosen, N.},
    month = may,
    year = {1935},
    pages = {777--780}
}

\end{filecontents}
\begin{filecontents}{IEEEcontrol.bib}
@IEEEtranBSTCTL{IEEE:bold,CTLname_latex_cmd = "\textbf"}
@IEEEtranBSTCTL{IEEE:plain,CTLname_latex_cmd = "\relax"}
\end{filecontents}

\begin{document}
\bstctlcite{IEEE:bold}
Hello world\cite{BCS}\bstctlcite{IEEE:plain}\cite{EPR}
\bibliographystyle{IEEEtran}
\bibliography{\jobname,IEEEcontrol}
\end{document}

Output


text:
Q: Define the level when using @ManyToOne that relate the same entity I have an object that can be child of itself, in a way that it generates a tree of objects, for exemple an article could be the composition of many other articles, so i'm using a @ManyToOne to relate the article to itself, the tree of 4 articles should look like this:
article A (lvl 1) --> article B (lvl 2) --> article C (lvl 3) --> article D (lvl 4)
@Entity
public class Article implements Serializable {

    @ManyToOne
    @JoinColumn(name = "article_father", referencedColumnName = "id")
    private Article articleFather;

    @Column(name = "level")
    private Integer level;

}

Now my problem is when i want to remove the father of article B, is there any way with jpa to refresh the levels of article B and C and D, so that i would have two trees :
article A (lvl 1)
article B (lvl 1) --> article C (lvl 2) --> article D (lvl 3)

A: If I right you need tree.
My example:
@Entity(name = "geography")
@Table(schema = "TEST", name = "GEOGRAPHY")
public class Geography {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
private Long id;

@Column(name = "NAME")
private String name;

@ManyToOne
@JoinColumn(name = "parent_id")
@JsonIgnore
private Geography parent;

@OneToMany(mappedBy = "parent")
@JsonIgnore
private Set<Geography> setElements = new HashSet<Geography>();
...
}

level - count of parents


text:
Q: bind a kendo grid using knockout js im learning knock ut js and i have to speed up my learning since i have got to create a website,i know kendo ui and know how to use it with jquery but if i want to bind my grid using Knockout js what should i do?i have tried the following but its not working,does not show anything when i run it:
my viewmodel
   var viewModel = {
       items: ko.observableArray([
          { id: ko.observable('1'), name: ko.observable('a') },
          { id: ko.observable('2'), name: ko.observable('b') },
          { id: ko.observable('3'), name: ko.observable('b') },
          { id: ko.observable('4'), name: ko.observable('d') }
        ])
    };

i bind it like this:
  ko.applyBindings(viewModel);

here is my view:
 <div data-bind="kendoGrid:{dataSource:items,colums:[{field:'id()'},{field:'name()'}]}"> </div>

am i missing something and is it the right way of binding in knock out?

A: Are you sure about the name and syntax of parameters?

*

*dataSource should be a object containing data (see here)

*colums should be columns
Also, you can see the official connector documentation here.


text:
Q: strtoul() not working as expected? I am trying to convert a string such as "0x7ffd01767a60" to hexadecimal so I can compare pointers. Not sure if this is the best decision.
I am doing this:
    char *address = "0x7ffd01767a60";

    strtol(address,NULL,16);
    printf("%lp",address);

And I am getting this: 0x7ffd01764120
EDIT: It seems I was printing the string address ignoring the function return. Thanks Jens! and schlenk.
SOLVED! This is what I do
    char *address = "0x7ffd01767a60";
    void *p;
    unsigned long int address_hex = strtol(address,NULL,16);
    p = (void*) address_hex;

    printf("%p",p);

printf prints the same memory address.

A: You're printing the address of the string itself while ignoring the result of the strtoul() function call. This should work:
const char *address = "0x7ffd01767a60";

unsigned long int address_hex = strtoul(address, NULL, 16);
// Check for errors in errno
printf("%lx\n", address_hex);

Also, personally I prefer code to be as explicit as possible which is why I passed 16 as the base parameter.
Note: Please read the documentation on the return value, to make sure that you identify errors correctly.


text:
Q: как создать файл во всех поддиректориях есть некая структура папок там много папок и под папок,
в гит пустые папки не загружаются и мне в них нужно создать файл,
я пытался это сделать так
find MY-DIR -type d -exec echo 'gitdirnoempty' >  .gitdirnoempty {}\;

но файл не создался что делать ?

A: Самое простое:
find MY-DIR -type d -exec touch '{}/.gitdirnoempty' \;

Также стоит добавить -empty, чтобы создавать файлы только в пустых каталогах:
find MY-DIR -type d -empty -exec touch '{}/.gitdirnoempty' \;

Если хочешь что-то непременно записать в файл, то как-то так:
find MY-DIR -type d -exec sh -c 'echo gitdirnoempty >"$0/.gitdirnoempty"' '{}' \;

Ошибки в исходном варианте:

*

*; должна быть отдельным аргументом

*вся конструкция с перенаправлением была довольно бессмысленна т.к. она интерпретируется shell'ом и перенаправляет вывод find в файл в текущем каталоге.


text:
Q: Getting ids from related models from the model of an object being created I am very new to .Net and am having a bit of trouble I cant seem to find an answer to (likely because I am trying to do it incorrectly.
I am building a web application that will build and schedule tournaments created by users and I have the following 2 models:
 public class Tournament
{
    public Tournament()
    {
        Matches = new List<Match>();
    }

    public int TournamentId { get; set; }
    public virtual ApplicationUser Owner { get; set; }
    public string Name { get; set; }
    public virtual ICollection<Match> Matches { get; set; }
    public int PlayerCount { get; set; }
    public string TournamentType { get; set; }

    ...
    // More code here
}

public class Match
{
    public Match(int game1, int game2)
    {
        ...
    }

    public int MatchId { get; set; }
    public string Player1 { get; set; }
    public string Player2 { get; set; }
    public bool Completed { get; set; }
    public int PriorMatch1 { get; set; }
    public int PriorMatch2 { get; set; }
    public virtual Tournament Tournament { get; set; }
}

In the create action of the Tournament I am making a call to a method in the tournament Model called createElimination() which runs an algorithm for creating all of the rounds and matches that need to be played based off of the PlayerCount set for the tournament (I wont bore you with the huge [probably poorly written] algorithm).
The issue I am having is matches after the first round need to be created and store the ID's of the previous round's matches that lead into that match.
What I would like to do is as I am creating matches, store the ids for use in following rounds
foreach (Match match in currentRound)
{
    Matches.Add(match);
    lastRoundIds.Add(Matches.Last().MatchId);
}

but these matches are not added in the database until the db.SaveChanges(); is called in the controller so the id's are non-existent at the time of creation.
I am not sure how to solve this issue. Perhaps I should not be using the model for this logic and I should move it somewhere else?  Any help would be great.


text:
Q: Memory addressing issues with a 2D array implemented as a 1D array (MIPS) I'm trying to represent a 2D puzzle as a 1D array. Currently, I'm trying to test having a simple 2x2 puzzle with empty cells. In MIPS, this is defined as the following:
puzzle:
    .word 0, 0, 0, 0

For the test, this should be what I get as output:
+---+---+
|   |   |

But, this is what I get:
+---+---+
|   |   |   |
Error #16:  Attempt to use nonexistent memory

Fault address:  004000d0

Register contents:

 $zero: 00000000   $at: 00000000   $v0: 00000004   $v1: 00000000
   $a0: 00000000   $a1: 00000015   $a2: 00000002   $a3: 00000000
   $t0: 00000000   $t1: 00000054   $t2: 00000000   $t3: 00000000
   $t4: 00000000   $t5: 00000000   $t6: 00000000   $t7: 00000000
   $s0: 00000002   $s1: 00000000   $s2: 00000015   $s3: 10000054
   $s4: 00000000   $s5: 00000000   $s6: 00000000   $s7: 00000000
   $t8: 00000000   $t9: 00000000   $k0: 00000000   $k1: 00000000
   $gp: 00000000   $sp: 7fffeac8   $fp: 00000000   $ra: 00400188
    pc: 004000d4    hi: 00000000    lo: 00000000

Current instruction:    8e620000 (at 004000d0)

Decoded instruction:  lw        $v0, 0($s3)     (0x10000054)

I already spent time stepping through the debugger and keeping track of the registers by hand, but I am stumped as to where the issue in memory is. The instruction it lists is when I read the memory in getElement, but I'm not sure how I could be accessing memory I shouldn't. I was wondering if anyone noticed anything off with getElement or printTop in regards to accessing memory?
# Name:         getElement
#
# Description:  Gets the value at the specified coordinates in the puzzle.
#
# Arguments:    a0      The x-coordinate
#               a1      The y-coordinate
#               a2      The size n
#
# Returns:      The element at array[n * row + col]
#

getElement:

    addi    $sp, $sp, -FRAMESIZE_24
    sw      $ra, 16($sp)
    sw      $s3, 12($sp)
    sw      $s2, 8($sp)
    sw      $s1, 4($sp)
    sw      $s0, 0($sp)

    move    $s0, $a2                # store n
    move    $s1, $a0                # store row
    move    $s2, $a1                # store col
    la      $s3, puzzle             # get address of array

    mul     $t0, $s0, $s1           # n * row
    add     $t1, $t0, $s2           # (n * row) + col
    sll     $t1, $t1, 2
    add     $s3, $s3, $t1
    lw      $v0, 0($s3)

    lw      $ra, 16($sp)
    lw      $s3, 12($sp)
    lw      $s2, 8($sp)
    lw      $s1, 4($sp)
    lw      $s0, 0($sp)
    addi    $sp, $sp, FRAMESIZE_24
    jr      $ra

# Name:         printTop
#
# Description:  Prints the top of each "row" for a given cell in a row.
#               Ex:
#                       +---+
#               top ->  |\##|
#                       |#\#|
#                       |##\|
#                       +---+
#
# Arguments:    a0      The array containing the cells in the puzzle
#               a1      The size n
#               a2      The current row
#
# Returns:      Nothing
#

printTop:

    addi    $sp, $sp, -FRAMESIZE_20
    sw      $ra, 12($sp)
    sw      $s2, 8($sp)
    sw      $s1, 4($sp)
    sw      $s0, 0($sp)

    move    $s0, $a0
    move    $s1, $a1
    move    $s2, $a2
    li      $t1, 0              # col = 0

    j       top_loop

top_loop:

    beq     $t1, $s1, top_done

    move    $a0, $s2
    move    $a1, $t1
    move    $a2, $s1
    jal     getElement

    # if empty
    beq     $v0, $zero, t_empty

t_empty:

    # print "   |"
    li      $v0, PRINT_STRING
    la      $a0, empty
    syscall

    addi    $t1, $t1, 1

    j       top_loop

top_done:

    lw      $ra, 12($sp)
    lw      $s2, 8($sp)
    lw      $s1, 4($sp)
    lw      $s0, 0($sp)
    addi    $sp, $sp, FRAMESIZE_20
    jr      $ra

Edit: I've been tinkering around with some of the code and got it very close I think to working. I subtracted the size n by 1 before going on in printTop and changed beq     $t1, $s1, top_done to  bgt     $t1, $s1, top_done and now the output I get is this:
+---+---+
|   |   |

Which is great! Except I was also just testing with a call to printTop directly in main, so when I actually run it in a loop I get this:
+---+---+
|   |   |
|
|
+---+---+
|   |
|
|
+---+---+

So for some reason for the second row it only prints one cell, but it looks like I'm no longer accessing nonexistent memory. Any ideas as to what the cause of this is?

A: Looking at the register dump:
$s0: 00000002   $s1: 00000000   $s2: 00000015   $s3: 10000054

s2 looks suspect as its supposed to be the column - I would expect 0 or 1.
a1, where it is set from is same value, and is being set from t1 in printTop
and although t1 looks ok incrementing in printToo for col, it isn't saved but the register is also used in getElement
So the one line cause of the issue is t1 is being used in multiple functions for multiple reasons.


text:
Q: read russian characters with silverlight I parse XML file. And I need to read russian letters.
But none of supported encodings(BigEndian,UTF8,Unicode) can do it.
FileStream f = new FileStream(filename, FileMode.Open);
StreamReader s = new StreamReader(f, Encoding.?);

What to do?

A: You need to use an encoding that matches the file you are trying to parse.  If the encoding is not one of the ones natively supported by Silverlight, you will have to supply your own sub-class of System.Text.Encoding to handle the file; it must convert the bytes in the file into the correct Unicode characters.  If you identify the standard name for your encoding, you might do a search and find an implementation already exists; otherwise, you must write your own.


text:
Q: Excel input pop up box if cell is false I would like to make an excel worksheet to suit my needs of making word documents (mail merge).
Can I use IF function like this:
IF(A1=Specific text;Write this text;RUN MACRO with popup box to input other text)

Basically, if value is true - write pre defined text and if it is false - give me pop up box to input new text?

A: Yes you can, however I would not recommend it because each time the worksheet is calculated, if the result of your IF() statement is FALSE, the InputBox will be displayed.
However if you insist, try something like the following:
Cell Formula =IF(A1="Something","Result1", AskForResult())
In a Code Module, add the following:
Public Function AskForResult() As String
    Dim strUserResponse As String

    strUserResponse = InputBox("What result to give?")

    AskForResult = strUserResponse
End Function

This will display an InputBox like below when the value in A1 <> "Something"

A: Using a vba function you can. If your vba function was:
function test() as string

    Test = Inputbox("Enter value")

End function

Usage:
=if(A1="value", "value1", test)


text:
Q: difference between embedded and standalone activemq broker I am using Spring for my application.  I am wondering what differences there is between "embedded" ActiveMQ and "stand-alone" ActiveMQ.  If I run ActiveMQ embedded, does thing mean remote clients can still connect up?  Is my understand correct that embeded ActiveMQ means that ActiveMQ will start automatically when I start my Spring application, or is there some other meanings to it?
For example Let's say I have deployed one application in system-A and deployed the same application in system-B.in the application I have configured embedded ActiveMQ broker through spring xml files with broker url as tcp:10.1.1.10;
If I send messages to activemq broker in system-A ,can I consume the same messages in system-B?

A: Embedded ActiveMQ vs Standalone ActiveMQ difference is exactly the difference between the words 'Embedded' and 'Standalone'.
Let me explain in context of a Camel Application:
StandAlone ActiveMQ means, that you have ActiveMQ and you move your Camel Application jar file into its Lib folder. You import the Camel Application's camel-context.xml file in your Activemq's activemq.xml file.
You start activeMQ.sh which starts ActiveMQ and creates your Camel Routes with it.
Note here, we are moving artifacts to ActiveMQ distribution which is not inside any other container. This ActiveMQ distribution can be on your local machine itself.
On the Other Hand:
An Embedded ActiveMQ means that you provide ActiveMQ ability to some other container. For example, You enable ActiveMQ capabilities in any Application Server. In this case you do not start ActiveMQ per se. You simply start the enclosing container and ActiveMQ capabilities are made available as the container startsup.
For example, you can have Tomcat on your local machine. You move few relevant activeMq jars in Tomcat's lib folder. You may have to configure Tomcat's config file in some scenarios. For instance in case you are providing queues as JNDI object, then the queue needs to be configured as a Resource.
Hope this helps.
Reference: http://icodingclub.blogspot.com/2011/09/spring-jms-with-embeded-activemq-in.html

A: Yes you are right about embedded ActiveMQ , It resides and runs inside a application you deploy, this instance of activeMQ starts and stops when application itself starts or stops.
Standalone ActiveMQ instance runs on its own and can be independently started and stopped
For your question, yes you can consume the messages from different systems with embedded activeMQ instances.
Hope this helps!
Good luck!


text:
Q: I Can't Run Some Ant Tasks In FDT Some of my Ant tasks fail in FDT. The error is usually:
BUILD FAILED
Problem: failed to create task or type fdt.invoke.launchConfiguration
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place

What is going on?

A: You need to make sure that the Ant script is being run the the same JRE as your workspace.


text:
Q: How to 'break' out of a Boolean "OR' XPath if first XPath matches? Using Webdriver in Python, I'm looking for a certain element, and if it's not found, I try find a different element that is usually present if the first is not. Problem is: it appears that the second XPath is sometimes evaluated first, and when it returns a valid value, it's not the value I need when both elements are present.
driver.find_element_by_xpath("//ol/div[2]/div/div/div[2]/div[1]/div/div[3]/div/a[1]/div/div/div[2]/div/span | //ol/div[2]/div/div/div[2]/div[1]/div/div[3]/div/a[1]/div/div/div[2]/span").text

The first XPath query is my ideal scenario, and if it returns a valid value, I need it to break out of the OR, so that the second XPath is not evaluated and possibly returned. Or alternativley, force it to evaluate the first expression and only if it does not return a match does it evaluate the second. What are my options here?
UPDATE
Here's what I'm actually trying to do: On the left hand side of a Google local search results page such as this, there are 20 results:

I want to extract the review score for each (not the star rating, but the number of reviews), whether it is non-zero, or 'No reviews'. Problem is: in the boolean OR Xpath above, it sometimes grabs the star-rating, not the review score:
In [14]: for i in range(1,21):
   ....:     reviews.append(driver.find_element_by_xpath("//ol/div[2]/div/div/div[2]/div[%s]/div/div[3]/div/a[1]/div/div/div[2]/div/span | //ol/div[2]/div/div/div[2]/div[%s]/div/div[3]/div/a[1]/div/div/div[2]/span" % (i,i)))

In [16]: [i.text for i in reviews]
Out[16]:
[u'5.0',
 u'4 reviews',
 u'4 reviews',
 u'4.3',
 u'2 reviews',
 u'No reviews',
 u'4.9',
 u'3 reviews',
 u'5.0',
 u'2 reviews',
 u'No reviews',
 u'4.9',
 u'4 reviews',
 u'3 reviews',
 u'No reviews',
 u'No reviews',
 u'4.9',
 u'No reviews',
 u'No reviews',
 u'4.7']

So what I've done is replaced it with a try/except:
            for result in range(1,21):
                try:
                    reviewCount = driver.find_element_by_xpath("//ol/div[2]/div/div/div[2]/div[%s]/div/div[3]/div/a[1]/div/div/div[2]/div/span" % result).text
                    reviewCounts.append(int(reviewCount.split()[0].replace(',','')))
                except:
                    #reviewCount = driver.find_element_by_xpath("//ol/div[2]/div/div/div[2]/div[%s]/div/div[3]/div/a[1]/div/div/div[2]/span" % result).text
                    reviewCounts.append(0)
            print '\t ****** Review counts for city %s : %s' % (city, reviewCounts)

But this is operation is extremely slow, often taking up to 2 minutes (really).

A: The "|" operator in XPath is not a boolean OR, it is a union operator: it forms the union of two node-sets. So the result of the expression contains the results of both selections.
I don't know what driver.find_element_by_xpath() does, but my guess would be that it takes the first node in the node-set delivered by the XPath expression, in document order - which could come from either operand of the union expression.
Solving this in XPath 2.0 would be dead easy, but I suspect Python is only offering you XPath 1.0. If that's the case, I suspect the best solution is some conditional logic in Python. In pseudo code replace
find(A | B)

by
X = find(A)
if (X is empty) {
  X = find(B)
}

This is roughly what you are doing I think (I don't know Python), except you are doing it by forcing an exception when X is empty. In most languages, forcing an exception and catching it is vastly more expensive than using exception-free logic.

A: Me again and I'll also provide the java code for you.
Note: here my '|' works well. I try to get the star and if no stars there it will returns the reviews' count. The output on my side is in Chinese so i won't put it here(:( you might not recognize whats that.). Test is based on firefox.
package com.selenium.webdriver.test;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;

public class OrCondition {
    public static void main(String[] args) throws MalformedURLException {
        DesiredCapabilities capabilities = DesiredCapabilities.firefox();
        WebDriver driver = new RemoteWebDriver(new URL(
                "http://192.168.12.100:4444/wd/hub"), capabilities);
        driver.get("https://www.google.com/?gws_rd=cr,ssl&ei=t1bdVbaJKcu9eO3KhLAN&fg=1#q=chiropractors&rflfq=1&tbm=lcl&tbs=lf_msr:-1,lf:1,lf_ui:1&oll=37.10749322441741,-95.47923175&ospn=0.9812998917572173,3.251953125&oz=8&fll=36.65933277945504,-94.52342120312498&fspn=1.8859928637987977,5.16357421875&fz=8&rlfi=hd:;si:&rlha=0");
        //0. Here wait for the items load
        WebElement wait = new WebDriverWait(driver, 20)
                .until(new ExpectedCondition<WebElement>() {

                    @Override
                    public WebElement apply(WebDriver d) {
                        return d.findElement(By.className("_gt"));

                    }
                });
        long start = System.currentTimeMillis();
        //1. the same with yesterday's question.
        List<WebElement> elements = driver.findElements(By
                .xpath("//div[@class='_gt']"));

        for (int i = 0; i < elements.size(); i++) {
            WebElement e = elements.get(i);

            WebElement aTag = e.findElement(By.tagName("a"));

            // String dataCid = aTag.getAttribute("data-cid");
            //2. Use "|"
            WebElement starSpan = aTag
                    .findElement(By
                            .xpath(".//g-review-stars/span | .//div[span[contains(text(),'reviews')]]"));

            if (starSpan.getAttribute("aria-label") != null) {
                System.out.println(starSpan.getAttribute("aria-label"));
            } else {
                System.out.println(starSpan.getText());
            }
        }

        long end = System.currentTimeMillis();
        //3. it costs about 2.5 seconds
        System.out.println("Time elapsed " + (end - start));
        driver.quit();
    }
}

A: Here is the working java code for above problem. (As jeffC told, I hope you can convert it too python compatible.)
        List<WebElement> names=driver.findElements(By.xpath("//a[@role='link']//div[@role='heading']"));
        List<WebElement> reviews=driver.findElements(By.xpath("//a[@role='link']//span[contains(text(),'reviews') and not(@class)]"));
        int i=0;
        for(WebElement ele1:names) {
            System.out.println(ele1.getText()+"==>"+reviews.get(i).getText());
            i++
        }

And the output is
Jamie H Bassel DC PC==>2 reviews
Rockefeller Health & Medical Chiropractic==>14 reviews
Frank J. Valente, DC, PC==>3 reviews
Elite Health & Sports Chiropractic==>No reviews
Dr. Robert Shire==>4 reviews
Klein Chiropractic Associates==>No reviews
Better Health Chiropractic PC==>21 reviews
Ron Safko DC, Chiropractic==>5 reviews
Dr Siri Smith DC==>No reviews
JW Chiropractic==>10 reviews
Midtown West - Westside Chiropractic==>No reviews
Carnegie Chiropractic, P.C.==>No reviews
43rd Medical==>No reviews
Balanced Health Medical Chiropractic==>30 reviews
Specific Chiropractic==>3 reviews
John J. Belmonte D.C.,P.C.==>2 reviews
Dr. Shawn M. Turner, DC==>No reviews
Ronald Bland, DC==>No reviews
John F. Brown, DC==>No reviews
BLEU HEALTH SPORTS CHIROPRACTIC, PC==>No reviews


text:
Q: Shouldn't vs should not usage I have heard many people say 'shouldn't it be ...' when correcting someone but today I was writing a formal email and I did not want to use any shorthand notation so I tried to expand it as 'should not it be ...' but this sounds wrong to me. Instead, 'should it not be ...' sounds correct.
I am wondering if this is a weird exception where the shorthand notation makes no sense if we tried to expand it as it is without restructuring the sentence. Are there more such examples?

A: As you have noticed, contractions like shouldn't are not the same syntactically as their full versions.
Syntactically, shouldn't etc. behave like auxiliaries (eg should): they precede the subject when there is an inversion (eg in questions).
Should not is not one word, and does not behave like one word. The should is the auxiliary and precedes the subject when there is an inversion. The not is another part of the verb string, normally following the first auxiliary (I am not seeing him; I will not be seeing him; I should not have been seeing him), but in inversion it follows the subject.

A: The word order "Should not it be" is not incorrect, but it is a bit dated. The contraction however remained out of convenience, and it's not intended to be expanded directly. This is not at all an exception. For instance:
Couldn't it be...

Hadn't it been...

Wouldn't you have...

None of these are idiomatic when expanded in place.