text:
Q: SQL 2014: CheckDB issue Scenario:
SQL Server 2014 : Simple Recovery with Full backup + Differentials (16TB)
I had to move 2 of the 3 data files to their drives with more space.
Got the following Checkdb errrors:
Msg 8904, Level 16, State 1, Line 1
Extent (3:330729680) in database ID 7 is allocated by more than one allocation object.

Msg 8904, Level 16, State 1, Line 1
Extent (3:330761496) in database ID 7 is allocated by more than one allocation object.

Msg 8904, Level 16, State 1, Line 1
Extent (3:330761952) in database ID 7 is allocated by more than one allocation object.

Msg 8905, Level 16, State 1, Line 1
Extent (4:69263216) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:112202728) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:183126192) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223416024) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223469792) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223471712) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223478376) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223500240) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223503600) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223516488) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223519616) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223541992) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223546336) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223553376) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223566624) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223621032) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223631192) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223644072) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223648872) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223656320) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223669376) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223673368) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223686968) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223703600) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223711440) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223792128) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223839320) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223868168) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223878312) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223887808) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223896816) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223908672) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:223911288) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224431616) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224436752) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224439432) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224441488) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224482016) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224501120) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224518192) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224523144) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224523152) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224551560) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224552808) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224553264) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224560344) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224589640) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224599976) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224600000) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224605000) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224611080) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224632192) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224634448) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224634744) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224637504) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224639424) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224642672) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224650144) in database ID 7 is marked allocated in the GAM, but no SGAM or IAM has allocated it.

Msg 8905, Level 16, State 1, Line 1
Extent (4:224718072) in database ID 7 is marked allocated in the GAM, but no
SGAM or IAM has allocated it.

CHECKDB found 62 allocation errors and 0 consistency errors not associated with any single object.

Msg 8913, Level 16, State 3, Line 1
Extent (3:330729680) is allocated to 'dbo.QTR2' and at least one other object.

Msg 8913, Level 16, State 3, Line 1
Extent (3:330761496) is allocated to 'dbo.QTR2' and at least one other object.

Msg 8913, Level 16, State 3, Line 1
Extent (3:330761952) is allocated to 'dbo.QTR2' and at least one other object.

CHECKDB found 3 allocation errors and 0 consistency errors in table 'dbo.QTR2' (object ID 1835731013).

CHECKDB found 65 allocation errors and 0 consistency errors in database 'DataStore'.
repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (DataStore).

Am currently exporting the data from the dbo.QTR2 table to another server.
I would like your input as it how to proceed to resolve these errors and specifically with allocation errors.
To add- the errorlogs had lot of stack dump text being written.
Update  1
**********************
Ran the following to find the suspect pages:
SELECT * FROM [msdb].[dbo].[suspect_pages];
Results: Null

Using one of the extents:
    DBCC TRACEON (3604);
    DBCC PAGE (7, 4, 224650144, 0);
    DBCC TRACEOFF (3604);
    GO

Results:

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

PAGE: (4:224650144)

BUFFER:

BUF @0x00000049D1A4F0C0

bpage = 0x0000001864370000          bhash = 0x0000000000000000          bpageno = (4:224650144)
bdbid = 7                           breferences = 0                     bcputicks = 0
bsampleCount = 0                    bUse1 = 14680                       bstat = 0x9
blog = 0x5215215a                   bnext = 0x0000000000000000

PAGE HEADER:

Page @0x0000001864370000

m_pageId = (4:224650144)            m_headerVersion = 1                 m_type = 1
m_typeFlagBits = 0x0                m_level = 0                         m_flagBits = 0x200
m_objId (AllocUnitId.idObj) = 18567 m_indexId (AllocUnitId.idInd) = 256
Metadata: AllocUnitId = 72057595254734848                                Metadata: PartitionId = 0
Metadata: IndexId = -1              Metadata: ObjectId = 0              m_prevPage = (4:155433890)
m_nextPage = (4:224650145)          pminlen = 30                        m_slotCnt = 231
m_freeCnt = 11                      m_freeData = 7719                   m_reservedCnt = 0
m_lsn = (2320287:6895221:8)         m_xactReserved = 0                  m_xdesId = (0:0)
m_ghostRecCnt = 0                   m_tornBits = -1594742432            DB Frag ID = 1

Allocation Status

GAM (4:224430848) = ALLOCATED       SGAM (4:224430849) = NOT ALLOCATED
PFS (4:224644200) = 0x40 ALLOCATED   0_PCT_FULL                          DIFF (4:224430854) = NOT CHANGED
ML (4:224430855) = NOT MIN_LOGGED

DBCC execution completed. If DBCC printed error messages, contact your system administrator.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

A: Use DBCC PAGE to investigate whether the cited extents are part of a nonclustered index, part of a clustered index, or something else. If they're part of a nonclustered index, you're in luck - the nonclustered index can be rebuilt without data loss. If the extents are part of either the clustered index (which contains the data itself) or part of something else (likely a system table), your best option is to restore to the last known good backup.

A: Due to the size of the database, I would recommend doing page restores instead of restoring the entire database. Query the suspect_pages system table to get the list of pages that are corrupt. Then use the PAGE option of RESTORE DATABASE command which will get the non-corrupted pages from your backups and replace the corrupted ones in your database, that's assuming your backups aren't of a corrupted database. For more information, see here and here.


text:
Q: Comparison between current row, previous row and next row in Talend I want to know if my value is included in an interval consisting of the previous row and the next row. How to do it in Talend?
I tried a tMemorizeRow function where I save 3 lines each time, but encountered a java.lang.NullPointerException exception as when I am on the first line it does not know the next row I saved.
What am I missing?

A: You can try this : add a column "sequence" with value as Numeric.sequence("s1",1,1)to your data : this way you'll know this exact order between rows in your flow (you can do it in a tMap). Redirect the tMap to a tHashOutput component (if you can't find in the palette, add it through Project Parameters>Designer>Palette>Technique , this component is hidden by default).
Then you'll need an other subjob, with 3 tHashInput : one for your main flow, and the two others as lookup : then you'll be able to join rows with previous and following one , thanks to your 'sequence' field.

Then in tMap_2 you'll be able to compare values from mainFlow with Previous and Next flows.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Managin friends in mysql database for social networking site I have long been searching for an answer to this watched a few videos but I can't seem to find an good answer. I want to make a friend system on my site. I have currently set up a many to many system I think is right. Am I supposed to have one database per member containing all their friends?
but my main problem is when I get all the friend id. how do I get their name? I can connect to the database once for each member using this.
<?php foreach ($friend as $person) {
friend_names[] = mysqli_query($con, "SELECT username FROM users WHERE id='$person'");
} ?>

But is there not a simpler way to do it all in one query. I have tried using the different joins but then its write down all the name in the database not just the logged on users friends. so then I would have to use one database per member containing friends id. and also when I use
SELECT users.username
FROM relationships
INNER JOIN users ON relationships.user_1 = users.id

It adds my username too. could anyone explain how I should do this. so I don't have to sit listen to people on youtube explaining how a function works :S?
DB for the relationships
CREATE TABLE IF NOT EXISTS `relationships` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_1` int(11) NOT NULL,
`user_2` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

A: select users.username
from relationships
inner join users on relationships.user_2=users.id
and relationships.user_1=2;

you will need to use this in your database. you just change the code at the end (relationships.user_1=2) with your session user id :)
edit:
to get it all In one query. I also added a row for status (blocked, friend, pending request):
SELECT users.username
FROM relationships
INNER JOIN users ON ((relationships.user_1 = users.id AND relationships.user_2='$user')
or (relationships.user_2 = users.id AND relationships.user_1='$user'))
and relationships.status=1


text:
Q: Custom puppet provider: How to retrieve a file from puppet master I need to retrieve a static file from within a custom Puppet provider from Puppet master (just like file built-in resource does). Defining a separate built-in file resource in Puppet code is not an option. So, in Puppet code the thing should look like this:
custom_type{
  property1 => 'value1'
  property2 => 'value2'
  file => "puppet:///${module_name}/somefile"
}

Although I've written custom types and providers before, interaction with Puppet master's file server is something I do not get.

A: I suggest using the file type after all. You need not do this from the manifest level. Puppet can handle this using generated resources.
For example, the nagios types do something similar.
In your custom type code, introduce a generate hook.
def generate
  if self[:file]
    Puppet::Type.type(:file).new({
      :name   => <whatever the path on the agent is>,
      :ensure => :present,
      :source => self[:file],
    })
  end
end

The agent takes care of adding this resource to the catalog.

A: Looking into the puppet file type, it looks like this is what you want on line 103:
 Puppet::FileServing::Content.indirection.find(metadata.source, :environment => resource.catalog.environment_instance, :links => resource[:links])

metadata.source is the path to the file.


text:
Q: Django and Celery Confusion After reading a lot of blogposts, I decided to switch from crontab to Celery for my middle-scale Django project. I have a few things I didn't understand:
1- I'm planning to start a micro EC2 instance which will be dedicated to RabbitMQ, would this be sufficient for a small-to-medium heavy tasking? (Such as dispatching periodical e-mails to Amazon SES).
2- Computing of tasks, does compution of tasks occur on the Django server or the rabbitMQ server (assuming the rabbitMQ is on a seperate server)?
3- When I need to grow my system and have 2 or more application servers behind a load balancer, do these two celery machines need to connect to the same rabbitMQ vhost? Assuming application servers are the carbon copy and tasks are same and everything is sync on the database level.

A: *

*I don't know the answer to this question, but you can definitely configure it to be suitable (e.g. use -c1 for a single process worker to avoid using much memory, or eventlet/gevent pools), see also the --autoscale option.  The choice of broker transport also matters here, the ones that are not polling are more CPU effective (rabbitmq/redis/beanstalk).

*Computing happens on the workers, the broker is only responsible for accepting, routing and delivering messages (and persisting messages to disk when necessary).

*To add additional workers these should indeed connect to the same virtual host. You would
only use separate virtual hosts if you would want applications to have separate message buses.


text:
Q: How to display binary images into a gridview in ASP.NET using C#? I want to display binary images into a gridview named 'gvExistedCharacter'. I did research about it and many of them suggested to use a handler. However, I have no idea how can I do about it.
FYI: The datatype of the image in the database is image and named 'blueBallImage'. I also want to display its level which is int in the same gridview.
I have tried
    SqlConnection con = new SqlConnection(@"Data Source=localhost;Initial Catalog=MyCloudGames;Integrated Security=True");

    SqlCommand cmd = new SqlCommand("Select blueBallImage FROM CorrespondingBall", con);
    cmd.CommandType = System.Data.CommandType.Text;
    cmd.Connection = con;

    SqlParameter ImageID = new SqlParameter("@characterID", System.Data.SqlDbType.Int);
    ImageID.Value = context.Request.QueryString["characterID"];
    cmd.Parameters.Add(ImageID);
    con.Open();
    SqlDataReader dReader = cmd.ExecuteReader();
    dReader.Read();
    context.Response.BinaryWrite((byte[])dReader["Image"]);
    dReader.Close();
    con.Close();

I received an error "The parameterized query '(@characterID int)Select blueBallImage FROM CorrespondingBall' expects the parameter '@characterID', which was not supplied."

A: You can use handler to display image in gridview , your html markup look like inside
Gridview   ItemTemplate  set image control src  as src=~/ShowImage.ashx?id=" + id
where ShowImage.ashx is your handler which return MemoryStream((byte[])img);
In your case your querystring is characterID
so your image src would be  src=~/ShowImage.ashx?id=" + characterID

Updated Answer:
Html Markup:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
    <Columns>
        <asp:TemplateField HeaderText="CharacterID">
            <ItemTemplate>
                <asp:Label ID="lblid" runat="server" Text='<%# Bind("characterID") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="GameLevel">
            <ItemTemplate>
                <asp:Label ID="lblglevel" runat="server" Text='<%# Bind("gameLevel") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Image">
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" ImageUrl='<%#"ShowImage.ashx?getID="+Eval("characterID") %>' />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

Code behind:
protected void Page_Load(object sender, EventArgs e)
{
    DataTable dt = getData();
    GridView1.DataSource = dt;
    GridView1.DataBind();
  }

public  DataTable getData()
{
  SqlDataAdapter dap = new SqlDataAdapter("select characterID,blueBallImage,gameLevel from CorrespondingBall", cn);
  DataSet ds = new DataSet();
  dap.Fill(ds);
  return ds.Tables[0];
}

Generic handler: Add new generic handler here showIamges.ashx is my generic handler
public void ProcessRequest(HttpContext context)
 {
    Int32 my_Id;
    if (context.Request.QueryString["getID"] != null)
    {
       my_Id = Convert.ToInt32(context.Request.QueryString["getID"]);
       context.Response.ContentType = "image/jpeg";
       Stream strm = ShowEmpImage(my_Id);
       byte[] buffer = new byte[4096];
       int byteSeq = strm.Read(buffer, 0, 4096);
       while (byteSeq > 0)
        {
           context.Response.OutputStream.Write(buffer, 0, byteSeq);
           byteSeq = strm.Read(buffer, 0, 4096);
        }
      }
}

public Stream ShowEmpImage(int my_Id)
{
   string conn = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
   SqlConnection connection = new SqlConnection(conn);
   string sql = "select blueBallImage from CorrespondingBall WHERE characterID = @ID";
   SqlCommand cmd = new SqlCommand(sql, connection);
   cmd.CommandType = CommandType.Text;
   cmd.Parameters.AddWithValue("@ID", my_Id);
   connection.Open();
   object img = cmd.ExecuteScalar();
   return new MemoryStream((byte[])img);
 }

A: You want to add @characterID parameter to your sql command but your command doesn't have a parameter called @characterID.
Remove your parameter process in your code or add @characterID in your sql command which try to match.


text:
Q: Speculable or Speculatable? In the field of programming, we know a function is "safe to speculatively execute" if it has no side-effects.
Is there a single word which can describe this attribute? Speculable? Speculatable? Something else?
(I prefer to avoid anything which does not include any variation of "speculate", in fear of drifting away from a term which is familiar in this context).

A: Either of the suggested terms could arise via ordinary methods of word formation, and would be properly understood by most people, and in particular by people familiar with the ideas of speculative execution.  I prefer speculable and regard it as a more-civilized word than speculatable.
Note that the meaning of speculable suggested at
a wordnik link in TrevorD's comment is "knowable", while an older dictionary suggests the meaning  "Capable of being seen", which is related to the second example shown by wordnik.
However, multiple authors (1,2) have used speculable to refer to things that are speculative, or  things that can be speculated about; both of those senses apply reasonably well to speculative execution matters, and are consistent with the first sense shown in OED1 (1919):

a. Obs. rare. ... f. specular* to SPECULATE. ...
    That admits of speculation ; speculative.

A: Specule is a proper word, a noun, found in dictionaries, unrelated in usage and etymology to the word speculate in general English.
Speculable/ speculeable cannot be used to imply speculatable, though some instances may be found in writing.
Note that the usage of speculable in a sense related to speculate is found essentially in philosophical discourse:

Thomas calls the objects of practical and speculative philosophy, respectively, the operable and the speculable. [emphasis mine]

(Ralph McInerny,  Hist. W. Phil. V.II: XIII C - Chap 6, St Thomas Aquinas)

Data speculatable processor having reply architecture US 5966544 A
  A microprocessor having a replay architecture with an execution core for performing data speculation in executing an instruction, …

LLVM Commits List:

I'd like Eric to take a quick look and agree that marking debug intrinsics speculatable is sane. (Yes they already are, but that doesn't mean it's sane. I also want Eric to know that 'speculatable' is going to start showing up in his debug info.)

Also, non-speculatable, speculatability, non-speculatability:

The method and apparatus are employed within a microprocessor capable of generating speculative memory accesses instructions. Certain instructions access memory locations containing speculatable information while others access memory locations containing non-secpulatable information. Memory-type values indicating the speculatability or non-speculatability of memory locations are stored within a translation lookaside buffer. (Method and apparatus for handling speculative memory access operations US 5956753)


text:
Q: Recalling viewDidLoad after failed connection not working this is my viewDidLoad function working well :
- (void)viewDidLoad
{
    [super viewDidLoad];
    //iAds code
    adview = [[ADBannerView alloc] initWithFrame:CGRectZero];
    adview.frame = CGRectOffset(adview.frame, 0, 0);

    adview.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
    adview.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
    [self.view addSubview:adview];
    adview.delegate = self;
    self.adbanerinvesiable = NO;

    //php data code
    NSError *er;
    SBJsonParser *parser = [[SBJsonParser alloc] init];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8888/newjson.php?number=1"]];
    NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    if (response.length != 0){
        NSString *json_string = [[NSString alloc]initWithData:response encoding:NSUTF8StringEncoding];
        listt = [parser objectWithString:json_string error:&er];
    }
    else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"No Internet conniction" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Refresh", nil];
        [alert show];

        //for ID contet post
        SBJsonParser *parser2 = [[SBJsonParser alloc] init];
        NSURLRequest *request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8888/newjson.php?number=2"]];
        NSData *response2 = [NSURLConnection sendSynchronousRequest:request2 returningResponse:nil error:nil];
        NSString *json_string2 = [[NSString alloc]initWithData:response2 encoding:NSUTF8StringEncoding];
        IDNum = [parser2 objectWithString:json_string2 error:&er];
    }
}

As you can see if the connection failed it will show UIAlertView and two Buttons {ok , Refresh}.
I used this Method in case the refresh button been clicked to call viewDidLoad But not Working and giving me blank white view:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

    if (buttonIndex == 1){
        [self viewDidLoad];
    }
}

Any idea please ?

A: You should put your PHP Data Code in a method in it's own, so when you need to call that specifically you can, because you can't (or should I say shouldn't) call viewDidLoad manually. That should only be called automatically by UIViewController.
Example
- (void)viewDidLoad
{
    [super viewDidLoad];
    //iAds code
    adview = [[ADBannerView alloc] initWithFrame:CGRectZero];
    adview.frame = CGRectOffset(adview.frame, 0, 0);

    adview.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
    adview.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
    [self.view addSubview:adview];
    adview.delegate = self;
    self.adbanerinvesiable = NO;
}

-(void)viewWillAppear:(BOOL)animated    /* or: -(void)viewDidAppear: */
{
    [super viewWillAppear:animtaed];

    [self refreshPHData];
}

-(void)refreshPHPData
{
    //php data code
    NSError *er;
    SBJsonParser *parser = [[SBJsonParser alloc] init];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8888/newjson.php?number=1"]];
    NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    if (response.length != 0){
        NSString *json_string = [[NSString alloc]initWithData:response encoding:NSUTF8StringEncoding];
        listt = [parser objectWithString:json_string error:&er];
    }
    else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"No Internet conniction" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Refresh", nil];
        [alert show];

        //for ID contet post
        SBJsonParser *parser2 = [[SBJsonParser alloc] init];
        NSURLRequest *request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8888/newjson.php?number=2"]];
        NSData *response2 = [NSURLConnection sendSynchronousRequest:request2 returningResponse:nil error:nil];
        NSString *json_string2 = [[NSString alloc]initWithData:response2 encoding:NSUTF8StringEncoding];
        IDNum = [parser2 objectWithString:json_string2 error:&er];
    }
}

Also, when you call viewDidLoad from your UIAlertView, you are creating a second (and third and so forth) adview because you aren't removing the previous instance. Depending on how many times the alert is shown and viewDidLoad is called, you are going to see adview stacking on top of itself. So try instead:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

    if (buttonIndex == 1){
        [self refreshPHPData];
    }
}


text:
Q: How to correctly copy image from UIImagePickerController? From this article, I'm learning to take picture / choose from library, and put the result in a UIImageView.
@IBOutlet var theImage: UIImageView!;

@IBAction func openLibrary (sender: UIButton) {
    if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.PhotoLibrary) {
        let imagePicker = UIImagePickerController()
        imagePicker.delegate = self
        imagePicker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary;
        imagePicker.allowsEditing = true
        self.presentViewController(imagePicker, animated: true, completion: nil)
    }
}

func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {
    theImage.image = image;
    self.dismissViewControllerAnimated(true, completion: nil);
}

The result is like this:
Before click on the select from library

While selecting the image

Image picker result

The image like cropped, even though I have set the mode to be Aspect Fit. What's wrong?
EDIT:
Scale to fit? This is all I have on the image mode:


text:
Q: Why do we need the address location of (&) when scaning input in C I'm just going over some C notes and I was wondering if you was to do this:
int var1 = 0;
scanf("%d", var1);

You would encounter some sort of problem. Where as if you wrote it with the address location of operation as so:
int var1 = 0;
scanf("%d", &var1);

It works perfectly fine.
I've always been under the impression that to store a value you use just the variable name...why are we specifying the address lcoation?

A: The scanf function needs to know where var1 is stored in memory in order to modify it. If you pass just var1 to scanf, then only  value of var1 gets pushed onto the stack. You need to pass &var1 so that the address of var1 gets pushed onto the stack. Once you've done that, then scanf can dereference the pointer to modify the variable in the calling function.

A: Because C copies parameters by value. Consider this (useless) function:
void set_one(int x)
{
    x = 1;
}

When you call this as
int i = 2;
set_one(i);

That's the same as
set_one(2);

The function gets a copy of the 2, calls it x, then overwrites it with a 1 and returns. The original 2, aka i, is not changed.
To make this function even remotely useful, you must tell it where to put its result, instead of the current value in the result location:
void set_one(int *p)
{
    *p = 1;
}

Now a call set_one(&i) tells the function to store it's result at the place designated by the variable name i, which gets overwritten as a result.

A:
why are we specifying the address lcoation?

Because compiler don't know where to store the value and that's why it needs an address of variable to store value rather than the variable.

A: Because the default parameter passing in C is to pass the parameters by value.  When you specify the address, the contents pointed to by the address get modified by the function and that is visible in the calling function.


text:
Q: Create Zip file for multiple images c# In my requirement I am converting docx to images its working fine but I need to store that converted multiple images into Zip file. Zip file was created successfully but Images are not opening it show corrupted/damage. Please try to help me to solve this solution. please refer my below total code. I used using Ionic.Zip; for creating a zip file.
         //Opens the word document and fetch each page and converts to image
        foreach (Microsoft.Office.Interop.Word.Window window in doc1.Windows)
        {
            foreach (Microsoft.Office.Interop.Word.Pane pane in window.Panes)
            {
                using (var zip = new ZipFile())
                {
                    var pngTarget = "";
                    for (var i = 1; i <= pane.Pages.Count; i++)
                    {
                        var page = pane.Pages[i];
                        var bits = page.EnhMetaFileBits;
                        var target = Path.Combine(startupPath.Split('.')[0], string.Format("{1}_page_{0}", i, startupPath.Split('.')[0]));

                        try
                        {
                            using (var ms = new MemoryStream((byte[])(bits)))
                            {
                                var image = System.Drawing.Image.FromStream(ms);
                                pngTarget = Path.ChangeExtension(target, "png");
                                image.Save(pngTarget, ImageFormat.Png);
                                zip.AddEntry(pngTarget, "Img");
                            }
                        }
                        catch (System.Exception ex)
                        { }
                    }

                    // CREATE A FILE USING A STRING.
                    // THE FILE WILL BE STORED INSIDE THE ZIP FILE.

                    // ZIP THE FOLDER WITH THE FILES IN IT.
                    //zip.AddFiles(Directory.GetFiles(@"c:\\users\\chaitanya_t\\Downloads\\"), "Images");

                    zip.Save(@"c:\\users\\chaitanya_t\\Downloads\\encoded.zip");  // SAVE THE ZIP FILE.
                }

            }
        }

A: Try setting the stream position at the begin of the stream before processing:
using (var ms = new MemoryStream((byte[])(bits))){
 ms.Position = 0; // Set stream position at the begin of the stream
 var image = System.Drawing.Image.FromStream(ms);
 pngTarget = Path.ChangeExtension(target, "png");
 image.Save(pngTarget, ImageFormat.Png);
 zip.AddEntry(pngTarget, ms.ToArray());
}


text:
Q: Chapter formatting I use report document class and the thing is that I would like to remove Chapter x phrase, add chapter number before chapter title and remove blank place between chapter name and top of page. For example normally it is like:
top of page
blank place
blank place
Chapter 1
Title of chapter
content

It would be better to be like this:
top of page
1. Title of chapter
content

A: You can use the titlesec package; a little example:
\documentclass{report}
\usepackage{titlesec}

\titleformat{\chapter}[block]
  {\normalfont\huge\bfseries}{\thechapter.}{1em}{\Huge}
\titlespacing*{\chapter}{0pt}{-19pt}{0pt}

\begin{document}

\chapter{Test chapter}

\end{document}

A: The macro that generates the heading of the chapter (and what it looks like eventually) in the default book and report document classes is \@makechapterhead (I've added some comments/descriptors):
\def\@makechapterhead#1{%
  \vspace*{50\p@}% <----------------- Space from top of page to Chapter #
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \huge\bfseries \@chapapp\space \thechapter% <-- Chapter #
        \par\nobreak
        \vskip 20\p@% <-------------- Space between Chapter # and title
    \fi
    \interlinepenalty\@M
    \Huge \bfseries #1\par\nobreak% <------------------ Chapter title
    \vskip 40\p@% <------------------ Space between chapter title and first paragraph
  }}

You can update these to your liking to modify the display. For example:

\documentclass{report}
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\makeatletter
\def\@makechapterhead#1{%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
        \huge\bfseries \thechapter.\ % <-- Chapter # (without "Chapter")
    \fi
    \interlinepenalty\@M
    #1\par\nobreak% <------------------ Chapter title
    \vskip 40\p@% <------------------ Space between chapter title and first paragraph
  }}
\makeatother
\begin{document}
\chapter{A chapter}\lipsum[1]
\end{document}

In the above example, the text block boundary was emphasized using showframe.


text:
Q: Subwoofer doesn't work on Dell Inspiron 17R after upgrade to 13.10 After upgrading from 13.04 to 13.10 Dell's Inspirion 17R subwoofer stoped working.
In Ubuntu 13.04 was workaround by adding in the file /etc/modprobe.d/alsa-base.conf next line:
options snd-hda-intel model=ref

This issue was discussed here: How to activate subwoofer in Inspiron 17r?
After update previous workarounds don't help and I get no sound from any speaker in this case.
Is there some other fix for the latest version?

A: I have a Dell 17R as well and had to use hdajackretask to get the subwoofer to work again.

*

*Install hdajackretask by installing alsa-tools and alsa-tools-gui.

*Open hdajackretask.

*Select "Show unconnected pins".

*Find pin 0x10 and choose "Internal Speaker (LFE)".

*Click "Install Boot Override".

*Restart and you should be good to go.

A: In HDAjackretask , ALong with overriding 0x10 pin as 'Internal Speaker (LFE)'.
Also override all connected pins leaving their value as is , that is , the default, in order to enable sound in all speakers . Then select install boot override and restart.
If the sound is not auto muted while connecting Headphones , disable Loopback mixing in alsa-mixer either by opening alsamixer and disabling Loopback Mixing or amixer set 'Loopback Mixing' 'Disabled' in terminal.
Hope it helps. :)


text:
Q: Search results is null when ViewsLifeTime field is included and Queried via Rest api I'm trying to do a search with the REST API sorting by ViewsLifeTime but the result search contains documents with ViewsLifeTime value is null, how can I avoid that?

A: First enable Search and Query property for "ViewsLifeTime" managed property in search service and perform full crawl.
Use Search Query API for not returning the items for which "ViewsLifeTime" count is null
https://domain.com/_api/search/query?querytext='NOT(viewslifetime:0)'

Reference Links :-
[Filter for Empty Values in Search][1]


text:
Q: Why is my GzipOutputStream starting with 10 bytes and never changing? I'm trying to write some bytes to a Gzip-compressed and ChaCha20-encrypted output stream to recreate an HmacBlock of a KDBX4 file. Below is how I declare and initialize the streams:
//needed for determining # of bytes written and resetting to 0 bytes when a certain amount are written
private ByteArrayOutputStream blockCipherTextOutputStream = new ByteArrayOutputStream();

//wraps blockCipherTextOutputStream
//bytes written here are ChaCha20 encrypted
private OutputStream encryptedOutputStream;

//wraps encryptedOutputStream
//bytes written here are in little-endian order
private LittleEndianDataOutputStream ledos;

//creating a CipherOutputStream initialized with ChaCha20 encryption
//sets blockCipherTextOutputStream as the underlying OutputStream to be written to
encryptedOutputStream = kdbxHeader.createEncryptedStream(credentials.getKey(), blockCipherTextOutputStream);

//the OutputStream that writes directly to the file
//bytes eventually get written here in other methods
private OutputStream outputStream;

if(kdbxHeader.getCompressionFlags().equals(KdbxHeader.CompressionFlags.GZIP)) {
    /*
     * this seems to be adding 10 bytes to the stream to start
     * writing to the stream seemingly does nothing afterwards
     */
     encryptedOutputStream = new GZIPOutputStream(encryptedOutputStream);
}

ledos = new LittleEndianDataOutputStream(encryptedOutputStream);

When creating the encrypted output stream, a method is called in the KdbxHeader class which in turn calls to a method in another class called ChaCha. Below is the method in ChaCha which actually creates (and returns) an encrypted output stream:
@Override
    public OutputStream getEncryptedOutputStream(OutputStream decryptedOutputStream, byte[] key, byte[] iv) {
        final ParametersWithIV keyAndIV = new ParametersWithIV(new KeyParameter(key), iv);
        StreamCipher cipher = new ChaCha7539Engine();
        cipher.init(true, keyAndIV);
        return new CipherOutputStream(decryptedOutputStream, cipher);
    }

Hopefully that's enough code to go on, I can add more if necessary but this is part of a larger API so there is a lot going on. encryptedOutputStream only starts (and doesn't expand from) 10 bytes when I try to compress it; otherwise, it starts empty (as it should) and I can write to it.
Even after initializing blockCipherTextOutputStream with a buffer size of 80000, the write attempts still don't seem to do anything as only the 10 bytes in encryptedOutputStream to start are visible in a hex editor. Why is this happening and what am I doing wrong here?


text:
Q: Tagging text in jquery select2 <select multiple id="e1" style="width:300px">
        <option value="AL">Alabama</option>
        <option value="Am">Amalapuram</option>
        <option value="An">Anakapalli</option>
        <option value="Ak">Akkayapalem</option>
        <option value="WY">Wyoming</option>
    </select>

$("#e1").select2({'placeholder': ' ','allowClear': true});

it is working fine for matched text. But i want to tag text(which doesnot match any option).
Kindly help.
please find the demo code in following link.
http://jsfiddle.net/marcusasplund/jEADR/2/

A: You have the tags option, but it can't be used with select element

$("#e1").select2({
  tags: [{
    "id": "AL",
    "text": "Alabama"
  }, {
    "id": "Am",
    "text": "Amalapuram"
  }, {
    "id": "An",
    "text": "Anakapalli"
  }, {
    "id": "Ak",
    "text": "Akkayapalem"
  }, {
    "id": "WY",
    "text": "Wyoming"
  }]
});
<script type="text/javascript" src="//code.jquery.com/jquery-1.8.3.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/select2/3.2/select2.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.2/select2.css"/>

<input id="e1" style="width:300px" />

A: There is an option called tags in select2 which allows you to unmatched text to tags but there are some problems here.

*

*It will not allow you to set tags option if you are binding select2  plugin on select. So for this you need to bind select2 on input.

SOURCE QUESTION

*

*Select2 Version 4.0 allows you to add tags option to select control too.

So the solution is either you need to upgrade to the latest plugin or
  you need to bind select2 on input control.


text:
Q: Typescript Generic Methods I have a method where i want to pass in a generic object array. I want to also pass in the objects properties to look for.
As the property names can changed i want to switch description and value with what i ever i pass in.
How do i do this, how do i pass in the property and pull out its value from the object array?
By executing the following i know if the properties exist:
console.log(obj[key].hasOwnProperty(strDisplay))
console.log(obj[key].hasOwnProperty(strValue))

public Test<T>(obj: T[], strDisplay: string, strValue: string) {

    const pickList: PickListOption[] = [];

    Object.keys(obj).forEach(key => {

      const option: IPickListOption = {
        display:obj[key].description  ,
        value: obj[key].value
      };

      pickList.push(option);

    })

    return pickList;
  }

I want to be able to return a new list 'pickList' with key values pairs of display and value.

A: Your use of Object.keys for an array seems a bit off. For transforming an array to another array map is a much better choice.
With regard to picking the two keys you will need strDisplay and strValue to be value keyof T in order to use indexing into the object:
interface PickListOption { value: unknown, display: unknown }
function Test<T>(arr: T[], strDisplay: keyof T, strValue: keyof T) {

  return arr.map((o): PickListOption => ({
    display: o[strDisplay],
    value: o[strValue]
  }))
}

You could also restrict the keys to only a specific type of value using a special mapped and conditional type:
type KeysOfValueType<T, TValue> = {
  [P in keyof T] : T[P] extends TValue ? P: never
}[keyof T]

interface PickListOption { value: number, display: string }
function Test<T>(arr: T[], strDisplay: KeysOfValueType<T, string>, strValue: KeysOfValueType<T, number>) {

  return arr.map((o): PickListOption => ({
    display: o[strDisplay] as unknown as string,
    value: o[strValue] as unknown as number
  }));
}


text:
Q: Flink Custom serialization with registerTypeWithKryoSerializer I'd like to advice a quick possible improvement you could do on the DOC online wrt Serialization.
As matter of fact you did an amazing job both on the implementation and on the documentation. The way flink automatically understands how to best serialize objects is very smart and powerful.
While developing a real-time analytics project that is going to leverage Flink I encountered an issue that is more related to missing doc than to flink.
I'd like to suggest here to amend, as it could spare several hours of despare of other people in the future :)
I had a couple classes needed custom serializers. I created Kryo serializers and also plugged those with registerTypeWithKryoSerializer.
What was not clear in the current doc is that since some of those are POJO, Flink prefers that over GenericType that then uses my kryo serializers.
Once I understood, after several hours of deep debugging, I just made sure those were not POJO any more, then all of a sudden my serializers were used.
So on one side you could think about always preferring custom serializers over POJO. But in the very short term I'd just suggest to amend the doc.
Let me know what you think and congrats for this amazing piece of work.
For previous projects we did use storm or spark streaming, but Flink is miles ahead for real-time streaming analytics.
Thanks and keep up the good work!

A: So the current quick workaround is to make sure your objects are not POJO.
In other case they are not serialized via GenericType that uses Kryo and sees your custom serializers.
Very useful to debug when you have this kind of issues is the:
env.getConfig().disableGenericTypes();
That allows to stop task startup with exception allowing you to check what kind of serializers and HintTypes were used.


text:
Q: Cant't reuse the stacklayout in Generic List in Xamarin.Forms I am creating set of stacklayout with different views and adding it to the List< StackLayout > in a singleton class.
When I create a new page and use the list of stacklayout it works as expected. But when I use the same list in second page it throws a null pointer exception and unable to add list of stacklayout in the second page.
Singleton Class:
  public class SessionData
  {

    private static SessionData _instance;
    public static SessionData Instance
    {
        get{
            if (_instance == null)
                _instance = new SessionData ();

            return _instance;
        }
    }
   public List<StackLayout> Views { get; set; } //List of stacklayout views
  }

Adding Views in ContentPage:
  StackLayout Scrollcontentview = new StackLayout ();
  var temp = SessionData.Instance.Views ;
  foreach (var content in temp)
  {
            if(content != null)
            {
                Scrollcontentview.Children.Add(content );
            }
  }

If I use code Adding Views in ContentPage (which is given above) in Page1 it works, and when I navigate to Page2 and use the same code it fails.
I don't know where I'm going wrong. If anyone knows the solution for this, sharing it will be really helpful.
Thanks in Advance

A: Short answer: you can't reuse a visual element multiple times in the view hierarchy.
Longer answer: avoid using singletons. if you really want to reuse a StackLayout, you have to make sure you remove it from its parent first.


text:
Q: Protractor use sendKeys() to upload a file in a  As you can see in the title, I am trying to upload a file using protractor.
In my project, I have a webpage where I can drag & drop a file, using resumable.js assigned to a div representing the drop area.
The fact is, when doing e2e testing, I obviously can't drag & drop a file, so I chose to upload it using sendKeys() with the absolute path of my file path.resolve('./tests', 'test.csv').
Until here, everything works (path is good and I can find my element with element(by.id(...)) but when I use sendKeys() it throws an error saying "unknown error: cannot focus element".
I tried to upload on an <input type="file"></input>, it works, but since it's on what I use I can't upload this on my original div.
I think I have to specify that this is a file, I saw the setFileDetector(detector) function but I am not sure this is the right way to proceed, and it doesn't seem to work with it anyway.
Here is the HTML drag & drop :

Drag & Drop your file below

And here is the test that works on an  but not on my div :
it('Should begin the import wizard by dropping a file', function(done) {

    // Begin the wizard
    var nextButton = element(by.id('next'));
    nextButton.click();

    // Upload a file
    var uploadArea = element(by.id('import-drop-area'));
    var file = path.resolve('./tests/import', 'test.csv');
    uploadArea.sendKeys(file);
    setTimeout(done, 1000);
});

I hope someone could help me, thank you by advance !
Best regards.


text:
Q: Call to undefined method Laravel\Lumen\Application::configurationIsCached() I Just install lumen-passport using

composer require dusterio/lumen-passport

then after just running php artisan
I got this In PassportServiceProvider.php line 81:
Call to undefined method Laravel\Lumen\Application::configurationIsCached()

have you encounter the same?
What did you do to solve it?

A: The problem is related to this Passport 7.3.2 issue.
The solution is to downgrade to laravel/passport to version 7.3.1

A: Not a good idea but i think the issue is related to new release so for the main time for me to be able to execute php artisan command I just comment this lines
if (! $this->app->configurationIsCached()) {
    $this->mergeConfigFrom(__DIR__.'/../config/passport.php', 'passport');
}

then good to go.. after that uncomment again

A: Another way to solve this is by using a laravel/lumen version above 5.8.11. Where the configurationIsCached method has been added.


text:
Q: SSRS: Custom bar width between multi-level categories I have a bar chart with multiple category groups and I need to increase the spacing between the first level category group, that is, where the blue arrow points to.
I want to change this:

Into this:

Thanks in advance.

A: As far as I know, there is no way to adjust the spacing between self-imposed groups of bars. However, there is a trick to get the desired affect. All you have to do is trick SSRS. In your query, you'll need to create empty bars with no labels. Without knowing how your query is structured, you can do it something like this:
Select 'Group 1' as Group_Label --This would be equivalent to your Recursos or Credito Pessoal
    , 'Bar 1' as Bar_Label --This would be like T-3
    , 10 as Value_1 --This would be like the Red part of the bar
    , 20 as Value_2
    , '1' as Bar_Sort --This will come in handy later

Union All

Select 'Group 2' as Group_Label --This would be equivalent to your Recursos or Credito Pessoal
    , 'Bar 1' as Bar_Label --This would be like T-3
    , 15 as Value_1 --This would be like the Red part of the bar
    , 30 as Value_2
    , '2' as Bar_Sort --This will come in handy later

Union All

Select '' as Group_Label
    , '' as Bar_Label
    , 0 as Value_1
    , 0 as Value_2
    , 1.5 as Bar_Sort

Order by Bar_Sort

What you would get if you set this up is the Group 1 Bar 1 followed by an empty bar (with no labels) followed by Group 2 Bar 1. This puts what the user will see as a definitive space between the groups of bars, but you know is really just an empty set of values. I've used this successfully with Bar charts multiple times.
If this isn't making sense to you, create a SQLfiddle example and I can help you tweak your code to make this work.


text:
Q: Next step to Mobile Application developer I want to become an Mobile Application developer and i had just finished a beginner course on Android dev using Kotlin.Can any one suggest me what should be my next step towards my goal.What topic should i learn next?
Should it be Flutter,Jetpack,Firebase,Retrofit,React Nativ etc.
I need mentorship!
Roadmap to Mobile Application Developer

A: You should learn these:

*

*DataBinding

*Coroutine

*LiveData and Flow

or these:

*

*Navigation

*Room

I think it's important to you .


text:
Q: Solve $A B A^T= C$ subject to $Ax=y$. I am having trouble solving the following problem.
Find $A$ such that $ABA^T=C$ and $Ax=y$.
Here, $B$ and $C$ are known positive definite matrices, and $x$ and $y$ are known vectors. I'm happy to do any necessary leg work if someone can point me to a good resource, but I am having trouble turning anything up on my own.

A: Since you write $A^T$, I suppose your matrices are real.
The equation $ABA^T=C$ means that $C^{-1/2}AB^{1/2}$ is real orthogonal. Hence the general solution is given by $A=C^{1/2}QB^{-1/2}$, where $Q$ is an arbitrary real orthogonal matrix.
If you want $Ax=y$, you need to solve $Q(B^{-1/2}x)=C^{-1/2}y$ for a real orthogonal $Q$. Clearly this is solvable if and only if $\|B^{-1/2}x\|_2=\|C^{-1/2}y\|_2$. When it is indeed solvable, you may pick any real orthogonal matrix that maps $B^{-1/2}x$ to $C^{-1/2}y$. For instance, when $B^{-1/2}x=C^{-1/2}y$, simply pick $Q=I$; otherwise, you may pick the Householder reflection matrix $Q=I-2ww^T$ where
$$
w=\frac{B^{-1/2}x-C^{-1/2}y}{\|B^{-1/2}x-C^{-1/2}y\|}.
$$


text:
Q: How to tell Firefox that a file will never change? Is it possible to specify some files in Firefox to be remembered forever?
For example, a file like http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js will never change, for sure. But Firefox will lose a few milliseconds every time to make a request, then to receive a 304 response, when there is really no need to do it.

A: According to the Cacheability website report for that URL, the web server is sending good HTTP response headers:
Expires: Sat, 23 Jul 2011 03:04:49 GMT
Cache-Control: public, max-age=31536000

So your Firefox should not be checking it with every request.

A: For those who are searching to avoid refreshing files when debugging CSS on their own website, a possible solution would be to declare files in JavaScript during debug.
For example, instead of putting an image like , put just , then through JavaScript change the src property of the image.
Of course, it does not answer my question, since my question is not just about websites I can can change, but about any website.


text:
Q: T-SQL Date difference greater than an integer I have 2 tables: Name, and Birthday. I need to get Names of people who are over 18, but I cannot manually enter a date.
UserID = int
Name = varchar(50)
Birthday = Date

UserID Name  UserID Birthday
----------- -----------------
  1    ABC    1     1997-05-15
  2    DEF    2     1997-09-21
  3    GHI    3     2011-02-01

I currently have this:
select u.UserID
from tbl_Name as u
join tbl_Birthday as b on u.UserId=b.UserID
where Birthday < '1997-08-22';

I tried changing the last line to the following and it still didn't work:
where datediff(year, birthday, convert(date, getdate())) > 18;
where Birthday - convert(date,getdate()) > 18;

Edit: I mixed up startdate and enddate in DATEDIFF, but this gives me problems with people who are 18 (born in 1997).
Edit 2: Made question more clear by specifying that a date cannot be manually entered.
Edit 3: Changed birthday dates.

A:   where DATEADD(YY,18,Birthday) >= getdate()

A: you can use this query if u want to try to retrive that person who are above 18.
     where DATEDIFF(YEAR,birthday,GETDATE())>18

A: Do not do date math on the Birthday column. That requires calculating the expression for every row in the table! Instead, do the math on the other side of the equality or inequality.
If your birth dates are stored with no time portion:
WHERE Birthday <= DateAdd(year, -18, GetDate)

If they are stored with a time portion that can be set to other than midnight, by convention a person is 18 on the date of their birthday, so:
WHERE Birthday < DateAdd(year, -18, Convert(date, GetDate() + 1))

Note: subtracting datetime values in SQL Server yields the number of days apart, explaining why one of your expressions was not working correctly (you treated it like years).

A: if( year((Cast (getdate() as date))-year(cast (BirthDay as date)))>18)
begin
select  birthday
end


text:
Q: Replace data between quotes in a file I want to extract data between " " from a data file having delimiter as comma.
Sample input file:
,7/30/2019,7/31/2019,Wed,8/1/2019,FH/FN 30yr & 20yr TBA & Spec ,"10,000",8/13/2019,

Expected o/p:
,7/30/2019,7/31/2019,Wed,8/1/2019,FH/FN 30yr & 20yr TBA & Spec ,"10000",8/13/2019,

A: Assuming this is properly formatted CSV (the example data looks ok in this respect), we can use csvformat from csvkit to temporarily change the field delimiters to some other character not otherwise present in the data, such as @, delete all commas, and change the field delimiter back to the default again:
$ csvformat -D '@' file.csv | tr -d , | csvformat -d '@'
,7/30/2019,7/31/2019,Wed,8/1/2019,FH/FN 30yr & 20yr TBA & Spec ,10000,8/13/2019,

The output does not have quotes around the field that we modified, but that's because it no longer needs it.
Obviously, "deleting all commas" may delete commas that we don't actually want to delete, so we can be a bit more selective and only delete the commas in the 7th field:
$ csvformat -D '@' file.csv | awk -F '@' 'BEGIN { OFS=FS } { gsub(",", "", $7); print }' | csvformat -d '@'
,7/30/2019,7/31/2019,Wed,8/1/2019,FH/FN 30yr & 20yr TBA & Spec ,10000,8/13/2019,

A: Try  for example awk:
cat oldfile | awk '{ print gensub ("(,\"[0-9]+),([0-9][0-9][0-9]),?([0-9][0-9][0-9])?,?([0-9][0-9][0-9]),?","\\1\\2\\3\\4","g");}' > newfile

This works for large numbers, too.
Explanation:
awk is a programmable filter. The command given here in the commandline (between the outer single quotes "'") will be executed for every line of input from your file.
The awk program looks like this (different formatting):
{
    print gensub ("(,\"[0-9]+),([0-9][0-9][0-9]),?([0-9][0-9][0-9])?,?([0-9][0-9][0-9]),?",
                  "\\1\\2\\3\\4",
                  "g");
}

The awk-builtin command gensub replaces things given in the first argument, with the replacement given in the second.  If the third argument is a string starting with "g" or "G" it will replace all occurrences (tries until no more are found).
What is replaced?  The first argument is a regular expression (q.v.) in double quotes, here are the parts: ,\ then afterwards [0-9]+ which means a digit 0-9 repeated one or more times (postfix operator +) then , which is just a character, then [0-9][0-9][0-9] and a comma , followed by a question mark ? (you know what the first part means now but the postfix ? is new - the comma digits can be omitted).  Then more digit groups and commas which may be omitted - this is for larger numbers.
In this explanation I have left out the parentheses ( and ) so far! These mark those things that are matched by the expression but remembered. In the second argument to gensub we reference the first \1 through fourth \4 things that were matched (the numbers) and print them out again here.

A: Another awk solution:
awk -F\" '{
    OFS="\"";
    for ( i = 1; i <= NF; i++ ) {
        if ( i % 2 == 0 ) {
            gsub(/,/, "", $i)
        }
    }
}1' input.csv

This will use the double quote as a field separator and loop through all fields.  If the field number is an even number (which is not fool-proof, but given your example it should mean that the field exists between quotes) it will remove any commas from that field.  The 1 will cause awk to print everything (with the changes made) using the double quote as the output field separator.
In use:
$ cat input.csv
,7/30/2019,7/31/2019,Wed,8/1/2019,FH/FN 30yr & 20yr TBA & Spec ,"10,000",8/13/2019,
,7/30/2019,7/31/2019,"100",FH/FN 30yr & 20yr TBA & Spec ,"10,000,000",8/13/2019,
,7/30/2019,7/31/2019,"Jack, Mary, and Jane",8/1/2019,"123,456,789,012,345,678","10,000",8/13/2019,
$ awk -F\" '{
>     OFS="\"";
>     for ( i = 1; i <= NF; i++ ) {
>         if ( i % 2 == 0 ) {
>             gsub(/,/, "", $i)
>         }
>     }
> }1' input.csv
,7/30/2019,7/31/2019,Wed,8/1/2019,FH/FN 30yr & 20yr TBA & Spec ,"10000",8/13/2019,
,7/30/2019,7/31/2019,"100",FH/FN 30yr & 20yr TBA & Spec ,"10000000",8/13/2019,
,7/30/2019,7/31/2019,"Jack Mary and Jane",8/1/2019,"123456789012345678","10000",8/13/2019,

NOTE: This will remove the commas in fields that are not numbers.  In order to read this file correctly as a csv you will need to do that.  If for some reason you want to retain those commas you can use the below solution.

awk -F\" '{
    OFS="\"";
    for ( i = 1; i <= NF; i++ ) {
        if ( i % 2 == 0 && $i ~ /[0-9]/ ) {
            gsub(/,/, "", $i)
        }
    }
}1' input.csv

A: Try this:
sed 's/\(\".*\),\(.*\"\)/\1\2/' file

A: Your own attempt sed '/\"/,/\"/s/,//' fails because the address range you give only filters for a range of lines, not a range inside a line.
This type of task is nasty in standard sed. If it's just about one comma, then sed -E 's/("[0-9]*),([0-9]*")/\1 \2/ would do the trick, but for multiple comma you'd have to loop, giving ugly results like
sed -Ee :loop -e 's/("[0-9 ]*),([^"]*")/\1 \2/;tloop'

The ("[0-9]*) matches the opening double quote followed by any number of digits and will be referred to as \1 in the replacement, the ([^"]*") matches anything after the comma until the closing ", so \1 \2 is the same, but with the first comma replaced.
Now the t command branches to the loop mark if a replacement was made. This gets repeated until there is no comma left to be replaced.
This even works for cases with more than one number with as many commas as you like: ,7/30/2019,"99,999,999,999,999",0,1 ,"10,000","foo, bar" will get transformed to ,7/30/2019,"99 999 999 999 999" 0 1  "10 000" "foo, bar"


text:
Q: Approximate point spectrum is complement of set of points of regular type I have a question concerning the approximate point spectrum of a closed linear operator. I need to show that the approximate point spectrum is the complement of the set of points of regular type, where
$\sigma_{ap}(T)=\{\lambda \in \mathbb C: \exists (x_n) \subset D(T), \|x_n\|=1, (T−\lambda)x_n \to 0,n \to \infty \}$ and $\Lambda(T)= \{ \lambda \in \mathbb C: \exists C>0 \|(T- \lambda)x\| \geq C \|x\|, x \in D(T) \}$.
I.e. I need to prove that $\sigma_{ap}(T)= \mathbb C \setminus \Lambda(T)$.
I know that one can show it with the closed graph Theorem but I don't know exactly how. Can please someone help me?
Thanks

A: The prrof of $\def\sap{\sigma_{\rm ap}}\sap(T) \subseteq \def\CL{\mathbf C \setminus \Lambda}\CL(T)$ you gave in your comment is correct.
For the other inclusion, suppose $\lambda \in \CL(T)$. Then
$$ \forall C > 0 \;\exists x \in D(T): \def\norm#1{\left\|#1\right\|}\norm{(T-\lambda)x} < C\|x\| $$
Now for every $n \in \def\N{\mathbf N}\N$ choose $x_n' \in D(T)$ such that
$$ \norm{(T-\lambda)x_n'} < \frac 1n \norm{x_n'}$$
Now let $x_n := \frac{x_n'}{\norm{x_n'}}$. Then $\norm{x_n} = 1$ and
$$ \norm{(T- \lambda)x_n} < \frac 1n \to 0 $$
Hence $\lambda \in \sap(T)$.


text:
Q: Cómo arreglo la pantalla Estoy iniciando un proyecto en VisualBasic 6, en el cual necesito que por medio de un botón se añadan más TextBox/CheckBox/ComboBox.
El problema es que al momento de añadirlos, se descompagina la pantalla.
Adjunto las imágenes para una mejor compresión:
Así es el formulario creado (Lo que está dentro del Frame se debe mostrar luego de presionado el botón. (El index en 0 y el visible en false)):

Cuando inicio la aplicación se ve así:

Y cuando presiono el botón sucede esto:

La idea es que se vea como en la primera imagen, en la que muestro el formulario creado.
Este es todo el código que utilizo:
Dim indice As Integer

Private Sub btnAñadir_Click()
indice = indice + 1 ' aumentamos el index

' frmAñadir
Load frmAñadir(indice) ' creamos el control
frmAñadir(indice).Visible = True ' lo hacemos visible
frmAñadir(indice).Top = frmAñadir(indice - 1).Top + frmAñadir(indice).Height ' movemos el control

'cmbAddTipo
Load cmbAddTipo(indice)
cmbAddTipo(indice).Visible = True
cmbAddTipo(indice).Top = cmbAddTipo(indice - 1).Top + cmbAddTipo(indice).Height

'txtAddPrefijo
Load txtAddPrefijo(indice)
txtAddPrefijo(indice).Visible = True
txtAddPrefijo(indice).Top = txtAddPrefijo(indice - 1).Top + txtAddPrefijo(indice).Height

'txtAddNumero
Load txtAddNumero(indice)
txtAddNumero(indice).Visible = True
txtAddNumero(indice).Top = txtAddNumero(indice - 1).Top + txtAddNumero(indice).Height

'checkAddPrincipal
Load checkAddPrincipal(indice)
checkAddPrincipal(indice).Visible = True
checkAddPrincipal(indice).Top = checkAddPrincipal(indice - 1).Top + checkAddPrincipal(indice).Height

'cmbAddVinculo
Load cmbAddVinculo(indice)
cmbAddVinculo(indice).Visible = True
cmbAddVinculo(indice).Top = cmbAddVinculo(indice - 1).Top + cmbAddVinculo(indice).Height

End Sub

A: La solución que encontré fue la siguiente, añadir los elementos dentro de un UserControl y desde ahí cargarlos. Adjunto el código por si alguien lo llega a necesitar:
Dim indice As Integer
Dim indicee As Integer

Private Sub btnAñadir_Click()
indice = indice + 1 'aumentamos el index
indicee = indicee + 0 'lo iniciamos en 0
uc1(indicee).Visible = True

'Label y TextBox de tipo
lblTipo(indicee).Visible = True
cmbAddTipo(indicee).Visible = True

'Label y TextBox de prefijo
lblAddPrefijo(indicee).Visible = True
txtAddPrefijo(indicee).Visible = True

'Label y TextBox de número
lblAddNum(indicee).Visible = True
txtAddNumero(indicee).Visible = True

chkAddPrincipal(indicee).Visible = True

'Label y TextBox de vínculo
lblAddVin(indicee).Visible = True
cmbAddVinculo(indicee).Visible = True

'uc1
Load uc1(indice) ' creamos el control
uc1(indice).Visible = True ' lo hacemos visible
uc1(indice).Top = uc1(indice - 1).Top + uc1(indice - 1).Height + 20

'lblTipo
Load lblTipo(indice)
Set lblTipo(indice).Container = uc1(indice)
lblTipo(indice).Visible = True
lblTipo(indice).Top = lblTipo(indice - 1).Top
'cmbAddTipo
Load cmbAddTipo(indice)
Set cmbAddTipo(indice).Container = uc1(indice)
cmbAddTipo(indice).Visible = True
cmbAddTipo(indice).Top = cmbAddTipo(indice - 1).Top

'lblAddPrefijo
Load lblAddPrefijo(indice)
Set lblAddPrefijo(indice).Container = uc1(indice)
lblAddPrefijo(indice).Visible = True
lblAddPrefijo(indice).Top = lblAddPrefijo(indice - 1).Top
'txtAddPrefijo
Load txtAddPrefijo(indice)
Set txtAddPrefijo(indice).Container = uc1(indice)
txtAddPrefijo(indice).Visible = True
txtAddPrefijo(indice).Top = txtAddPrefijo(indice - 1).Top

'lblAddNum
Load lblAddNum(indice)
Set lblAddNum(indice).Container = uc1(indice)
lblAddNum(indice).Visible = True
lblAddNum(indice).Top = lblAddNum(indice - 1).Top
'txtAddNumero
Load txtAddNumero(indice)
Set txtAddNumero(indice).Container = uc1(indice)
txtAddNumero(indice).Visible = True
txtAddNumero(indice).Top = txtAddNumero(indice - 1).Top

'checkAddPrincipal
Load chkAddPrincipal(indice)
Set chkAddPrincipal(indice).Container = uc1(indice)
chkAddPrincipal(indice).Visible = True
chkAddPrincipal(indice).Top = chkAddPrincipal(indice - 1).Top

'lblAddVin
Load lblAddVin(indice)
Set lblAddVin(indice).Container = uc1(indice)
lblAddVin(indice).Visible = True
lblAddVin(indice).Top = lblAddVin(indice - 1).Top
'cmbAddVinculo
Load cmbAddVinculo(indice)
Set cmbAddVinculo(indice).Container = uc1(indice)
cmbAddVinculo(indice).Visible = True
cmbAddVinculo(indice).Top = cmbAddVinculo(indice - 1).Top

End Sub


text:
Q: How to readline to find a match string and split the result into multiple files This is the scenario, I've a pattern file that I needed to read line by line.
The content of the pattern file somewhat similar to this
chicken
chicken
chicken
chicken
## comment
## comment
fish
fish
chicken
chicken
chicken

The code I've came up so far is like this.
def readlines_write():
    with open(filename) as rl:
        for line in rl:
            if "chicken" in line:
                with open(new_filename, 'a+') as new_rl:
                    new_rl.write(line)

With above code I can find all "chicken" in that pattern file and the result would be write in new_filename. But that is not the objective. Because I've lump sum it all together in one file.
I would like to split the chicken and write it to multiple files.
Eg. In the end result should be, read line by line continuously, if found chicken and stop when the next line is not contain chicken. Break and write it to a file, a.out for example.
And the script continue read line by line and found the next matches after the "comment" and "fish". And write the result to b.out
I've the pseudo in mind but I'm not sure how to translate it to python logic.
Summary, I would like to split the chicken that got separated by the comment and other words than chicken.

A: So, what you're looking for is contiguous groups of chicken lines, and you want to put each group into it a separate file. Fine, batteries are included.
import itertools

def is_chicken(x):
    return 'chicken' in x # Can add more complex logic.

def write_groups(input_sequence):
    count = 1
    grouper = itertools.groupby(input_sequence, is_chicken)
    for found, group in grouper:
        # The value of `found` here is what `is_chicken` returned;
        # we only want groups where it returned true.
        if found:
            with open('file-%d.chicken' % count, 'w') as f:
                f.writelines(group)
            count += 1

Now you can
with open('input_file') as input_file:
    write_groups(input_file)

The same thing can be done in a more functionally-decomposed way, though a bit harder to understand in you're not used to generators:
def get_groups(input_sequence):
    grouper = itertools.groupby(input_sequence, is_chicken)
    # Return a generator producing only the groups we want.
    return (group for (found, group) in grouper if found)

with open('input_file') as input_file:
    for (count, group) in enumerate(get_groups(input_file), start=1):
        with open('file-%d.chicken' % count, 'w') as f:
            f.writelines(group)

A: Just add an else condition and keep changing the name of the file by an integer or timestamp.
def readlines_write():
        i = 0
        new_filename = 'filename{}.out'.format(i)
        with open(filename) as rl:
            for line in rl:
                if "chicken" in line:
                    with open(new_filename, 'a+') as new_rl:
                        new_rl.write(line)
                else:
                    i +=1
                    new_filename = 'filename{}.out'.format(i)


text:
Q: Missing 0 key when change input source from ABC to Hungarian I recently got a new MacBook Pro for work/personal usage, the physical keyboard itself has a default US English qwerty layout. In keyboard settings I added ABC and Hungarian. It works perfectly, except for one little thing when I change to Hungarian input there is no way to write 0.
Is there a key combination, or way to configure it? It's very frustrating whenever I write something in Hungarian and have to change the input source back to ABC just to write 0.

A: Hungary (and the rest of Europe) uses the ISO keyboard, which has one extra key compared to the US Qwerty keyboard.  As a result, some characters may go missing or be misplaced when you try to use European layouts with the US keyboard.
Hungarian Qwerty has the zero at Option `.  Hungarian (which is qwertz) seems to have it at Control Option Zero. (Mac's don't normally use Control for characters like this, so it may not work in all apps.)
You can also create a custom layout, or set up a text shortcut in system preferences > keyboard > text > replace with.
ABC Extended has zero in the normal place and can make all the Hungarian special characters via option dead keys.
https://sites.psu.edu/symbolcodes/mac/codemacext/


text:
Q: Проблема парсинга html на heroku node.js const parseAucInfo = async (url: string): Promise<IAucInfo> => {
  const data = await fetch(url).then((response: any) => response.text());
  console.log(data); }

запускаю этот код на своем пк и мне приходит разметка с нужной информацией, если запускаю его на сервере heroku то приходит разметка с сообщением с ошибкой

DDoS protection by Cloudflare

Ray ID: 618381797960a729

можно как-то обойти эту  проблему? Или только смена хостинга для скрипта?


text:
Q: "a basic education" or "basic education"? This is a question from Common Mistakes at IELTS Advanced: And How to Avoid Them.
In page 9 we have to decide which one is correct:

*

*All children should receive basic education.

*All children should receive a basic education.

But I think both can be correct based on the context. I guess the first one is correct because education is uncountable in this context. I think "basic education" is a general concept that should be provided for all children. But the second one is correct if we meant to tell that all children need to receive at least a kind of basic education from a wide range of options available.
So is the question wrong? Because in the answer keys, it says that only the second one is correct.

A: There is a difference inferred between 'education' with an article, and without.
'Education' is a very broad term - it could refer to basic, primary education for children, secondary or tertiary education for older children and young adults, or really and kind of structured learning on any topic, at any age and at any time in someone's life.
Usually, referring to "an education" means one's childhood education, however extensive. In places where a basic primary and secondary education is mandatory, saying someone has had "an education" may specifically infer that they have had tertiary (degree level) education.
In the context of your example, where you are specifying children and that the education being spoken of is 'basic', the difference between your two examples is less discernable. But it could be taken that "all children should receive basic education" means some specific learning on a specific subject, whereas "all children should receive an education" means a full, rounded education on a range of subjects.


text:
Q: How to prove $\int_e f_k(x)dx=0$ for $k=1,2,\cdots,n$ Let $f_k\in L(E),(k=1,2,\cdots,n)$. If $0<m(E)<+\infty, \  \  \int_E f_k(x)dx=0, k=1,2,\cdots,n.$
Then how to prove for any $\lambda:0<\lambda<1$, there is a subset $e: m(e)=\lambda m(E)$ such that  $\int_e f_k(x)dx=0$ for $k=1,2,\cdots,n$
I have no idea at all.
First, for each $f_k$, can we find a $e_k$ s.t $ m(e_k)=\lambda m(E)$ and $\int_{e_k} f_k(x)dx=0$
Second, does $f_k$ shares a common subset satisfying the above condition?

A: This is a special case of Lyapunov's convexity theorem. The theorem has some pretty short  proofs (see the linked paper and its list of references). Perhaps a direct proof of this result could be a bit shorter, but not much shorter.
To apply Lyapunov's convexity theorem, introduce vector-valued measure
$$\nu(e) = \left( \int_e f_1,\dots, \int_e f_n , \frac{m (e)}{ m(E)} \right)\in \mathbb R^{n+1}$$
By assumption, the range of this measure contains the points $(0,\dots,0,0)$ (take $e=\varnothing$)   and $(0,\dots,0,1)$ (take $e=E$). By convexity, it also contains $(0,\dots,0,\lambda)$.


text:
Q: Passing arrays into a method (java) I am currently writing a code to do a Knight's Tour. I am trying to pass a double array (the board) into a method and I get an error that an  is expected.  I do not know how I am supposed to declare it(array doesn't work), or if that's wrong entirely.
Here is the code I am currently stuck on.
 public void makeBoard(Board,int column, int row){
     for (i=1;i<=column;i++)
     {
         for  (j=1;j<=row;j++)
         {
              Board[i][j] = "x";
         }
     }
     Board[1][1] = "1";
     xpos = 1;
     ypos = 1;
 }

Mainly the declaration. Board is a double array.

A: You need to specify the type of the parameter.
public void makeBoard(String[][] Board, int column, int row){

Notes:

*

*The name of the type is not a double array. The word double is the name of a different type in Java. It means a double precision floating point number. You don't have any doubles anywhere in your code.

*The standard naming convention is to use camel case for parameter names. You should write board instead of Board.

*Arrays are 0-indexed in Java. Your loops should start from 0, not 1.

A: In a java method, parameter is made up with parameter type and name. For int column, int is the type and column is the name. Therefore, board is actually your param name and the type should be String[][].
public void makeBoard(String[][] Board,int column, int row){...}


text:
Q: Laravel sending custom email I don't know if this is possible
I am trying to send custom email all the users from my users table. I am using the mail fascades present in laravel.
There is a blade template like this :
@component('mail::message')
# New Book Lunch

This is the body of the email.

@component('mail::button', ['url' => $url ?? ''])
View Order
@endcomponent

Thanks,

{{ config('app.name') }}
@endcomponent

My method to send mail looks like this
class NewsLetterController extends Controller
{

    public function newsletter(Request $request)
    {
        $subject = $request->name;
        $message = $request->message;

        $email = User::pluck('email');
        Mail::to($email)->(Add my custom $message and $subject)->send(new NewsLetter());
    }

}

Here I want to add a custom message and subject my filling a form. How can that be done so I can add custom message?

A: Looking at the docs: https://laravel.com/docs/8.x/mail#sending-mail
You can pass the variables to the Mailable via the constructor.
Mail::to($request->user())->send(new NewsLetter($subject, $message));

And in the Mailable:
class NewsLetter extends Mailable
{
    // ...

    public function __construct(string $subject, string $message)
    {
       $this->subject = $subject;
       $this->message = $message;
    }
}

If you want to pass the message to the view, your build could look like:
class NewsLetter extends Mailable
{
    // ...

    public function build()
    {
        return $this->view('emails.newsletter')
            ->with([
                'message' => $this->message,
            ]);
    }
}

And finally, you add the message in blade:

{{ $message }}


text:
Q: Abrir e fechar o código ou usar variável? Dois scripts com mesmos resultado:
Exemplo 1:
<?php

...códigos PHP acima...

$tabela = '
';
$tabela .= '
';
$tabela .= ' Valor1 	';
$tabela .= ' Valor2 	';
$tabela .= ' Valor3 	';
$tabela .= '
';
$tabela .= '
';
$tabela .= '' . $valor1 . '	';
$tabela .= '' . $valor2 . '	';
$tabela .= '' . $valor3 . '	';
$tabela .= '
';
$tabela .= '
';

echo $tabela;

...códigos PHP abaixo...

?>

Exemplo 2:
<?php

...códigos PHP acima...
?>

     Valor1
     Valor2
     Valor3

     <?= $valor1 ?>
     <?= $valor2 ?>
     <?= $valor3 ?>

<?
...códigos PHP abaixo...

?>

Gostaria de saber se existem, e quais seriam, as vantagens e desvantagens entre os exemplos acima.
Por exemplo: penso que tratar tudo em uma variável para depois imprimir, iria ocupar mais memória e processamento, pois há a concatenação e espaço em memória (principalmente se considerarmos em grandes laços).

Ponto que me levantou a questão:
Erro por excesso de cálculos

Fatal error: Allowed memory size of 134217728 bytes exhausted
  (tried to allocate 36 bytes)

Cruzamento de valores em array

A: O primeiro envolve mais processamento, é um código PHP sendo interpretado e processado para gerar um texto que será enviado ao servidor (possivelmente). O segundo já é considerado o texto a ser enviado apenas invocando o processador do PHP em algumas partes, e tem um custo muito menor (para processar o texto).
Então o primeiro tem o custo do buffer do texto do HTML como um todo e o buffer de manipulação da string.
De forma geral o segundo é mais legível. O segundo costuma ser usado mais como um template da página a ser renderizada onde só algumas lacunas são preenchidas por processamento, que dá muito mais trabalho para executar já que tudo precisa ser garantidamente correto, ao contrário do HTML que pode ser mandado até todo errado que é responsabilidade do cliente, possivelmente um navegador web, determinar se está certo ou não.
O primeiro não é comum e só deveria ser usado em casos que seja algo muito complexo a ser processado. Geralmente seria melhor fazer o processamento e depois gerar o texto do HTML.
Ele tende a usar mais memória também porque ocupará no PHP para processar como dados e depois criar o texto final. Mas isso é detalhe de implementação.
Mesmo o PHP tendo strings mutáveis ainda assim tende a alocar mais fazendo várias concatenações assim. Não é tão crítico quanto linguagens que trabalham com strings imutáveis.
Neste exemplo específico eu optaria pelo segundo (teve época que eu fazia diferente, mas eu estava errado, fazia por gosto e não por necessidade). Há casos que eu poderia optar pelo primeiro. Não que vá fazer uma enorme diferença. Sempre falo que se quer eficiência opte por outra linguagem, PHP te dá facilidade (ou dava), não eficiência.
Só note que estou estimando um pouco as coisas. Consigo ver um cenário que o primeiro possa ser mais eficiente. Não deveria, mas dependendo da arquitetura do PHP é possível, eu só não contaria com isso. De qualquer forma teria que avaliar, mas novamente, se for necessário, a ferramenta é errada.
Esse erro de memória deve ser por outra coisa. Isso por si só não causa este tipo de erro, mas várias outras coisas erradas juntas podem causar o erro em qualquer mínima alocação. É só uma coincidência ocorrer aí, para este caso não faz nem cosquinha.

A: Não existe certo e errado aqui, existem necessidades, no primeiro você salvou tudo em um string e depois jogou para o echo, isso é util se for tratar o valor da variável incluindo o HTML
Agora se a intenção é não fazer nada com valor da variavel e só jogar para o echo o segundo exemplo é bem mais fácil de dar manutenção e entender o seu proprio HTML, mesmo que fosse um loop de while que traria resultados e um array ou banco de dados.
Então para concluir, você pode usar qualquer um dos dois, mas o primeiro será útil mesmo se for manipular a $tabela, com DOMDocument, ou com funções de string como, substr, str_replace, preg_replace, etc.
Agora sobre a memoria, a probabilidade disto ocorrer é raríssima, se ocorreu é porque fez algo muito absurdo, grave mesmo e poderia ocorrer até sem a variável, por exemplo se usar o buffer, como ob_start (ou até mesmo sem buffer), devo dizer que se ocorreu é porque fez algo muito de errado, supondo que seu php.ini limite para memory_limit=2MB, a string teria que ser gigante mesmo para conseguir alcançar isto.
Outras situações que podem ocasionar isto é a manipulação de imagens com GD, que é complexa e realmente consome muita memoria, o uso de frameworks pesados (não vou citar nomes, no chat quem tiver interesse sobre o assunto dos frameworks podem me chamar) ou um loop que fica criando variaveis de maneira sem controle algum.
Para irmos aos finalmentes, o problema com memória geralmente esta na forma de como fez e não necessariamente em setar variavel ou exibir direto.


text:
Q: What is the zero signal? I was looking into a nagios plugin and I found this code:
killall -0 $1

I tried this and it returned 0 for a running process, but it did not kill the process.
Please explain the meaning of this 0 value and why it did not kill the process.

A: From man 2 kill:

If sig is 0, then no signal is sent, but error checking is still
  performed; this can be used to check for the existence of a process ID
  or process group ID.

kill(2) returns 0 on success, and -1 otherwise. So, with the zero signal, assuming that the process has enough permission to send a signal to the target process, 0 is returned if the process or process group ID exists, otherwise, it returns -1 (and sets errno to ESRCH). Note that the man page simply states that error checking is still performed, so it will return -1 and set errno to EPERM if the target process exists but the sending process does not have enough permissions to send it a signal.
The killall(1) and kill(1) command utilities behave similarly because they use kill(2) under the hood.
Note that program code should not rely on this to make decisions based on the existence of a process: there is always a window of time between checking that the process exists and using that information where the process could terminate (and possibly a new, unrelated process starts in that window of time and the same PID is recycled and used).

A: signal -0just checks to see if the specified process is running.  It doesn't kill it.  If you want to kill the process use -9 which is a termination signal.
While -0 isn't listed here, this link explains what some of the other signals are:
http://man7.org/linux/man-pages/man7/signal.7.html


text:
Q: How to read the contents from two files one by one using foreach loop? My TCL Script:
set a [open fruits.txt r]
set b [read $a]
foreach c $b {
    puts  "Fruits : $c"

    set website [open website_name1.txt r]
    set each_one [read $website]
    foreach each $each_one {
        puts  "website name : $c"
    }
}

fruits.txt contents:
apple orange mango litchi banana

website_name1.txt contents:
google.com yahoo.com metlife.com cisco.com span.com

Now if I run the above script, I am getting output as shown below:
D:\Desktop>tclsh statck_qns.tcl
Fruits : apple
website name : apple
website name : apple
website name : apple
website name : apple
website name : apple
Fruits : orange
website name : orange
website name : orange
website name : orange
website name : orange
website name : orange
Fruits : mango
website name : mango
website name : mango
website name : mango
website name : mango
website name : mango
Fruits : litchi
website name : litchi
website name : litchi
website name : litchi
website name : litchi
website name : litchi
Fruits : banana
website name : banana
website name : banana
website name : banana
website name : banana
website name : banana

D:\Desktop>

But I trying to get output as shown below:
Fruits : apple
website name : google.com
Fruits : orange
website name : yahoo.com
Fruits : mango
website name : metlife.com
Fruits : litchi
website name : cisco.com
Fruits : banana
website name : span.com

A: There are a number of issues with your code. You are using $c in the second loop while it should be $each. Also, if you want to put the website name only once, you need to get a loop that loops through both lists at the same time.
set a [open fruits.txt r]
set b [read $a]

set website [open website_name1.txt r]
set each_one [read $website]

foreach c $b each $each_one {
  puts  "Fruits : $c"
  puts  "website name : $each"
}

close $a
close $website

codepad demo
You can loop through two lists (or more) with foreach with the above format, i.e.:
foreach var1 list1 var2 list2 ... varn listn {
  # code here
}

If the number of elements are not the same in the lists, then you will start get empty strings in the variable name of the list with the shorter number of elements.

A: Can also read line-by-line with a while loop
set f_fruit [open fruits.txt r]
set f_web [open website_name1.txt r]
while {[gets $f_fruit fruit] != -1 && [gets $f_web website] != -1} {
    puts "Fruits: $fruit"
    puts "website name: $website"
}
close $f_fruit
close $f_web


text:
Q: Effects of replacing stripped libraries with unstripped libraries in /usr/lib and /lib path in linux for running valgrind I have below libs in /usr/lib path(stripped) which needs to be replaced with unstripped types.
/usr/lib/libdbus-1.so.3.14.7
/usr/lib/liblog4c.so.3.3.0
/usr/lib/libnetsnmp.so.40.0.0
/lib/ld-2.24.so

As I need to run valgrind for one of my process (say : snmp agent process), having libs with debug symbols will help in identifying file location, function name info.
From /proc/$pid/maps file found that in addition to snmp agent process, there are some other processes also using these listed libraries. So what will happen to these processes when I replace the existing stripped libs with unstripped libraries in the same path.
or
How to run valgrind without disturbing other processes which are using the libs of interest.

A: Exactly what operating system are you using?
Normally the way that you should do this is to install the debuginfo packages. Most Linux distributions split out the debuginfo, so that you can install stripped binaries but also optionally install the separate debuginfo. Tools like gdb and Valgrind know where to look for the debuginfo files and will read them when needed.
If you do that then you should not need to install un-stripped binaries.


text:
Q: Using import java.util.Random; nextInt and user input I am fairly new to java so this will probably seem like a basic question. I am trying to use the random java.util and nextInt to create a random number in a range specified by user input and then cast it as a character, to then be stored in an array;
gridCells[x][y] = (char)(r.nextInt(numberOfRegions) + 'a');

However, because I want nextInt to use user Input, and although im controlling the range of values, im guessing the error is caused because nextInt thinks numberOfRegions could be 0?
// Map Class
import java.util.Random;

public class map
{
    // number of grid regions
    private int numberOfRegions;
    private boolean correctRegions = false

    // grid constants
    private int xCord = 13; // 13 so the -1 makes 12 for a 12x12 grid
    private int yCord = 13;

    // initiate grid
    private int[][] gridCells = new int[xCord][yCord];

    Random r = new Random();

    map() { }

    // ask for number of regions
    public void regions()
    {
        keyboard qwerty = new keyboard(); // keyboard class
        while(correctRegions = false)
        {
            System.out.print("Please enter the number of regions: ");
            numberOfRegions = qwerty.readInt();
            if(numberOfRegions < 2) // nothing less then 2 accepted
            {
                correctRegions = false;
            }
            else if(numberOfRegions > 4) // nothing greater then 4 accepted
            {
                correctRegions = false;
            }
            else
            {
                correctRegions = true;
            }
        }
    }

    // fills the grid with regions
    public void populateGrid()
    {
        for(int x =0; x<gridCells[x].length-1; x++) // -1 to avoid outofboundsexception error
        {
            for(int y =0; y<gridCells[y].length-1; y++)
            {
                gridCells[x][y] = (char)(r.nextInt(numberOfRegions) + 'a');
            }
        }
    }

    public void showGrid()
    {
        for(int x=0;x<gridCells[x].length-1; x++)
        {
            for(int y=0; y<gridCells[x].length-1; y++)
            {
                System.out.print(gridCells[x][y] + " ");
            }
            System.out.println();
        }
    }
}

A: public void populateGrid()
{
    for(int x =0; x<gridCells[x].length-1; x++) // -1 to avoid outofboundsexception error
    {
        for(int y =0; y<gridCells[y].length-1; y++)
        {
            gridCells[x][y] = (char)(r.nextInt(numberOfRegions) + 'a');
        }
    }
}

This is bogus, either you do index < array.length or index <= array.length-1.
index < array.length-1 is most likely not what you intended.
Also, if you get compilation errors, it is maybe because you did not initialize numberOfRegions. Normally, thats not an error but a warning, but maybe your compiler is set to issue an error in this case. Try
private int numberOfRegions = 0;

A: you have to know how the java.util.random works.
Random r = new Random();

int number = r.nextInt(numberOfRegions);

this will produce an integer from zero (0) to ur numberRegions.
to exclude zero from ur possible range of random number generated, do something like this
int number = 1 + r.nextInt(numberOfRegions);

with this, the minimum number that can be generated is 1
int number = 2 + r.nextInt(numberOfRegions);

with this, the minimum number that can be generated is 2
...and so on

A: Well I have found something:
Your while condition is an assignment:
while(correctRegions = false)

You should write:
while(correctRegions == false) // == is a boolean operator, = is an assignment


text:
Q: Двумерные массивы.Сумма элементов j-строки не превышала 3 В меню ресторана M блюд. В течение дня ресторан обслужил N посетителей. При этом посетители заказывали только по три блюда. Определить наиболее и наименее популярные блюда.
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

int main()
{
    srand(time(0));
    int i, j, s;
    const int m = 5, n = 5;
    int mass[m][n];
    for (i = 0; i < m; i++)
    {
            for (j = 0; j < n; j++)
            {
                mass[i][j] = rand() % 2;
            }
    }
    for (i = 0; i < m; i++)
    {
        for (j = 0; j < n; j++)
        {
            cout << mass[i][j] << "\t";
        }
        cout << endl;
    }
        for (int i = 0; i < m; i++)
        {
            s = 0;
            for (int j = 0; j < n; j++)
            {
                s += mass[i][j];
            }
            cout << s << '\n';
        }
return(0);

Я сделал двумерный массив и сумму элементов в нем по строкам. Подскажите пожалуйста, как реализовать это: "При этом посетители заказывали только по три блюда", у меня идея - сделать так, чтобы сумма элементов  j-строки не превышала 3. И как вычленить из суммы всех строк максимальный и минимальный?

A: Одномерный массив блюд длиной M.
Двумерный массив заказов 3 x N. Значения элементов - индексы из первого массива. Наверное, с ограничением - в одном заказе не может повторяться одно и то же блюдо?
Одномерный массив счетчиков заказанных блюд длиной M.
Заполнить массив счетчиков, исходя из данных заказов. Найти в массиве счетчиков минимум и максимум.