text:
Q: How do I add a search for the next match? I need to search for items and when found the match, put them into the userform. I could do the search when pressing the search button, but could not manage to search the next match when pressing the same button again(CommandButton4).
I'd like to find all matches by pressing the button until nothing further found. Here are my codes:
Private Sub CommandButton4_Click()

Dim ws As Worksheet
Dim FindString As String
Dim Rng As Range

Set ws = ThisWorkbook.Worksheets("BİLGİLER")

FindString = TextBox2.Value

If Trim(FindString) <> "" Then
    Set Rng = ws.Cells.Find( _
                     What:=FindString, _
                     LookIn:=xlValues, _
                     LookAt:=xlPart, _
                     SearchOrder:=xlByRows, _
                     SearchDirection:=xlNext, _
                     MatchCase:=False, _
                     SearchFormat:=False)

    If Not Rng Is Nothing Then
        Application.Goto Rng, True

        TextBox1.Value = ActiveCell.Offset(0, -1).Value
        TextBox2.Value = ActiveCell.Offset(0, 0).Value
        ComboBox1.Value = ActiveCell.Offset(0, 1).Value
        TextBox3.Value = ActiveCell.Offset(0, 2).Value
        TextBox4.Value = ActiveCell.Offset(0, 3).Value
        TextBox5.Value = ActiveCell.Offset(0, 4).Value
        TextBox6.Value = ActiveCell.Offset(0, 5).Value
        TextBox7.Value = ActiveCell.Offset(0, 6).Value
        ComboBox2.Value = ActiveCell.Offset(0, 7).Value
        TextBox8.Value = ActiveCell.Offset(0, 8).Value
        TextBox9.Value = ActiveCell.Offset(0, 9).Value

        TextBox10.Value = ActiveCell.Offset(0, 15).Value
        TextBox11.Value = ActiveCell.Offset(0, 16).Value
        TextBox12.Value = ActiveCell.Offset(0, 17).Value
        TextBox13.Value = ActiveCell.Offset(0, 18).Value
        TextBox14.Value = ActiveCell.Offset(0, 19).Value
        TextBox15.Value = ActiveCell.Offset(0, 20).Value
        TextBox16.Value = ActiveCell.Offset(0, 21).Value
        TextBox17.Value = ActiveCell.Offset(0, 22).Value
        ComboBox3.Value = ActiveCell.Offset(0, 23).Value
        TextBox18.Value = ActiveCell.Offset(0, 24).Value
        TextBox19.Value = ActiveCell.Offset(0, 25).Value

        TextBox20.Value = ActiveCell.Offset(0, 10).Value
        TextBox21.Value = ActiveCell.Offset(0, 11).Value
        TextBox22.Value = ActiveCell.Offset(0, 12).Value
        TextBox23.Value = ActiveCell.Offset(0, 13).Value
        TextBox24.Value = ActiveCell.Offset(0, 14).Value

        ComboBox4.Value = ActiveCell.Offset(0, 26).Value
        ComboBox5.Value = ActiveCell.Offset(0, 27).Value

        ActiveCell.EntireRow.Select
    Else
        MsgBox "Nothing found"
    End If

End If

End Sub

I know it mustn't be so hard but my brain has stopped working. :) I've done so much search that I can't even think now... Thanks in advance.

A: please put following loop in the end of your code to find all other matches:
dim sFirstMatchAddress as string
sFirstMatchAddress  = Rng.address

With ws.Cells

  Do
    Set rng = .FindNext(rng)
    If sFirstMatchAddress = rng.Address Then Exit Do
    'Fill the text boxes*
  Loop

end with

Also, I guess it will be impossible to predict how may textboxes you require to handle all matches. You may need to think how to add textboxes dynamically depanding on number of matches.
Secondly, you don't have to use
Application.Goto Rng, True

and
TextBox1.Value = ActiveCell.Offset(0, -1).Value

Instead, put only:
TextBox1.Value = Rng.Offset(0, -1).Value

A: Worksheets("BILGILER") has to be the ActiveSheet because you are selecting cells on it.
Tried and Tested
Private Sub CommandButton4_Click()

    Dim FindString As String
    Dim Rng As Range, SearchRange As Range

    ThisWorkbook.Worksheets("BILGILER").Select

    Set SearchRange = Intersect(Columns("C"), ActiveSheet.UsedRange)

    FindString = TextBox2.Value

    If Trim(FindString) <> "" Then
        Set Rng = SearchRange.Find( _
                  What:=FindString, _
                  After:=Cells(ActiveCell.Row, "C"), _
                  LookIn:=xlValues, _
                  LookAt:=xlPart, _
                  SearchOrder:=xlByRows, _
                  SearchDirection:=xlNext, _
                  MatchCase:=False, _
                  SearchFormat:=False)

        If Not Rng Is Nothing Then
            Application.Goto Rng, True

                    TextBox1.Value = ActiveCell.Offset(0, -1).Value
                    TextBox2.Value = ActiveCell.Offset(0, 0).Value
                    ComboBox1.Value = ActiveCell.Offset(0, 1).Value
                    TextBox3.Value = ActiveCell.Offset(0, 2).Value
                    TextBox4.Value = ActiveCell.Offset(0, 3).Value
                    TextBox5.Value = ActiveCell.Offset(0, 4).Value
                    TextBox6.Value = ActiveCell.Offset(0, 5).Value
                    TextBox7.Value = ActiveCell.Offset(0, 6).Value
                    ComboBox2.Value = ActiveCell.Offset(0, 7).Value
                    TextBox8.Value = ActiveCell.Offset(0, 8).Value
                    TextBox9.Value = ActiveCell.Offset(0, 9).Value

                    TextBox10.Value = ActiveCell.Offset(0, 15).Value
                    TextBox11.Value = ActiveCell.Offset(0, 16).Value
                    TextBox12.Value = ActiveCell.Offset(0, 17).Value
                    TextBox13.Value = ActiveCell.Offset(0, 18).Value
                    TextBox14.Value = ActiveCell.Offset(0, 19).Value
                    TextBox15.Value = ActiveCell.Offset(0, 20).Value
                    TextBox16.Value = ActiveCell.Offset(0, 21).Value
                    TextBox17.Value = ActiveCell.Offset(0, 22).Value
                    ComboBox3.Value = ActiveCell.Offset(0, 23).Value
                    TextBox18.Value = ActiveCell.Offset(0, 24).Value
                    TextBox19.Value = ActiveCell.Offset(0, 25).Value

                    TextBox20.Value = ActiveCell.Offset(0, 10).Value
                    TextBox21.Value = ActiveCell.Offset(0, 11).Value
                    TextBox22.Value = ActiveCell.Offset(0, 12).Value
                    TextBox23.Value = ActiveCell.Offset(0, 13).Value
                    TextBox24.Value = ActiveCell.Offset(0, 14).Value

                    ComboBox4.Value = ActiveCell.Offset(0, 26).Value
                    ComboBox5.Value = ActiveCell.Offset(0, 27).Value

            ActiveCell.EntireRow.Select
        Else
            MsgBox "Nothing found"
        End If

    End If

End Sub

A: Markos, I did what you said; I put the edited code. It is like this now:
Private Sub CommandButton4_Click()

Dim ws As Worksheet
Dim FindString As String
Dim Rng As Range

Set ws = ThisWorkbook.Worksheets("BİLGİLER")

FindString = TextBox2.Value

If Trim(FindString) <> "" Then
Set Rng = ws.Cells.Find( _
                 What:=FindString, _
                 LookIn:=xlValues, _
                 LookAt:=xlPart, _
                 SearchOrder:=xlByRows, _
                 SearchDirection:=xlNext, _
                 MatchCase:=False, _
                 SearchFormat:=False)

If Not Rng Is Nothing Then

Dim sFirstMatchAddress As String
sFirstMatchAddress = Rng.Address

With ws.Cells

Do
Set Rng = .FindNext(Rng)
If sFirstMatchAddress = Rng.Address Then Exit Do

    TextBox1.Value = Rng.Offset(0, -1).Value
    TextBox2.Value = Rng.Offset(0, 0).Value
    ComboBox1.Value = Rng.Offset(0, 1).Value
    TextBox3.Value = Rng.Offset(0, 2).Value
    TextBox4.Value = Rng.Offset(0, 3).Value
    TextBox5.Value = Rng.Offset(0, 4).Value
    TextBox6.Value = Rng.Offset(0, 5).Value
    TextBox7.Value = Rng.Offset(0, 6).Value
    ComboBox2.Value = Rng.Offset(0, 7).Value
    TextBox8.Value = Rng.Offset(0, 8).Value
    TextBox9.Value = Rng.Offset(0, 9).Value

    TextBox10.Value = Rng.Offset(0, 15).Value
    TextBox11.Value = Rng.Offset(0, 16).Value
    TextBox12.Value = Rng.Offset(0, 17).Value
    TextBox13.Value = Rng.Offset(0, 18).Value
    TextBox14.Value = Rng.Offset(0, 19).Value
    TextBox15.Value = Rng.Offset(0, 20).Value
    TextBox16.Value = Rng.Offset(0, 21).Value
    TextBox17.Value = Rng.Offset(0, 22).Value
    ComboBox3.Value = Rng.Offset(0, 23).Value
    TextBox18.Value = Rng.Offset(0, 24).Value
    TextBox19.Value = Rng.Offset(0, 25).Value

    TextBox20.Value = Rng.Offset(0, 10).Value
    TextBox21.Value = Rng.Offset(0, 11).Value
    TextBox22.Value = Rng.Offset(0, 12).Value
    TextBox23.Value = Rng.Offset(0, 13).Value
    TextBox24.Value = Rng.Offset(0, 14).Value

    ComboBox4.Value = Rng.Offset(0, 26).Value
    ComboBox5.Value = Rng.Offset(0, 27).Value
    Loop

End With

Else
    MsgBox "Nothing found"
End If
End If

End Sub

But it did not work, either. It does what my previous code does; it finds only one match. I don't know if I put them in right place.
Correction: It does not what my previous code does; it finds the last match.

A: try this. It only reads data to user form.
 Option Explicit

Private rngLastFound As Range

Private Sub CommandButton4_Click()

Dim ws As Worksheet
Dim FindString As String
Dim Rng As Range, SearchRange As Range

Set ws = ThisWorkbook.Worksheets("BILGILER")
If rngLastFound Is Nothing Then Set rngLastFound = ws.Range("C1")
Set SearchRange = Intersect(Columns("C"), ws.UsedRange)

FindString = TextBox2.Value

If Trim(FindString) <> vbNullString Then
    Set Rng = SearchRange.Find( _
                     What:=FindString, _
                     After:=ws.Cells(rngLastFound.Row, SearchRange.Column), _
                     LookIn:=xlValues, _
                     LookAt:=xlPart, _
                     SearchOrder:=xlByRows, _
                     SearchDirection:=xlNext, _
                     MatchCase:=False, _
                     SearchFormat:=False)

    If Not Rng Is Nothing Then
        Set rngLastFound = Rng

        TextBox1.Value = Rng.Offset(0, -1).Value
        TextBox2.Value = Rng.Offset(0, 0).Value
        ComboBox1.Value = Rng.Offset(0, 1).Value
        TextBox3.Value = Rng.Offset(0, 2).Value
        TextBox4.Value = Rng.Offset(0, 3).Value
        TextBox5.Value = Rng.Offset(0, 4).Value
        TextBox6.Value = Rng.Offset(0, 5).Value
        TextBox7.Value = Rng.Offset(0, 6).Value
        ComboBox2.Value = Rng.Offset(0, 7).Value
        TextBox8.Value = Rng.Offset(0, 8).Value
        TextBox9.Value = Rng.Offset(0, 9).Value

        TextBox10.Value = Rng.Offset(0, 15).Value
        TextBox11.Value = Rng.Offset(0, 16).Value
        TextBox12.Value = Rng.Offset(0, 17).Value
        TextBox13.Value = Rng.Offset(0, 18).Value
        TextBox14.Value = Rng.Offset(0, 19).Value
        TextBox15.Value = Rng.Offset(0, 20).Value
        TextBox16.Value = Rng.Offset(0, 21).Value
        TextBox17.Value = Rng.Offset(0, 22).Value
        ComboBox3.Value = Rng.Offset(0, 23).Value
        TextBox18.Value = Rng.Offset(0, 24).Value
        TextBox19.Value = Rng.Offset(0, 25).Value

        TextBox20.Value = Rng.Offset(0, 10).Value
        TextBox21.Value = Rng.Offset(0, 11).Value
        TextBox22.Value = Rng.Offset(0, 12).Value
        TextBox23.Value = Rng.Offset(0, 13).Value
        TextBox24.Value = Rng.Offset(0, 14).Value

        ComboBox4.Value = Rng.Offset(0, 26).Value
        ComboBox5.Value = Rng.Offset(0, 27).Value

    Else
        MsgBox "Nothing found"
    End If

End If

End Sub


text:
Q: div aumentademasiado de altura al agregar boton Puse un botón en un div pero al agregarlo el div aumenta mucho de altura y queda pegado al footer, además el botón se sale del div, no sé que puede ser.

.caja {
  height: auto;
  background: #fff;
  width: 100%;
  margin: 0 auto;
  position: relative;
  bottom: 630px;
}

.boton {
  background: #ff4000;
  color: #fff;
  border-radius: 5px;
  padding: 10px;
  font-style: normal;
  width: 20%;
  margin: 0 auto;
  display: block;
  position: absolute;
  bottom: 0px;
  right: 0;
  left: 0;
}

--CONTENIDO

MÁS

A: Intenta de esta manera:

.caja {
 height: auto;
 background: #fff;
 width: 100%;
 margin: auto;
 bottom: 630px;
}

.boton {
 background: #ff4000;
 color: #fff;
 border-radius: 5px;
 padding: 10px;
 font-style: normal;
 width: 20%;
 margin: auto;
 display: block;
}
<!DOCTYPE html>

   <title></title>

              --CONTENIDO
              <button class="boton">
                MÁS
              </button>

redpajama_set_name: RedPajamaStackExchange


text:
Q: Symfony2: Access Request object in Entity I'd like to know how to access the Request object in an entity (Symfony2) to modify the user locale.
If someone has found a solution for my problem, please let me know.

A: It's not possible. This is by design: the entity is just a simple object that should know nothing about the request - it's the responsibility of the controller to interpret the request, and manipulate the entity based on that.
Something like:
//inside your controller:
public function fooBarAction(Request $request)
{
    $entity = // get entity
    $entity->setLocale($request->getSession()->getLocale());
}

The above is just example code, it won't work if you just copy and paste it. It's just to demonstrate the general idea. The entity should just be a very simple object, who's only responsibility is to hold some data. It shouldn't know where the data is coming from - that keeps it flexible (if you want to set the locale based on something else, you only have to change your controller, not all your entities).

A: It is possible, but...
What you can but never should do is inject the Request object into the entity (Practically turning your entity into service, see here). Also, even worse idea (but which people still do), you could inject the whole container and get Request from there. The reason why you shouldn't do it is you never should have any code that deals with business rules or any system code in your entities.
You can switch your locale directly in your routes by using _locale custom variable (accessible also from the Request). Or you can create a kernel listener, which will do the required functionality for you. This way you keep your code testable and decoupled.


text:
Q: How to get the difference of elements inside a list of lists in Java? My actual problem is similar to this. I have two boxes, which contains some colorful baskets. Each of these baskets contains some fruits in multiple quantity.
Below is the pictorial representation of such scenario-
Box1
Red Basket = [(Mango, 12), (Apple, 7)]
Yellow Basket = [(Apple, 7), (Banana, 2)]
Blue Basket = [(Orange, 16)]

Box2
Red Basket = [(Mango, 8), (Apple, 10), (Papaya, 1)]
Yellow Basket = [(Apple, 10), (Orange, 10)]

Now I wanna do is to calculate the difference of each fruit, keeping in mind that difference can be calculated only on same color of baskets. Below is what, the difference should show me-
Difference Box
Red Basket = [(Mango, 4), (Apple, 3), (Papaya, 1)]
Yellow Basket = [(Apple, 3), (Banana, 8)]
Blue Basket = [(Orange, 16)]

My Java classes looks like following-
Main Class:
public class Difference {
    public static void main(String[] args) {
        Fruit mango1 = new Fruit("Mango", 12);
        Fruit apple1 = new Fruit("Apple", 7);
        Fruit orange1 = new Fruit("Orange", 16);
        Fruit banana1 = new Fruit("Banana", 2);

        Bucket redBucket1 = new Bucket("Red");
        Bucket yellowBucket1 = new Bucket("Yellow");
        Bucket blueBucket1 = new Bucket("Blue");

        redBucket1.addFruit(mango1);
        redBucket1.addFruit(apple1);

        yellowBucket1.addFruit(apple1);
        yellowBucket1.addFruit(banana1);

        blueBucket1.addFruit(orange1);

        Box box1 = new Box();
        box1.addBucket(redBucket1);
        box1.addBucket(yellowBucket1);
        box1.addBucket(blueBucket1);

        Fruit mango2 = new Fruit("Mango", 8);
        Fruit apple2 = new Fruit("Apple", 10);
        Fruit orange2 = new Fruit("Orange", 10);
        Fruit papaya2 = new Fruit("Papaya", 1);

        Bucket redBucket2 = new Bucket("Red");

        Bucket yellowBucket2 = new Bucket("Yellow");

        redBucket2.addFruit(mango2);
        redBucket2.addFruit(apple2);
        redBucket2.addFruit(papaya2);

        yellowBucket2.addFruit(apple2);
        yellowBucket2.addFruit(orange2);

        Box box2 = new Box();
        box2.addBucket(redBucket2);
        box2.addBucket(yellowBucket2);

        Box difference = getDifference(box1, box2);
    }

    private static Box getDifference(Box box1, Box box2) {
        return null;
    }
}

Extra Classes:
public class Fruit {
    private int count;
    private String name;
    public Fruit(String name, int count) {
        this.name = name;
        this.count = count;
    }
}

public class Bucket {
    private List<Fruit> fruits;
    private String color;
    public Bucket(String color) {
        fruits= new ArrayList<Fruit>();
        this.color = color;
    }
}

public class Box {
    private List<Bucket> buckets;
    public Box() {
        buckets= new ArrayList<Bucket>();
    }
    public void addBucket(Bucket bucket) {
        buckets.add(bucket);
    }
}

How can I achieve this kind of difference? I tried it but my solution is ugly, where for each element I am traversing entire list.

A: Instead of the baskets containing a list of fruit, try using a hashmap.  A Hasmap will allow you to get each fruit by the key used, probably the fruit name VS iterating over the entire list.

A: A possible solution is to create the class Basket. It's a real world notion, so it seems a good design choice at first sight.
public class Basket {
    private Color color;                   // Color is an enum
    private Map<Fruit, Integer> fruitMap   // map of pairs: <fruit kind, number of fruit of that kind>

    // ... getters and setters
}


text:
Q: Facebook/Twitter/GooglePlus Sharing and 307 Redirects On my site, when a user initially visits and they do not have an assigned session token, a 307 redirect them to a subdomain where the token is applied, and then brings them back to the page they were currently on. This is done for SSO across multiple domains and CNames.
But the 307 has a problem when social share buttons (Facebook, Twitter, Google Plus) is involved. The redirect is called, but the social sites appear to never leave the SSO subdomain.
I realize there are a few ways to solve this problem so my questions are:

*

*What are the request domains of Facebook/Twitter/GooglePlus so logic can be worked in to not have them redirected to the sso domain?

*Why aren't the social sites following the 307 redirect?

*Can the social sites have a cookie or session attached to them?


text:
Q: Sentiment Analysis_Apache HBase_Apache Storm I am trying to do sentiment analysis on Apache Storm and retrieve results using Hbase. Can anyone tell me how to do that?

A: You can take a look at my prototype project.
Doing very simple sentiments analysis, then words trending and writing results to HDFS. Maybe you can reuse some parts for your needs.


text:
Q: App notifications don't dismiss when read on the site I absolutely love the notifications on my device by the way; they are awesome.
It would be great however if they automatically went away when I took action on the notification in the website.
Scenario

*

*A user's question receives a comment

*Notification appears on Android app

*User views the comment via the site, notification dismissed on the site

*Notification is still visible on the device

The principal: If I've dismissed something anywhere it should be dismissed everywhere


text:
Q: OpenGL L-System Rendering I have gotten my basic L-System working and I decided to try and optimize the rendering of the application. Previously I was looping through the whole string of the L-System with a switch case and drawing. Better yet I will show you what I was doing:
for(unsigned int stringLoop = 0; stringLoop < _buildString.length(); stringLoop++)
{

        switch(_buildString.at(stringLoop))
        {
        case'X':
            //Do Nothing
            //X is there just to facilitate the Curve of the plant
            break;
        case'F':

            _prevState = _currState;
            _currState.position += _currState.direction * stdBranchLength;
            //Set the previous state to the current state
            _graphics.SetColour3f(0.0f, 1.0f, 0.0f);

            _graphics.Begin(OGLFlags::LINE_STRIP);
                _graphics.Vertex3f(_prevState.position.X(), _prevState.position.Y(), _prevState.position.Z());
                _graphics.Vertex3f(_currState.position.X(), _currState.position.Y(), _currState.position.Z());
            _graphics.End();

            break;
        case'[':
            _prevStack.push(_currState);
            break;
        case']':
            _prevState = _currState;
            _currState = _prevStack.top();
            _prevStack.pop();
            break;
        case'-':

            _currState.direction = _currState.direction.RotatedAboutZ(-(ROTATION) * Math::DegreesToRadians);

            break;
        case'+':
            _currState.direction = _currState.direction.RotatedAboutZ(ROTATION * Math::DegreesToRadians);

            break;
        };

}

I removed all of this because I was literally resolving the tree every single frame, I changed this loop so that it would save all of the verticies in a std vector.
    for(unsigned int stringLoop = 0; stringLoop < _buildString.length(); stringLoop++)
{

        switch(_buildString.at(stringLoop))
        {
        case'X':
            break;
        case'F':

            //_prevState = _currState;
            _currState.position += _currState.direction * stdBranchLength;
            _vertexVector.push_back(_currState.position);

            break;
        case'[':
            _prevStack.push(_currState);
            break;
        case']':
            _currState = _prevStack.top();
            _prevStack.pop();
            break;
        case'-':
            _currState.direction = _currState.direction.RotatedAboutZ(-(ROTATION) * Math::DegreesToRadians);
            break;
        case'+':
            _currState.direction = _currState.direction.RotatedAboutZ(ROTATION * Math::DegreesToRadians);
            break;
        };
}

Now I changed my render loop so I just read straight from the vector array.
    DesignPatterns::Facades::OpenGLFacade _graphics = DesignPatterns::Facades::openGLFacade::Instance();

_graphics.Begin(OGLFlags::LINE_STRIP);
    for(unsigned int i = 0; i < _vertexVector.size(); i++)
    {
        _graphics.Vertex3f(_vertexVector.at(i).X(), _vertexVector.at(i).Y(), _vertexVector.at(i).Z());
    }
_graphics.End();

Now my problem is that when I am using a vector array and I use Line Stip, I get extra artifact.
The first image is the original render that is the unoptimized one, then the second is the newer render which runs faster, and the thirds is a render of a dragon curve which uses no push and pops like the first two are using (I am pretty sure the push and pop is where the problems are coming in).
Is the problem with my logic here of storing verticies, or is it because I am using a line strip? I would just use lines, but it doesn't really work at all, it ends up looking more of a line_stipple.
Also sorry about the length of this post.
alt text http://img197.imageshack.us/img197/8030/bettera.jpg
alt text http://img23.imageshack.us/img23/3924/buggyrender.jpg
alt text http://img8.imageshack.us/img8/627/dragoncurve.jpg

A: You are getting those extra lines because you are using a LINE_STRIP.
In your 'F' case, push both end points of your line into the vector (like you were doing originally).
_vertexVector.push_back(_prevState.position);
_vertexVector.push_back(_currState.position);

And when you draw, use LINE_LIST instead.


text:
Q: how to find the most recently checked in file in VSS I have to figure out the most recently checked in files on VSS. I know the date of check in but not much info other than the directory to which they were checked. There are a large number of files and I was wondering if there is a report I can pull out from some where.
Thanks

A: Right-click on the directory in VSS Explorer and choose View History: you can add date filters to the search, then output the results as text.


text:
Q: NSOperationQueue Complete I'm using ASIHTTPRequest to make a queue request, But i was wondering if there is a way to know When the queue has finished With all the request here is part of my code
 for (int i=0; i< [result count]; i++)
{
    Reportes *temp    =   [result objectAtIndex:i];
    ASIFormDataRequest *request     =   [ASIFormDataRequest requestWithURL:url];

    [request setTag:0];
    [request setDelegate:self];
    [request setPostValue:[[NSUserDefaults standardUserDefaults] stringForKey:USERNAME] forKey:POST_USUARIO];
    [request setPostValue:[KeychainWrapper keychainStringFromMatchingIdentifier:PIN_SAVED] forKey:POST_CLAVE];
    [request setPostValue:POST_IDSISTEMA_VALUE forKey:POST_IDSISTEMA];
    [request setPostValue:[self getMacAddress] forKey:POST_MAC];

    [request setPostValue:[[temp toNSDictionary] JSONRepresentation] forKey:@"value"];
    [[self queue] addOperation:request];

}

A: You can implement the following method
- (void)queueFinished:(ASINetworkQueue *)queue
{
    // You could release the queue here if you wanted
    if ([[self networkQueue] requestsCount] == 0) {
        [self setNetworkQueue:nil];
    }
    NSLog(@"Queue finished");
}

queueFinished is the one that gets called after all the requests have finished. In order for this to work you have to call
[[self queue] setQueueDidFinishSelector:@selector(queueFinished:)];

when you initialize the queue


text:
Q: BDB, How to get primary keys in specified order? I have asked the same question for some days on oracle forums, but no answer came:(
link is:http://forums.oracle.com/forums/thread.jspa?threadID=2162345&tstart=0
Hi, I build BBS using BDB as backend database, forum database, topic database and post database share one environment. This BBS web application is multi-thread program. If user selects one forum, its topics will be listed in order of last reply time;selecting one topic, posts are listed in order of reply time as well.
struct forum {
UInt16 forumID;
string forumName;
string _lastPoster; // who is the last one replied in this forum
};

struct topic {
UInt32 topicID;
UInt16 forumID; // topic comes from this forum
string title; // topic title
UInt64 dateOfLastReply; // when last reply to this topic happen
};

struct post {
UInt64 postID;
UInt32 topicID; // post comes from this topic
string title; // post title as of topic
UInt64 dateOfPost; // when this post is created
};

I create one primary database and two secondary databases for topic, primary key is topicID, secondary keys are forumID and dateOfLastReply respectively, and I want to show 1st 25 topics in latest reply time order on the 1st browser page, 2nd 25 topics on the 2nd browser page, and etc.
if using SQL, it will be: SELECT topicID FROM topic WHERE forumID=xx ORDER BY dateOfLastReply DESC
From performance perspective, I want get all topics id of one same forum, and need them come in reply time order, then retrieve topic one by one based on returned topicID, how can I do this? guess I have to use joins.
Plus, do you have any suggestion about retrieval performance given the fact that topics retrieval will happen each time browser want to request the next page, that is, 2nd 25 topics of this forum?
Is DB_DBT_MULTIPLE helpful to me?
thanks.

A: Are you using BDB's new SQL access layers?   If so, just use SQL.
If not, BDB is (mostly) just a key-value datastore.   It has several access methods (hash, B+tree, etc), but at its core thats all it is.  If you want to sort/search by non-primary keys, you'll have to create indexes on those values, and do the searching/joining in your own code.

A: You need to create a secondary database with a composite key, consisting of (forum_id, dateoflastreply). Then, all the results you want will be in a contiguous range of rows, and you can query on them by doing a range scan (eg, 20 rows starting with (1, 2010-01-01)).

A: Assuming that the topic_secondary database (which contains the secondary keys) is defined via DB_ASSOCIATE, then you would open a cursor on the topic_secondary database and using DBC->get() with DB_SET_RANGE you would position the cursor on the desired forumID and move the cursor forward from there.
By using a cursor over the secondary database, you get the data returned from the primary database in the desired order. And by specifying the forumID in the initial DBC->get() with DB_SET_RANGE, you can position the cursor at the proper place to begin your scan.
Please see the documentation on Cursors and Secondary indexes.
Please let me know if this answers your question.
Regards,
Dave


text:
Q: Get stored procedure output value from SQL Server in ASP.NET with Entity Framework I have a stored procedure that updates a record, before that check what name to enter does not have another record, in case it registers or will not return a message, which I can not catch in my controller.
My stored procedure is:
CREATE PROCEDURE SP_ACTUALIZAR_MARCA
    @IIDMARCA INT,
    @NOMBRE VARCHAR(100),
    @DESCRIPCION VARCHAR(200),
    @MENSAJE INT OUTPUT
AS
BEGIN
    SET NOCOUNT ON

    IF EXISTS(SELECT * FROM Marca WHERE NOMBRE = @NOMBRE AND IIDMARCA <> @IIDMARCA)
    BEGIN
        SET @MENSAJE = 0
    END
    ELSE
    BEGIN
        UPDATE Marca
        SET NOMBRE = UPPER(@NOMBRE), DESCRIPCION = LOWER(@DESCRIPCION)
        WHERE IIDMARCA = @IIDMARCA

        SET @MENSAJE = 1
    END
END

And in my controller at the moment I have the following:
public ActionResult ActualizarMarca(MarcaCLS oMarcaCLS)
{
    int a = 0;

    if (ModelState.IsValid)
    {
        using (bd)
        {
            bd.SP_ACTUALIZAR_MARCA(iIDMARCA: oMarcaCLS.iidMarca, nOMBRE: oMarcaCLS.nombreMarca, dESCRIPCION: oMarcaCLS.descripcionMarca, mENSAJE:);
        }
    }
    else
    {
        return View(oMarcaCLS);
    }

    return View(oMarcaCLS);
}

The output message underlined in the image, I don't know how to catch it in my controller, I thought that with an integer variable I could but it generates the following

No argument has been given that corresponds to the required formal parameter.
I need the value of "@MENSAJE" of stored procedure in my controller
[HttpPost]
        public ActionResult ActualizarMarca(MarcaCLS oMarcaCLS)
        {
            ObjectParameter mensaje = new ObjectParameter("mensaje", typeof(int));//output
            try
            {
                if (ModelState.IsValid)
                {
                    using (bd)
                    {
                        bd.SP_ACTUALIZAR_MARCA(iIDMARCA: oMarcaCLS.iidMarca, nOMBRE: oMarcaCLS.nombreMarca, dESCRIPCION: oMarcaCLS.descripcionMarca, mENSAJE: mensaje );
                    }
                }
                else
                {
                    return View(oMarcaCLS);
                }
            }
            catch (Exception e)
            {

            }
            int a = Convert.ToInt32(mensaje.Value);
            return RedirectToAction("Index");
        }


text:
Q: Java + PDFBox on Linux I need to write a small program for a server which will use PDFBox. I'm writing under windows with NetBeans. How do I add PDFBox jar to my program jar once I export it to the server?

A: You don't necessarily have to put pdfbox.jar into your application's jar. It's easier to keep them separate and just add them both to your classpath before running it.
For example, place both jars in the same directory and run:
$ java -cp myapp.jar:pdfbox.jar app.MainClass args


text:
Q: Update iPhones over the air with private server I've a more than 20 iPhone 5s/6/6s in my company. I normally download IPSW and update using iTunes so that the updates do not take all the internet bandwidth.
I would like to know if it's possible create our own server and publish those updates such that users can update their phone by Wi-Fi. That way instead of downloading updates directly from Apple it will download from my private server.

A: You can run the Caching service, part of server.app. The Caching service supports OTA updates for iOS 7 and later. All you need to do is enable the service in Server.app. Devices do not need to be part of MDM supervision.

macOS and iOS devices automatically access the available caching service on the network they're currently connected to

You can find Apple's documentation of the Caching service at:

*

*https://help.apple.com/serverapp/mac/#/apd74DDE89F-08D2-4E0A-A5CD-155E345EFB83


text:
Q: Rails 4: Is it a bad practice to do database operations in model? Say I have product model(app/models/product.rb) and the following method def in the model.
def update_stock product
  product.stock -= 1
  product.save(:validation => false)
end

Is this acceptable?
Thanks in advance.

A: This is a good practice to keep the database operations and business logic of an application in model. Model directly interacts with database with ORM (Object Relational mapping). Also in rails convention controller should be thin and model should be fat .This answer explains it in details
What is Ruby on Rails ORM in layman's terms? Please explain

A: This looks suspicious to me - you say that this is a method in your Product model, but then the method updates an entirely different product instance (the one you pass in, not the one you call the method on).
If this was something like:
class Product < ActiveRecord::Base
  def update_stock
    self.stock -= 1
    save
  end
end

Then it would be much more appropriate. (update_stock doesn't seem like the best name for the method, either, and skipping the validations likely isn't a good idea.)

A: As you want to update something better use update_attributes!
It may be write in this way:
class Product < ActiveRecord::Base

  def update_stock product
   self.update_attributes!(stock:  stock - 1)
 end
end

A: It's up to you!
The simplest way I use to deduce how to do things is to look at it from a modular perspective. If you have "heavy" code in a controller, will you benefit from using that code in another area of the app?

Rails is a series of classes & modules
Code is accessible to different parts of the app, depending on which modules are called. If you feel like you'll benefit from re-using the method in different areas of the app, you should include either an instance or class method in the model, as this will open this method to those objects
I would use the code provided by RSB & sevenseacat, probably using the decrement! method in sevenseacats answer:
self.decrement!(:stock)

In regards to your question, I would personally do that, but would make it an instance method. sevenseacat basically explained what I'd do


text:
Q: When does AWS deregister an EC2 from the auto-scaling group during scale-in? I am trying to figure out when and how AWS deregisters an EC2 from an auto-scaling group during scale-in. I am especially worried about a case when an EC2 which is about to be terminated will receive an incoming request shortly before being terminated. This would naturally cause processing of the requst to fail. The desired behavior would be for AWS to deregister the about-to-be-terminated instance from the group some configurable time before actually terminating it. I have found no documentation about this specific issue. Am I missing something?

A: There's no configuration that guarantees that a specific time elapses between deregistering an instance from the group and terminating it.
You can use Elastic Load Balancer health checks to remove instances that are not responding from the load balancer endpoint before they are terminated.

A: From AWS Documentation https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html
Default termination policy
The default termination policy applies multiple termination criteria before selecting an instance to terminate. When Amazon EC2 Auto Scaling terminates instances, it first determines which Availability Zones have the most instances, and it finds at least one instance that is not protected from scale in. Within the selected Availability Zone, the following default termination policy behaviour applies:
Determine whether any of the instances eligible for termination use the oldest launch template or launch configuration:
[For Auto Scaling groups that use a launch template]
Determine whether any of the instances use the oldest launch template, unless there are instances that use a launch configuration. Amazon EC2 Auto Scaling terminates instances that use a launch configuration before it terminates instances that use a launch template.
[For Auto Scaling groups that use a launch configuration]
Determine whether any of the instances use the oldest launch configuration.
After applying the preceding criteria, if there are multiple unprotected instances to terminate, determine which instances are closest to the next billing hour. If there are multiple unprotected instances closest to the next billing hour, terminate one of these instances at random.


text:
Q: How to use a wrapper function that i generated using swig in python? Okay, I am new to swig. I have finally successfully wrapped the most expensive part of my python program using swig and also numpy.i . The program is a finite difference scheme for the 2D wave PDE . My question is how do I use it now ? I can see it after I import it within IPython.
In [1]: import wave2

In [2]: wave2.wave_prop
Out[2]: <function _wave2.wave_prop>

But, when I go to use it I get an error saying:
TypeError: in method 'wave_prop', argument 1 of type 'float **'

How can I transform my 2D numpy arrays to some form that will enable me to use this. There is another stackoverflow that is very similar that did not help me, although I have found a lot of help with this matter along the way.
Here is the header:
void wave_prop(float** u_prev ,int Lx, int Ly,float** u ,int Lx2, int Ly2,float** u_next,int Lx3,int Ly3  );

Here is the c code:
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<math.h>

#define n 100

void wave_prop(float** u_prev ,int Lx,int Ly,float** u ,int Lx2,int Ly2,float** u_next,int Lx3,int Ly3 ){

int dx=1;
int dy=1;
float c=1;
float dt =1;
int t_old=0;int t=0;int t_end=150;
int x[Lx];
int y[Ly];

for(int i=0;i<=99;i++){
        x[i]=i;
        y[i]=i;
    }

while(t<t_end){
    t_old=t; t +=dt;
    //the wave steps through time
    for (int i=1;i<99;i++){
        for (int j=1;j<99;j++){
                u_next[i][j] = - u_prev[i][j] + 2*u[i][j] + \
                        (c*dt/dx)*(c*dt/dx)*u[i-1][j] - 2*u[i][j] + u[i+1][j] + \
                (c*dt/dx)*(c*dt/dx)*u[i][j-1] - 2*u[i][j] + u[i][j+1];
                }
             }

    //set boundary conditions to 0

    for (int j=0;j<=99;j++){ u_next[0][j] = 0;}
    for (int i=0;i<=99;i++){ u_next[i][0] = 0;}
    for (int j=0;j<=99;j++){ u_next[Lx-1][j] = 0;}
    for (int i=0;i<=99;i++){ u_next[i][Ly-1] = 0;}

    //memcpy(dest, src, sizeof (mytype) * rows * coloumns);
    memcpy(u_prev, u, sizeof (float) * Lx * Ly);
    memcpy(u, u_next, sizeof (float) * Lx * Ly);

    }
}

And here is my interface:
   %module wave2
%{
    #define SWIG_FILE_WITH_INIT
    #include "wave2.h"

%}

%include "numpy.i"

%init %{
    import_array();
%}

%include "wave2.h"
%apply (float** INPLACE_ARRAY2, int DIM1, int DIM2) { (float** u_prev,int Lx,int Ly ),(float** u,int Lx2,int Ly2),(float* u_next,int Lx3,int Ly3)}

These are the commands I used to compile and link:
$ swig -python wave2.i
$ gcc -c -fpic wave2.c wave2_wrap.c -I/usr/include/python2.7 -std=c99
$ gcc -shared wave2.o wave2_wrap.o -o _wave2.so

Without any errors or warnings. There is a lack of intermediate examples like this on the internet, trust me I have scoured!, so if WE can get this working it could serve as a good tutorial for someone. Please do not mark my question down then go away into the night . If you think some of my coding needs improvement please let me know I am trying to basically teach myself everything right now... Thank you very much for your help
Oh and also here is a script that I am trying to use it in. I have also tried to use the function in other ways within IPython...
'''George Lees Jr.
2D Wave pde '''

from numpy import *
import numpy as np
import matplotlib.pyplot as plt
from wave2 import *
import wave2

#declare variables
#need 3 arrays u_prev is for previous time step due to d/dt

Lx=Ly = (100)
n=100
dx=dy = 1
x=y = np.array(xrange(Lx))
u_prev = np.array(zeros((Lx,Ly),float))
u = np.array(zeros((Lx,Ly),float))
u_next = np.array(zeros((Lx,Ly),float))
c = 1 #constant velocity
dt = (1/float(c))*(1/sqrt(1/dx**2 + 1/dy**2))
t_old=0;t=0;t_end=150

#set Initial Conditions and Boundary Points
#I(x) is initial shape of the wave
#f(x,t) is outside force that creates waves set =0

def I(x,y): return exp(-(x-Lx/2.0)**2/2.0 -(y-Ly/2.0)**2/2.0)
def f(x,t,y): return 0

#set up initial wave shape

for i in xrange(100):
    for j in xrange(100):
        u[i,j] = I(x[i],y[j])

#copy initial wave shape for printing later

u1=u.copy()

#set up previous time step array

for i in xrange(1,99):
    for j in xrange(1,99):
            u_prev[i,j] = u[i,j] + 0.5*((c*dt/dx)**2)*(u[i-1,j] - 2*u[i,j] + u[i+1,j]) + \
            0.5*((c*dt/dy)**2)*(u[i,j-1] - 2*u[i,j] + u[i,j+1]) + \
            dt*dt*f(x[i], y[j], t)

#set boundary conditions to 0

for j in xrange(100): u_prev[0,j] = 0
for i in xrange(100): u_prev[i,0] = 0
for j in xrange(100): u_prev[Lx-1,j] = 0
for i in xrange(100): u_prev[i,Ly-1] = 0

wave2.wave_prop( u_prev ,Lx ,Ly , u , Lx, Ly, u_next,Lx,Ly )

#while t<t_end:
#   t_old=t; t +=dt
    #the wave steps through time
#   for i in xrange(1,99):
#       for j in xrange(1,99):
#               u_next[i,j] = - u_prev[i,j] + 2*u[i,j] + \
#                       ((c*dt/dx)**2)*(u[i-1,j] - 2*u[i,j] + u[i+1,j]) + \
#               ((c*dt/dx)**2)*(u[i,j-1] - 2*u[i,j] + u[i,j+1]) + \
#                       dt*dt*f(x[i], y[j], t_old)
#
#   #set boundary conditions to 0
#
#   for j in xrange(100): u_next[0,j] = 0
#   for i in xrange(100): u_next[i,0] = 0
#   for j in xrange(100): u_next[Lx-1,j] = 0
#   for i in xrange(100): u_next[i,Ly-1] = 0

    #set prev time step equal to current one
#   u_prev = u.copy(); u = u_next.copy();

fig = plt.figure()
plt.imshow(u,cmap=plt.cm.ocean)
plt.colorbar()
plt.show()
print u_next

Also yes I checked to make sure that the arrays were all numpy nd array types

A: Okay so i was able to accomplish what i wanted to in Cython, thank god. In the process I found Cython much more powerful of a tool !
So the result is a 2D wave PDE solved using a finite difference. The main computation has been exported to a Cythonized function. The function takes in three 2D np.ndarrays and returns one back. Much easier to work with numpy and other data types as well.
Here is the Cythonized function:
from numpy import *
cimport numpy as np

def cwave_prop( np.ndarray[double,ndim=2] u_prev, np.ndarray[double,ndim=2] u, np.ndarray[double,ndim=2] u_next):

    cdef double t = 0
    cdef double t_old = 0
    cdef double t_end = 100
    cdef int i,j
    cdef double c = 1
    cdef double Lx = 100
    cdef double Ly = 100
    cdef double dx = 1
    cdef double dy = 1
    cdef double dt = (1/(c))*(1/(sqrt(1/dx**2 + 1/dy**2)))

    while t<t_end:
        t_old=t; t +=dt

        #wave steps through time and space

        for i in xrange(1,99):
            for j in xrange(1,99):
                u_next[i,j] = - u_prev[i,j] + 2*u[i,j] + \
                        ((c*dt/dx)**2)*(u[i-1,j] - 2*u[i,j] + u[i+1,j]) + \
                ((c*dt/dx)**2)*(u[i,j-1] - 2*u[i,j] + u[i,j+1])

        #set boundary conditions of grid to 0

        for j in xrange(100): u_next[0,j] = 0
        for i in xrange(100): u_next[i,0] = 0
        for j in xrange(100): u_next[Lx-1,j] = 0
        for i in xrange(100): u_next[i,Ly-1] = 0

        #set prev time step equal to current one
        for i in xrange(100):
            for j in xrange(100):
                u_prev[i,j] = u[i,j];
                u[i,j] = u_next[i,j];

    print u_next

And here is my python script that calls it and also returns it back then plots the result.
Any suggestions on writing better code are welcome...
'''George Lees Jr.
2D Wave pde '''

from numpy import *
import numpy as np
import matplotlib.pyplot as plt
import cwave2
np.set_printoptions(threshold=np.nan)

#declare variables
#need 3 arrays u_prev is for previous time step due to time derivative

Lx=Ly = (100)                       #Length of x and y dims of grid
dx=dy = 1                       #derivative of x and y respectively
x=y = np.array(xrange(Lx))              #linspace to set the initial condition of wave
u_prev=np.ndarray(shape=(Lx,Ly), dtype=np.double)   #u_prev 2D grid for previous time step needed bc of time derivative
u=np.ndarray(shape=(Lx,Ly), dtype=np.double)        #u 2D grid
u_next=np.ndarray(shape=(Lx,Ly), dtype=np.double)   #u_next for advancing the time step #also these are all numpy ndarrays
c = 1                           #setting constant velocity of the wave
dt = (1/float(c))*(1/sqrt(1/dx**2 + 1/dy**2))       #we have to set dt specifically to this or numerical approx will fail!
print dt

#set Initial Conditions and Boundary Points
#I(x) is initial shape of the wave

def I(x,y): return exp(-(x-Lx/2.0)**2/2.0 -(y-Ly/2.0)**2/2.0)

#set up initial wave shape

for i in xrange(100):
    for j in xrange(100):
        u[i,j] = I(x[i],y[j])

#set up previous time step array

for i in xrange(1,99):
    for j in xrange(1,99):
            u_prev[i,j] = u[i,j] + 0.5*((c*dt/dx)**2)*(u[i-1,j] - 2*u[i,j] + u[i+1,j]) + \
            0.5*((c*dt/dy)**2)*(u[i,j-1] - 2*u[i,j] + u[i,j+1])

#set boundary conditions to 0

for j in xrange(100): u_prev[0,j] = 0
for i in xrange(100): u_prev[i,0] = 0
for j in xrange(100): u_prev[Lx-1,j] = 0
for i in xrange(100): u_prev[i,Ly-1] = 0

#call C function from Python
cwave2.cwave_prop( u_prev , u , u_next )
#returned u (2D np.ndarray)

from tempfile import TemporaryFile
outfile = TemporaryFile()
np.save(outfile,u)
fig = plt.figure()
plt.imshow(u,cmap=plt.cm.ocean)
plt.colorbar()
plt.show()


text:
Q: how to use clip-path with text inside the div? i tried the following:
http://codepen.io/anon/pen/YXePBY

lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet lorem ipsum dolor sit amet

div {
    width: 280px;
    height: 280px;
    background: #1e90ff;
    -webkit-clip-path: polygon(0 0, 78% 0, 93% 99%, 0% 100%);
  clip-path: polygon(0 0, 78% 0, 93% 99%, 0% 100%);
  padding: 15px
}

/* Center the demo */
html, body { height: 100%; }
body {
    display: flex;
    justify-content: center;
    align-items: center;
}

what I want is, that the text inside the div gets a line break when it reaches the border.
how is this possible?
and how can I get the highest browser compatibility?
is there maybe a way to make this with SVGs?

A: You can't do this with clip path alone.
Clip path is applied to the element regardless of its contents. It's not a definition of the outer bounds of an element but a definition of how the element is clipped within its bounds, hence the text not behaving as you might expect. It still requires the element to be a box, because currently in css, all things are boxes.
It is however possible. These two articles here and here go into the required detail. First of all you define an element using a css shape declaration. You then use a clip-path, with the same definition as the polygon definition, to clip away any of the background that affects your shape
Taken from the first article (and conveniently close to what you want):
.shaped{
    /*...*/
    shape-outside: polygon(0 0, 100% 0, 100% 100%, 30% 100%);
    shape-margin: 20px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 30% 100%);
}

We can see it's pretty simple, the shape is defined as a polygon and it will behave like any other block, except it has a polygon edge rather than a block edge. Floating the element will then cause the text to flow around it.
Here is an example at JSFiddle* (-webkit- prefixes are required, as is a WebKit browser such as Google Chrome). By looking at this JSFiddle*, before clip-path is applied, you can see why it is necessary. In my example, both .shaped and .text are held within the same container but as siblings. The text flows around its sibling rather than expanding to fill its container. The container itself and use of background colours achieve the effect in the mock-up. (you may need to adjust the JSFiddle panel size to squish or stretch things and see the effect clearly).
Unfortunately, css shapes are very fresh. A quick glance at caniuse.com shows barely half of current browsers support these. Even Firefox has no implementation at all in the current version. As for IE ...
What I would suggest is that you use css shapes as your default and let the new browsers handle it (Firefox will catch up soon I'm sure) but provide some sort of browser feature detection method like Modernizr to decide whether or not to apply a fallback that will display the two sections as blocks without the slant.


text:
Q: DIY generator does not generate electricity I am doing a school project and it would be great to have some help. I have built a small generator using a pringles can and enameled copper wire, but when I spin the magnet inside, the voltmeter I am using does not show any constant increase in AC voltage. The meter is not the problem as it is brand new and was around $80. I  have tried spinning both with the direction of the wires and against it, and got nothing.

A: Maybe your magnet is too short?   The poles of the magnet must be very close to the copper wire.  If a small magnet is spinning inside a large pringles can, the generator won't work.
Or, maybe the magnet is spinning wrong.   To act as a generator, the magnet poles must flip end-over-end, so the poles are sweeping across the loop of wire.
If instead the magnet poles are sweeping along the wire, then the generator won't work.  (The magnet poles must not travel around and around the circular pringles can, instead they have to sweep into the can and out, with the axle of the magnet assembly poking through the cardboard can, sticking through the coil of wire.)   Or, if the magnet poles aren't sweeping in a biiig circle through space (if the magnet only spins on axis, with poles barely moving,) then the generator won't work.   Or finally, if two or more magnets were stacked with opposite poles too close together, then the fields are canceled out, and the generator won't work.
Here's a similar generator project, with the wire wound on a plastic ring.  See how the neo supermagnets are flipping end-over-end?  Notice that the ends of the magnet are moving quite close to the copper wire.  And, the magnet sweeps across the copper wire.  Not along it.
Here's my entire debugging section for this type of ultra-simple generator.
Hint: instead of a voltmeter, wind 600 turns or more of thin #30 wire, then hook the ends to a red LED, and the LED will flash as the magnets spin.
PS
Beware of online projects which don't work, where the author never bothered to test or even build the device they show!  For example, wikiHow diagrams and instructions are wrong, while Instructables version works fine.

A:
when I spin the magnet inside, the voltmeter I am using does not show
  any constant increase in AC voltage.

Here's one way to generate voltage with a magnet and a coil: -

Notice that the voltage rises as the magnet enters towards the coil and as the magnet is removed, the coil voltage is negative. Also note that when the magnet reaches the stationary position when fully inserted, the voltage drops to zero.
What is important is that the coil is subject to a changing magnetic field; the intensity rises as the magnet enters the coil and drops in intensity as the magnet exits the coil. It is therefore a change of magnetic flux that gives rise to a voltage induced in a coil.
You can achieve the same thing if the magnet is spinning relative to the coil like this: -

However, if you were to rotate the spinning axis through 90 degrees so that the magnet rotated in the horizontal plane, the voltage output would be close to zero. Some voltage would be induced in the "turns" at the extreme ends of the coil but no voltage would be induced in the turn at the coils mid-point.
In your experiment, I suspect you are not rotating the magnet in the correct plane relative to the coil and this will produce zero or low voltages.

A: The cardboard part of pringles cans has metal inside, which could make it conductive. If the enamel wire is wound around a conductive can the current may travel through the can instead of through your wire.


text:
Q: Variable dimensional arrays in C Is it possible to make an array of a variable number of dimensions? That is, the number of dimensions would be specified at runtime.
If yes, then how to do it?
Note that I am talking about a variable number of dimensions, not variable length of an array.

A: Sure. Just write your own library to handle that:
#include <stdio.h>
#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
#include <assert.h>

struct arrnd_s {
    void *memory;
    size_t membsize;
    size_t *dims;
    size_t dimcnt;
};

static inline size_t _arrnd_arraysize(struct arrnd_s *t)
{
    size_t ret = 1;
    for (size_t i = 0; i < t->dimcnt; ++i) {
        ret *= t->dims[i];
    }
    return ret;
}

struct arrnd_s *arrnd_new(size_t membsize, size_t dimcnt, ...)
{
    struct arrnd_s *t = malloc(sizeof(*t));
    if (t == NULL) {
        goto T_MALLOC_ERR;
    }
    t->dims = malloc(dimcnt * sizeof(*t->dims));
    if (t->dims == NULL) {
        goto T_DIMS_ERR;
    }

    va_list va;
    va_start(va, dimcnt);
    for (size_t i = 0; i < dimcnt; ++i) {
        t->dims[i] = va_arg(va, size_t);
    }
    va_end(va);

    t->dimcnt = dimcnt;
    t->memory = malloc(_arrnd_arraysize(t) * membsize);
    if (t->memory == NULL) {
        goto T_MEMORY_ERR;
    }
    t->membsize = membsize;

    return t;

    T_MEMORY_ERR:
    free(t->dims);
    T_DIMS_ERR:
    free(t);
    T_MALLOC_ERR:
    return NULL;
}

void arrnd_free(const struct arrnd_s *t)
{
    assert(t != NULL);
    free(t->memory);
    free(t->dims);
    free((void*)t);
}

size_t arrnd_arraysize(struct arrnd_s *t)
{
    assert(t != NULL);
    assert(t->dims != NULL);
    assert(t->dimcnt >= 1);
    return _arrnd_arraysize(t);
}

size_t arrnd_getdim(struct arrnd_s *t, size_t dimpos)
{
    assert(t != NULL);
    assert(t->dims != NULL);
    assert(t->dimcnt >= 1);
    assert(dimpos < t->dimcnt);
    return t->dims[dimpos];
}

void *arrnd_getpnt_v(struct arrnd_s *t, va_list va)
{
    assert(t != NULL);
    assert(t->dims != NULL);
    assert(t->dimcnt >= 1);
    size_t pos = 0;
    for (size_t i = 0; i < t->dimcnt; ++i) {
        const size_t dim = va_arg(va, size_t);
        pos += dim;
        if (i != t->dimcnt - 1) {
            pos *= t->dims[i];
        }
    }
    return &((char*)t->memory)[pos * t->membsize];
}

void *arrnd_getpnt(struct arrnd_s *t, ...)
{
    va_list va;
    va_start(va, t);
    void * const ret = arrnd_getpnt_v(t, va);
    va_end(va);
    return ret;
}

int main()
{

    struct arrnd_s *arrnd = arrnd_new(sizeof(int), 4, 2, 4, 4, 8);
    assert(arrnd != NULL);
    assert(arrnd_arraysize(arrnd) == 2 * 4 * 4 * 8);

    for (size_t i = 0; i < arrnd_getdim(arrnd, 0); ++i) {
        for (size_t j = 0; j < arrnd_getdim(arrnd, 1); ++j) {
            for (size_t k = 0; k < arrnd_getdim(arrnd, 2); ++k) {
                for (size_t l = 0; l < arrnd_getdim(arrnd, 3); ++l) {
                    *(int*)arrnd_getpnt(arrnd, i, j, k, l) = i + j + k + l;
                }
            }
        }
    }

    for (size_t i = 0; i < arrnd_getdim(arrnd, 0); ++i) {
        for (size_t j = 0; j < arrnd_getdim(arrnd, 1); ++j) {
            for (size_t k = 0; k < arrnd_getdim(arrnd, 2); ++k) {
                for (size_t l = 0; l < arrnd_getdim(arrnd, 3); ++l) {
                    printf("[%zu][%zu][%zu][%zu] = %d\n", i, j, k, l, *(int*)arrnd_getpnt(arrnd, i, j, k, l));
                }
            }
        }
    }

    arrnd_free(arrnd);

    return 0;
}

As a side note, the follwing is something I always considered cool in C, but this is compile time, not runtime:
int main() {
    int memory[256];
    for (size_t i = 0; i < sizeof(memory)/sizeof(*memory); ++i) {
        memory[i] = i;
    }

    int *arr1d = (void*)memory;
    printf("1d[%d] = %d == %d\n", 1, arr1d[1], memory[1]);

    int (*arr2d)[16] = (void*)memory;
    printf("2d[%d][%d] = %d == %d\n", 2, 2, arr2d[2][2], memory[2 * 16 + 2]);

    int (*arr3d)[8][8] = (void*)memory;
    printf("3d[%d][%d][%d] = %d == %d\n", 2, 2, 2, arr3d[2][2][2], memory[(2 * 8 + 2) * 8 + 2]);

    int (*arr4d)[4][4][4] = (void*)memory;
    printf("4d[%d][%d][%d][%d] = %d == %d\n", 2, 2, 2, 2, arr4d[2][2][2][2], memory[((2 * 4 + 2) * 4 + 2) * 4 + 2]);

    int (*arr5d)[2][2][2][2] = (void*)memory;
    printf("5d[%d][%d][%d][%d][%d] = %d == %d\n", 1, 1, 1, 1, 1, arr5d[1][1][1][1][1], memory[(((1 * 2 + 1) * 2 + 1) * 2 + 1) * 2 + 1]);

    return 0;
}


text:
Q: Architecture for single page application (JavaScript) I wanted to understand the overall architecture for designing single page application (mainly through JavaScript)
Let's say I have a login page (Usernam/Password) and on successful authentication, I am shown the homepage. Now both the login and homepage screens should actually be part of a single page.
How can I design such kind of page?

A: This is such a broad question that entire books could be written to answer it in detail.
Basically what you need to do is to use AJAX instead of page reloads. You still need to connect to the server to authenticate users but instead of reloading the entire page every time you do it, you need to make an AJAX call to your server and depending on whether the login was successful or not change some parts of the content on the page (like changing the Login button to a "Logged in as user xxx" message etc.).

A: If you haven't seen it already, John Papa has a very popular course on designing Single Page Applications on Pluralsight:
http://www.pluralsight.com/training/Courses/TableOfContents/single-page-apps-jumpstart
It does require a Pluralsight subscription, but you can get a 10 day free trial to confirm the  content is valuable to you. (I am not affiliated with Pluralsight, btw.)

A: You may want to look up this free Single Page App book. I found it when I Googled "Single Page Apps".

A: You may take inspiration from existing solutions that you can find over the web :

*

*ExtJS (MVC application architecture)

*Knockout (built upon the MVVM pattern)

*Backbone

A: I Just added a project to SourceForge that may help.  I've been developing this library for about a year now, and I think it's ready for prime-time.  This project allows for you to reference asp.net MVC from within JavaScript.
https://sourceforge.net/projects/peachajax/

This library generates dynamic JavaScript code to use for AJAX operations. The library requires jQuery.
  For example, if you use an Action Method within a Controller for AJAX operation, you can quickly access this via the dynamically generated JavaScript file as follows:

peach.ControllerName.ActionMethodName(parameter1, parameter2, parameter3); // javascript

The mapped parameters are directly associated with the ActionMethods parameters.
Customization features include:

*

*Custom parameters

*Custom callbacks

*Custom client-side processing functions for parameters (for serializing specialized model types)

*Custom pre-request processors

*Custom post-request processors

A: If you're more an MVC guy, I personally have been using chaplinjs.org, which is based on backbone, and hbs for single-page app glory. I have a few modifications to use websockets instead of long-polls, but it's pretty quite extendible, and if you're familiar with mvc, easy enough to get into (you'll run into more problems with backbone than with Chaplin)

A: You need index.html page like below

 ...

 ...

 ...

 ...

When application loaded, all views (divs with view class) are hidden (display:none) except login view. Login view should have login form on it, when it submitted by user it initiates ajax request. When ajax successful application hides login page and displays home page instead.
You may structure your code next way. For every module you will have model, view and controller files.
For example, for login module you may have loginModel.js, loginView.js, loginCtrl.js. In model file you will connect to DB and check credentials provided. In view you will bind listeners to controls. In controller you will react to user pressed Submit button.

A: I set up a basic SPA using jquery like this:

if you need to attach handlers to elements inside your modules, you can attach inside your nav handler like so:

function LoadAbout(){
      $("#content").load("about.txt", function(){
          $("#contactusbutton").click(ContactUsClick);
      });
      $("#page").html("About");
}

I <3 callbacks


text:
Q: How to set C# class attribute into C++/CLI class I want to set testcase attribute into my c++/cli class. i am adding the dll reference for that attribute. Note here that the dll which i am using for attribute setup which is in C#. please find below code:
using namespace Sample::Generic::TestAutomation::TestSystem;
namespace ClassLibrary1 {

[AttributeUsage(Sample::Generic::TestAutomation::TestSystem::TestCase)]
    public ref class Class1 : public Sample::CheckIt::TestPool::TestCase
    {
    private:
        static Class1^ Instance = nullptr;
        GenericLogger^ Switchmodule_log;
        TAIoPortClient^ _generalio;
        bool _testCaseInit = false;
   };

When i am trying to use this attribute, i am getting below error:

Error C2275   'Sample::Generic::TestAutomation::TestSystem::TestCase':
  illegal use of this type as an
  expression    ClassLibrary1   c:\users\chan\documents\visual studio
  2015\projects\classlibrary1\classlibrary1\ClassLibrary1.h 17

A: AttributeUsage is for when you define a new attribute. When you define MyFancyNewAttribute, you use AttributeUsage to declare whether the attribute is used on classes, or methods, or whatever.
You're overthinking this. To use the attribute, it's the same syntax as in C#.
[TestCase]
public ref class Class1


text:
Q: Do I have to uninstall wine each time uninstalling a program installed by wine? Let me try to explain this.
Sorry for being a newbie.
Anyways, I have wine installed to install Evernote, then I realized Evernote version 5.9* is no good that I should go for an older version 5.8* which then I downloaded.
I used the alt+F2 to open up the wine uninstaller to remote my Evernote 5.9* then I go into the ~/.wine folder and deleted the Evernote folder within.
Then I tried installing Evernote 5.8* in terminal with wine which didn't work and so I tried going to the add/remove of wine to install which gives me the error message of
Evernote was already installed by another user. Only one per-user installation is supported...........
I searched up for this error alert, lots threads are saying to remove wine in order to remove things in the wine bottle.
Is this a must or else I won't be able to install Evernote again?


text:
Q: Startup script not running on GCP Compute Engine windows server with autoscaling turned on I have a Managed Group in Computer engine on GCP.  Autoscaling is set up and running but when a new server comes on or if I do a "Rolling Replace" the start up script is not being run.  It is a very simple script that makes sure the latest code is running on the website. This is a screenshot from the "Template" that is used to create the new VMs

If I RDP into the box and run the exact same two lines of code, it works fine.

Is there something that I need to do before or after the script to make sure that the VM is fully up and ready for the command? Or something else that needs to be done.

A: When using a Startup Script in Windows, you need to use a specific key depending on what type of startup up script you would like to run. In your case, you are running cmd commands so in this case you have to replace the key "startup-script" with "windows-startup-script-cmd" within the Template as described here.


text:
Q: mvc3 how to transfer list objects between action methods I have a List object in 1 controller and I was wondering how can I transfer it to the next controller for example this is what I have
public ActionResult namelist()
    {
        var mynames = new List<everyname>
       {
           new everyname{ firstname ="john", Lastname= "henny"},
              new everyname{ firstname = "bob", Lastname = "cosso"},
      new everyname{ firstname = "bill", Lastname = "luther"},
      new everyname{ firstname ="mike", Lastname= "jones"}

       };
        return View(mynames);
    }

 // how can i transfer the above list with information into this action below

         public ActionResult newlist()
    {
       // i tried transfering the list here and it did not work
        var namelist = new namelist()
        IEnumerable<SelectListItem> items =  namelist.Select(c => new SelectListItem
        {
            Value = namelist,
            Text = namelist

        });

how can i transfer things? i am lost on this.

A: In the NameList method you can add this line:
TempData["namelist"] = mynames;

then at the top of the newList method add this line:
var namelist = Tempdata["namelist"] as List<everyname>;

Once you access a value in TempData it is purged from the TempData object


text:
Q: ASP.NET Core read HTML email and display in webapp I am working on a custom email webapp for my company. I have browsed the web and can't find an exact answer. Maybe I don't know what to "google" for exactly. I have never done anything email related.
In our database we are saving emails as a string. It contains everything.
<DOCTYPE><head><body><style> etc. How would I go about displaying this in my webapp.
I tried just pasting the HTML in a <div> inside one of my components but the styles would not load properly.
How would I go about reading/parsing the raw HTML in the string to then display it in my webapp. Is there a nuget package anyone recommends.
I am using Blazor on .net core 5.

A: As you may have found, putting an email HTML body into an existing web page will almost result in CSS pollution as the HTML may have styles (or may use styles from the web page).
My solution to this was to load and display the email HTML inside an <iframe> tag as this isolates the email from the page very effectively. The URL for the IFRAME is separate view on the server, which just returns the raw email HTML (remember to add security to this if needed in your app).
There are probably better ways to do this in CSS now without having to resort to IFRAME.


text:
Q: Would this be a binomial probability problem? Asthma is an important health problem for inner-city children, frequently resulting
in hospital admissions if symptoms become exacerbated. A study is proposed in
which children will be randomized to either an active intervention or control intervention. It is expected that 30% of the children in the active group versus 10% of the children in the control group will have an improvement in asthma symptoms.
Suppose that 50 households are randomized per group. In the active intervention group, 14 of the 50 children had an improvement in symptoms compared
with 6 out of 50 control intervention children. Test the hypothesis that active
intervention has a higher rate of improvement than control intervention group.
Can someone help me with this problem? I have no ideal how to approach it.


text:
Q: Problems during binding SpotLight to the instance I have RAC Oracle11 installation built from 2 nodes running on Linux Red Hat OS.
Now, I try to make connection from SpotLight running on Windows 7 to the Instance of one of nodes (TNS name of it is: LIBD1)
This what I do:
Make new connection -> give user with SYS permission -> connect -> get error about that, that user not configured -> User Configuration Wizard opens -> give SYS as user with sysdba permissions (real SYS not other user with SYS permission) -> check "configure new user" option -> give new user name -> next
And I get error: DBMS_SQL access.denied.
What I do wrong?
Thank you for ahead.


text:
Q: Something about Oauth2-server's JWT Access Tokens and JWT bearer Uh..I'm not sure what's wrong with my code.
Q1.

I made reference to the oauth2-server's demo.
And using Memory storage can work But when I try Pdo storage.
I get the "500 Internal Server Error" and "Unexpected character (<) at position 1."
Server
 $storage = new OAuth2\Storage\Pdo(array(
                                         'dsn' => $dsn,
                                         'username' => $username,
                                         'password' => $password));

    $this->server = new OAuth2\Server($storage, array(
        'use_jwt_access_tokens' => true,
    ));
    $this->server->addGrantType(new OAuth2\GrantType\ClientCredentials($storage));

Token
 public function token_post(){
    $this->server->handleTokenRequest(OAuth2\Request::createFromGlobals())->send();
}

Q2.
In JWT Bearer page
I can get access_token with demo,but this access_token don't work.
alway get "Failed" With resource page
resource
public function resource_get()
{
    if (!$this->server->verifyResourceRequest(OAuth2\Request::createFromGlobals())) {
        exit("Failed");
    }
    echo json_encode(array('success' => true, 'message' => 'You accessed my APIs!'));
}

Q3.
I have no idea about what is the different between JWT Access Tokens and JWT Bearer to use?
Remark
Sorry for bad English.
I use Google'translation to help me completion of these.
So i can't use realy correct description.
Sorry again for bad English.


text: Q: How to stop navigation menu from shrinking on WordPress? The navigation menu on my WordPress website shrinks on random pages. When refreshing the page, the menu goes back to normal. How can I stop the menu from shrinking?


text:
Q: Codeigniter queries fetching cached results (select query results not updated) I have an admin panel software. I have a list of items. I delete one from the list and refresh the page to run select query again. But the deleted one reappears there. even though its not visible in phpmyadmin.
Tried to clear cache and refreshed a lot but it's still the same.
Adding new item also similar result. query runs successfully but not updated when select query in codeignighter
database.php:
$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'admin_tr_user',
    'password' => 'zxxxxxxxz',
    'database' => 'xyz_db',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => '',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

Select all method in a model:
function get_apps() {

      $this->db->order_by("date", "desc");
      $query = $this->db->get('apps');

      return $query->result_array();

    }

A: I'm answering my own question here:
It was nginx cache causing this issue. I edited the Nginx config to bypass the cache by default.
in /etc/nginx/nginx.conf
  # Cache bypass. I set the default from 0 to 1
    map $http_cookie $no_cache {
        default 1;
        ~SESS 1;
        ~wordpress_logged_in 1;
    }


text:
Q: How to display the accessed (thru for loop) objects in array in HTML using javascript I had a form from HTML. The input data from form will go to the multidimensional array that I made in JS. Then I will use for loop to access the objects in array in order to display the object values in the HTML div. In html, it only displays [object,object]
var data = [];
var i, item;

function myForm(event){
    event.preventDefault();
    var name = document.getElementById("name").value; //Getting Values from the form of HTML
    var phone = document.getElementById("phone").value; //Getting Values from the form of HTML
    var bday = document.getElementById("bday").value; //Getting Values from the form of HTML
    var email = document.getElementById("email").value; //Getting Values from the form of HTML
    var pWord = document.getElementById("pWord").value; //Getting Values from the form of HTML
    var age = document.getElementById("bday").value; //Getting Values from the form of HTML
    var ageValue;
    var Bdate = document.getElementById("bday").value; //Getting Values from the form of HTML and calculating the age of the user
    var Bday = +new Date(Bdate);
    ageValue = ~~ ((Date.now() - Bday) / (31557600000));
    var theBday = document.getElementById("age");
    theBday.innerHTML = ageValue;

    var userObject = {
        name: name,
        phone: phone,
        bday: bday,
        email: email,
        pWord: pWord,
        ageValue: ageValue,

    }; //The values i get from my Input in html. The userObject will be in a array data[]
       data.push(userObject);

      for (i=0 ; i <data.length ; i++){
        for (item in data[i]){
            document.getElementById("demo3").innerHTML=(item + data[i][item]);  //I'm trying to display the details from my form but the only thing show up is [object,object]
        }
    }
}

A: The problem in the above code is this line
document.getElementById("demo3").innerHTML=(item + data[i][item]);

which is replacing the content of div#demo3 instead of appending so use this line instead
document.getElementById("demo").innerHTML+=(item + data[i][item]);

Here is a working example in jsfiddle.
I did not face [object,object] problem. If you can post your html code problem can be identified easily.
Update
Clear the content of div#demo before running the loop again.
document.getElementById("demo").innerHTML = "";

Check this updated jsfiddle.

A:

        HOME
        LOG IN
        SIGN UP

Sign Up Form

    <form id="myForm" onsubmit="myForm(event)">
    Name:

        <input type="text" name="name" id="name" maxlength="50" required="required" value="1234"></input>

    Phone Number:

        <input type="phone" name="phone" id="phone" maxlength="20" required="required" value="123"></input>

    Birthday:

        <input type="date" name="bday" id="bday" required="required" value="2010-05-02"></input>

    Email:

        <input type="email" name="email" id="email" maxlength="50" required="required" value="asasa@yahoo.com"></input>

    Password:

        <input type="password" name="pWord" id="pWord" maxlength="50" required="required" value="fgfghff"></input>

    <button type="submit" name="submit" id="submit" value="Submit" onsubmit="myData()" >Submit</button>
    <button type="reset" name="reset" id="reset" value="reset">Reset</button>

    </form>

        Result
        Name:

        Phone Number:

        Birthday:

        Email:

        Password:

        Age:


text:
Q: Manage and load my custom font in single point in wpf project I'm working on a C# project and now my task is apply a custom font in all the project. The project is very big and there are a lot of xaml files.
My friend wrote a static class name FontManager and call it's load() method in the constructor of all xaml.cs files.
I want to see that is there any way to call the method once in the project and not for all the xaml files in the project.
Thanks


text:
Q: fedora dhcpd name server configuration I'm having a hard time configuring a more modern release of a Fedora DHCP service to replace an older one and the problem is that clients aren't getting the appropriate DNS server information.
I had been using dhcpd on an earlier Fedora release quite successfully to serve an internal network and provide the following features to clients:
1) Unknown clients ONLY received an IP address, but are NOT provided external routing or DNS server information.
2) Clients known via MAC addresses were mapped to specific IPs, given the correct out-bound route, and external DNS servers.
However, that system suffered a hardware failure and I've been trying to transition to an alternate server with younger OS - FC 21. (The older configuration was of an unknown version, but not very old.) I can't seem to get either known or unknown clients the correct DNS server information to resolve host names; they can route, but cannot resolve names.
The new software, dhcp-4.3.1-12.fc21, and it does not have the same configuration details. Instead it has an ability to update friendly DNS servers - a feature not required here. All my searches for how to properly configure it have revealed instead details about updating a friendly DNS server with knowledge of served hosts - which, of course, has nothing to do with what I am trying to do.
These directions only speak of something called domain-name-servers, and the example is thus:
# option domain-name-servers ns1.example.org, ns2.example.org;

My own entries at the moment have been for ALL clients and use IP addresses instead of domain names, like this
option domain-name-servers 67.100.88.26, 64.105.172.26;

It would be very nice if someone can confirm that domain-name-servers is intended to be used to point to the cooperating DNS servers that this DHCP server is supposed to connect with for updating with information about clients of this DHCP server.
I have had difficulty finding ANY other name-server related configuration settings that aren't related to authentication between dhcpd server and cooperating dns servers.
Notably, it seems relatively insane to me to provide names and not IP addresses for entries in a location that is going to tell clients how to look-up IP addresses from names, but maybe the strategy just depends on the host's own /etc/resolv.conf.
Could it be that the new system simply hands over to ALL clients the system's resolv.conf data?! HORRIFIC! That would mean that one CANNOT HIDE this data from unknown clients! However, that cannot be because my clients receive NO DNS server data!

A: It turned out that the system I was testing on had two interfaces, both dhcp served but by different servers (the other being a hardware router), and so my testing was less than helpful. However, once I realized the problem, I was able to get it working and confirm a few facts that are FAR less than clear in the official documentation:

*

*domain-name-servers does in fact point clients to their DNS servers, and it works both globally and on a host-by-host basis. And;

*domain-name-servers must be prefaced with the word "option", space delimited, and multiple servers are separated by commas, with a semicolon terminator. And;

*Without a domain-name-servers entry at an appropriate location, no DNS translation is possible.

Lesson learned: test more carefully! ("test only one thing at a time" also means don't let an unmanaged variable be introduced by accident.)
It would also be nice if the documentation were more clear.


text:
Q: Obligar actualizar app a los usuarios Estoy haciendo cambios en una aplicación que ya está subida tanto a play store como a apple store, mi pregunta es la siguiente:
-Como puedo hacer para que cuando suba mi app actualizada, obligue a los usuarios a actualizarla.
Un saludo, gracias.

A: En iOS hay una librería llamada Siren, te dejo el link:
Siren GitHub
Debes agregar el pod:
pod 'Siren'

En el AppDelegate importas la librería
import Siren

En la función del AppDelegate didFinishLaunchingWithOptions llamas a la librería
Siren.shared.wail()

En el link hay más detalles de cómo quieres que se presente al usuario si existe una versión de tu App.

A: No existe una forma nativa de obligar a los usuarios a actualizar, ya que el usuario es el que debe permitir la actualización, a menos que tenga seleccionada la opción auto-update.
Revisa para Android la pregunta, en la cual se agregan opciones para "provocar" la actualización :
Forzar la actualización de aplicación en Play Store
Lo principal para que las aplicaciones instaladas a los usuarios detecten una actualización es que definas en tu app un versionCode mayor al definido en la versión que se encuentra actualmente en Google Play Store.
Como ejemplo, si tu última versión de la aplicación tiene un Version Code 16

Define dentro de tu build.gradle una versión mayor, en este caso sería la 17:
 android {
      ...
      defaultConfig {
        ...
        versionCode 17
        versionName "1.6"
      }
    }

Revisa:
Cómo establecer la versión de tu app

A: Yo tengo una app que obliga a realizar la actualización, pero obviamente no es nativa y requiere además una API. Lo que hago es:
Primero, obtener el valor de la versión actual de la app (ejemplo 6.1):
PackageInfo pInfo;
pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
version = pInfo.versionName;

Luego, obtengo el valor de la versión que debería ser des de la API, por ejemplo 6.2. Si no coincide, sale un diálogo que notifica la necesidad de actualizar. Un botón ofrece camino directo a Google Play, y el otro, ofrece la opción de no actualizar. Esta última opción no deja continuar con la app realizando un finish() hacia el login o un exit.
No olvides de subir el valor de versionCode cada vez que cambies de versión.


text:
Q: How can I get Spring to properly marshal XML value into a Java date? I'm using Spring 3 to create some ReST services. When POSTing XML, Spring handles String fields but won't convert Date fields. Here is an example:
@XmlRootElement(name = "TestObj")
@XmlAccessorType(XmlAccessType.FIELD)
public class TestObj {

    @XmlElement(type = Date.class, name = "Birthdate")
    @XmlJavaTypeAdapter(BirthdateXmlAdapter.class)
    private Date birthdate;

    @XmlElement(type = String.class, name = "Name")
    private String name;

    // getters and setters ...
}

I thought perhaps an XmlAdapter is required and created one to marshall/unmarshall according to the date format I need. BirthdateXmlAdapter is called but a null value is passed in which of course sets the birthdate field to null.
@RequestMapping(value="/test", method=RequestMethod.POST)
public TestObj test(@RequestBody TestObj testObj) {
    logger.debug(testObj.toString());

    return testObj;
}

Pretty simple use case here. I use RestClient to POST XML and see the "name" attribute set properly in my TestObj but birthdate is null.

A: If you annotate as follows you:
import java.util.Date;
import javax.xml.bind.annotation.*;

@XmlRootElement(name = "TestObj")
@XmlAccessorType(XmlAccessType.FIELD)
public class TestObj {

    @XmlElement(name = "Birthdate")
    @XmlSchemaType(name="date")
    private Date birthdate;

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

}

You can produce/consume the following XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TestObj>
    <Birthdate>2010-09-22</Birthdate>
    <Name>Jane Doe</Name>
</TestObj>


text:
Q: Using static objects in XAML that were created in code in Silverlight I couldn't get this to work in Silverlight, so I created two test projects.  One simple WPF project and one simple Silverlight project that both do only one thing:  set a public static readonly variable in code, and use it in a completely bare bones XAML.  In WPF, works without a hitch.  In Silverlight, I get the following compiler warning and runtime error:
Warning   2   The tag 'Static' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml'...
and
Invalid attribute value {x:Static SilverlightApplication3:Page.Test} for property Text. [Line: 7 Position: 25]
I'm assuming this is not supported in Silverlight 2, or am I just missing something really simple?  Here's the full code for both just in case it's the latter:
public partial class Window1 : Window
{
    public static readonly string Test = "test";
    public Window1()
    {
        InitializeComponent();
    }
}

<Window x:Class="WpfApplication4.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300"
        xmlns:WpfApplication4="clr-namespace:WpfApplication4">
    <Grid>
        <TextBlock Text="{x:Static WpfApplication4:Window1.Test}" />
    </Grid>
</Window>

and here's the SL version:
public partial class Page : UserControl
    {
        public static readonly string Test = "test";
        public Page()
        {
            InitializeComponent();
        }
    }

<UserControl x:Class="SilverlightApplication3.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:SilverlightApplication3="clr-namespace:SilverlightApplication3"
    Width="400" Height="300">
    <Grid x:Name="LayoutRoot" Background="White">
        <TextBlock Text="{x:Static SilverlightApplication3:Page.Test}" />
    </Grid>
</UserControl>

A: Unfortunately Silverlight has many limits with respect to functionality and you just found one of them. StaticMarkupExpression is not supported by SL2. You also can't define it by yourself.
e.g. guy from ms: http://blogs.msdn.com/edmaia/archive/2008/11/23/animating-objects-visibility-in-silverlight.aspx
The trick may be to use an object like
class Helper{
    public string Value {get{return Page.Test;}}

// implement INotifyPropertyChange if you want updates
}

And then
<Grid.Resources>
     <somexmlns:Helper x:Key="Helper"/>
</Grid.Resources>

<TextBlock Text="{Binding Value, Source={StaticResource Helper}}"/>

A: Unfortunately, it looks like Silverlight doesn't support binding to static properties: What is the {x:Static sdfsdf} equivalent?

A: You can actually bind to static properties as long as the class is not a static class. So using the previous example of the Helper class:
public class Helper
{
    public static string Value{ get {return Page.Test;} }
}

The XAML will stay the same.

A: I just noticed that you had a secondary question about binding to a color. I don't think it can be done in Silverlight. I'm pretty sure the minimum requirement for a binding target in Silverlight is FrameworkElement.

A: A static object will be instantiated only once and will persist until the end of the program.A static object can retain its state even when it is not in scope, but only visible within their local scope.


text:
Q: adding custom Gutenberg block icon I have added a static block for adding a shortcode. Instead of using the      dashicons as the block icon, I want to use a customized icon which is already existed in the plugin 'images' folder. Anyone please help me to use a .svg image as the block icon. Below is the code I have tried so far to add an customized icon
( function() {
var __ = wp.i18n.__;
var createElement = wp.element.createElement;
var registerBlockTypeMainPage = wp.blocks.registerBlockType;
const iconEl = el('svg', { width: 20, height: 20 },
    el('path', { d: "M8.54,4.68V8h3.23v.58H8.54v3.28H8V8.55H4.74V8H8V4.68Z,M26.48,5.93,24.15,8.26l2.28,2.28L26,11,23.74,8.66,21.42,11,21,10.58l2.33-2.32L21.05,6l.41-.41,2.28,2.28,2.33-2.33Z,M11.26,23.45V24h-6v-.59Z,M27.25,22.36v.58h-7v-.58Zm0,2.19v.57h-7v-.57Z" } )
);

registerBlockTypeMainPage(
    'mdlr/static-block',
    {
        title: __( 'Test block' ),
        icon: iconEl,
        category: 'widgets',

        edit: function( props ) {
            return createElement(
                'p',
                {
                    className: props.className,
                },
                '[test-block]'
            );
        },

        save: function( props ) {
            return createElement(
                'p',
                {
                    className: props.className,
                },
                '[test-block]'
            );
        },
    }
);
})();


text:
Q: Expected BEGIN_ARRAY but was BEGIN_OBJECT Gson android serializable I am trying to serialize an ArrayList so that it is available with all the Claim Attributes when I close and restart my App. I am getting the error as seen in the title.   Expecterd begin_array but got begin_object instead.
here is my code:
    @Override
protected void onStart(){
    super.onStart();
    claim = loadFromFile();
    Toast.makeText(this, "loading File"+claim.size(), Toast.LENGTH_SHORT).show();
    ClaimsList cl = new ClaimsList();
    cl.setClaimList(claim);
    //ArrayAdapter<Claim> claimAdapter = new ArrayAdapter<Claim>(this, R.layout.custom_view_claim, claim);
    //listView.setAdapter(claimAdapter);
}

public void saveInFile(Claim claim) {
    Gson gson = new Gson();
    try {
        FileOutputStream fos = openFileOutput(this.SAVEFILE,0);
        OutputStreamWriter osw = new OutputStreamWriter(fos);
        gson.toJson(claim, osw);
        osw.flush();
        fos.close();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

//recover those persistent data created in the save function
private ArrayList<Claim> loadFromFile() {
    Gson gson = new Gson();
    ArrayList<Claim> claim = new ArrayList<Claim>();
    try {
        FileInputStream fis = openFileInput(SAVEFILE);
        //Based on http://google.gson.googlecode.com/svn/trunk/gson/dos/javadoc/com/google/gson/Gson.html
        Type listType = new TypeToken<ArrayList<Claim>>(){}.getType();
        InputStreamReader isr = new InputStreamReader(fis);
        claim = gson.fromJson(isr, listType);
        fis.close();

    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    if (claim == null){
        claim = new ArrayList<Claim>();
    }
    return claim;
}

Here are the Class Atributes I have:
ArrayList<Claim> claim;
String SAVEFILE = "file.sav";

and Finally here is the logCat:
    02-01 16:50:45.121: E/AndroidRuntime(4695): FATAL EXCEPTION: main
02-01 16:50:45.121: E/AndroidRuntime(4695): Process: app.zioueche_travelexpense, PID: 4695
02-01 16:50:45.121: E/AndroidRuntime(4695): java.lang.RuntimeException: Unable to start activity ComponentInfo{app.zioueche_travelexpense/app.zioueche_travelexpense.AddClaim}: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.app.ActivityThread.access$900(ActivityThread.java:161)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.os.Handler.dispatchMessage(Handler.java:102)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.os.Looper.loop(Looper.java:157)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.app.ActivityThread.main(ActivityThread.java:5356)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at java.lang.reflect.Method.invokeNative(Native Method)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at java.lang.reflect.Method.invoke(Method.java:515)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at dalvik.system.NativeStart.main(Native Method)
02-01 16:50:45.121: E/AndroidRuntime(4695): Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
02-01 16:50:45.121: E/AndroidRuntime(4695):     at com.google.gson.Gson.fromJson(Gson.java:822)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at com.google.gson.Gson.fromJson(Gson.java:775)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at app.zioueche_travelexpense.AddClaim.loadFromFile(AddClaim.java:273)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at app.zioueche_travelexpense.AddClaim.onStart(AddClaim.java:239)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1189)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.app.Activity.performStart(Activity.java:5436)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
02-01 16:50:45.121: E/AndroidRuntime(4695):     ... 11 more
02-01 16:50:45.121: E/AndroidRuntime(4695): Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
02-01 16:50:45.121: E/AndroidRuntime(4695):     at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:79)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60)
02-01 16:50:45.121: E/AndroidRuntime(4695):     at com.google.gson.Gson.fromJson(Gson.java:810)

A: You could use these functions: isJsonObject() and  isJsonArray()
For example:
     Gson gson = new Gson();
            JsonParser parser = new JsonParser();
             JsonElement jsonElement = parser.parse(productJSONStr);

            if (jsonElement.isJsonArray()) {
            }
            else if (jsonElement.isJsonObject()) {

            }else{

            }

I hope this may help you.


text:
Q: Pivotal server instance throws an error "Failed to start component" but works fine for same instance in different directory Pivotal server instance throws an error "Failed to start component" but works fine for same instance in different directory.

SEVERE [localhost-startStop-1]
  org.apache.catalina.core.ContainerBase.addChildInternal
  ContainerBase.addChild: start:
  org.apache.catalina.LifecycleException: Failed to start component
  [StandardEngine[Catalina].StandardHost[localhost].StandardContext


text:
Q: Elasticsearch with Docker: connect using JDBC / None of the configured nodes are available I started an elasticsearch docker container using the command below. Then I tried connecting using the driver from https://github.com/Anchormen/sql4es
Each time I got "None of the configured nodes are available[127.0.0.1]". What may be wrong ?
The elasticsearch.yml has network.host=0.0.0.0
JDBC URL: jdbc:sql4es://127.0.0.1:9300/sample?cluster.name=docker-cluster
docker run --name=elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.3.2

curl -XGET http://127.0.0.1:9200/_nodes/http?pretty
{
  "_nodes" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "cluster_name" : "docker-cluster",
  "nodes" : {
    "aTrIrCDtSzmeF1vy6MnUcg" : {
      "name" : "aTrIrCD",
      "transport_address" : "172.17.0.3:9300",
      "host" : "172.17.0.3",
      "ip" : "172.17.0.3",
      "version" : "6.3.2",
      "build_flavor" : "default",
      "build_type" : "tar",
      "build_hash" : "053779d",
      "roles" : [
        "master",
        "data",
        "ingest"
      ],
      "attributes" : {
        "ml.machine_memory" : "2076528640",
        "xpack.installed" : "true",
        "ml.max_open_jobs" : "20",
        "ml.enabled" : "true"
      },
      "http" : {
        "bound_address" : [
          "0.0.0.0:9200"
        ],
        "publish_address" : "172.17.0.3:9200",
        "max_content_length_in_bytes" : 104857600
      }
    }
  }
}