I am working on my first applescript. I open a webpage through Safari which is eg: Evernote page - https://itunes.apple.com/us/app/evernote/id281796108 and I wish to get the version and it's latest updated date which lies on the left hand side of the page i.e. under image logo of the app under "Category" it's "Updated" and "Version".

Here is the script I am working on:

tell application "Safari"
    open location "https://itunes.apple.com/us/app/evernote/id281796108?"
    activate
end tell


tell application "System Events"
    tell process "Safari"
        -- Add the logic to get the updated date and version.
    end tell
end tell

Is it possible to get the data from the webpage through applescript?

I'm currently pinging google.com and would like to create a graph trend of the latency. What's the best way to do so ? I thought of creating a .txt file and using excel, but I'm not sure how to do this from terminal. Any ideas ?

when my Lumia 620 pulls mails from some of my imap accounts, it immediately marks them as 'read' on the server, although I never opened them. The status in the WP mail app stays correct (unread).

It does not affect all providers. For example, freenet.de works fine, while web.de and gmx.de have this issue (all are German freemail providers). I noticed that those 2 do also provide the IDLE command which notifies mail clients of account changes. The other one doesn't.

Other mail clients like Thunderbird don't behave like that. Also, there is nobody else accessing the accounts (pretty sure) nor do I aggregate or auto-forward messages somewhere. From my web research I know that this issue has been reported a few times in the past, even for WP 7 and Windows 8.

Did anyone else observe this effect or even find a solution? It's quite annoying as it makes me miss mails sometimes.

P.S.: An interesting (probably unrelated) fact is that I cannot deactivate mail notifications on the lock screen. If I untick the checkbox in "settings -> notifications and actions" AND even deactivate them for each account, they still come up.

Thanks in advance,
Alex
Lumia 620,
WP 8.10.12393.890

I want to import contacts from bada OS to my windows phone. I do not want to copy them to sim. I want some sync method. I have tried a lot of things but nothing has worked so far.

My employer has been moving from traditional waterfall projects to a modified version of agile. Work is broken into stories, which are estimated and sequenced into two-week long iterations. Each iteration includes points for building, testing, and accepting features.

Stories are focused on testable business features. There is no way to plan and account for cross cutting concerns such as design, architecture, infrastructure, or (ironically) project management.

Should agile teams explicitly include stories or tasks for these cross-cutting concerns? How does your team handle tasks that never go away? Are they "off book"?

I'm making a .NET application where I'll have a lot of data entries. This will not go to any server though, but needs to be stored and updated, frequently on the local machine.

I would like something like an SQL database, that simply exists in a file, in my application's folder (or in %appdata% or whatever).

But how do I go about this? What can I use? I'm a big fan of Linq2Sql, so if it supports that, it would be awesome.

I've tried to use MSSQL Compact, but I couldn't really get it to work very well. It basically required me to install MSSQL as well.

What options do I have, other than MSSQL Compact?

The author of this article refers to 'Implicit cache' a few times http://alistapart.com/article/application-cache-is-a-douchebag#section8. What is implicit cache? Is it the web page being cached once it refers to a manifest file?

And, if multiple web pages refer to same manifest file, does cache update of one of web pages result in updation of all other web pages referring to the same manifest file?

I'm reading algorithms and I understand most of it, one thing that I can still struggle with a lot is something as simple as running times on different for-loops. Everyone seems to have easy with that, except for me and therefore I search help here.

I am currently doing some excercises from my book and I need help completing them in order to figure out the different running times.

The title of the exercise is: "Give the order of growth(as a function of N) of the running times of each of the following code fragments"

a:

int sum = 0;
for (int n = N; n > 0; n /= 2)
  for(int i = 0; i < n; i++)
    sum++;

b:

int sum = 0;
for (int i = 1; i < N; i *= 2)
  for(int j = 0; j < i; j++)
    sum++;

c:

int sum = 0;
for (int i = 1; i < N; i *= 2)
  for(int j = 0; j < N; j++)
    sum++;

We have learned different kinds of running times/order of growth like n, n^2, n^3, Log N, N Log N etc. But I have hard understanding which to choose when the for loop differs like it does. the "n, n^2, n^3" is not a problem though, but I can't tell what these for-loops running time is.

Here's an attempt of something.. the y-axis represents "N" value and the x axis represents times the outer loop has been run. The drawings in the left is: arrow to the right = outer-loop, circle = inner loop and the current N value. I have then drawn some graphs just to look at it but I'm not sure this is right though.. Especially the last one where N remains 16 all the time. Thanks.

My drawing

I have recently switched from Matlab to Fortran and I am looking For Fortran alternatives for nonlinear optimization algorithms like SQP. In matlab I am using fmincon. The things that i need are:

  1. To use a nonlinear (cost) function for example min f(x) = sum(x.^2)
  2. To use nonlinear equality (=) and inequality (<) constraints (for example x_1 - x_2 = 0 and x_1^2 + x_2^2 < T)

Any advice on what library to use? I have tried the Intel Math Kernel Library but nonlinear constraints are not supported...

If we take the two below entities as en example.

public class Person
{
    public string Username {get;set;}
    public string DisplayName {get;set;}
}

public class Worker:Person
{
    public string Title {get;set}
    public int SecurityId {get;set;}
}

When anyone first registers with this app, basic information would be captured and a Person would be created. Once an admin comes along, they may want to assign a role to this Person. Now Roles in the sense of Authorisation are not in question, there is a RoleProvider. However, if I make someone a worker, some additional details need to be captured. How those new details are best stored is what is in question.

  • I could have a WorkerProperties class with the fields and give Person --> Worker a 0.1->1 relationship.

  • I could have all the fields as part of Person and just fill in what is required. At runtime accessing the Persons role would be needed to work out what fields would be required.

  • I could create a Worker as shown above. Inheriting from Person. With this option there is the problem that the PK is the username registered with. I would need to somehow change the discriminator column generated by EF to essentially change the object type to Worker.

I'm trying to figure out what sort of data structure to use for modeling some hypothetical, idealized network usage.

In my scenario, a number of users who are hostile to each other are all trying to form networks of computers where all potential connections are known. The computers that one user needs to connect may not be the same as the ones another user needs to connect, though; user 1 might need to connect computers A, B and D while user 2 might need to connect computers B, C and E.

enter image description here

Image generated with the help of NCTM Graph Creator

I think the core of this is going to be an undirected cyclic graph, with nodes representing computers and edges representing Ethernet cables. However, due to the nature of the scenario, there are a few uncommon features that rule out adjacency lists and adjacency matrices (at least, without non-trivial modifications):

  1. edges can become restricted-use; that is, if one user acquires a given network connection, no other user may use that connection
    • in the example, the green user cannot possibly connect to computer A, but the red user has connected B to E despite not having a direct link between them
  2. in some cases, a given pair of nodes will be connected by more than one edge
    • in the example, there are two independent cables running from D to E, so the green and blue users were both able to connect those machines directly; however, red can no longer make such a connection
  3. if two computers are connected by more than one cable, each user may own no more than one of those cables

I'll need to do several operations on this graph, such as:

  • determining whether any particular pair of computers is connected for a given user
  • identifying the optimal path for a given user to connect target computers
  • identifying the highest-latency computer connection for a given user (i.e. longest path without branching)

My first thought was to simply create a collection of all of the edges, but that's terrible for searching. The best thing I can think to do now is to modify an adjacency list so that each item in the list contains not only the edge length but also its cost and current owner. Is this a sensible approach? Assuming space is not a concern, would it be reasonable to create multiple copies of the graph (one for each user) rather than a single graph?

I'm a Java software engineer and is trying to design a program similar to Wireshark(Different Capturing).

I know Wireshark is written C, which makes it portable across multiple platform. I am just wondering if there are any applications written in Java?

What do I actually lose when I write something in Java, instead of C for similar applications

If you want to vote me down, please at least state the reason.

1) I am not finding application, I'm trying to understand if it has been performed before.. is call feasibility studies.

Basically I have a series of logic in my website that can lead to 5 total outcomes. Basically two different if tests and then a catch all else statement.

For example:

if cond1:
    if mod1:
        #do things
    elif mod2:
        #do things
elif cond2:
    if mod1:
        #do things
    if mod2
        #do things
else:
    #do things

I was thinking about rewriting it like this:

if cond1 and mod1:
    #do things
elif cond1 and mod2:
    #do things
elif cond2 and mod1:
    #do things
elif cond2 and mod2:
    #do things
else:
    #do things

Is there any real difference in these two coding options/a better choice for this kind of logic testing?

I've an Android app with multiple observers of type A that subscribe with several Observables of type B. The subscription is done in IO Scheduler and the observation on the Android main thread.

The problem that I've is that randomlly after some work one message emitted by B is never received in A and after some hours of debbuging I can't find the cause.

Relevant code when the problem happens:

"NEXT1" and "NEXT2" are printed but "RECEIVED","ERROR", COMPLETED aren't.

            //The subscription
            B.getMessate()
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(A);

            //B
            Observable<msg> getMessage() {
                 return Observable.create(new Observable.OnSubscribe<msg>() {    
                      public void call(Subscriber<? super msg> subscriber) {
                         ...
                         onNext(msg)
                         println("NEXT1")
                      }
                 }).doOnNext({ (o) -> println("NEXT2")});
            }



            //A 
            onNext(msg) {
                  //Never called when problem happens
                  println("RECEIVED")
            }
            onError(msg) {
                  //Never called when problem happens
                  println("ERROR")
            }
            onError(msg) {
                  //Never called when problem happens
                  println("COMPLETED")
            }

Anyone has some clue? or any recommendation for debugging that?

What I've checked:

  • I've paused the app and checked that all threads to see if one is locked. And aparentlly all working threads are parked and main thread is waiting messages in android message queue.
  • Observers never call unsubscribe()

I want to implement one transaction which will take at least 10 seconds to complete the process.

Meanwhile user has an option to cancel on going process. I have to stop the transaction without commit if the user requests to cancel the process.

How to interrupt ongoing process with cancel request before commit the transaction in C# Asp.Net MVC?

Im adding chromecast support into an app Im working on and Ive noticed that I see every test device that streams video including an xbox one and numerous rokus, smart tv's, and apple tv's that we develop on. Now I cant cast to them directly so I was wondering two things.

First can I use the mediarouter api's on android to cast to these devices and second how can I keep them from showing up in the device selection list.

Lets consider an application like Wireshark.

  1. Data needs to be compress and decompress
  2. Work across multiple platform
  3. GUI
  4. high utilization depending on the load(ie packet capturing)

Java Swing can provides the GUI and Java can work across multiple platform but I am not sure about Java capabilities to perform task like packet capturing and compression/decompress for Data Presentation.

I know that Minecraft, which is written in Java has been plagued with a lot of memory issues and etc (for better or worst)

My amateur reading of the MIT license suggests that any software is distributed to my customers containing any MIT-licensed components can be freely re-distributed in its entirety.

Permission is hereby granted [...] to deal in the Software without restriction, including [...] the rights to [...] distribute [...] copies of the Software.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

It's not clear whether "the Software" refers to the entire application, or just the individual MIT-licensed component. So which is it?

I apologize if this has been answered, extensive Googling found me a lot of similar but not-quite-the-same situations that didn't provide an answer. I have a WebView and would like to put a Google AdView underneath it. However, I don't want the add always attached to the bottom of the window, I want it to come AFTER the WebView, i.e. I scroll through the content of the webpage and then, underneath that, the ad is displayed. I've tried many variations of Relative and Linear layout, here's one attempt as an example:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <WebView
        android:id="@+id/webview"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_alignParentTop="true"
        android:layout_weight="1"/>

    <com.google.android.gms.ads.AdView
        android:id="@+id/web_frag_ad"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        ads:adUnitId="myUnitId"
        ads:adSize="BANNER" />

</LinearLayout>

I've tried RelativeLayout with layout_below, but the WebView covers it up. It displays if I alignParentBottom, but that isn't the behavior I want. I want it to only be visible after scrolling through the content of the web page. I'm sure I'm making a simple layout mistake, and help pointing me in the right direction is greatly appreciated.

I am working on a code snippet where i am storing my json encoded data into a txt file,and using following method to separate all parts and adding them into database.

public boolean addAnswersFromJSONArray() {
    boolean flag = false;

    Answer answer = new Answer();
    File sdcard = Environment.getExternalStorageDirectory();
    File file = new File(sdcard, "user_live.txt");

    FileReader fr;
    JsonReader reader;

    try {
        fr = new FileReader(file);
        reader = new JsonReader(fr);
        reader.beginArray();
        reader.setLenient(true);

        while (reader.hasNext()) {
            reader.beginObject();
            while (reader.hasNext()) {
                String name = reader.nextName();

                if (name.equals("product_name")) {
                    answer.setProductName(reader.nextString());
                } else if (name.equals("subject")) {
                    answer.setSubject(reader.nextString());
                } else if (name.equals("month")) {
                    answer.setMonth(reader.nextString());
                } else if (name.equals("year")) {
                    answer.setYear(reader.nextString());
                } else if (name.equals("question")) {
                    answer.setQuestion(reader.nextString());
                } else if (name.equals("answer")) {
                    answer.setAnswer(reader.nextString());
                } else if (name.equals("question_no")) {
                    answer.setQuestion_no(reader.nextString());
                } else if (name.equals("marks")) {
                    answer.setMarks(reader.nextString());
                } else {
                    reader.skipValue();
                }
            }

            answer.save(db);
            reader.endObject();
            flag = true;
        }

        reader.endArray();
        reader.close();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        file.delete();
        db.close();
    }
    return flag;
}  

and then i am retrieving each fields departments,subjects,month and year,questions,answers,question_no, but while retrieving marks i am getting only unique entries that is 10 and 5....Ideally the size of one set is 18 so i m getting ArrayIndexoutOfBounds Exception.

  //database calling part 
  marks = db.getMarksList(department, subject, month_year);

database method is,

  public String[] getMarksList(String department, String subject,
        String month_year) {
    String month = month_year.split("-")[0];
    String year = month_year.split("-")[1];
    String whereClause = DEPARTMENT + " = '" + department + "'" + " AND "
            + SUBJECT + " = '" + subject + "' AND " + MONTH + " = '"
            + month + "' AND " + YEAR + " = '" + year + "'";
    System.out.println("questions: " + whereClause);
    Cursor cursor = db.query(true, "ANSWERS", new String[] { "MARKS" },
            whereClause, null, null, null, "DEPARTMENT", null);
    String list[] = new String[cursor.getCount()];
    int i = 0;
    if (cursor != null && cursor.getCount() > 0) {
        for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor
                .moveToNext()) {
            list[i] = new String(cursor.getString(0));
            i++;
        }
    }
    return list;
}

Can anyone help me to resolve this issue?? Why getting only unique value,I have checked my json result also each row contains marks.

Is there some kind of compendium website for commonly used variable names?

Examples

  • db for a database
  • s for a string
  • i for an integer loop control variable

Note: these don't necessarily have to be good names, just commonly used ones. Although a list of preferred names would be useful.

Thanks in advance to anyone who is actually willing to help point me to resource instead of complaining, being a rules lawyer, or downvoting.